khoj 1.22.2.dev9__py3-none-any.whl → 1.22.2.dev10__py3-none-any.whl

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 (35) hide show
  1. khoj/interface/compiled/404/index.html +1 -1
  2. khoj/interface/compiled/_next/static/chunks/121-7024f479c297aef0.js +1 -0
  3. khoj/interface/compiled/_next/static/chunks/1906-1747a36c336df02c.js +3 -0
  4. khoj/interface/compiled/_next/static/chunks/8423-14fc72aec9104ce9.js +1 -0
  5. khoj/interface/compiled/_next/static/chunks/app/chat/{page-f8bc420192b8a6f4.js → page-132e5199f954559f.js} +1 -1
  6. khoj/interface/compiled/_next/static/chunks/app/factchecker/{page-faaf60c2a32dd9e2.js → page-04a19ab1a988976f.js} +1 -1
  7. khoj/interface/compiled/_next/static/chunks/app/{page-a03a9fb2dc6d6e47.js → page-8465c90401833c39.js} +1 -1
  8. khoj/interface/compiled/_next/static/chunks/app/share/chat/{page-6d1313e0d33b0451.js → page-e20f54450d3ce6c0.js} +1 -1
  9. khoj/interface/compiled/_next/static/chunks/{webpack-dff708c71e9234cb.js → webpack-0a276a1d5ba42cb8.js} +1 -1
  10. khoj/interface/compiled/_next/static/css/{149c5104fe3d38b8.css → 9eec70b61e3de1ba.css} +1 -1
  11. khoj/interface/compiled/agents/index.html +1 -1
  12. khoj/interface/compiled/agents/index.txt +1 -1
  13. khoj/interface/compiled/automations/index.html +1 -1
  14. khoj/interface/compiled/automations/index.txt +1 -1
  15. khoj/interface/compiled/chat/index.html +1 -1
  16. khoj/interface/compiled/chat/index.txt +2 -2
  17. khoj/interface/compiled/factchecker/index.html +1 -1
  18. khoj/interface/compiled/factchecker/index.txt +2 -2
  19. khoj/interface/compiled/index.html +1 -1
  20. khoj/interface/compiled/index.txt +2 -2
  21. khoj/interface/compiled/search/index.html +1 -1
  22. khoj/interface/compiled/search/index.txt +1 -1
  23. khoj/interface/compiled/settings/index.html +1 -1
  24. khoj/interface/compiled/settings/index.txt +1 -1
  25. khoj/interface/compiled/share/chat/index.html +1 -1
  26. khoj/interface/compiled/share/chat/index.txt +2 -2
  27. {khoj-1.22.2.dev9.dist-info → khoj-1.22.2.dev10.dist-info}/METADATA +1 -1
  28. {khoj-1.22.2.dev9.dist-info → khoj-1.22.2.dev10.dist-info}/RECORD +33 -32
  29. khoj/interface/compiled/_next/static/chunks/2614-7cf01576d4457a75.js +0 -3
  30. khoj/interface/compiled/_next/static/chunks/8423-50162a9e62970350.js +0 -1
  31. /khoj/interface/compiled/_next/static/{3ha-3qUhlbm88tHUHwG1o → 8FOLk1SHpnB3zyOIonJkE}/_buildManifest.js +0 -0
  32. /khoj/interface/compiled/_next/static/{3ha-3qUhlbm88tHUHwG1o → 8FOLk1SHpnB3zyOIonJkE}/_ssgManifest.js +0 -0
  33. {khoj-1.22.2.dev9.dist-info → khoj-1.22.2.dev10.dist-info}/WHEEL +0 -0
  34. {khoj-1.22.2.dev9.dist-info → khoj-1.22.2.dev10.dist-info}/entry_points.txt +0 -0
  35. {khoj-1.22.2.dev9.dist-info → khoj-1.22.2.dev10.dist-info}/licenses/LICENSE +0 -0
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8423],{38423:function(e,t,n){"use strict";n.d(t,{Z:function(){return I}});var a=n(57437),s=n(37649),r=n.n(s),l=n(2265),o=n(9557),i=n(70571);n(7395);var c=n(77574),d=n(89475),u=n(55631),h=n(5198),f=n(2861),m=n(359),g=n(13493),x=n(88145),p=n(58259),j=n(26100),b=n(86819),v=n(35719),w=n(77689),y=n(86829),N=n(33009),k=n(42491),C=n(93146),D=n(50495),T=n(6780),S=n(19573),R=n(61485),O=n(66820),E=n(19666),z=n(58485),_=n(58575);function I(e){let[t,n]=(0,l.useState)(""),s=(0,l.useRef)(null),[I,L]=(0,l.useState)(null),[M,U]=(0,l.useState)(null),[A,Y]=(0,l.useState)(!1),[F,W]=(0,l.useState)(null),[H,K]=(0,l.useState)(!1),[$,J]=(0,l.useState)(!1),[P,Z]=(0,l.useState)(!1),[B,V]=(0,l.useState)(""),[X,q]=(0,l.useState)(null),[G,Q]=(0,l.useState)(null),[ee,et]=(0,l.useState)(0),[en,ea]=(0,l.useState)(!1);function es(){if(P&&(Z(!1),V(""),e.sendImage(X||"")),t.trim()){if(!e.isLoggedIn){W("Hey there, you need to be signed in to send messages to Khoj AI"),K(!0);return}e.sendMessage(t.trim()),n("")}}function er(t){if(!e.isLoggedIn){W("Whoa! You need to login to upload files"),K(!0);return}let n=["jpg","jpeg","png"];for(let e=0;e<t.length;e++){let a=t[e],s=a.name.split(".").pop();if(n.includes(s||"")){Z(!0),V(URL.createObjectURL(a));return}}(0,o.ko)(t,L,Y,U,e.setUploadedFiles,e.conversationId)}async function el(){try{let e=await navigator.mediaDevices.getUserMedia({audio:!0}),t=new MediaRecorder(e,{mimeType:"audio/webm"}),a=[];t.ondataavailable=async e=>{a.push(e.data);let t=new Blob(a,{type:"audio/webm"}),s=new FormData;s.append("file",t);try{let e=await fetch("/api/transcribe",{method:"POST",body:s});if(!e.ok)throw Error("Network response was not ok");let t=await e.json();n(t.text.trim())}catch(e){console.error("Error sending audio to server:",e)}},t.start(1500),t.onstop=async()=>{let e=new Blob(a,{type:"audio/webm"}),s=new FormData;s.append("file",e);try{let e=await fetch("/api/transcribe",{method:"POST",body:s});if(!e.ok)throw Error("Network response was not ok");let a=await e.json();t.stream.getTracks().forEach(e=>e.stop()),Q(null),n(a.text.trim())}catch(e){console.error("Error sending audio to server:",e)}},Q(t)}catch(e){console.error("Error getting microphone",e)}}(0,l.useEffect)(()=>{if(A||et(0),A){let e=setInterval(()=>{et(e=>{let t=e+(Math.floor(5*Math.random())+1);return t<100?t:100})},800);return()=>clearInterval(e)}},[A]),(0,l.useEffect)(()=>{async function e(){if(B){let e=await fetch(B),t=await e.blob(),n=new FileReader;n.onload=function(){q(n.result)},n.readAsDataURL(t)}Y(!1)}Y(!0),e()},[B]),(0,l.useEffect)(()=>{!$&&G&&G.stop(),$&&!G&&el()},[$,G]);let eo=(0,l.useRef)(null);return(0,l.useEffect)(()=>{eo.current&&(eo.current.style.height="auto",eo.current.style.height=Math.max(eo.current.scrollHeight-24,64)+"px")},[t]),(0,a.jsxs)(a.Fragment,{children:[H&&F&&(0,a.jsx)(O.Z,{onOpenChange:K,loginRedirectMessage:F}),A&&(0,a.jsx)(T.aR,{open:A,children:(0,a.jsxs)(T._T,{children:[(0,a.jsx)(T.fY,{children:(0,a.jsx)(T.f$,{children:"Uploading data. Please wait."})}),(0,a.jsx)(T.yT,{children:(0,a.jsx)(i.E,{indicatorColor:"bg-slate-500",className:"w-full h-2 rounded-full",value:ee})}),(0,a.jsx)(T.OL,{className:"bg-slate-400 hover:bg-slate-500",onClick:()=>Y(!1),children:"Dismiss"})]})}),I&&(0,a.jsx)(T.aR,{open:null!==I,children:(0,a.jsxs)(T._T,{children:[(0,a.jsx)(T.fY,{children:(0,a.jsx)(T.f$,{children:"Data Upload Warning"})}),(0,a.jsx)(T.yT,{children:I}),(0,a.jsx)(T.OL,{className:"bg-slate-400 hover:bg-slate-500",onClick:()=>L(null),children:"Close"})]})}),M&&(0,a.jsx)(T.aR,{open:null!==M,children:(0,a.jsxs)(T._T,{children:[(0,a.jsxs)(T.fY,{children:[(0,a.jsx)(T.f$,{children:"Oh no!"}),(0,a.jsx)(T.yT,{children:"Something went wrong while uploading your data"})]}),(0,a.jsx)(T.yT,{children:M}),(0,a.jsx)(T.OL,{className:"bg-slate-400 hover:bg-slate-500",onClick:()=>U(null),children:"Close"})]})}),t.startsWith("/")&&1===t.split(" ").length&&(0,a.jsx)("div",{className:"flex justify-center text-center",children:(0,a.jsxs)(S.J2,{open:t.startsWith("/"),children:[(0,a.jsx)(R.xo,{className:"flex justify-center text-center"}),(0,a.jsx)(S.yk,{onOpenAutoFocus:e=>e.preventDefault(),className:"".concat(e.isMobileWidth?"w-[100vw]":"w-full"," rounded-md"),children:(0,a.jsxs)(k.mY,{className:"max-w-full",children:[(0,a.jsx)(k.sZ,{placeholder:"Type a command or search...",value:t,className:"hidden"}),(0,a.jsxs)(k.e8,{children:[(0,a.jsx)(k.rb,{children:"No matching commands."}),(0,a.jsx)(k.fu,{heading:"Agent Tools",children:e.chatOptionsData&&Object.entries(e.chatOptionsData).map(e=>{let[t,s]=e;return(0,a.jsx)(k.di,{className:"text-md",onSelect:()=>{n("/".concat(t," "))},children:(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1",children:[(0,a.jsxs)("div",{className:"font-bold flex items-center",children:[function(e){let t="h-4 w-4 mr-2";return e.includes("summarize")?(0,a.jsx)(c.U,{className:t}):e.includes("help")?(0,a.jsx)(d.H,{className:t}):e.includes("automation")?(0,a.jsx)(u.H,{className:t}):e.includes("webpage")?(0,a.jsx)(h.A,{className:t}):e.includes("notes")?(0,a.jsx)(f.a,{className:t}):e.includes("image")?(0,a.jsx)(m.E,{className:t}):e.includes("default")?(0,a.jsx)(g.j,{className:t}):e.includes("general")?(0,a.jsx)(x.K,{className:t}):e.includes("online")?(0,a.jsx)(p.u,{className:t}):(0,a.jsx)(j.o,{className:t})}(t),"/",t]}),(0,a.jsx)("div",{children:s})]})},t)})}),(0,a.jsx)(k.zz,{})]})]})})]})}),(0,a.jsxs)("div",{className:"".concat(r().actualInputArea," items-center justify-between dark:bg-neutral-700 relative"),onDragOver:function(e){e.preventDefault(),ea(!0)},onDragLeave:function(e){e.preventDefault(),ea(!1)},onDrop:function(e){e.preventDefault(),ea(!1),e.dataTransfer.files&&er(e.dataTransfer.files)},children:[P&&(0,a.jsxs)("div",{className:"absolute bottom-[80px] left-0 right-0 dark:bg-neutral-700 bg-white pt-5 pb-5 w-full rounded-lg border dark:border-none grid grid-cols-2",children:[(0,a.jsx)("div",{className:"pl-4 pr-4",children:(0,a.jsx)("img",{src:B,alt:"img",className:"w-auto max-h-[100px]"})}),(0,a.jsx)("div",{className:"pl-4 pr-4",children:(0,a.jsx)(b.X,{className:"w-6 h-6 float-right dark:hover:bg-[hsl(var(--background))] hover:bg-neutral-100 rounded-sm",onClick:function(){Z(!1),V("")}})})]}),(0,a.jsx)("input",{type:"file",multiple:!0,ref:s,onChange:function(e){e.target.files&&er(e.target.files)},style:{display:"none"}}),(0,a.jsx)(D.z,{variant:"ghost",className:"!bg-none p-0 m-2 h-auto text-3xl rounded-full text-gray-300 hover:text-gray-500",disabled:e.sendDisabled,onClick:function(){s.current&&s.current.click()},children:(0,a.jsx)(v.p,{className:"w-8 h-8"})}),(0,a.jsx)("div",{className:"grid w-full gap-1.5 relative",children:(0,a.jsx)(C.g,{ref:eo,className:"border-none w-full h-16 min-h-16 max-h-[128px] md:py-4 rounded-lg resize-none dark:bg-neutral-700 ".concat(e.isMobileWidth?"text-md":"text-lg"),placeholder:"Type / to see a list of commands",id:"message",autoFocus:!0,value:t,onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(Z(!1),V(""),e.preventDefault(),es())},onChange:e=>n(e.target.value),disabled:e.sendDisabled||$})}),$?(0,a.jsx)(E.pn,{children:(0,a.jsxs)(E.u,{children:[(0,a.jsx)(E.aJ,{asChild:!0,children:(0,a.jsx)(D.z,{variant:"default",className:"".concat(!$&&"hidden"," ").concat(e.agentColor?(0,_.tp)(e.agentColor):"bg-orange-300 hover:bg-orange-500"," rounded-full p-1 m-2 h-auto text-3xl transition transform md:hover:-translate-y-1"),onClick:()=>{J(!$)},disabled:e.sendDisabled,children:(0,a.jsx)(w.d,{weight:"fill",className:"w-6 h-6"})})}),(0,a.jsx)(E._v,{children:"Click to stop recording and transcribe your voice."})]})}):G?(0,a.jsx)(z.l,{}):(0,a.jsx)(E.pn,{children:(0,a.jsxs)(E.u,{children:[(0,a.jsx)(E.aJ,{asChild:!0,children:(0,a.jsx)(D.z,{variant:"default",className:"".concat(!t||$||"hidden"," ").concat(e.agentColor?(0,_.tp)(e.agentColor):"bg-orange-300 hover:bg-orange-500"," rounded-full p-1 m-2 h-auto text-3xl transition transform md:hover:-translate-y-1"),onClick:()=>{n("Listening..."),J(!$)},disabled:e.sendDisabled,children:(0,a.jsx)(y.P,{weight:"fill",className:"w-6 h-6"})})}),(0,a.jsx)(E._v,{children:"Click to transcribe your message with voice."})]})}),(0,a.jsx)(D.z,{className:"".concat((!t||$)&&"hidden"," ").concat(e.agentColor?(0,_.tp)(e.agentColor):"bg-orange-300 hover:bg-orange-500"," rounded-full p-1 m-2 h-auto text-3xl transition transform md:hover:-translate-y-1"),onClick:es,disabled:e.sendDisabled,children:(0,a.jsx)(N.a,{className:"w-6 h-6",weight:"bold"})})]}),en&&(0,a.jsx)("div",{className:"text-muted-foreground",children:"Drop file to upload"})]})}},66820:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var a=n(57437),s=n(6780),r=n(87138);function l(e){return(0,a.jsx)(s.aR,{open:!0,onOpenChange:e.onOpenChange,children:(0,a.jsxs)(s._T,{children:[(0,a.jsx)(s.fY,{children:(0,a.jsx)(s.f$,{children:"Sign in to Khoj to continue"})}),(0,a.jsxs)(s.yT,{children:[e.loginRedirectMessage,". By logging in, you agree to our"," ",(0,a.jsx)(r.default,{href:"https://khoj.dev/terms-of-service",children:"Terms of Service."})]}),(0,a.jsxs)(s.xo,{children:[(0,a.jsx)(s.le,{children:"Dismiss"}),(0,a.jsx)(s.OL,{className:"bg-slate-400 hover:bg-slate-500",onClick:()=>{window.location.href="/login?next=".concat(encodeURIComponent(window.location.pathname))},children:(0,a.jsxs)(r.default,{href:"/login?next=".concat(encodeURIComponent(window.location.pathname)),children:[" ","Login"]})})]})]})})}},70571:function(e,t,n){"use strict";n.d(t,{E:function(){return o}});var a=n(57437),s=n(2265),r=n(52431),l=n(37440);let o=s.forwardRef((e,t)=>{let{className:n,value:s,indicatorColor:o,...i}=e;return(0,a.jsx)(r.fC,{ref:t,className:(0,l.cn)("relative h-4 w-full overflow-hidden rounded-full bg-secondary",n),...i,children:(0,a.jsx)(r.z$,{className:"h-full w-full flex-1 bg-primary transition-all ".concat(o),style:{transform:"translateX(-".concat(100-(s||0),"%)")}})})});o.displayName=r.fC.displayName},93146:function(e,t,n){"use strict";n.d(t,{g:function(){return l}});var a=n(57437),s=n(2265),r=n(37440);let l=s.forwardRef((e,t)=>{let{className:n,...s}=e;return(0,a.jsx)("textarea",{className:(0,r.cn)("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",n),ref:t,...s})});l.displayName="Textarea"},19666:function(e,t,n){"use strict";n.d(t,{_v:function(){return d},aJ:function(){return c},pn:function(){return o},u:function(){return i}});var a=n(57437),s=n(2265),r=n(27071),l=n(37440);let o=r.zt,i=r.fC,c=r.xz,d=s.forwardRef((e,t)=>{let{className:n,sideOffset:s=4,...o}=e;return(0,a.jsx)(r.VY,{ref:t,sideOffset:s,className:(0,l.cn)("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n),...o})});d.displayName=r.VY.displayName},37649:function(e){e.exports={actualInputArea:"chatInputArea_actualInputArea__Ha6cN"}}}]);