profoundjs 7.12.0 → 7.13.0

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.
@@ -1,4 +1,3 @@
1
-
2
1
  /*
3
2
 
4
3
  This file is not updated by the BUILD program.
@@ -20,8 +20,8 @@ false},250)})});c.querySelectorAll("span.pai-citation").forEach(function(f){func
20
20
  j.addEventListener("mouseleave",function(){l()})}});f.addEventListener("mouseleave",function(){h=setTimeout(l,100)})});if(a.replace)(a=k.lastChild)&&a.classList.contains("pai-agent-response")&&a.parentNode.removeChild(a)}else c.innerText=d;k.appendChild(c);k.scrollTop=k.scrollHeight};this.clear=function(){o.classList.contains("pai-recording")&&q.stop();i.value="";k.innerHTML="";b.greeting&&b.add({message:b.greeting,type:"greeting"});b.setHeading(b.heading);b.setBrandColor(B);v();I=x=null};this.setTheme=
21
21
  function(a){G=a;G=typeof G!=="string"?"light":G.toLowerCase();G==="dark"?b.dom.classList.add("pai-dark"):b.dom.classList.remove("pai-dark")};this.setBrandColor=function(a){B=a;if(a=b.dom.querySelector(".pai-heading")){a.style.backgroundColor=null;a.style.backgroundImage=null;a.classList.remove("pai-branded")}t&&t.classList.remove("pai-branded");s.style.backgroundColor=null;if(B){var d=S(B,-30);if(a){a.style.backgroundColor=B;a.style.backgroundImage="linear-gradient(to right, "+B+", "+d+")";a.classList.add("pai-branded")}t&&
22
22
  a&&t.classList.add("pai-branded");s.style.backgroundColor=B}};this.setHeading=function(a){var d=b.dom.querySelector(".pai-heading");if(a){if(d===null){d=document.createElement("div");d.classList.add("pai-heading");b.dom.prepend(d);E()}d.innerText=a}else if(d!==null){d.remove();E()}};this.send=function(){if(i.value!=="")if(!b.isLoading()){if(o.classList.contains("pai-recording")){q.stop();o.classList.toggle("pai-recording")}b.onSend&&b.onSend(i.value);b.add({message:i.value});H=[];var a={};a.message=
23
- i.value;if(x)a.threadId=x;var d="/profound-ai/chat";if(g()){a.agentData=p();a.agentFile=Ext.c("centerPanel").e().title.replace(/\*/g,"").trim();w=pui.streamingModelList.includes(a.agentData.aiAgent.model);d="/ide/profound-ai/chat"}else a.agent=b.agent;var c=b.data;if(typeof c==="function")c=c();if(b.data)a.data=c;i.value="";E();i.focus();b.showLoader();c={"Content-Type":"application/json"};if(w){c.Connection="keep-alive";c["Response-Type"]="stream"}if(pui.appJob.authToken)c.Authorization="Bearer "+
24
- pui.appJob.authToken;else if(L){var e=L;if(typeof e==="function")e=e();c.Authorization="Bearer "+e}fetch(F+d,{method:"POST",headers:c,body:JSON.stringify(a)}).then(function(f){return w?f.body.getReader():f.json()}).then(function(f){w?n(f):C(f)})["catch"](function(f){b.hideLoader();b.add({message:"Error: "+f.message,type:"error"})})}};this.poll=function(){if(!(!x||!I||!K)){var a={};a.threadId=x;a.runId=I;a.modelKey=K;var d="/profound-ai/poll";if(g())d="/ide/profound-ai/poll";fetch(F+d,{method:"POST",
23
+ i.value;if(x)a.threadId=x;var d="/profound-ai/chat";if(g()){a.agentData=p();a.agentFile=Ext.c("centerPanel").e().title.replace(/\*/g,"").trim();w=pui.streamingModelList.includes(a.agentData.aiAgent.model);d="/ide/profound-ai/chat"}else a.agent=b.agent;var c=b.data;if(typeof c==="function")c=c();if(b.data)a.data=c;i.value="";E();i.focus();b.showLoader();c={"Content-Type":"application/json"};if(w){c.Connection="keep-alive";c["Response-Type"]="stream"}if(pui.appJob&&pui.appJob.authToken)c.Authorization=
24
+ "Bearer "+pui.appJob.authToken;else if(L){var e=L;if(typeof e==="function")e=e();c.Authorization="Bearer "+e}fetch(F+d,{method:"POST",headers:c,body:JSON.stringify(a)}).then(function(f){return w?f.body.getReader():f.json()}).then(function(f){w?n(f):C(f)})["catch"](function(f){b.hideLoader();b.add({message:"Error: "+f.message,type:"error"})})}};this.poll=function(){if(!(!x||!I||!K)){var a={};a.threadId=x;a.runId=I;a.modelKey=K;var d="/profound-ai/poll";if(g())d="/ide/profound-ai/poll";fetch(F+d,{method:"POST",
25
25
  headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}).then(function(c){return c.json()}).then(function(c){C(c)})["catch"](function(c){b.hideLoader();b.add({message:"Error: "+c.message,type:"error"})})}};this.showLoader=function(a){a||(a=P);J.innerText=a;if(!b.isLoading()){w?b.add({message:y,type:"agent-response"}):k.appendChild(A);v()}k.scrollTop=k.scrollHeight};this.hideLoader=function(){if(b.isLoading()){if(w)for(var a=k.querySelectorAll(".pai-inline-loader"),d=a.length-1;d>=0;d--)a[d].parentNode.removeChild(a[d]);
26
26
  else k.removeChild(A);v()}};this.isLoading=function(){if(w)return k.querySelectorAll(".pai-inline-loader").length>0;return A.parentNode===k};this.destroy=function(){if(b.dom){b.dom.parentNode.removeChild(b.dom);b.dom=null}};this.removeEmbedIcon=function(){profound.ai.removeEmbedIcon()}};profound.ai.d=function(g){if(!document.querySelector('link[href="'+g+'"]')){var p=document.createElement("link");p.rel="stylesheet";p.href=g;document.head.appendChild(p)}};
27
27
  profound.ai.b=function(g,p){if(document.querySelector('script[src="'+g+'"]'))typeof p==="function"&&p();else{var m=document.createElement("script");m.type="text/javascript";m.src=g;m.onload=function(){typeof p==="function"&&p()};document.head.appendChild(m)}};
@@ -1,4 +1,3 @@
1
-
2
1
  class RichDisplay extends React.Component {
3
2
  constructor(props) {
4
3
  super(props);
@@ -1,4 +1,3 @@
1
-
2
1
  Vue.component("rich-display", {
3
2
  props: ["path", "screen", "data", "className"],
4
3
  template: '<div style="position: relative;"></div>',