@inkeep/open-knowledge 0.63.0-beta.19 → 0.63.0-beta.20
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-C4fJ0jTx.mjs → acp-harness-probe-BzhWxC15.mjs} +2 -2
- package/dist/cli.mjs +6 -6
- package/dist/constants-DpaKrOZE.mjs +2 -0
- package/dist/index.mjs +1 -1
- package/dist/init-aacE1Gec.mjs +1 -0
- package/dist/{init-B63mr7nZ.mjs → init-pgX_L3k0.mjs} +3 -3
- package/dist/{launch-json-removal-Caqfjzc9.mjs → launch-json-removal-DsClr5dC.mjs} +2 -2
- package/dist/{loader-ANGIJBvP.mjs → loader-DPR4CHww.mjs} +2 -2
- package/dist/loader-DQqSRL9U.mjs +1 -0
- package/dist/{preview-Cb-95VDq.mjs → preview-B41DDSQR.mjs} +2 -2
- package/dist/preview-DqHVit3o.mjs +1 -0
- package/dist/public/assets/{ActivityModeContent-R02cizpm.js → ActivityModeContent-Dlp2qWVb.js} +1 -1
- package/dist/public/assets/{AddPropertiesButton-I1ggRsVQ.js → AddPropertiesButton-DBHjMhKR.js} +1 -1
- package/dist/public/assets/{AgentDiffPane-uzXmOYIj.js → AgentDiffPane-Dl2jHnnK.js} +1 -1
- package/dist/public/assets/CodeMirrorPropInput-B3NZ_xw8.js +3 -0
- package/dist/public/assets/DocumentContext-Dq3krLop.js +38 -0
- package/dist/public/assets/{ExcalidrawDocEditor-GDV0N0y0.js → ExcalidrawDocEditor-D24okewn.js} +1 -1
- package/dist/public/assets/FeedbackForm-CeBRCXtv.js +1 -0
- package/dist/public/assets/{ImportSkillDialog-BZetMzZM.js → ImportSkillDialog-C1b2Gk8P.js} +1 -1
- package/dist/public/assets/{ManagedArtifactProperties-wJGeDztw.js → ManagedArtifactProperties-Br-atMb7.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-Dk-CD6tf.js +1 -0
- package/dist/public/assets/{MermaidDocEditor-aTs0O3AE.js → MermaidDocEditor-C0RFnSnW.js} +1 -1
- package/dist/public/assets/{PropertyDisplayRow-BpvBaWUs.js → PropertyDisplayRow-DERcU3o_.js} +1 -1
- package/dist/public/assets/{SessionsHost-cYX9nueC.js → SessionsHost-CSsb3_zE.js} +2 -2
- package/dist/public/assets/{SettingsDialogBody-Bj1MIZNv.js → SettingsDialogBody-Cf2zGSTf.js} +3 -3
- package/dist/public/assets/{SkillInstallMenu-BD_PAM_a.js → SkillInstallMenu-W1ROQmVM.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-W23kGjss.js → SkillToolbarControls-B135P7_E.js} +1 -1
- package/dist/public/assets/SourceEditor-NirHMFoJ.js +1 -0
- package/dist/public/assets/{TerminalWindowApp-CvNMqudy.js → TerminalWindowApp-_D1FhpJK.js} +1 -1
- package/dist/public/assets/{TextDocEditor-BVN0RUMF.js → TextDocEditor-BqJYdJNH.js} +1 -1
- package/dist/public/assets/{ThreadView-CMZK-BpJ.js → ThreadView-DEe7-jjo.js} +5 -5
- package/dist/public/assets/{TimelineDiffPane-Bc-XAZLu.js → TimelineDiffPane-CAZdbKwX.js} +1 -1
- package/dist/public/assets/{agent-diff-store-DD0f4NIB.js → agent-diff-store-DQrcuZEj.js} +1 -1
- package/dist/public/assets/{auth-state-cache-ClD5JYWh.js → auth-state-cache-C8M8-rQ5.js} +2 -2
- package/dist/public/assets/{comment-chips-Bwj8YFje.js → comment-chips-BJ9-FE5y.js} +1 -1
- package/dist/public/assets/index-bl1nW2o_.js +2196 -0
- package/dist/public/assets/{progress-Dudp7Wq_.js → progress-Bc5JFmoF.js} +3 -3
- package/dist/public/assets/{selection-context-KQJN1S83.js → selection-context-PGkDzekK.js} +1 -1
- package/dist/public/assets/{src-DrSSm1I_.js → src-DFdwegh8.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-ehxDWEji.js → typing-burst-detector-Bw02vO08.js} +3 -3
- package/dist/public/assets/use-activity-panel-jrK0NpxV.js +1 -0
- package/dist/public/assets/{use-open-skill-B0DZvwmE.js → use-open-skill-BI9UempW.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-BQo-PoMT.js → use-timeline-entry-diff-BsyOlJRs.js} +2 -2
- package/dist/public/index.html +14 -14
- package/dist/{repair-launch-json-B4Zi-Yew.mjs → repair-launch-json-_LNf0mxY.mjs} +2 -2
- package/dist/{repair-mcp-configs-D6loXjxW.mjs → repair-mcp-configs-4w5anrcS.mjs} +2 -2
- package/dist/{src-BVxbsT3r.mjs → src-B0ORaXQ7.mjs} +2 -2
- package/dist/src-B7cV11n2.mjs +1 -0
- package/dist/{start-D0lDn8MK.mjs → start-BcTUylsQ.mjs} +2 -2
- package/dist/start-Cdm2F7H4.mjs +1 -0
- package/package.json +4 -4
- package/dist/constants-DR0hfHht.mjs +0 -2
- package/dist/init-DbOIjPcY.mjs +0 -1
- package/dist/loader-DbBBfvBR.mjs +0 -1
- package/dist/preview-CSz9dsdq.mjs +0 -1
- package/dist/public/assets/CodeMirrorPropInput-CmmYeoCU.js +0 -3
- package/dist/public/assets/DocumentContext-FaHb8ylL.js +0 -38
- package/dist/public/assets/FeedbackForm-BD3HfKup.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-CqWQpzLt.js +0 -1
- package/dist/public/assets/SourceEditor-BaL1qejh.js +0 -1
- package/dist/public/assets/index-BZpwGG-G.js +0 -2196
- package/dist/public/assets/use-activity-panel-Ctnb4QnY.js +0 -1
- package/dist/src-DeVr_0td.mjs +0 -1
- package/dist/start-CtaMmjrN.mjs +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./jsx-runtime-BUgB2tll.js";import{Br as t,Nr as n,On as r,Pn as i,Pr as a,Yn as o,oi as s,qn as c,ri as l,ui as u}from"./DocumentContext-FaHb8ylL.js";import{n as d,r as f}from"./dist-Nvb76hAm.js";import{t as p}from"./compiler-runtime-BfE3aGVn.js";import{i as m}from"./local-menu-action-bus-BuSRFm5g.js";import{t as h}from"./utils-CPqDy6Hr.js";import{t as g}from"./button-CA0dewJJ.js";import{i as _,n as ee,t as te}from"./tooltip-DPvMEqsq.js";import{st as v}from"./CodeMirrorPropInput-CmmYeoCU.js";import{$n as y,Ln as b,Pi as x,Rn as S,_r as C,er as w}from"./dist-D4WRKOt72.js";import{n as T}from"./dist-CuH7ikCn.js";import{t as E}from"./dist-BIGNzOeF2.js";import{t as ne}from"./createLucideIcon-CAkY8Blx.js";import{t as re}from"./x-wQUDJS55.js";import{f as ie}from"./doc-paths-C9Yc1vg4.js";var D=ne(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),O=p(),k=`var(--ok-comment-hue,37,99,235)`,ae=k,oe={fill:.22,line:.7},A={fill:.45,line:1},se=.45;function ce(e,t){let n=ae,{fill:r,line:i}=t?A:oe;return[`border-radius:2px`,`padding-bottom:1px`,...e.id===null?[]:[`cursor:pointer`],`background-color:rgba(${n},${r})`,`box-shadow:inset 0 -2px 0 rgba(${n},${i})`,``].join(`;`)}function j(e){return e.map(e=>e.id??`·`).join(`|`)}function le(e){let t=null;for(let n of e)n.id!==null&&(t===null||n.to-n.from<t.to-t.from)&&(t=n);return t?.id??null}function ue(e,t){return e.id===null||e.id===t}function de(e,t=null){let n=[...e].filter(e=>e.from<e.to).sort((e,t)=>e.from-t.from||e.to-t.to||(e.id??``).localeCompare(t.id??``));if(n.length===0)return[];let r=[...new Set(n.flatMap(e=>[e.from,e.to]))].sort((e,t)=>e-t),i=[],a=null,o=()=>{if(a===null)return;let e=a.covering.find(e=>ue(e,t));i.push({from:a.from,to:a.to,style:ce(e??a.covering[0],e!==void 0),threadId:le(a.covering)}),a=null};for(let e=0;e<r.length-1;e++){let t=r[e],i=r[e+1],s=n.filter(e=>e.from<=t&&e.to>=i);if(s.length===0){o();continue}if(a!==null&&a.to===t&&j(a.covering)===j(s)){a.to=i;continue}o(),a={from:t,to:i,covering:s}}return o(),i}var M=`data-comment-reveal`;function N(e){return typeof CSS<`u`&&CSS.escape?CSS.escape(e):e}function P(e){return e===``?null:document.querySelector(`[data-testid="property-row"][data-key="${N(e)}"]`)}function fe(e){let t=P(e);if(t===null)return null;let n=t.getBoundingClientRect();return n.height===0&&n.width===0?null:n}function pe(e){P(e)?.scrollIntoView({block:`center`,behavior:`smooth`})}function F(e){if(e.quote===``)return!1;let t=e.path.length===0?e.key:e.path[e.path.length-1],n=Array.from(document.querySelectorAll(`[data-testid="property-row"][data-key="${N(String(t))}"]`)),r=Array.from(document.querySelectorAll(`[data-testid="property-row"]`));for(let t of[...n,...r]){let n=t.querySelector(`textarea, input`);if(n===null)continue;let r=I(n.value,e.quote,e.start,e.end);if(r!==null)return t.scrollIntoView({block:`center`,behavior:`smooth`}),n.focus(),n.setSelectionRange(r.start,r.end),me(n),!0}return!1}function I(e,t,n,r){if(n!==void 0&&r!==void 0&&e.slice(n,r)===t)return{start:n,end:r};let i=e.indexOf(t);return i<0?null:{start:i,end:i+t.length}}function me(e){e.style.setProperty(`--comment-reveal-fill`,`rgba(${k},${se})`),e.setAttribute(M,`true`);let t=()=>{e.removeAttribute(M),e.style.removeProperty(`--comment-reveal-fill`)};e.addEventListener(`blur`,t,{once:!0}),e.addEventListener(`pointerdown`,t,{once:!0}),e.addEventListener(`keydown`,t,{once:!0})}function L(e,{includeBlockComponents:t=!1}={}){let n=``,r=[];return e.descendants((e,i)=>{if(e.isText&&e.text){for(let t=0;t<e.text.length;t++)n+=e.text[t],r.push(i+t);return!0}if(e.isBlock&&!t)return!0;let a=b(e);if(a.length>0){let t=i+e.nodeSize-1;for(let e=0;e<a.length;e++)n+=a[e],r.push(e===a.length-1?t:i)}return!0}),{text:n,positions:r}}function R(e,t){let n=[];if(t===``)return n;let r=e.indexOf(t);for(;r!==-1;)n.push(r),r=e.indexOf(t,r+1);return n}function z(e,t,n){let r=n?.prefix??``,i=n?.suffix??``;if(r===``&&i===``)return null;let a=r===``?[0]:C(e,r,{syntaxIn:`needle`}).map(e=>e.end),o=i===``?[e.length]:C(e,i,{syntaxIn:`needle`}).map(e=>e.start);if(a.length!==1||o.length!==1)return null;let s=a[0],c=o[0];for(;s<c&&/\s/.test(e[s]??``);)s+=1;for(;c>s&&/\s/.test(e[c-1]??``);)--c;if(c<=s)return null;let l=x(t.length);return c-s>l?null:{start:s,end:c}}function B(e,t){let n=e.positions[t.start],r=e.positions[t.end-1];return n==null||r==null?null:{from:n,to:r+1}}function V(e,t,n){if(t.length===0)return null;let r=R(e.text,t).map(e=>({start:e,end:e+t.length}));if(r.length===0&&(r=C(e.text,t,{syntaxIn:`needle`})),r.length===0){let r=z(e.text,t,n);return r===null?null:B(e,r)}let i=n?.prefix??``,a=n?.suffix??``,o=t=>e.text.includes(t)||C(e.text,t,{syntaxIn:`needle`}).length>0;if(i!==``&&a!==``&&!o(i+t+a)&&o(i+a))return null;let s=y({prefix:i,suffix:a},{syntaxInContext:!0}),c=t=>s===0||w(e.text,t,{prefix:i,suffix:a},{syntaxIn:`none`,syntaxInContext:!0})>=s;if(r.length===1){if(!c(r[0])){let r=z(e.text,t,n);return r===null?null:B(e,r)}return B(e,r[0])}let l=[],u=-1;for(let t of r){let n=w(e.text,t,{prefix:i,suffix:a},{syntaxIn:`none`,syntaxInContext:!0});n>u?(u=n,l=[t]):n===u&&l.push(t)}if(!c(l[0])){let r=z(e.text,t,n);return r===null?null:B(e,r)}return B(e,l[0])}var H=64;function he(e,t,n){return{prefix:S(e,Math.max(0,t-H),t),suffix:S(e,n,Math.min(e.content.size,n+H))}}function U(e,t,n){return W(e)(t,n)}function W(e){let t=L(e),n=null;return(r,i)=>{let a=V(t,r,i);return a===null?(n??=L(e,{includeBlockComponents:!0}),V(n,r,i)):a}}var ge=220,_e=24,ve=600;function G(e,t){return i(e,()=>{let n=r(e);t(),window.setTimeout(()=>n.release(),ve)})}function ye(e){let t=e.viewTop+e.insetTop,n=e.viewBottom-ge;return e.anchorTop>=t&&e.anchorBottom<=n?0:e.anchorTop-(t+_e)}function K(e){let t=e?.parentElement??null;for(;t;){let e=getComputedStyle(t).overflowY;if(e===`auto`||e===`scroll`)return t;t=t.parentElement}return null}function q(e){let t=Number.parseFloat(getComputedStyle(e).scrollPaddingTop);return Number.isFinite(t)?t:0}function J(e,t,n,r){let i=v(e);if(!i)return!1;let a=K(i.dom);if(!a)return G(n,()=>e.commands.scrollIntoView());let o,s;try{o=i.coordsAtPos(t.from),s=i.coordsAtPos(t.to)}catch{return!1}let c=a.getBoundingClientRect(),l=ye({anchorTop:o.top,anchorBottom:Math.max(o.bottom,s.bottom),viewTop:c.top,viewBottom:c.bottom,insetTop:q(a)});if(l===0)return!0;let u=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;return G(n,()=>a.scrollTo({top:a.scrollTop+l,behavior:r?.instant||u?`auto`:`smooth`}))}var be=1e4,xe=80,Se=1500,Y=[`wheel`,`touchstart`,`mousedown`,`keydown`];function Ce(e){let t=!1,r=null,i=null,s=-1,l=()=>{let o=c(e.docName);if(!o||o.isDestroyed)return!1;if(t||(t=!0,n(e.threadId)),e.quote===``)return r===null&&(r=Date.now(),a(e.threadId)),!0;let l=o.state.doc.content.size;return(i===null||l!==s)&&(i=U(o.state.doc,e.quote,e.context),s=l),!i||!J(o,i,e.docName,{instant:!0})?!1:(r===null&&(r=Date.now(),a(e.threadId)),!0)};u(`comments`),l(),c(e.docName)===null&&window.location.assign(ie(e.docName));let d=!1,f=()=>{if(!d){d=!0,h(),window.clearInterval(g),window.clearTimeout(_);for(let e of Y)window.removeEventListener(e,p,!0)}},p=()=>f(),m=()=>{l()&&r!==null&&Date.now()-r>=Se&&f()},h=o(m),g=window.setInterval(m,xe),_=window.setTimeout(()=>{r===null&&T.error(t?E._({id:`KeXgA-`}):E._({id:`JDQ5I5`})),f()},be);for(let e of Y)window.addEventListener(e,p,!0);m()}var X=e();function we(){return l().length}function Te(){let e=(0,O.c)(4),n=l(),r;if(e[0]!==n){r=new Map;for(let e of n){let n=t(e)?.docName;n!==void 0&&r.set(n,(r.get(n)??0)+1)}e[0]=n,e[1]=r}else r=e[1];let i;return e[2]===r?i=e[3]:(i=[...r].map(Ee),e[2]=r,e[3]=i),i}function Ee(e){let[t,n]=e;return{docName:t,count:n}}function De(e){let t=(0,O.c)(34),{count:n,docs:r,attached:i,onAttach:a,onDismiss:o}=e,s;t[0]===r?s=t[1]:(s=r===void 0?[]:r,t[0]=r,t[1]=s);let c=s,{_:l}=f();if(n===0)return null;if(!i){let e;t[2]===l?e=t[3]:(e=l({id:`UpOct_`}),t[2]=l,t[3]=e);let n,r,i;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(n=h(`h-auto min-h-0 gap-1 rounded-md border border-dashed bg-transparent px-1.5 py-0.5`,`text-xs font-normal text-muted-foreground hover:bg-muted/60 hover:text-foreground`),r=(0,X.jsx)(m,{className:`size-3`}),i=(0,X.jsx)(d,{id:`VbyRUy`}),t[4]=n,t[5]=r,t[6]=i):(n=t[4],r=t[5],i=t[6]);let o;return t[7]!==a||t[8]!==e?(o=(0,X.jsxs)(g,{type:`button`,size:`sm`,variant:`ghost`,"aria-pressed":!1,"aria-label":e,onClick:a,"data-testid":`composer-context-chip-comments`,className:n,children:[r,i]}),t[7]=a,t[8]=e,t[9]=o):o=t[9],o}let u;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(u=h(`inline-flex items-center gap-1 rounded-md border bg-muted/60 py-0.5 pr-0.5 pl-1.5`,`text-xs text-muted-foreground`),t[10]=u):u=t[10];let p;t[11]===l?p=t[12]:(p=l({id:`2zvUIK`}),t[11]=l,t[12]=p);let v;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,X.jsx)(D,{className:`size-3`}),t[13]=v):v=t[13];let y;t[14]!==n||t[15]!==c.length?(y=c.length>1?(0,X.jsx)(d,{id:`5TmrYN`,values:{0:c.length,count:n}}):(0,X.jsx)(d,{id:`eiUA4k`,values:{count:n}}),t[14]=n,t[15]=c.length,t[16]=y):y=t[16];let b;t[17]!==p||t[18]!==y?(b=(0,X.jsx)(_,{asChild:!0,children:(0,X.jsxs)(g,{type:`button`,size:`sm`,variant:`ghost`,"aria-label":p,onClick:ke,"data-testid":`composer-comments-open-panel`,className:`h-auto min-h-0 gap-1 px-0.5 py-0 text-xs font-normal text-muted-foreground hover:text-foreground`,children:[v,y]})}),t[17]=p,t[18]=y,t[19]=b):b=t[19];let x;t[20]===c?x=t[21]:(x=(0,X.jsx)(ee,{className:`max-w-64`,children:c.length>1?(0,X.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:c.map(Oe)}):(0,X.jsx)(d,{id:`2zvUIK`})}),t[20]=c,t[21]=x);let S;t[22]!==b||t[23]!==x?(S=(0,X.jsxs)(te,{children:[b,x]}),t[22]=b,t[23]=x,t[24]=S):S=t[24];let C;t[25]===l?C=t[26]:(C=l({id:`pFRz_E`}),t[25]=l,t[26]=C);let w;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,X.jsx)(re,{className:`size-3`}),t[27]=w):w=t[27];let T;t[28]!==o||t[29]!==C?(T=(0,X.jsx)(g,{type:`button`,size:`sm`,variant:`ghost`,"aria-label":C,onClick:o,className:`size-4 p-0 text-muted-foreground hover:text-foreground`,children:w}),t[28]=o,t[29]=C,t[30]=T):T=t[30];let E;return t[31]!==T||t[32]!==S?(E=(0,X.jsxs)(`span`,{"data-testid":`composer-context-chip-comments`,className:u,children:[S,T]}),t[31]=T,t[32]=S,t[33]=E):E=t[33],E}function Oe(e){return(0,X.jsxs)(`li`,{className:`flex items-baseline gap-1.5`,children:[(0,X.jsx)(`span`,{className:`tabular-nums`,children:e.count}),(0,X.jsx)(`span`,{className:`truncate`,children:Z(e.docName)})]},e.docName)}function ke(){return s()}function Z(e){let t=e.lastIndexOf(`/`);return t>=0?e.slice(t+1):e}function Ae(e,t){let n=e;for(let e of t)n+=typeof e==`number`?`[${e}]`:`.${e}`;return n}function je(e){Ce({docName:e.docName,quote:e.target.kind===`property`?``:e.anchor?.quote??``,threadId:e.id,context:e.anchor??void 0});let{target:t,anchor:n}=e;if(t.kind!==`property`||n===null)return;let r=0,i=()=>{F({key:t.key,path:t.path,quote:n.quote,start:n.start,end:n.end})||(r+=1,!(r>=Q)&&requestAnimationFrame(i))};requestAnimationFrame(i)}var Q=30;function Me(e){return{docName:e.docName,body:e.instruction,propertyKey:e.property,quote:e.passage?.exact??``,anchorLost:e.anchorLost,prefix:e.passage?.prefix??``,suffix:e.passage?.suffix??``,repeats:e.passageRepeats}}var $=48;function Ne(e){let t=e.replace(/\s+/g,` `).trimStart();return t.length>$?`…${t.slice(-$)}`:t}function Pe(e){let t=e.replace(/\s+/g,` `).trimEnd();return t.length>$?`${t.slice(0,$)}…`:t}function Fe(e){if(!e.repeats)return null;let t=Ne(e.prefix),n=Pe(e.suffix);return t===``&&n===``?null:`(This text appears more than once in the file. The one meant is ${t===``?`at the start of the file, followed by "${n}"`:n===``?`at the end of the file, preceded by "${t}"`:`between "${t}" and "${n}"`} — match that context rather than the first occurrence.)`}function Ie(e,t,n){let r=t.trim(),i=[];if(i.push(r.length>0?r:`Address the following review comments by editing the documents directly.`),i.push(``),i.push(e.length===1?`The comment:`:`The ${e.length} comments:`),e.forEach((e,t)=>{if(i.push(``),e.propertyKey){let n=e.quote.trim();if(n===``)i.push(`${t+1}. In \`${e.docName}\`, on the \`${e.propertyKey}\` property (frontmatter):`),i.push(``),i.push(` ${e.body.trim()}`);else{i.push(`${t+1}. In \`${e.docName}\`, on this text within the \`${e.propertyKey}\` property (frontmatter):`),i.push(``);for(let e of n.split(`
|
|
1
|
+
import{t as e}from"./jsx-runtime-BUgB2tll.js";import{$r as t,An as n,Ar as r,Gn as i,Ir as a,Un as o,kr as s,ni as c,oi as l,wn as u}from"./DocumentContext-Dq3krLop.js";import{n as d,r as f}from"./dist-Nvb76hAm.js";import{t as p}from"./compiler-runtime-BfE3aGVn.js";import{i as m}from"./local-menu-action-bus-BuSRFm5g.js";import{t as h}from"./utils-CPqDy6Hr.js";import{t as g}from"./button-CA0dewJJ.js";import{i as _,n as ee,t as te}from"./tooltip-DPvMEqsq.js";import{xt as v}from"./CodeMirrorPropInput-B3NZ_xw8.js";import{$n as y,Ln as b,Pi as x,Rn as S,_r as C,er as w}from"./dist-D4WRKOt72.js";import{n as T}from"./dist-CuH7ikCn.js";import{t as E}from"./dist-BIGNzOeF2.js";import{t as ne}from"./createLucideIcon-CAkY8Blx.js";import{t as re}from"./x-wQUDJS55.js";import{f as ie}from"./doc-paths-C9Yc1vg4.js";var D=ne(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),O=p(),k=`var(--ok-comment-hue,37,99,235)`,ae=k,oe={fill:.22,line:.7},A={fill:.45,line:1},se=.45;function ce(e,t){let n=ae,{fill:r,line:i}=t?A:oe;return[`border-radius:2px`,`padding-bottom:1px`,...e.id===null?[]:[`cursor:pointer`],`background-color:rgba(${n},${r})`,`box-shadow:inset 0 -2px 0 rgba(${n},${i})`,``].join(`;`)}function j(e){return e.map(e=>e.id??`·`).join(`|`)}function le(e){let t=null;for(let n of e)n.id!==null&&(t===null||n.to-n.from<t.to-t.from)&&(t=n);return t?.id??null}function ue(e,t){return e.id===null||e.id===t}function de(e,t=null){let n=[...e].filter(e=>e.from<e.to).sort((e,t)=>e.from-t.from||e.to-t.to||(e.id??``).localeCompare(t.id??``));if(n.length===0)return[];let r=[...new Set(n.flatMap(e=>[e.from,e.to]))].sort((e,t)=>e-t),i=[],a=null,o=()=>{if(a===null)return;let e=a.covering.find(e=>ue(e,t));i.push({from:a.from,to:a.to,style:ce(e??a.covering[0],e!==void 0),threadId:le(a.covering)}),a=null};for(let e=0;e<r.length-1;e++){let t=r[e],i=r[e+1],s=n.filter(e=>e.from<=t&&e.to>=i);if(s.length===0){o();continue}if(a!==null&&a.to===t&&j(a.covering)===j(s)){a.to=i;continue}o(),a={from:t,to:i,covering:s}}return o(),i}var M=`data-comment-reveal`;function N(e){return typeof CSS<`u`&&CSS.escape?CSS.escape(e):e}function P(e){return e===``?null:document.querySelector(`[data-testid="property-row"][data-key="${N(e)}"]`)}function fe(e){let t=P(e);if(t===null)return null;let n=t.getBoundingClientRect();return n.height===0&&n.width===0?null:n}function pe(e){P(e)?.scrollIntoView({block:`center`,behavior:`smooth`})}function F(e){if(e.quote===``)return!1;let t=e.path.length===0?e.key:e.path[e.path.length-1],n=Array.from(document.querySelectorAll(`[data-testid="property-row"][data-key="${N(String(t))}"]`)),r=Array.from(document.querySelectorAll(`[data-testid="property-row"]`));for(let t of[...n,...r]){let n=t.querySelector(`textarea, input`);if(n===null)continue;let r=I(n.value,e.quote,e.start,e.end);if(r!==null)return t.scrollIntoView({block:`center`,behavior:`smooth`}),n.focus(),n.setSelectionRange(r.start,r.end),me(n),!0}return!1}function I(e,t,n,r){if(n!==void 0&&r!==void 0&&e.slice(n,r)===t)return{start:n,end:r};let i=e.indexOf(t);return i<0?null:{start:i,end:i+t.length}}function me(e){e.style.setProperty(`--comment-reveal-fill`,`rgba(${k},${se})`),e.setAttribute(M,`true`);let t=()=>{e.removeAttribute(M),e.style.removeProperty(`--comment-reveal-fill`)};e.addEventListener(`blur`,t,{once:!0}),e.addEventListener(`pointerdown`,t,{once:!0}),e.addEventListener(`keydown`,t,{once:!0})}function L(e,{includeBlockComponents:t=!1}={}){let n=``,r=[];return e.descendants((e,i)=>{if(e.isText&&e.text){for(let t=0;t<e.text.length;t++)n+=e.text[t],r.push(i+t);return!0}if(e.isBlock&&!t)return!0;let a=b(e);if(a.length>0){let t=i+e.nodeSize-1;for(let e=0;e<a.length;e++)n+=a[e],r.push(e===a.length-1?t:i)}return!0}),{text:n,positions:r}}function R(e,t){let n=[];if(t===``)return n;let r=e.indexOf(t);for(;r!==-1;)n.push(r),r=e.indexOf(t,r+1);return n}function z(e,t,n){let r=n?.prefix??``,i=n?.suffix??``;if(r===``&&i===``)return null;let a=r===``?[0]:C(e,r,{syntaxIn:`needle`}).map(e=>e.end),o=i===``?[e.length]:C(e,i,{syntaxIn:`needle`}).map(e=>e.start);if(a.length!==1||o.length!==1)return null;let s=a[0],c=o[0];for(;s<c&&/\s/.test(e[s]??``);)s+=1;for(;c>s&&/\s/.test(e[c-1]??``);)--c;if(c<=s)return null;let l=x(t.length);return c-s>l?null:{start:s,end:c}}function B(e,t){let n=e.positions[t.start],r=e.positions[t.end-1];return n==null||r==null?null:{from:n,to:r+1}}function V(e,t,n){if(t.length===0)return null;let r=R(e.text,t).map(e=>({start:e,end:e+t.length}));if(r.length===0&&(r=C(e.text,t,{syntaxIn:`needle`})),r.length===0){let r=z(e.text,t,n);return r===null?null:B(e,r)}let i=n?.prefix??``,a=n?.suffix??``,o=t=>e.text.includes(t)||C(e.text,t,{syntaxIn:`needle`}).length>0;if(i!==``&&a!==``&&!o(i+t+a)&&o(i+a))return null;let s=y({prefix:i,suffix:a},{syntaxInContext:!0}),c=t=>s===0||w(e.text,t,{prefix:i,suffix:a},{syntaxIn:`none`,syntaxInContext:!0})>=s;if(r.length===1){if(!c(r[0])){let r=z(e.text,t,n);return r===null?null:B(e,r)}return B(e,r[0])}let l=[],u=-1;for(let t of r){let n=w(e.text,t,{prefix:i,suffix:a},{syntaxIn:`none`,syntaxInContext:!0});n>u?(u=n,l=[t]):n===u&&l.push(t)}if(!c(l[0])){let r=z(e.text,t,n);return r===null?null:B(e,r)}return B(e,l[0])}var H=64;function he(e,t,n){return{prefix:S(e,Math.max(0,t-H),t),suffix:S(e,n,Math.min(e.content.size,n+H))}}function U(e,t,n){return W(e)(t,n)}function W(e){let t=L(e),n=null;return(r,i)=>{let a=V(t,r,i);return a===null?(n??=L(e,{includeBlockComponents:!0}),V(n,r,i)):a}}var ge=220,_e=24,ve=600;function G(e,t){return n(e,()=>{let n=u(e);t(),window.setTimeout(()=>n.release(),ve)})}function ye(e){let t=e.viewTop+e.insetTop,n=e.viewBottom-ge;return e.anchorTop>=t&&e.anchorBottom<=n?0:e.anchorTop-(t+_e)}function K(e){let t=e?.parentElement??null;for(;t;){let e=getComputedStyle(t).overflowY;if(e===`auto`||e===`scroll`)return t;t=t.parentElement}return null}function q(e){let t=Number.parseFloat(getComputedStyle(e).scrollPaddingTop);return Number.isFinite(t)?t:0}function J(e,t,n,r){let i=v(e);if(!i)return!1;let a=K(i.dom);if(!a)return G(n,()=>e.commands.scrollIntoView());let o,s;try{o=i.coordsAtPos(t.from),s=i.coordsAtPos(t.to)}catch{return!1}let c=a.getBoundingClientRect(),l=ye({anchorTop:o.top,anchorBottom:Math.max(o.bottom,s.bottom),viewTop:c.top,viewBottom:c.bottom,insetTop:q(a)});if(l===0)return!0;let u=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;return G(n,()=>a.scrollTo({top:a.scrollTop+l,behavior:r?.instant||u?`auto`:`smooth`}))}var be=1e4,xe=80,Se=1500,Y=[`wheel`,`touchstart`,`mousedown`,`keydown`];function Ce(e){let t=!1,n=null,a=null,c=-1,u=()=>{let i=o(e.docName);if(!i||i.isDestroyed)return!1;if(t||(t=!0,s(e.threadId)),e.quote===``)return n===null&&(n=Date.now(),r(e.threadId)),!0;let l=i.state.doc.content.size;return(a===null||l!==c)&&(a=U(i.state.doc,e.quote,e.context),c=l),!a||!J(i,a,e.docName,{instant:!0})?!1:(n===null&&(n=Date.now(),r(e.threadId)),!0)};l(`comments`),u(),o(e.docName)===null&&window.location.assign(ie(e.docName));let d=!1,f=()=>{if(!d){d=!0,h(),window.clearInterval(g),window.clearTimeout(_);for(let e of Y)window.removeEventListener(e,p,!0)}},p=()=>f(),m=()=>{u()&&n!==null&&Date.now()-n>=Se&&f()},h=i(m),g=window.setInterval(m,xe),_=window.setTimeout(()=>{n===null&&T.error(t?E._({id:`KeXgA-`}):E._({id:`JDQ5I5`})),f()},be);for(let e of Y)window.addEventListener(e,p,!0);m()}var X=e();function we(){return t().length}function Te(){let e=(0,O.c)(4),n=t(),r;if(e[0]!==n){r=new Map;for(let e of n){let t=a(e)?.docName;t!==void 0&&r.set(t,(r.get(t)??0)+1)}e[0]=n,e[1]=r}else r=e[1];let i;return e[2]===r?i=e[3]:(i=[...r].map(Ee),e[2]=r,e[3]=i),i}function Ee(e){let[t,n]=e;return{docName:t,count:n}}function De(e){let t=(0,O.c)(34),{count:n,docs:r,attached:i,onAttach:a,onDismiss:o}=e,s;t[0]===r?s=t[1]:(s=r===void 0?[]:r,t[0]=r,t[1]=s);let c=s,{_:l}=f();if(n===0)return null;if(!i){let e;t[2]===l?e=t[3]:(e=l({id:`UpOct_`}),t[2]=l,t[3]=e);let n,r,i;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(n=h(`h-auto min-h-0 gap-1 rounded-md border border-dashed bg-transparent px-1.5 py-0.5`,`text-xs font-normal text-muted-foreground hover:bg-muted/60 hover:text-foreground`),r=(0,X.jsx)(m,{className:`size-3`}),i=(0,X.jsx)(d,{id:`VbyRUy`}),t[4]=n,t[5]=r,t[6]=i):(n=t[4],r=t[5],i=t[6]);let o;return t[7]!==a||t[8]!==e?(o=(0,X.jsxs)(g,{type:`button`,size:`sm`,variant:`ghost`,"aria-pressed":!1,"aria-label":e,onClick:a,"data-testid":`composer-context-chip-comments`,className:n,children:[r,i]}),t[7]=a,t[8]=e,t[9]=o):o=t[9],o}let u;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(u=h(`inline-flex items-center gap-1 rounded-md border bg-muted/60 py-0.5 pr-0.5 pl-1.5`,`text-xs text-muted-foreground`),t[10]=u):u=t[10];let p;t[11]===l?p=t[12]:(p=l({id:`2zvUIK`}),t[11]=l,t[12]=p);let v;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,X.jsx)(D,{className:`size-3`}),t[13]=v):v=t[13];let y;t[14]!==n||t[15]!==c.length?(y=c.length>1?(0,X.jsx)(d,{id:`5TmrYN`,values:{0:c.length,count:n}}):(0,X.jsx)(d,{id:`eiUA4k`,values:{count:n}}),t[14]=n,t[15]=c.length,t[16]=y):y=t[16];let b;t[17]!==p||t[18]!==y?(b=(0,X.jsx)(_,{asChild:!0,children:(0,X.jsxs)(g,{type:`button`,size:`sm`,variant:`ghost`,"aria-label":p,onClick:ke,"data-testid":`composer-comments-open-panel`,className:`h-auto min-h-0 gap-1 px-0.5 py-0 text-xs font-normal text-muted-foreground hover:text-foreground`,children:[v,y]})}),t[17]=p,t[18]=y,t[19]=b):b=t[19];let x;t[20]===c?x=t[21]:(x=(0,X.jsx)(ee,{className:`max-w-64`,children:c.length>1?(0,X.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:c.map(Oe)}):(0,X.jsx)(d,{id:`2zvUIK`})}),t[20]=c,t[21]=x);let S;t[22]!==b||t[23]!==x?(S=(0,X.jsxs)(te,{children:[b,x]}),t[22]=b,t[23]=x,t[24]=S):S=t[24];let C;t[25]===l?C=t[26]:(C=l({id:`pFRz_E`}),t[25]=l,t[26]=C);let w;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,X.jsx)(re,{className:`size-3`}),t[27]=w):w=t[27];let T;t[28]!==o||t[29]!==C?(T=(0,X.jsx)(g,{type:`button`,size:`sm`,variant:`ghost`,"aria-label":C,onClick:o,className:`size-4 p-0 text-muted-foreground hover:text-foreground`,children:w}),t[28]=o,t[29]=C,t[30]=T):T=t[30];let E;return t[31]!==T||t[32]!==S?(E=(0,X.jsxs)(`span`,{"data-testid":`composer-context-chip-comments`,className:u,children:[S,T]}),t[31]=T,t[32]=S,t[33]=E):E=t[33],E}function Oe(e){return(0,X.jsxs)(`li`,{className:`flex items-baseline gap-1.5`,children:[(0,X.jsx)(`span`,{className:`tabular-nums`,children:e.count}),(0,X.jsx)(`span`,{className:`truncate`,children:Z(e.docName)})]},e.docName)}function ke(){return c()}function Z(e){let t=e.lastIndexOf(`/`);return t>=0?e.slice(t+1):e}function Ae(e,t){let n=e;for(let e of t)n+=typeof e==`number`?`[${e}]`:`.${e}`;return n}function je(e){Ce({docName:e.docName,quote:e.target.kind===`property`?``:e.anchor?.quote??``,threadId:e.id,context:e.anchor??void 0});let{target:t,anchor:n}=e;if(t.kind!==`property`||n===null)return;let r=0,i=()=>{F({key:t.key,path:t.path,quote:n.quote,start:n.start,end:n.end})||(r+=1,!(r>=Q)&&requestAnimationFrame(i))};requestAnimationFrame(i)}var Q=30;function Me(e){return{docName:e.docName,body:e.instruction,propertyKey:e.property,quote:e.passage?.exact??``,anchorLost:e.anchorLost,prefix:e.passage?.prefix??``,suffix:e.passage?.suffix??``,repeats:e.passageRepeats}}var $=48;function Ne(e){let t=e.replace(/\s+/g,` `).trimStart();return t.length>$?`…${t.slice(-$)}`:t}function Pe(e){let t=e.replace(/\s+/g,` `).trimEnd();return t.length>$?`${t.slice(0,$)}…`:t}function Fe(e){if(!e.repeats)return null;let t=Ne(e.prefix),n=Pe(e.suffix);return t===``&&n===``?null:`(This text appears more than once in the file. The one meant is ${t===``?`at the start of the file, followed by "${n}"`:n===``?`at the end of the file, preceded by "${t}"`:`between "${t}" and "${n}"`} — match that context rather than the first occurrence.)`}function Ie(e,t,n){let r=t.trim(),i=[];if(i.push(r.length>0?r:`Address the following review comments by editing the documents directly.`),i.push(``),i.push(e.length===1?`The comment:`:`The ${e.length} comments:`),e.forEach((e,t)=>{if(i.push(``),e.propertyKey){let n=e.quote.trim();if(n===``)i.push(`${t+1}. In \`${e.docName}\`, on the \`${e.propertyKey}\` property (frontmatter):`),i.push(``),i.push(` ${e.body.trim()}`);else{i.push(`${t+1}. In \`${e.docName}\`, on this text within the \`${e.propertyKey}\` property (frontmatter):`),i.push(``);for(let e of n.split(`
|
|
2
2
|
`))i.push(` > ${e}`);i.push(``),i.push(` ${e.body.trim()}`)}e.anchorLost&&(i.push(``),i.push(n===``?` (Note: \`${e.propertyKey}\` is no longer in this document's frontmatter — it was renamed or removed since the comment was written. Do not apply this to a different property; if you cannot tell what it now refers to, say so instead of guessing.)`:` (Note: that text is no longer in \`${e.propertyKey}\` — the value was edited, reshaped, or removed since the comment was written. Do not apply this to a different property or a different part of the value; if you cannot tell what it now refers to, say so instead of guessing.)`));return}i.push(`${t+1}. In \`${e.docName}\`, on this passage:`),i.push(``);for(let t of e.quote.split(`
|
|
3
3
|
`))i.push(` > ${t}`);i.push(``),i.push(` ${e.body.trim()}`);let n=Fe(e);n!==null&&(i.push(``),i.push(` ${n}`)),e.anchorLost&&(i.push(``),i.push(` (Note: this passage is no longer in the document — it was edited or removed since the comment was written. Do not apply this to a different passage; if you cannot tell what it now refers to, say so instead of guessing.)`))}),n&&n.markdown.trim().length>0){i.push(``),i.push(`Also in scope, selected in \`${n.docName}\` (not a comment):`),i.push(``);for(let e of n.markdown.trim().split(`
|
|
4
4
|
`))i.push(`> ${e}`)}return i.join(`
|