@inkeep/open-knowledge 0.79.3-beta.0 → 0.79.3-beta.1

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 (40) hide show
  1. package/dist/cli.mjs +6 -6
  2. package/dist/constants-CMlttrfV.mjs +1 -0
  3. package/dist/index.mjs +1 -1
  4. package/dist/{init-H4L4PCDm.mjs → init-CU5RL6f6.mjs} +2 -2
  5. package/dist/init-Cifsemq8.mjs +1 -0
  6. package/dist/{launch-json-removal-DAf1fKWA.mjs → launch-json-removal-MAOA6UoT.mjs} +1 -1
  7. package/dist/{loader-gbJWrT9X.mjs → loader-_iulGod2.mjs} +1 -1
  8. package/dist/loader-y0nJuvh8.mjs +1 -0
  9. package/dist/{preview-CMgnC4UA.mjs → preview-BFGjEB-3.mjs} +1 -1
  10. package/dist/preview-x0kqNHT0.mjs +1 -0
  11. package/dist/public/assets/FeedbackForm-BWVDETqI.js +1 -0
  12. package/dist/public/assets/{ImageAttachments-CIgN2ICo.js → ImageAttachments-CbvAD6gO.js} +1 -1
  13. package/dist/public/assets/{ReportBugDialogBody-C-53A-0F.js → ReportBugDialogBody-Dgdx0abm.js} +1 -1
  14. package/dist/public/assets/{ReportBugMenuTrigger-29birQ-y.js → ReportBugMenuTrigger-L6UKLhv7.js} +1 -1
  15. package/dist/public/assets/{SessionsHost-CKvXoA48.js → SessionsHost-DLUt2F6p.js} +2 -2
  16. package/dist/public/assets/{TerminalWindowApp-BXIexfq8.js → TerminalWindowApp-BMEXM7e6.js} +1 -1
  17. package/dist/public/assets/{ThreadView-D1YayNv3.js → ThreadView-DcCcrnS8.js} +17 -17
  18. package/dist/public/assets/image-attachment-IlVZ-iwe.js +1 -0
  19. package/dist/public/assets/index-0UAk3qu0.js +2205 -0
  20. package/dist/public/assets/{progress-C8ijsHox.js → progress-CTr23hqQ.js} +1 -1
  21. package/dist/public/assets/{use-installed-clis-F-bc0S3Y.js → use-installed-clis-D8GK8YwQ.js} +2 -2
  22. package/dist/public/index.html +6 -6
  23. package/dist/{registry-probes-DCe3rWZ7.mjs → registry-probes-DIjo4lc4.mjs} +1 -1
  24. package/dist/{removal-file-path-DiyOqKix.mjs → removal-file-path-DpLraZks.mjs} +1 -1
  25. package/dist/{repair-launch-json-CK7gSieg.mjs → repair-launch-json-D8diDIHc.mjs} +1 -1
  26. package/dist/{repair-mcp-configs-B2IwckuL.mjs → repair-mcp-configs-pQlO34hz.mjs} +1 -1
  27. package/dist/{src-7sNhM-_B.mjs → src-jzrJerbj.mjs} +1 -1
  28. package/dist/src-w38zUUim.mjs +1 -0
  29. package/dist/start-BsY2TxeT.mjs +1 -0
  30. package/dist/{start-DYrDwaUD.mjs → start-D93NCq63.mjs} +2 -2
  31. package/package.json +5 -5
  32. package/dist/constants-wVFbQ-W8.mjs +0 -1
  33. package/dist/init-CqGfdMuB.mjs +0 -1
  34. package/dist/loader-BK3wGq2e.mjs +0 -1
  35. package/dist/preview-DPQ4BPLK.mjs +0 -1
  36. package/dist/public/assets/FeedbackForm-t3IG2SJR.js +0 -1
  37. package/dist/public/assets/image-attachment-C1B_QOlM.js +0 -1
  38. package/dist/public/assets/index-CWenCiFy.js +0 -2205
  39. package/dist/src-DZ44CKon.mjs +0 -1
  40. package/dist/start-DaOK3zKh.mjs +0 -1
@@ -0,0 +1 @@
1
+ import{t as e}from"./dist-Cr4-nBVI.js";import{t}from"./tool-list-format-C9KSFYHU.js";import{r as n}from"./acp-thread-protocol-BiCah0pm.js";var r=new Set([`image/png`,`image/jpeg`,`image/gif`,`image/webp`]),i=700*1024,a=i,o=i,s=i,c=3;function l(e){return e.kind!==`image`&&e.kind!==`blob`?0:e.sizeBytes??e.data.length}function u(e){return e.reduce((e,t)=>e+l(t),0)}function d(){return Math.round(s/1024)}var f={"unsupported-type":!1,"too-large":!1,"file-too-large":!0,"not-text":!0};function p(e){return f[e.kind]}function m(e){throw Error(`Unhandled attachment error: ${JSON.stringify(e)}`)}function h(t){switch(t.kind){case`unsupported-type`:{let n=t.mimeType;if(n.startsWith(`image/`))return e._({id:`FqMKq2`,values:{mimeType:n}});let r=n||`unknown`;return e._({id:`9gu0n7`,values:{fileType:r}})}case`too-large`:{let n=Math.round(t.limitBytes/1024),r=Math.round(t.sizeBytes/1024);return e._({id:`Kb08WL`,values:{sizeKb:r,limitKb:n}})}case`file-too-large`:case`not-text`:return _(t,[t.name]);default:return m(t)}}function g(n){let r=e.locale;if(n.length<=c)return t(n,r);let i=n.slice(0,c-1),a=n.length-i.length;return t([...i,e._({id:`uqs8Gd`,values:{others:a}})],r)}function _(t,n){let r=n.length,i=g(n);if(t.kind===`not-text`)return t.location===`outside-project`?e._({id:`f0wEYt`,values:{count:r,files:i}}):e._({id:`bsg04M`,values:{count:r,files:i}});let a=Math.round(t.limitBytes/1024);return t.location===`outside-project`?e._({id:`RVMlXa`,values:{count:r,files:i,capKb:a}}):e._({id:`NYbytK`,values:{count:r,files:i,capKb:a}})}function v(e){let t=new Map;for(let n of e){let e=`${n.kind}:${n.location}`,r=t.get(e);r===void 0?t.set(e,{first:n,names:[n.name]}):r.names.push(n.name)}return[...t.values()].map(({first:e,names:t})=>_(e,t))}async function y(e){let t=await new Promise((t,n)=>{let r=new FileReader;r.onerror=()=>n(r.error??Error(`FileReader failed`)),r.onload=()=>{let e=r.result;if(typeof e!=`string`){n(Error(`FileReader returned non-string result`));return}t(e)},r.readAsDataURL(e)}),n=t.indexOf(`,`);return n>=0?t.slice(n+1):t}var b=2048,x=512,S=6,C=.85;async function w(e,t,n){let r=Math.max(e.width,e.height),i=Math.min(x,r),a=Math.min(1,b/r);for(let r=0;r<S;r+=1){let r=Math.max(1,Math.round(e.width*a)),o=Math.max(1,Math.round(e.height*a));if(Math.max(r,o)<i)return null;let s=await n(r,o);if(s.size<=t)return{blob:s,width:r,height:o};a*=Math.sqrt(t/s.size)*.9}return null}async function T(e,t,n){let r=new OffscreenCanvas(t,n),i=r.getContext(`2d`);if(i===null)throw Error(`OffscreenCanvas has no 2d context`);i.imageSmoothingQuality=`high`,i.drawImage(e,0,0,t,n);let a=await r.convertToBlob({type:`image/webp`,quality:C});return a.type===`image/webp`?a:(i.globalCompositeOperation=`destination-over`,i.fillStyle=`#ffffff`,i.fillRect(0,0,t,n),r.convertToBlob({type:`image/jpeg`,quality:C}))}async function E(e,t){for(let n of t){let t=await w(e,n,(t,n)=>T(e,t,n));if(t!==null)return t}return null}var D=async(e,t)=>{if(typeof createImageBitmap!=`function`||typeof OffscreenCanvas!=`function`)return null;let n;try{return n=await createImageBitmap(e),await E(n,t)}catch(t){return console.warn(`[acp-attachment] could not resize an image`,{sizeBytes:e.size,mimeType:e.type||``},t),null}finally{n?.close()}};async function O(e,t={}){let n=e.type||``;if(!r.has(n))return{ok:!1,error:{kind:`unsupported-type`,mimeType:n}};let i=e.name||`image`,o=Math.max(0,Math.min(a,t.budgetBytes??716800));if(e.size>o&&n!==`image/gif`){let n=o>0?[o]:[];e.size>716800&&o<716800&&n.push(a);let r=t.shrink??D,s=n.length>0?await r(e,n):null;if(s!==null)return console.info(`[acp-attachment] resized an image to fit`,{fromBytes:e.size,toBytes:s.blob.size,width:s.width,height:s.height,mimeType:s.blob.type}),{ok:!0,part:{kind:`image`,data:await y(s.blob),mimeType:s.blob.type,name:i,sizeBytes:s.blob.size}}}return e.size>716800?{ok:!1,error:{kind:`too-large`,sizeBytes:e.size,limitBytes:a}}:{ok:!0,part:{kind:`image`,data:await y(e),mimeType:n,name:i,sizeBytes:e.size}}}function k(e){return{size:l(e),type:e.kind===`image`||e.kind===`blob`?e.mimeType:``}}function A(e,t,n){console.warn(`[acp-attachment] refused`,{surface:e,reason:n.kind,sizeBytes:t.size,mimeType:t.type||``,...`limitBytes`in n?{limitBytes:n.limitBytes}:{}})}function j(e){return N(e,e=>e.type.startsWith(`image/`))}function M(e){return N(e,e=>e.size>0)}function N(e,t){if(e===null)return[];let n=[],r=e=>{e!==null&&t(e)&&n.push(e)},i=!1,a=e.items;if(a)for(let e=0;e<a.length;e+=1){let t=a[e];if(t?.kind!==`file`)continue;let n=t.getAsFile();n!==null&&(i=!0,r(n))}if(!i){let t=e.files;if(t)for(let e=0;e<t.length;e+=1)r(t[e]??null)}return n}function P(e,t,n){let r=n===`\\`?e.toLowerCase():e,i=n===`\\`?t.toLowerCase():t,a=i.endsWith(n)?i:`${i}${n}`;if(r===i)return``;if(!r.startsWith(a))return null;let o=e.slice(a.length);return n===`\\`?o.replaceAll(`\\`,`/`):o}function F(e,t){let n=t.absPathOf,r=t.workspaceContentDir;if(n===void 0||r===void 0||r===``)return`unknown`;let i=n(e);if(i===null||i===``)return`unknown`;let a=P(i,r,t.pathSeparator??`/`);return a===null?`outside-project`:{path:a}}function I(e){if(e.includes(0))return null;try{return new TextDecoder(`utf-8`,{fatal:!0}).decode(e)}catch{return null}}async function L(e,t){let r=e.name||`attachment`;if(e.size>716800)return{ok:!1,error:{kind:`file-too-large`,name:r,location:t,limitBytes:o}};let i=e.type||``,a=I(new Uint8Array(await e.arrayBuffer()));return a===null?{ok:!1,error:{kind:`not-text`,name:r,location:t}}:{ok:!0,part:{kind:`blob`,data:a,textPayload:!0,mimeType:n(i)?i:`text/plain`,name:r,sizeBytes:e.size}}}async function R(e,t={}){if((e.type||``).startsWith(`image/`))return O(e,{budgetBytes:t.imageBudgetBytes});let n=F(e,t);return typeof n==`string`?L(e,n):{ok:!0,part:{kind:`file`,path:n.path,name:e.name||`attachment`}}}export{v as a,R as c,k as d,u as f,j as i,p as l,d as n,h as o,M as r,l as s,s as t,A as u};