@inkeep/open-knowledge 0.49.1 → 0.49.3

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.
Files changed (57) hide show
  1. package/dist/{acp-harness-probe-C8FhVWZi.mjs → acp-harness-probe-CV3l-A7S.mjs} +2 -2
  2. package/dist/cli.mjs +6 -6
  3. package/dist/constants-OpzgN1ix.mjs +2 -0
  4. package/dist/index.d.mts +17 -17
  5. package/dist/index.mjs +1 -1
  6. package/dist/init-CzaswOZC.mjs +1 -0
  7. package/dist/{init-VslWN3Iz.mjs → init-sscoocdL.mjs} +3 -3
  8. package/dist/{launch-json-removal-9-8M5r9e.mjs → launch-json-removal-Bah81akE.mjs} +2 -2
  9. package/dist/{loader-f3tIWlWk.mjs → loader-1zEuqyKl.mjs} +2 -2
  10. package/dist/loader-_q6Z7pfj.mjs +1 -0
  11. package/dist/preview-B-kLFfor.mjs +1 -0
  12. package/dist/{preview-CdESX2Ja.mjs → preview-a2qLL5bd.mjs} +2 -2
  13. package/dist/public/assets/{ActivityModeContent-C08FYohG.js → ActivityModeContent-H-D1VX7m.js} +1 -1
  14. package/dist/public/assets/{AgentDiffPane-T499-ugv.js → AgentDiffPane-B-gK5PsE.js} +1 -1
  15. package/dist/public/assets/{ChangedOutsideBadge-GeQfL_b-.js → ChangedOutsideBadge-D741mWRP.js} +1 -1
  16. package/dist/public/assets/{DocumentContext-C-Lo65-_.js → DocumentContext-CIVf31K9.js} +1 -1
  17. package/dist/public/assets/FeedbackForm-DshmSaPh.js +1 -0
  18. package/dist/public/assets/{ImportSkillDialog-ChsGV6eb.js → ImportSkillDialog-DQBS4ypC.js} +1 -1
  19. package/dist/public/assets/ManagedArtifactProperties-CE_UbtEZ.js +1 -0
  20. package/dist/public/assets/{ManagedArtifactProperties-B1ZA0ofn.js → ManagedArtifactProperties-CawqG1nH.js} +1 -1
  21. package/dist/public/assets/ReportBugDialogBody-B3qyqQDx.js +3 -0
  22. package/dist/public/assets/{SessionsHost-BRUQMi7f.js → SessionsHost-Bp7gQA1o.js} +2 -2
  23. package/dist/public/assets/{SettingsDialogBody-COTbFRqi.js → SettingsDialogBody-BLpulm10.js} +1 -1
  24. package/dist/public/assets/{SkillToolbarControls-PvRY_LHn.js → SkillToolbarControls-oKXEehFt.js} +1 -1
  25. package/dist/public/assets/{SourceEditor-Duqpede9.js → SourceEditor-C6NdTjpn.js} +1 -1
  26. package/dist/public/assets/{TerminalWindowApp-CFxcrkfe.js → TerminalWindowApp-DDnvJYMu.js} +1 -1
  27. package/dist/public/assets/{ThreadView-CAGruMiN.js → ThreadView-CGjBIs53.js} +1 -1
  28. package/dist/public/assets/{TimelineDiffPane-DnaRcvCk.js → TimelineDiffPane-BWfU5B2x.js} +1 -1
  29. package/dist/public/assets/{agent-diff-store-B7oQn7l7.js → agent-diff-store-CwO6mhOq.js} +1 -1
  30. package/dist/public/assets/{auth-state-cache-BUYyIMUZ.js → auth-state-cache-BBgW3LTD.js} +1 -1
  31. package/dist/public/assets/{comment-chips-BhvfCPCk.js → comment-chips-h8GZFVHH.js} +1 -1
  32. package/dist/public/assets/{follow-file-BymUhAtT.js → follow-file-CJHokzM7.js} +1 -1
  33. package/dist/public/assets/{index-B-snLDY1.js → index-BSoHa32-.js} +108 -108
  34. package/dist/public/assets/{selection-context-CSP8zK1H.js → selection-context-iNNNmmJS.js} +1 -1
  35. package/dist/public/assets/{skill-actions-98H3SnCL.js → skill-actions-8q8e7e5S.js} +1 -1
  36. package/dist/public/assets/{typing-burst-detector-BOmjXV-P.js → typing-burst-detector-D_ygX_hf.js} +1 -1
  37. package/dist/public/assets/{use-activity-panel-BwANCYjg.js → use-activity-panel-pkBl8bMj.js} +1 -1
  38. package/dist/public/assets/{use-open-skill-DCSEJ3jJ.js → use-open-skill-Mk41LRxd.js} +1 -1
  39. package/dist/public/assets/{use-skill-directory-D9S5f8By.js → use-skill-directory-Dzvfx2id.js} +1 -1
  40. package/dist/public/assets/{use-timeline-entry-diff-CB_cI1yy.js → use-timeline-entry-diff-Dk10Z55V.js} +1 -1
  41. package/dist/public/index.html +13 -13
  42. package/dist/{repair-launch-json-DwJ_yLw4.mjs → repair-launch-json-DQWnpxc4.mjs} +2 -2
  43. package/dist/{repair-mcp-configs-Q1hO02co.mjs → repair-mcp-configs-BMKiBYgT.mjs} +2 -2
  44. package/dist/src-DmiflYsL.mjs +1 -0
  45. package/dist/{src-DNPRz0-U.mjs → src-P_0ZFdzg.mjs} +2 -2
  46. package/dist/{start-DRG6a2sz.mjs → start-CcmrNw0D.mjs} +2 -2
  47. package/dist/start-DWgeY9Lf.mjs +1 -0
  48. package/package.json +5 -5
  49. package/dist/constants-BkYBCRUx.mjs +0 -2
  50. package/dist/init-BlCMJ0yB.mjs +0 -1
  51. package/dist/loader-Birwg2h1.mjs +0 -1
  52. package/dist/preview-gKyXf1a0.mjs +0 -1
  53. package/dist/public/assets/FeedbackForm-C_A-lpjC.js +0 -1
  54. package/dist/public/assets/ManagedArtifactProperties-B_ecuboX.js +0 -1
  55. package/dist/public/assets/ReportBugDialogBody-BUGec7jk.js +0 -3
  56. package/dist/src-BgeIHNkQ.mjs +0 -1
  57. package/dist/start-CWIlNpAT.mjs +0 -1
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{Wn as n}from"./DocumentContext-C-Lo65-_.js";import{t as r}from"./react-f2sANaYj.js";import{r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./utils-CPqDy6Hr.js";import{r as s,t as c}from"./button-RQ5o7P7w.js";import{t as l}from"./separator-k0mwGcaM.js";import{t as u}from"./createLucideIcon-BbftclCc.js";import{t as d}from"./x-COTyTduF.js";var f=u(`share-2`,[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]]),p=a(),m=t(),h=s(`group/button-group flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-lg [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1`,{variants:{orientation:{horizontal:`[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-lg!`,vertical:`flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-lg!`}},defaultVariants:{orientation:`horizontal`}});function g(e){let t=(0,p.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,orientation:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]!==n||t[5]!==r?(a=o(h({orientation:r}),n),t[4]=n,t[5]=r,t[6]=a):a=t[6];let s;return t[7]!==r||t[8]!==i||t[9]!==a?(s=(0,m.jsx)(`div`,{role:`group`,"data-slot":`button-group`,"data-orientation":r,className:a,...i}),t[7]=r,t[8]=i,t[9]=a,t[10]=s):s=t[10],s}function _(e){let t=(0,p.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,orientation:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`vertical`:i,s;t[4]===n?s=t[5]:(s=o(`relative self-stretch bg-input data-horizontal:mx-px data-horizontal:w-auto data-vertical:my-px data-vertical:h-auto`,n),t[4]=n,t[5]=s);let c;return t[6]!==a||t[7]!==r||t[8]!==s?(c=(0,m.jsx)(l,{"data-slot":`button-group-separator`,orientation:a,className:s,...r}),t[6]=a,t[7]=r,t[8]=s,t[9]=c):c=t[9],c}var v=`button, a[href], [role="menuitem"], [role="button"], input, textarea, select, [contenteditable="true"]`;function y(e,t){e.target instanceof HTMLElement&&(!(e.currentTarget instanceof HTMLElement)||!e.currentTarget.contains(e.target)||e.target.closest(v)||(e.preventDefault(),t.current?.focus()))}var b=e(r(),1);function x(e){let t=e.lastIndexOf(`/`);return t>=0?e.slice(t+1):e}function S(e){let t=(0,p.c)(21),{path:r,onRemove:a}=e,{_:o}=i(),s,l;t[0]!==o||t[1]!==r?(s=x(r),l=o({id:`hnq8fP`,values:{label:s}}),t[0]=o,t[1]=r,t[2]=s,t[3]=l):(s=t[2],l=t[3]);let u=l,f=`composer-context-chip-file-${r}`,h;t[4]===a?h=t[5]:(h=e=>{(e.key===`Backspace`||e.key===`Delete`)&&(e.preventDefault(),a())},t[4]=a,t[5]=h);let g;t[6]===r?g=t[7]:(g=(0,m.jsx)(`span`,{className:`absolute top-1/2 left-1/2 inline-flex size-3 -translate-x-1/2 -translate-y-1/2 opacity-100 transition-opacity duration-150 ease-out group-hover/chip:opacity-0 group-focus-within/chip:opacity-0 motion-reduce:transition-none`,children:(0,m.jsx)(n,{path:r,className:`size-3`,showExtensionBadge:!1})}),t[6]=r,t[7]=g);let _;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,m.jsx)(d,{className:`absolute top-1/2 left-1/2 size-3 -translate-x-1/2 -translate-y-1/2 opacity-0 transition-opacity duration-150 ease-out group-hover/chip:opacity-100 group-focus-within/chip:opacity-100 motion-reduce:transition-none`,"aria-hidden":!0}),t[8]=_):_=t[8];let v;t[9]!==a||t[10]!==u||t[11]!==h||t[12]!==g?(v=(0,m.jsxs)(c,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":u,onClick:a,onKeyDown:h,className:`group/remove relative size-3.5 shrink-0 rounded-sm text-muted-foreground/80 hover:text-foreground`,children:[g,_]}),t[9]=a,t[10]=u,t[11]=h,t[12]=g,t[13]=v):v=t[13];let y;t[14]===s?y=t[15]:(y=(0,m.jsx)(`span`,{className:`min-w-0 truncate`,children:s}),t[14]=s,t[15]=y);let b;return t[16]!==r||t[17]!==f||t[18]!==v||t[19]!==y?(b=(0,m.jsxs)(`span`,{"data-testid":f,title:r,className:`group/chip inline-flex max-w-[14rem] items-center gap-1 rounded-md border bg-muted/40 py-0.5 pr-1.5 pl-1 text-muted-foreground text-xs`,children:[v,y]}),t[16]=r,t[17]=f,t[18]=v,t[19]=y,t[20]=b):b=t[20],b}function C(e){let t=(0,p.c)(13),{files:n,onRemoveFile:r,className:i,children:a}=e,s;t[0]===n?s=t[1]:(s=n===void 0?[]:n,t[0]=n,t[1]=s);let c=s;if(c.length===0&&b.Children.toArray(a).length===0)return null;let l;t[2]===i?l=t[3]:(l=o(`flex flex-wrap items-center gap-1`,i),t[2]=i,t[3]=l);let u;if(t[4]!==c||t[5]!==r){let e;t[7]===r?e=t[8]:(e=e=>(0,m.jsx)(S,{path:e,onRemove:()=>r?.(e)},e),t[7]=r,t[8]=e),u=c.map(e),t[4]=c,t[5]=r,t[6]=u}else u=t[6];let d;return t[9]!==a||t[10]!==l||t[11]!==u?(d=(0,m.jsxs)(`div`,{className:l,"data-testid":`composer-context-chips`,children:[u,a]}),t[9]=a,t[10]=l,t[11]=u,t[12]=d):d=t[12],d}function w(){let e=(0,p.c)(2),[t,n]=(0,b.useState)(T),r,i;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{let e=window.matchMedia(`(prefers-reduced-motion: reduce)`);n(e.matches);let t=e=>n(e.matches);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,b.useEffect)(r,i),t}function T(){return typeof window<`u`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function E(e,t){let n=e[t];return typeof n==`string`&&n!==``?n:null}function D(e){if(typeof e!=`object`||!e)return null;let t=e,n=E(t,`tool`)??E(t,`name`),r=t;if(typeof t.arguments==`object`&&t.arguments!==null)r=t.arguments;else if(typeof t.arguments==`string`)try{let e=JSON.parse(t.arguments);typeof e==`object`&&e&&(r=e)}catch{}return{tool:n,args:r}}var O=`ok-acp-follow-file-v1`;function k(){try{return localStorage.getItem(O)!==`0`}catch{return!0}}function A(e){try{localStorage.setItem(O,e?`1`:`0`)}catch{}}function j(e){return e===``||e.startsWith(`/`)||e.startsWith(`\\`)||e.split(`/`).some(e=>e===``||e.startsWith(`.`))?null:e}function M(e,t){let n=t.pathSeparator,r=e=>n===`\\`?e.replaceAll(`\\`,`/`):e,i=r(t.contentDir).replace(/\/$/,``),a=r(e);if(!a.startsWith(`${i}/`))return null;let o=a.slice(i.length+1),s=/\.(md|mdx)$/.exec(o);return s===null?null:j(o.slice(0,-s[0].length))}var N=new Set([`cat`,`ls`,`grep`,`rg`,`find`,`head`,`tail`,`wc`,`sort`,`uniq`,`cut`,`sed`,`awk`,`bat`,`less`,`more`]);function P(e,t){let n=[],r=/"([^"]*)"|'([^']*)'|(\S+)/g,i=r.exec(e);for(;i!==null;)n.push(i[1]??i[2]??i[3]??``),i=r.exec(e);let a=n[0];if(a===void 0||!N.has(a))return null;for(let e of n.slice(1)){if(e.startsWith(`-`)||/[*?[\]]/.test(e))continue;let n=/\.(md|mdx)$/i.exec(e);if(n===null)continue;if(e.startsWith(`/`)||/^[A-Za-z]:[\\/]/.test(e)){if(t!==null){let n=M(e,t);if(n!==null)return n}continue}let r=j(e.replace(/^\.\//,``).slice(0,-n[0].length));if(r!==null)return r}return null}function F(e){if(e===null||e.loading||e.error!==null)return{};let t=e.pages;return{docExists:e=>t.has(e)}}function I(e,t,n,r){let i=D(e);if(i===null)return null;let{tool:a,args:o}=i;if(a===`delete`||a===null&&/\bdelete\b/i.test(t))return null;let s=typeof o.document==`object`&&o.document!==null?o.document:null,c=null;if(Array.isArray(o.documents))for(let e=o.documents.length-1;e>=0;e--){let t=o.documents[e];if(typeof t==`object`&&t){c=t;break}}let l=(s===null?null:E(s,`path`))??(c===null?null:E(c,`path`))??E(o,`to`)??E(o,`docName`);if(l!==null)return j(l.replace(/\.(md|mdx)$/,``));let u=E(o,`command`);if(u!==null){let e=P(u,n);return e!==null&&r.docExists!==void 0&&!r.docExists(e)?null:e}return null}function L(e,t,n={}){if(e.toolKind===`delete`)return null;let r=I(e.rawInput,e.title,t,n);if(r!==null)return r;if(t===null)return null;let i=e.toolKind!==`edit`&&e.toolKind!==`move`&&n.docExists!==void 0;for(let r=e.locations.length-1;r>=0;r--){let a=e.locations[r];if(a===void 0)continue;let o=M(a.path,t);if(o!==null)return i&&!n.docExists?.(o)?null:o}return null}var R={lastFollowed:null,yielded:!1,reArmed:!1};function z(e,t,n){if(e===null||n.lastFollowed===e)return{navigateTo:null,state:n};if(n.lastFollowed!==null&&t!==null&&t!==n.lastFollowed&&t!==e&&!n.reArmed)return{navigateTo:null,state:{...n,yielded:!0}};if(n.yielded&&!n.reArmed)return{navigateTo:null,state:n};let r={lastFollowed:e,yielded:!1,reArmed:!1};return t===e?{navigateTo:null,state:r}:{navigateTo:e,state:r}}function B(e,t,n={}){let r=null;for(let i of e){if(i.kind!==`tool_call`)continue;let e=L(i,t,n);e!==null&&(r=e)}return r}export{F as a,E as c,C as d,y as f,f as h,k as i,D as l,_ as m,z as n,j as o,g as p,B as r,A as s,R as t,w as u};
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{Wn as n}from"./DocumentContext-CIVf31K9.js";import{t as r}from"./react-f2sANaYj.js";import{r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./utils-CPqDy6Hr.js";import{r as s,t as c}from"./button-RQ5o7P7w.js";import{t as l}from"./separator-k0mwGcaM.js";import{t as u}from"./createLucideIcon-BbftclCc.js";import{t as d}from"./x-COTyTduF.js";var f=u(`share-2`,[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]]),p=a(),m=t(),h=s(`group/button-group flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-lg [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1`,{variants:{orientation:{horizontal:`[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-lg!`,vertical:`flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-lg!`}},defaultVariants:{orientation:`horizontal`}});function g(e){let t=(0,p.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,orientation:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]!==n||t[5]!==r?(a=o(h({orientation:r}),n),t[4]=n,t[5]=r,t[6]=a):a=t[6];let s;return t[7]!==r||t[8]!==i||t[9]!==a?(s=(0,m.jsx)(`div`,{role:`group`,"data-slot":`button-group`,"data-orientation":r,className:a,...i}),t[7]=r,t[8]=i,t[9]=a,t[10]=s):s=t[10],s}function _(e){let t=(0,p.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,orientation:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`vertical`:i,s;t[4]===n?s=t[5]:(s=o(`relative self-stretch bg-input data-horizontal:mx-px data-horizontal:w-auto data-vertical:my-px data-vertical:h-auto`,n),t[4]=n,t[5]=s);let c;return t[6]!==a||t[7]!==r||t[8]!==s?(c=(0,m.jsx)(l,{"data-slot":`button-group-separator`,orientation:a,className:s,...r}),t[6]=a,t[7]=r,t[8]=s,t[9]=c):c=t[9],c}var v=`button, a[href], [role="menuitem"], [role="button"], input, textarea, select, [contenteditable="true"]`;function y(e,t){e.target instanceof HTMLElement&&(!(e.currentTarget instanceof HTMLElement)||!e.currentTarget.contains(e.target)||e.target.closest(v)||(e.preventDefault(),t.current?.focus()))}var b=e(r(),1);function x(e){let t=e.lastIndexOf(`/`);return t>=0?e.slice(t+1):e}function S(e){let t=(0,p.c)(21),{path:r,onRemove:a}=e,{_:o}=i(),s,l;t[0]!==o||t[1]!==r?(s=x(r),l=o({id:`hnq8fP`,values:{label:s}}),t[0]=o,t[1]=r,t[2]=s,t[3]=l):(s=t[2],l=t[3]);let u=l,f=`composer-context-chip-file-${r}`,h;t[4]===a?h=t[5]:(h=e=>{(e.key===`Backspace`||e.key===`Delete`)&&(e.preventDefault(),a())},t[4]=a,t[5]=h);let g;t[6]===r?g=t[7]:(g=(0,m.jsx)(`span`,{className:`absolute top-1/2 left-1/2 inline-flex size-3 -translate-x-1/2 -translate-y-1/2 opacity-100 transition-opacity duration-150 ease-out group-hover/chip:opacity-0 group-focus-within/chip:opacity-0 motion-reduce:transition-none`,children:(0,m.jsx)(n,{path:r,className:`size-3`,showExtensionBadge:!1})}),t[6]=r,t[7]=g);let _;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,m.jsx)(d,{className:`absolute top-1/2 left-1/2 size-3 -translate-x-1/2 -translate-y-1/2 opacity-0 transition-opacity duration-150 ease-out group-hover/chip:opacity-100 group-focus-within/chip:opacity-100 motion-reduce:transition-none`,"aria-hidden":!0}),t[8]=_):_=t[8];let v;t[9]!==a||t[10]!==u||t[11]!==h||t[12]!==g?(v=(0,m.jsxs)(c,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":u,onClick:a,onKeyDown:h,className:`group/remove relative size-3.5 shrink-0 rounded-sm text-muted-foreground/80 hover:text-foreground`,children:[g,_]}),t[9]=a,t[10]=u,t[11]=h,t[12]=g,t[13]=v):v=t[13];let y;t[14]===s?y=t[15]:(y=(0,m.jsx)(`span`,{className:`min-w-0 truncate`,children:s}),t[14]=s,t[15]=y);let b;return t[16]!==r||t[17]!==f||t[18]!==v||t[19]!==y?(b=(0,m.jsxs)(`span`,{"data-testid":f,title:r,className:`group/chip inline-flex max-w-[14rem] items-center gap-1 rounded-md border bg-muted/40 py-0.5 pr-1.5 pl-1 text-muted-foreground text-xs`,children:[v,y]}),t[16]=r,t[17]=f,t[18]=v,t[19]=y,t[20]=b):b=t[20],b}function C(e){let t=(0,p.c)(13),{files:n,onRemoveFile:r,className:i,children:a}=e,s;t[0]===n?s=t[1]:(s=n===void 0?[]:n,t[0]=n,t[1]=s);let c=s;if(c.length===0&&b.Children.toArray(a).length===0)return null;let l;t[2]===i?l=t[3]:(l=o(`flex flex-wrap items-center gap-1`,i),t[2]=i,t[3]=l);let u;if(t[4]!==c||t[5]!==r){let e;t[7]===r?e=t[8]:(e=e=>(0,m.jsx)(S,{path:e,onRemove:()=>r?.(e)},e),t[7]=r,t[8]=e),u=c.map(e),t[4]=c,t[5]=r,t[6]=u}else u=t[6];let d;return t[9]!==a||t[10]!==l||t[11]!==u?(d=(0,m.jsxs)(`div`,{className:l,"data-testid":`composer-context-chips`,children:[u,a]}),t[9]=a,t[10]=l,t[11]=u,t[12]=d):d=t[12],d}function w(){let e=(0,p.c)(2),[t,n]=(0,b.useState)(T),r,i;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{let e=window.matchMedia(`(prefers-reduced-motion: reduce)`);n(e.matches);let t=e=>n(e.matches);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,b.useEffect)(r,i),t}function T(){return typeof window<`u`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function E(e,t){let n=e[t];return typeof n==`string`&&n!==``?n:null}function D(e){if(typeof e!=`object`||!e)return null;let t=e,n=E(t,`tool`)??E(t,`name`),r=t;if(typeof t.arguments==`object`&&t.arguments!==null)r=t.arguments;else if(typeof t.arguments==`string`)try{let e=JSON.parse(t.arguments);typeof e==`object`&&e&&(r=e)}catch{}return{tool:n,args:r}}var O=`ok-acp-follow-file-v1`;function k(){try{return localStorage.getItem(O)!==`0`}catch{return!0}}function A(e){try{localStorage.setItem(O,e?`1`:`0`)}catch{}}function j(e){return e===``||e.startsWith(`/`)||e.startsWith(`\\`)||e.split(`/`).some(e=>e===``||e.startsWith(`.`))?null:e}function M(e,t){let n=t.pathSeparator,r=e=>n===`\\`?e.replaceAll(`\\`,`/`):e,i=r(t.contentDir).replace(/\/$/,``),a=r(e);if(!a.startsWith(`${i}/`))return null;let o=a.slice(i.length+1),s=/\.(md|mdx)$/.exec(o);return s===null?null:j(o.slice(0,-s[0].length))}var N=new Set([`cat`,`ls`,`grep`,`rg`,`find`,`head`,`tail`,`wc`,`sort`,`uniq`,`cut`,`sed`,`awk`,`bat`,`less`,`more`]);function P(e,t){let n=[],r=/"([^"]*)"|'([^']*)'|(\S+)/g,i=r.exec(e);for(;i!==null;)n.push(i[1]??i[2]??i[3]??``),i=r.exec(e);let a=n[0];if(a===void 0||!N.has(a))return null;for(let e of n.slice(1)){if(e.startsWith(`-`)||/[*?[\]]/.test(e))continue;let n=/\.(md|mdx)$/i.exec(e);if(n===null)continue;if(e.startsWith(`/`)||/^[A-Za-z]:[\\/]/.test(e)){if(t!==null){let n=M(e,t);if(n!==null)return n}continue}let r=j(e.replace(/^\.\//,``).slice(0,-n[0].length));if(r!==null)return r}return null}function F(e){if(e===null||e.loading||e.error!==null)return{};let t=e.pages;return{docExists:e=>t.has(e)}}function I(e,t,n,r){let i=D(e);if(i===null)return null;let{tool:a,args:o}=i;if(a===`delete`||a===null&&/\bdelete\b/i.test(t))return null;let s=typeof o.document==`object`&&o.document!==null?o.document:null,c=null;if(Array.isArray(o.documents))for(let e=o.documents.length-1;e>=0;e--){let t=o.documents[e];if(typeof t==`object`&&t){c=t;break}}let l=(s===null?null:E(s,`path`))??(c===null?null:E(c,`path`))??E(o,`to`)??E(o,`docName`);if(l!==null)return j(l.replace(/\.(md|mdx)$/,``));let u=E(o,`command`);if(u!==null){let e=P(u,n);return e!==null&&r.docExists!==void 0&&!r.docExists(e)?null:e}return null}function L(e,t,n={}){if(e.toolKind===`delete`)return null;let r=I(e.rawInput,e.title,t,n);if(r!==null)return r;if(t===null)return null;let i=e.toolKind!==`edit`&&e.toolKind!==`move`&&n.docExists!==void 0;for(let r=e.locations.length-1;r>=0;r--){let a=e.locations[r];if(a===void 0)continue;let o=M(a.path,t);if(o!==null)return i&&!n.docExists?.(o)?null:o}return null}var R={lastFollowed:null,yielded:!1,reArmed:!1};function z(e,t,n){if(e===null||n.lastFollowed===e)return{navigateTo:null,state:n};if(n.lastFollowed!==null&&t!==null&&t!==n.lastFollowed&&t!==e&&!n.reArmed)return{navigateTo:null,state:{...n,yielded:!0}};if(n.yielded&&!n.reArmed)return{navigateTo:null,state:n};let r={lastFollowed:e,yielded:!1,reArmed:!1};return t===e?{navigateTo:null,state:r}:{navigateTo:e,state:r}}function B(e,t,n={}){let r=null;for(let i of e){if(i.kind!==`tool_call`)continue;let e=L(i,t,n);e!==null&&(r=e)}return r}export{F as a,E as c,C as d,y as f,f as h,k as i,D as l,_ as m,z as n,j as o,g as p,B as r,A as s,R as t,w as u};