heyio 0.30.0 → 0.30.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "heyio",
3
- "version": "0.30.0",
3
+ "version": "0.30.1",
4
4
  "description": "IO — a personal AI assistant built on the GitHub Copilot SDK",
5
5
  "bin": {
6
6
  "io": "dist/index.js"
@@ -78,8 +78,8 @@ https://github.com/highlightjs/highlight.js/issues/2277`),X=U,D=R),$===void 0&&(
78
78
  `,3),s=e.indexOf(`
79
79
  ---`,3),n=t!==-1?t:s!==-1&&e.slice(s).trimEnd()==="---"?s:-1;if(n===-1)return{frontmatter:null,body:e};const r=e.slice(4,n),i=t!==-1?e.slice(t+5):"",a={};for(const o of r.split(`
80
80
  `)){const l=o.match(/^([^:]+):\s*(.*)$/);if(!l)continue;const c=l[1].trim();let u=l[2].trim();(u.startsWith('"')&&u.endsWith('"')||u.startsWith("'")&&u.endsWith("'"))&&(u=u.slice(1,-1)),a[c]=u}return{frontmatter:Object.keys(a).length>0?a:null,body:i}}function as(e){if(!e)return"";const t=e.split(`
81
- `),s=[];let n=!1,r=!1,i=!1,a=[],o="",l=[];function c(){r&&(s.push("</ul>"),r=!1)}function u(){i&&(s.push(Mv(l)),l=[],i=!1)}for(const d of t){if(d.startsWith("```")){if(c(),u(),!n)n=!0,o=d.slice(3).trim().split(/\s+/)[0].toLowerCase(),a=[];else{const w=a.join(`
82
- `);let k;try{k=o&&Ke.getLanguage(o)?Ke.highlight(w,{language:o,ignoreIllegals:!0}).value:Ke.highlightAuto(w).value}catch{k=w.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}const P=o.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),T=P?`<span class="text-[10px] text-txt-muted font-mono absolute top-2 right-3 select-none">${P}</span>`:"";s.push(`<div class="relative my-2"><pre class="bg-surface-1 border border-edge rounded-xl p-3 overflow-x-auto"><code class="hljs font-mono text-xs">${k}</code></pre>${T}</div>`),n=!1,o="",a=[]}continue}if(n){a.push(d);continue}if(fd(d)){c(),i=!0,l.push(d);continue}i&&u();const f=d.match(/^####\s+(.+)/),p=d.match(/^###\s+(.+)/),g=d.match(/^##\s+(.+)/),v=d.match(/^#\s+(.+)/);if(f){c(),s.push(`<h4 class="text-sm font-semibold text-gray-200 mt-4 mb-1">${Dt(f[1])}</h4>`);continue}if(p){c(),s.push(`<h3 class="text-base font-semibold text-gray-100 mt-5 mb-2">${Dt(p[1])}</h3>`);continue}if(g){c(),s.push(`<h2 class="text-lg font-bold text-gray-100 mt-6 mb-2 pb-1 border-b border-gray-800">${Dt(g[1])}</h2>`);continue}if(v){c(),s.push(`<h1 class="text-xl font-bold text-gray-100 mt-6 mb-3">${Dt(v[1])}</h1>`);continue}if(/^---+$/.test(d.trim())){c(),s.push('<hr class="border-gray-800 my-4" />');continue}const E=d.match(/^[-*+]\s+(.+)/);if(E){r||(s.push('<ul class="list-disc list-inside my-2 space-y-1 pl-2">'),r=!0),s.push(`<li>${Dt(E[1])}</li>`);continue}const x=d.match(/^\d+\.\s+(.+)/);if(x){r||(s.push('<ol class="list-decimal list-inside my-2 space-y-1 pl-2">'),r=!0),s.push(`<li>${Dt(x[1])}</li>`);continue}if(d.trim()===""){c(),s.push('<div class="my-2"></div>');continue}c(),s.push(`<p class="my-1">${Dt(d)}</p>`)}if(n&&a.length){const d=a.join(`
81
+ `),s=[];let n=!1,r=null,i=!1,a=[],o="",l=[];function c(){r&&(s.push(`</${r}>`),r=null)}function u(){i&&(s.push(Mv(l)),l=[],i=!1)}for(const d of t){if(d.startsWith("```")){if(c(),u(),!n)n=!0,o=d.slice(3).trim().split(/\s+/)[0].toLowerCase(),a=[];else{const w=a.join(`
82
+ `);let k;try{k=o&&Ke.getLanguage(o)?Ke.highlight(w,{language:o,ignoreIllegals:!0}).value:Ke.highlightAuto(w).value}catch{k=w.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}const P=o.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),T=P?`<span class="text-[10px] text-txt-muted font-mono absolute top-2 right-3 select-none">${P}</span>`:"";s.push(`<div class="relative my-2"><pre class="bg-surface-1 border border-edge rounded-xl p-3 overflow-x-auto"><code class="hljs font-mono text-xs">${k}</code></pre>${T}</div>`),n=!1,o="",a=[]}continue}if(n){a.push(d);continue}if(fd(d)){c(),i=!0,l.push(d);continue}i&&u();const f=d.match(/^####\s+(.+)/),p=d.match(/^###\s+(.+)/),g=d.match(/^##\s+(.+)/),v=d.match(/^#\s+(.+)/);if(f){c(),s.push(`<h4 class="text-sm font-semibold text-gray-200 mt-4 mb-1">${Dt(f[1])}</h4>`);continue}if(p){c(),s.push(`<h3 class="text-base font-semibold text-gray-100 mt-5 mb-2">${Dt(p[1])}</h3>`);continue}if(g){c(),s.push(`<h2 class="text-lg font-bold text-gray-100 mt-6 mb-2 pb-1 border-b border-gray-800">${Dt(g[1])}</h2>`);continue}if(v){c(),s.push(`<h1 class="text-xl font-bold text-gray-100 mt-6 mb-3">${Dt(v[1])}</h1>`);continue}if(/^---+$/.test(d.trim())){c(),s.push('<hr class="border-gray-800 my-4" />');continue}const E=d.match(/^[-*+]\s+(.+)/);if(E){r==="ol"&&c(),r||(s.push('<ul class="list-disc list-inside my-2 space-y-1 pl-2">'),r="ul"),s.push(`<li>${Dt(E[1])}</li>`);continue}const x=d.match(/^\d+\.\s+(.+)/);if(x){r==="ul"&&c(),r||(s.push('<ol class="list-decimal list-inside my-2 space-y-1 pl-2">'),r="ol"),s.push(`<li>${Dt(x[1])}</li>`);continue}if(d.trim()===""){c(),s.push('<div class="my-2"></div>');continue}c(),s.push(`<p class="my-1">${Dt(d)}</p>`)}if(n&&a.length){const d=a.join(`
83
83
  `).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");s.push(`<pre class="bg-gray-900 border border-gray-800 rounded p-3 my-2 overflow-x-auto"><code class="font-mono text-xs text-green-300">${d}</code></pre>`)}return u(),c(),s.join(`
84
84
  `)}const Dv={class:"fixed bottom-4 right-4 z-50 flex flex-col items-end"},Uv={key:0,class:"mb-3 w-[400px] h-[500px] max-w-[calc(100vw-2rem)] max-h-[calc(100vh-6rem)] flex flex-col rounded-2xl bg-surface-2 border border-edge shadow-card overflow-hidden"},Bv={class:"flex items-center justify-between px-4 py-2.5 border-b border-edge/50 bg-surface-3/50"},Hv={key:0,class:"flex flex-col items-center justify-center h-full select-none"},Fv={key:0,class:"max-w-[80%] px-3 py-2 rounded-xl rounded-br-sm text-xs whitespace-pre-wrap bg-accent/[0.12] text-txt-primary border border-accent/20"},Vv={key:1,class:"max-w-[85%] flex gap-2 items-start"},zv=["innerHTML"],qv={key:0,class:"flex justify-start"},Kv={class:"shrink-0 border-t border-edge/50 p-2.5 bg-surface-3/30"},Wv=["disabled"],Gv=["disabled"],Zv={key:0,class:"absolute top-0 right-0 w-3 h-3 rounded-full bg-accent border-2 border-surface-2 shadow-glow-sm"},Jv={key:1,class:"absolute inset-0 rounded-full border-2 border-accent/60 animate-ping pointer-events-none"},Yv={key:2,class:"absolute inset-0 rounded-full border border-accent/30 animate-pulse pointer-events-none"},Xv='<span class="stream-cursor"></span>',Qv=nt({__name:"FloatingChat",setup(e){const t=ju(),s=K(!1),n=K(""),r=K(null),i=K(null),a=K(!1),o=Ne(()=>t.messages.some(g=>g.streaming));function l(){s.value=!0,a.value=!1,qt(()=>c())}function c(){qt(()=>{r.value&&r.value.scrollTo({top:r.value.scrollHeight,behavior:"instant"})})}vt(()=>t.messages.length,()=>{s.value?c():t.messages.length>0&&(a.value=!0)}),vt(()=>{var g;return(g=t.messages[t.messages.length-1])==null?void 0:g.content},()=>{s.value&&c()});function u(g){g.key==="Enter"&&!g.shiftKey&&(g.preventDefault(),p())}function d(){const g=i.value;g&&(g.style.height="auto",g.style.height=Math.min(g.scrollHeight,100)+"px")}async function f(){try{await Te("/api/orchestrator/abort",{method:"POST"})}catch{}}async function p(){const g=n.value.trim();if(!g||t.isLoading)return;n.value="",qt(()=>{i.value&&(i.value.style.height="auto")}),t.isLoading=!0,t.addMessage({id:crypto.randomUUID(),role:"user",content:g}),t.addMessage({id:crypto.randomUUID(),role:"assistant",content:"",streaming:!0}),c();const v=new EventSource(await nr("/api/events"));v.onmessage=E=>{try{const x=JSON.parse(E.data);x.type==="delta"?t.appendToLast(x.text):x.type==="done"&&(t.setLastStreaming(!1),t.isLoading=!1,v.close())}catch{}},v.onerror=()=>{t.setLastStreaming(!1),t.isLoading=!1,v.close()};try{await Te("/api/message",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:g})})}catch{t.appendToLast(`
85
85
 
@@ -8,7 +8,7 @@
8
8
  <link rel="preconnect" href="https://fonts.googleapis.com" />
9
9
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
10
10
  <link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Outfit:wght@300;400;500;600;700&display=swap" rel="stylesheet" />
11
- <script type="module" crossorigin src="/assets/index-D3uXBVcQ.js"></script>
11
+ <script type="module" crossorigin src="/assets/index-BvKvht8h.js"></script>
12
12
  <link rel="stylesheet" crossorigin href="/assets/index-DmthMbtN.css">
13
13
  </head>
14
14
  <body>