cli-jaw 1.7.32 → 1.7.33
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/dist/bin/cli-jaw.js +11 -0
- package/dist/bin/cli-jaw.js.map +1 -1
- package/dist/bin/star-prompt.js +96 -0
- package/dist/bin/star-prompt.js.map +1 -0
- package/dist/src/agent/args.js +0 -4
- package/dist/src/agent/args.js.map +1 -1
- package/dist/src/agent/events.js +328 -54
- package/dist/src/agent/events.js.map +1 -1
- package/dist/src/agent/spawn.js +9 -6
- package/dist/src/agent/spawn.js.map +1 -1
- package/dist/src/cli/command-context.js +1 -0
- package/dist/src/cli/command-context.js.map +1 -1
- package/dist/src/cli/commands.js +2 -1
- package/dist/src/cli/commands.js.map +1 -1
- package/dist/src/cli/handlers.js +20 -0
- package/dist/src/cli/handlers.js.map +1 -1
- package/dist/src/cli/registry.js +6 -19
- package/dist/src/cli/registry.js.map +1 -1
- package/dist/src/core/config.js +1 -0
- package/dist/src/core/config.js.map +1 -1
- package/package.json +1 -1
- package/public/css/tool-ui.css +20 -1
- package/public/dist/assets/constants-IeOVgtYz.js +1 -0
- package/public/dist/assets/{employees-CpgcoYx1.js → employees-Do9d6Xi5.js} +1 -1
- package/public/dist/assets/{index-DVAk6-ox.css → index-qALA03H1.css} +1 -1
- package/public/dist/assets/{index-DlhVtNGh.js → index-yGExjgR_.js} +4 -4
- package/public/dist/assets/{memory-jVeY3J9Z.js → memory-DeZSzBAb.js} +1 -1
- package/public/dist/assets/memory-Dpe-qPbZ.js +1 -0
- package/public/dist/assets/render-CQnnZ-_i.js +30 -0
- package/public/dist/assets/{settings-DN37FmEm.js → settings-C8bSXG3q.js} +1 -1
- package/public/dist/assets/settings-COrhSfDh.js +1 -0
- package/public/dist/assets/skills-BO0V4aHG.js +1 -0
- package/public/dist/assets/{skills-C-Hd0Khs.js → skills-Ci5t_dsV.js} +1 -1
- package/public/dist/assets/{slash-commands-DKD_PVHP.js → slash-commands-0RvnZU9z.js} +1 -1
- package/public/dist/assets/slash-commands-DbUvFtCk.js +1 -0
- package/public/dist/assets/ui-Cxk1_e0b.js +1 -0
- package/public/dist/assets/ui-IWxpAzJ7.js +131 -0
- package/public/dist/assets/vendor-icons-Bs4t7RP2.js +1 -0
- package/public/dist/assets/ws-FsYmCE65.js +14 -0
- package/public/dist/index.html +2 -2
- package/public/js/constants.ts +5 -18
- package/public/js/features/process-block.ts +10 -1
- package/public/js/features/settings-types.ts +1 -1
- package/public/js/features/tool-ui.ts +2 -0
- package/public/js/icons.ts +15 -0
- package/public/js/ui.ts +80 -18
- package/public/js/virtual-scroll.ts +38 -8
- package/public/js/ws.ts +7 -3
- package/public/dist/assets/constants-2eOyiA6N.js +0 -1
- package/public/dist/assets/memory-CnXTT6wp.js +0 -1
- package/public/dist/assets/render-CtsdCdtV.js +0 -30
- package/public/dist/assets/settings-DidDB9Rr.js +0 -1
- package/public/dist/assets/skills-BsXI_IT2.js +0 -1
- package/public/dist/assets/slash-commands-DTi0pAMr.js +0 -1
- package/public/dist/assets/ui-BUkXAGyS.js +0 -1
- package/public/dist/assets/ui-N2Up5Bik.js +0 -130
- package/public/dist/assets/vendor-icons-C6LXvgi0.js +0 -1
- package/public/dist/assets/ws-Dgn9Mqgb.js +0 -14
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import{A as e,C as t,D as n,E as r,F as i,I as a,M as o,N as s,O as c,P as l,S as u,T as d,_ as f,b as ee,j as p,k as m,u as te,v as ne,w as h,x as re,y as ie}from"./vendor-render-D2YP6GiF.js";import{r as ae}from"./api-DygAf_G_.js";import{Q as g,Z as _}from"./vendor-mermaid-UktBx7L0.js";import{A as oe,B as se,C as ce,D as le,E as ue,F as de,G as fe,H as pe,I as me,J as he,K as ge,L as _e,M as ve,N as ye,O as be,P as xe,Q as Se,R as Ce,S as we,T as Te,U as Ee,V as De,W as Oe,X as ke,Y as Ae,Z as je,_ as Me,a as Ne,b as Pe,c as Fe,d as Ie,f as Le,g as Re,h as ze,i as Be,j as Ve,k as He,l as Ue,m as We,n as Ge,o as Ke,p as qe,q as Je,r as Ye,s as Xe,t as Ze,u as Qe,v as $e,w as et,x as tt,y as nt,z as rt}from"./vendor-icons-Bs4t7RP2.js";var v=`ko`,y={},b={};async function it(){let e=null;try{e=localStorage.getItem(`claw_locale`)}catch{}if(!e){let t=(navigator.language||`ko`).split(/[-_]/)[0].toLowerCase();e=[`en`,`ko`].includes(t)?t:`ko`}b=await x(`ko`),y=e===`ko`?b:await x(e),v=e,C()}async function x(e){try{let{api:t}=await _(async()=>{let{api:e}=await import(`./api-COrKYKcO.js`);return{api:e}},[]);return await t(`/api/i18n/${e}`)||{}}catch{return{}}}function S(e,t={}){let n=y[e]??b[e]??e;for(let[e,r]of Object.entries(t))n=n.replaceAll(`{${e}}`,String(r));return n}function C(){document.querySelectorAll(`[data-i18n]`).forEach(e=>{let t=e.getAttribute(`data-i18n`);t&&(e.textContent=S(t))}),document.querySelectorAll(`[data-i18n-placeholder]`).forEach(e=>{let t=e.getAttribute(`data-i18n-placeholder`);t&&(e.placeholder=S(t))}),document.querySelectorAll(`[data-i18n-title]`).forEach(e=>{let t=e.getAttribute(`data-i18n-title`);t&&(e.title=S(t))}),document.querySelectorAll(`[data-i18n-aria]`).forEach(e=>{let t=e.getAttribute(`data-i18n-aria`);t&&e.setAttribute(`aria-label`,S(t))})}async function at(e){if(e!==v){y=e===`ko`?b:await x(e),v=e;try{localStorage.setItem(`claw_locale`,e)}catch{}C();try{let{loadEmployees:e}=await _(async()=>{let{loadEmployees:e}=await import(`./employees-Do9d6Xi5.js`);return{loadEmployees:e}},[]);e()}catch{}try{let{loadSkills:e}=await _(async()=>{let{loadSkills:e}=await import(`./skills-BO0V4aHG.js`);return{loadSkills:e}},[]);e()}catch{}try{let{loadCommands:e}=await _(async()=>{let{loadCommands:e}=await import(`./slash-commands-DbUvFtCk.js`);return{loadCommands:e}},[]);e()}catch{}try{let{loadSettings:e}=await _(async()=>{let{loadSettings:e}=await import(`./settings-COrhSfDh.js`);return{loadSettings:e}},[]);e()}catch{}}}function ot(){return v}function st(e,t={}){let n=new URL(e,location.origin);return n.searchParams.has(`locale`)||n.searchParams.set(`locale`,v),fetch(n.toString(),t)}var ct=`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M2 12c0 0 2-4 6-4 1 0 2 .5 3 1l3-6c0 0 1 5 3 7 1.5 1.5 5 2 5 2s-1 4-5 4c-1 0-2-.3-3-.8L12 18c0 0-2-1-4-1-4 0-6-5-6-5z"/><circle cx="17" cy="11" r="0.5" fill="currentColor" stroke="none"/><path d="M7 12l1 2"/><path d="M9.5 12l1 2"/></svg>`,w=14,lt=16;function T(e,t=lt){return Se(e,{size:t})}var E={check:T(De),error:T(rt),warning:T(Be),skip:T(Fe),tool:T(Ye),thinking:T(we),search:T(Ie),web:T(ve),exec:T(Ze),compacting:T(nt),plan:T(Pe),brain:T(Je),heartPulse:T(oe),lock:T(ce),lockOpen:T(et),key:T(le),settings:T(Ue),file:T(de),trash:T(Ne),lightbulb:T(ue),refresh:T(qe),mic:T(tt),clipboard:T(Ce),robot:T(he),palette:T($e),link:T(Te),salute:T(Ve),shark:ct,user:T(se),paperclip:T(Me),save:T(Le),gamepad:T(ye),house:T(be),radio:T(We),folder:T(xe),pencil:T(Re),chart:T(ge),hourglass:T(He),target:T(Ke),ban:T(Ae),play:T(ze),stop:T(Xe),close:T(Ge,w),send:T(Qe),copy:T(_e,w),download:T(me,w),checkSimple:T(fe,w),chevronLeft:T(Ee,w),chevronRight:T(pe,w),chevronDown:T(Oe,w),arrowLeft:T(je,w),arrowRight:T(ke,w)},ut={"✅":`check`,"❌":`error`,"🔧":`tool`,"⏭":`skip`,"🧠":`brain`,"💓":`heartPulse`,"🔒":`lock`,"🔓":`lockOpen`,"🔑":`key`,"⚙":`settings`,"⚙️":`settings`,"📄":`file`,"🗑":`trash`,"🗑️":`trash`,"⚠":`warning`,"⚠️":`warning`,"💡":`lightbulb`,"🦈":`shark`,"👤":`user`,"💭":`thinking`,"🔍":`search`,"🌐":`web`,"⚡":`exec`,"🗜":`compacting`,"🗜️":`compacting`,"📝":`plan`,"📑":`clipboard`,"🤖":`robot`,"📋":`clipboard`,"🔄":`refresh`,"🎨":`palette`,"🎤":`mic`,"🔗":`link`,"🫡":`salute`,"📎":`paperclip`,"💾":`save`,"🎮":`gamepad`,"🏠":`house`,"📡":`radio`,"📂":`folder`,"✏️":`pencil`,"📊":`chart`,"🎙️":`mic`,"⏳":`hourglass`,"🎯":`target`,"📨":`send`,"🚫":`ban`,"▶":`play`};function dt(e){let t=ut[e];return t?E[t]:e}function ft(e){return e===`✅`?`done`:e===`❌`?`error`:null}function pt(e=document.body){let t=e.querySelectorAll(`[data-icon]`);for(let e of t){let t=e.dataset.icon;t&&E[t]&&(e.innerHTML=E[t],e.classList.add(`icon-hydrated`))}}function mt(e){let t=[],n=e.replace(/```[\s\S]*?```/g,e=>(t.push(e),`\x00P${t.length-1}\x00`)).replace(/`[^`]+`/g,e=>(t.push(e),`\x00P${t.length-1}\x00`));return n=n.replace(/([\p{P}])\*\*(?=[^\s\p{P}])/gu,(e,t)=>t===`*`?e:t+`**`),n=n.replace(/\x00P(\d+)\x00/g,(e,n)=>t[Number(n)]),n}var D=0;function ht(e){let t=new Map;return{text:e.replace(/^ {0,3}(`{3,}|~{3,})[^\n]*\n[\s\S]*?\n {0,3}\1[ \t]*$/gm,e=>{let n=`\x00FENCE-${D++}\x00`;return t.set(n,e),n}),fences:t}}function gt(e,t){for(let[n,r]of t)e=e.replace(n,()=>r);return e}function _t(e,t=!1){let n=[],r=``,i=0;for(;i<e.length;){let a=e.indexOf(`<svg`,i);if(a===-1){r+=e.slice(i);break}let o=e[a+4];if(o&&!/[\s\/>]/.test(o)){r+=e.slice(i,a+4),i=a+4;continue}r+=e.slice(i,a);let s=0,c=a,l=!1;for(;c<e.length;){let t=e.indexOf(`<svg`,c+1),o=e.indexOf(`</svg>`,c+(c===a?0:1));if(o===-1)break;if(t!==-1&&t<o){let n=e[t+4];n&&/[\s\/>]/.test(n)&&s++,c=t+4}else if(s===0){let t=o+6,s=e.slice(a,t),c=D++,u=`\n\n<div data-jaw-svg="${c}"></div>\n\n`;n.push({id:c,index:a,length:s.length,svg:s,kind:`complete`,placeholder:u}),r+=u,i=t,l=!0;break}else s--,c=o+6}if(!l){let o=D++;if(t){let t=e.slice(a),s=`\n\n<div data-jaw-svg="${o}" data-jaw-kind="partial"></div>\n\n`;n.push({id:o,index:a,length:t.length,svg:``,kind:`partial`,placeholder:s}),r+=s,i=e.length}else{let t=`\n\n<div data-jaw-svg="${o}" data-jaw-kind="error"></div>\n\n`,s=e.slice(a),c=s.search(/\n\s*\n/),l=c===-1?s.length:c;n.push({id:o,index:a,length:l,svg:``,kind:`error`,placeholder:t}),r+=t,i=a+l}}}return{text:r,blocks:n}}l.registerLanguage(`javascript`,s),l.registerLanguage(`js`,s),l.registerLanguage(`typescript`,o),l.registerLanguage(`ts`,o),l.registerLanguage(`python`,p),l.registerLanguage(`py`,p),l.registerLanguage(`bash`,e),l.registerLanguage(`shell`,m),l.registerLanguage(`sh`,m),l.registerLanguage(`json`,c),l.registerLanguage(`css`,n),l.registerLanguage(`xml`,r),l.registerLanguage(`html`,r),l.registerLanguage(`markdown`,d),l.registerLanguage(`md`,d),l.registerLanguage(`yaml`,h),l.registerLanguage(`yml`,h),l.registerLanguage(`sql`,t),l.registerLanguage(`rust`,u),l.registerLanguage(`rs`,u),l.registerLanguage(`go`,re),l.registerLanguage(`java`,ee),l.registerLanguage(`cpp`,ie),l.registerLanguage(`c`,ie),l.registerLanguage(`diff`,ne),l.registerLanguage(`plaintext`,f),l.registerLanguage(`text`,f);var O=null,k=Promise.resolve();function vt(){return document.documentElement.getAttribute(`data-theme`)===`light`?{primaryColor:`#e2e8f0`,primaryTextColor:`#1a202c`,primaryBorderColor:`#a0aec0`,lineColor:`#718096`,secondaryColor:`#ebf8ff`,tertiaryColor:`#f7fafc`,background:`transparent`,mainBkg:`#e2e8f0`,nodeBorder:`#a0aec0`,clusterBkg:`#f7fafc`,clusterBorder:`#cbd5e0`,titleColor:`#1a202c`,edgeLabelBackground:`#f7fafc`}:{primaryColor:`#2d3748`,primaryTextColor:`#e2e8f0`,primaryBorderColor:`#4a5568`,lineColor:`#718096`,secondaryColor:`#1a365d`,tertiaryColor:`#1a202c`,background:`transparent`,mainBkg:`#2d3748`,nodeBorder:`#4a5568`,clusterBkg:`#1a202c`,clusterBorder:`#2d3748`,titleColor:`#e2e8f0`,edgeLabelBackground:`#1a202c`}}async function A(){return O||(O=await _(()=>import(`./mermaid.core-CoRN09Dx.js`),[]),O.default.setParseErrorHandler(()=>{})),O.default}function j(){O.default.initialize({startOnLoad:!1,theme:`base`,htmlLabels:!1,themeVariables:vt(),securityLevel:`strict`,suppressErrorRendering:!0})}function M(e){let t=g.sanitize(e,{USE_PROFILES:{svg:!0,svgFilters:!0},FORBID_TAGS:[`script`,`iframe`,`object`,`embed`,`form`,`input`,`foreignObject`,`animate`,`set`,`animateTransform`,`animateMotion`],FORBID_ATTR:[`onerror`,`onclick`,`onload`,`onmouseover`,`onfocus`,`onblur`,`background`]}),n=document.createElement(`div`);n.innerHTML=t;for(let e of n.querySelectorAll(`style`)){let t=e.textContent||``;t=t.replace(/@import\b[^;]*;?/gi,`/* stripped */`),t=t.replace(/@font-face\s*\{[^}]*\}/gi,`/* stripped */`),t=t.replace(/url\s*\(\s*(?!['"]?#)[^)]*\)/gi,`none`),e.textContent=t}return n.innerHTML}function N(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}function P(e){return g.sanitize(e,{USE_PROFILES:{html:!0,svg:!0,svgFilters:!0},FORBID_TAGS:[`script`,`style`,`iframe`,`object`,`embed`,`form`,`input`,`foreignObject`,`animate`,`set`,`animateTransform`,`animateMotion`],FORBID_ATTR:[`onerror`,`onclick`,`onload`,`onmouseover`,`onfocus`,`onblur`,`background`],ADD_TAGS:[`use`],ADD_ATTR:[`aria-hidden`,`xmlns`,`viewBox`,`role`,`aria-label`,`data-jaw-svg`,`data-jaw-kind`,`data-mermaid-code-raw`]})}var yt=`http://www.w3.org/2000/svg`,bt=new Set([`a`,`area`,`link`]);g.addHook(`afterSanitizeAttributes`,e=>{let t=e.tagName.toLowerCase();if(e.namespaceURI===yt||!bt.has(t)){let t=e.getAttribute(`href`)||``;t&&!t.startsWith(`#`)&&e.removeAttribute(`href`)}let n=e.getAttributeNS(`http://www.w3.org/1999/xlink`,`href`)||e.getAttribute(`xlink:href`)||``;if(n&&!n.startsWith(`#`)&&(e.removeAttributeNS(`http://www.w3.org/1999/xlink`,`href`),e.removeAttribute(`xlink:href`)),t===`image`||t===`feimage`){let t=e.getAttribute(`src`)||``;t&&!t.startsWith(`#`)&&e.removeAttribute(`src`)}let r=[`fill`,`stroke`,`filter`,`mask`,`clip-path`,`marker-start`,`marker-mid`,`marker-end`,`cursor`];if(e.hasAttribute(`style`)){let t=e.style?.cssText||``;if(/url\s*\(/i.test(t)){let n=t.replace(/url\s*\(\s*(?!['"]?#)[^)]*\)/gi,`none`);e.style.cssText=n}}for(let t of r)if(e.hasAttribute(t)){let n=e.getAttribute(t)||``;if(/url\s*\(/i.test(n)){let r=n.replace(/url\s*\(\s*(?!['"]?#)[^)]*\)/gi,`none`);e.setAttribute(t,r)}}});var xt=/["'](?:subtasks|employee_config|agent_phases|orchestration_plan)["']\s*:/;function F(e){let t=e.replace(/```json\n([\s\S]*?)\n```/g,(e,t)=>xt.test(t)?``:e);return t=t.replace(/\{[^{}]*"subtasks"\s*:\s*\[[\s\S]*?\]\s*\}/g,``).trim(),t}function St(e){let t=[],n=[],r=e.replace(/```[\s\S]*?```/g,e=>(n.push(e),`\x00C${n.length-1}\x00`)).replace(/`[^`]+`/g,e=>(n.push(e),`\x00C${n.length-1}\x00`));return r=r.replace(/\$\$([\s\S]+?)\$\$/g,(e,n)=>(t.push({tex:n.trim(),displayMode:!0}),`\x00MATH-${t.length-1}\x00`)),r=r.replace(/\\\[([\s\S]+?)\\\]/g,(e,n)=>(t.push({tex:n.trim(),displayMode:!0}),`\x00MATH-${t.length-1}\x00`)),r=r.replace(/(?<!\$)\$(?!\$)([^\n$]+?)\$(?!\$)/g,(e,n)=>(t.push({tex:n.trim(),displayMode:!1}),`\x00MATH-${t.length-1}\x00`)),r=r.replace(/\\\((.+?)\\\)/g,(e,n)=>(t.push({tex:n.trim(),displayMode:!1}),`\x00MATH-${t.length-1}\x00`)),r=r.replace(/\x00C(\d+)\x00/g,(e,t)=>n[Number(t)]),{text:r,blocks:t}}function Ct(e,t,n=!1){return e.replace(/\x00MATH-(\d+)\x00/g,(e,r)=>{let i=t[Number(r)];if(!i)return`<code title="math placeholder error">[math error]</code>`;if(n)return i.displayMode?`<div class="math-placeholder">${N(i.tex)}</div>`:`<code class="math-placeholder">${N(i.tex)}</code>`;try{return te.renderToString(i.tex,{displayMode:i.displayMode,throwOnError:!1})}catch{return i.displayMode?`<pre><code>${N(i.tex)}</code></pre>`:`<code>${N(i.tex)}</code>`}})}var I=0;async function wt(){let e=document.querySelectorAll(`.mermaid-rendered`);if(!e.length)return;let t=await A();for(let n of e){let e=n.dataset.mermaidCode;if(!e)continue;let r=`mermaid-${++I}`;try{j();let{svg:i}=await t.render(r,e);n.innerHTML=M(i),R(n)}catch{}}}var L=null;function Tt(){L||=new IntersectionObserver(e=>{for(let t of e){if(!t.isIntersecting)continue;let e=t.target;e.classList.contains(`mermaid-pending`)&&(L.unobserve(e),z(e))}},{rootMargin:`200px`})}function R(e){e.querySelector(`.mermaid-copy-btn`)?.remove(),e.querySelector(`.mermaid-save-btn`)?.remove();let t=document.createElement(`button`);t.className=`mermaid-save-btn`,t.type=`button`,t.ariaLabel=`Save as image`,t.title=`Save`,t.innerHTML=E.download,e.appendChild(t);let n=document.createElement(`button`);n.className=`mermaid-copy-btn`,n.type=`button`,n.ariaLabel=`Copy source`,n.title=`Copy`,n.innerHTML=E.copy,e.appendChild(n)}function Et(e,t,n){e.classList.remove(`mermaid-rendered`),e.innerHTML=`
|
|
2
|
+
<div class="mermaid-error">
|
|
3
|
+
<div class="mermaid-error-title">${E.warning} ${N(S(`mermaid.renderFail`)||`Mermaid render failed`)}</div>
|
|
4
|
+
<div class="mermaid-error-msg">${N(n.slice(0,200))}</div>
|
|
5
|
+
<pre class="mermaid-error-code"><code>${N(t)}</code></pre>
|
|
6
|
+
</div>`}async function Dt(e){if(!e.isConnected){delete e.dataset.mermaidQueued;return}e.classList.remove(`mermaid-pending`);let t=e.dataset.mermaidCodeRaw||``,n=t?decodeURIComponent(t):e.textContent||``;e.dataset.mermaidCode=n;let r=`mermaid-${++I}`;try{let t=await A();j();let{svg:i}=await t.render(r,n);if(!e.isConnected){delete e.dataset.mermaidQueued;return}e.innerHTML=M(i),e.classList.add(`mermaid-rendered`),R(e)}catch(t){Et(e,n,t?.message||t?.str||`Unknown error`)}}function z(e){e.dataset.mermaidQueued!==`1`&&(e.dataset.mermaidQueued=`1`,k=k.then(()=>Dt(e)).catch(e=>{console.error(`[mermaid:queue] render failed, keeping queue alive:`,e)}))}async function B(e,t={}){let n=(e||document).querySelectorAll(`.mermaid-pending`);if(n.length){Tt();for(let e of n)if(e.dataset.mermaidQueued!==`1`){if(t.immediate){let t=e.getBoundingClientRect(),n=window.innerHeight||document.documentElement.clientHeight;if(t.bottom>=-200&&t.top<=n+200){L.unobserve(e),z(e);continue}}L.observe(e)}}}function Ot(){if(O)return;let e=()=>{A().catch(()=>{})};typeof window.requestIdleCallback==`function`?window.requestIdleCallback(e,{timeout:2e3}):setTimeout(e,500)}var V=!1;function kt(){if(V)return!0;let e=new a;return e.code=function({text:e,lang:t}){if(t===`mermaid`)return`<div class="mermaid-container mermaid-pending" data-mermaid-code-raw="${encodeURIComponent(e)}" role="status" aria-label="Diagram loading">
|
|
7
|
+
<div class="mermaid-skeleton">
|
|
8
|
+
<div class="mermaid-skeleton-spinner"></div>
|
|
9
|
+
<div class="mermaid-skeleton-text">Rendering diagram…</div>
|
|
10
|
+
</div>
|
|
11
|
+
</div>`;if(t?.trim().toLowerCase()===`diagram-html`)return`<div class="diagram-widget-pending" data-diagram-html="${btoa(unescape(encodeURIComponent(e)))}"
|
|
12
|
+
role="status" aria-label="Interactive widget loading">
|
|
13
|
+
<div class="diagram-spinner"></div>
|
|
14
|
+
</div>`;let n=N(e);if(t&&l.getLanguage(t))try{n=l.highlight(e,{language:t}).value}catch{}else try{n=l.highlightAuto(e).value}catch{}let r=t?N(t):``,i=S(`code.copy`)||`Copy`;return`<div class="code-block"><div class="code-header"><span class="code-lang">${r}</span><button class="code-copy-btn" type="button" aria-label="${N(i)}">${N(i)}</button></div><pre><code class="hljs${t?` language-${N(t)}`:``}">${n}</code></pre></div>`},i.setOptions({renderer:e,gfm:!0,breaks:!1}),V=!0,!0}function At(e){(e||document).querySelectorAll(`.code-block pre code, .code-block-wrapper pre code`).forEach(e=>{if(e.dataset.highlighted===`yes`)return;let t=[...e.classList].find(e=>e.startsWith(`language-`))?.replace(`language-`,``),n=e.textContent||``;try{t&&l.getLanguage(t)?e.innerHTML=l.highlight(n,{language:t}).value:e.innerHTML=l.highlightAuto(n).value,e.dataset.highlighted=`yes`}catch{}})}var H=/(?:~\/[^\s)`\]"'<>]+|\/(?:Users|home|tmp|var|opt|private)\/[^\s)`\]"'<>]+)/g,jt=/[.,!?:;]+$/,Mt=/^(?:~\/|\/(?:Users|home|tmp|var|opt|private)\/)/;function Nt(e){return Mt.test(e)}function U(e,t){t&&t.classList.add(`opening`),ae(`/api/file/open`,`POST`,{path:e}).then(e=>{t?.classList.remove(`opening`),e?.ok===!1?(t?.classList.add(`open-failed`),t&&(t.title=e?.error||`Failed to open`),setTimeout(()=>{t?.classList.remove(`open-failed`),t&&(t.title=``)},2e3)):(t?.classList.add(`opened`),setTimeout(()=>t?.classList.remove(`opened`),1500))}).catch(()=>{t?.classList.remove(`opening`),t?.classList.add(`open-failed`),setTimeout(()=>t?.classList.remove(`open-failed`),2e3)})}function W(e){let t=new Set([`PRE`,`A`,`BUTTON`,`TEXTAREA`,`INPUT`,`SCRIPT`,`STYLE`]),n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode(n){let r=n.parentElement;for(;r&&r!==e;){if(t.has(r.tagName)||r.classList.contains(`file-path-link`)||r.tagName===`CODE`&&r.parentElement?.tagName===`PRE`)return NodeFilter.FILTER_REJECT;r=r.parentElement}return NodeFilter.FILTER_ACCEPT}}),r=new Map,i;for(;i=n.nextNode();){let e=i.textContent||``;H.lastIndex=0;let t,n=[];for(;t=H.exec(e);){let e=t[0],r=e.replace(jt,``);r.length<4||n.push({index:t.index,raw:e,clean:r})}n.length&&r.set(i,n)}for(let[e,t]of r){let n=e.textContent||``,r=e.parentNode;if(!r)continue;let i=document.createDocumentFragment(),a=0;for(let{index:e,raw:r,clean:o}of t){e>a&&i.appendChild(document.createTextNode(n.slice(a,e)));let t=document.createElement(`span`);t.className=`file-path-link`,t.setAttribute(`data-file-path`,o),t.setAttribute(`role`,`button`),t.setAttribute(`tabindex`,`0`),t.textContent=o,i.appendChild(t);let s=r.slice(o.length);s&&i.appendChild(document.createTextNode(s)),a=e+r.length}a<n.length&&i.appendChild(document.createTextNode(n.slice(a))),r.replaceChild(i,e)}}var G=!1;function Pt(){G||(G=!0,document.addEventListener(`click`,e=>{let t=e.target,n=t?.closest(`a`),r=n?.getAttribute(`href`)||``;if(n&&Nt(r)){e.preventDefault(),n.classList.add(`file-path-link`),U(r,n);return}let i=t?.closest(`.file-path-link`);if(!i)return;let a=i.getAttribute(`data-file-path`);a&&U(a,i)}),document.addEventListener(`keydown`,e=>{if(e.key!==`Enter`&&e.key!==` `)return;let t=e.target;t?.classList.contains(`file-path-link`)&&(e.preventDefault(),t.click())}))}var K=!1;function Ft(){K||(K=!0,document.addEventListener(`click`,e=>{let t=e.target,n=t?.closest(`.code-copy-btn`);if(n){let e=n.closest(`.code-block`);if(!e)return;let t=e.querySelector(`pre code`);if(!t)return;navigator.clipboard.writeText(t.textContent||``).then(()=>{let e=n.textContent||``;n.textContent=S(`code.copied`),n.classList.add(`copied`),setTimeout(()=>{n.textContent=e,n.classList.remove(`copied`)},1500)}).catch(()=>{});return}let r=t?.closest(`.code-lang-label`);if(!r)return;let i=r.closest(`.code-block-wrapper`);if(!i)return;let a=i.querySelector(`pre code`);a&&navigator.clipboard.writeText(a.textContent||``).then(()=>{let e=r.textContent||``;r.textContent=S(`code.copied`),r.classList.add(`copied`),setTimeout(()=>{r.textContent=e,r.classList.remove(`copied`)},1500)}).catch(()=>{})}))}var q=!1;function It(){q||(q=!0,document.addEventListener(`click`,e=>{let t=e.target,n=t?.closest(`.diagram-copy-btn`);if(n){let e=n.closest(`.diagram-container`);if(!e)return;let t=``;if(e.dataset.widgetHtml)try{t=decodeURIComponent(escape(atob(e.dataset.widgetHtml)))}catch{return}else{let n=e.querySelector(`svg`);n&&(t=n.outerHTML)}t&&J(n,t,`copy`);return}let r=t?.closest(`.mermaid-copy-btn`);if(r){let e=r.closest(`.mermaid-container`);if(!e)return;let t=e.dataset.mermaidCode||``;t&&J(r,t,`copy`);return}let i=t?.closest(`.diagram-save-btn`);if(i){let e=i.closest(`.diagram-container`);if(!e)return;if(e.dataset.widgetHtml){let t=e.querySelector(`iframe`);t?.contentWindow&&(t.contentWindow.postMessage({type:`jaw-request-screenshot`},`*`),J(i,``,`save`));return}let t=e.querySelector(`svg`);t&&X(t,i);return}let a=t?.closest(`.mermaid-save-btn`);if(a){let e=a.closest(`.mermaid-container`);if(!e)return;let t=e.querySelector(`svg`);t&&X(t,a);return}}))}function J(e,t,n){let r=()=>{let t=e.innerHTML;e.innerHTML=E.checkSimple,e.classList.add(`copied`),setTimeout(()=>{e.innerHTML=t,e.classList.remove(`copied`)},1500)};n===`copy`?navigator.clipboard.writeText(t).then(r).catch(()=>{}):r()}function Y(e,t){let n=e.children,r=t.children,i=[`fill`,`stroke`,`stroke-width`,`color`,`opacity`,`rx`,`ry`,`font-size`,`font-weight`,`font-family`,`text-anchor`,`dominant-baseline`];for(let e=0;e<n.length;e++){let t=n[e],a=r[e];if(!t||!a)continue;let o=getComputedStyle(t);for(let e of i){let t=o.getPropertyValue(e);t&&a.style.setProperty(e,t)}t.children.length&&Y(t,a)}}function X(e,t){let n=e.cloneNode(!0);Y(e,n);let r=e.getBoundingClientRect();n.getAttribute(`width`)||n.setAttribute(`width`,String(r.width)),n.getAttribute(`height`)||n.setAttribute(`height`,String(r.height));let i=new XMLSerializer().serializeToString(n),a=`data:image/svg+xml;charset=utf-8,`+encodeURIComponent(i),o=new Image;o.onload=()=>{let e=document.createElement(`canvas`);e.width=o.naturalWidth*2,e.height=o.naturalHeight*2;let n=e.getContext(`2d`);n.scale(2,2),n.drawImage(o,0,0),e.toBlob(e=>{e&&(Z(e,`diagram-${Date.now()}.png`),J(t,``,`save`))},`image/png`)},o.onerror=()=>{Z(new Blob([i],{type:`image/svg+xml;charset=utf-8`}),`diagram-${Date.now()}.svg`),J(t,``,`save`)},o.src=a}function Z(e,t){let n=URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=t,r.click(),setTimeout(()=>URL.revokeObjectURL(n),1e3)}function Lt(e){return e.kind===`partial`?`<div class="diagram-container diagram-loading" role="status"
|
|
15
|
+
aria-label="Diagram loading"><div class="diagram-spinner"></div></div>`:e.kind===`error`?`<div class="diagram-container diagram-error" role="alert">
|
|
16
|
+
Malformed SVG: unclosed element</div>`:`<div class="diagram-container diagram-svg" tabindex="0"
|
|
17
|
+
role="figure" aria-label="SVG diagram">
|
|
18
|
+
${P(e.svg)}
|
|
19
|
+
<button class="diagram-save-btn" type="button"
|
|
20
|
+
aria-label="Save as image" title="Save">${E.download}</button>
|
|
21
|
+
<button class="diagram-copy-btn" type="button"
|
|
22
|
+
aria-label="Copy source" title="Copy">${E.copy}</button>
|
|
23
|
+
<button class="diagram-zoom-btn" type="button"
|
|
24
|
+
aria-label="Expand diagram" title="Expand">⤢</button>
|
|
25
|
+
</div>`}function Rt(e,t){for(let n of t){let t=`<div\\b[^>]*?\\bdata-jaw-svg="${n.id}"[^>]*></div>`,r=new RegExp(t,`g`),i=Lt(n);e=e.replace(r,()=>i)}return e}function zt(e){(e||document).querySelectorAll(`.diagram-zoom-btn`).forEach(e=>{e.dataset.bound||(e.dataset.bound=`1`,e.addEventListener(`click`,()=>{let t=e.closest(`.diagram-container`);if(!t)return;let n=t.cloneNode(!0);n.querySelectorAll(`.diagram-zoom-btn, .diagram-copy-btn, .diagram-save-btn`).forEach(e=>e.remove()),Bt(n.innerHTML)}))})}function Bt(e){let t=document.activeElement,n=document.createElement(`div`);n.className=`diagram-overlay`,n.setAttribute(`role`,`dialog`),n.setAttribute(`aria-modal`,`true`),n.setAttribute(`aria-label`,`Expanded diagram`),n.innerHTML=`
|
|
26
|
+
<div class="diagram-overlay-content">${P(e)}</div>
|
|
27
|
+
<button class="diagram-overlay-close" type="button" aria-label="Close">✕</button>
|
|
28
|
+
`,n.querySelectorAll(`.diagram-overlay-content svg`).forEach(e=>{if(!e.getAttribute(`viewBox`)){let t=e.getAttribute(`width`)||e.getBBox?.()?.width,n=e.getAttribute(`height`)||e.getBBox?.()?.height;t&&n&&e.setAttribute(`viewBox`,`0 0 ${parseFloat(String(t))} ${parseFloat(String(n))}`)}e.removeAttribute(`width`),e.removeAttribute(`height`)});let r=n.querySelector(`.diagram-overlay-close`),i=()=>{n.remove(),document.removeEventListener(`keydown`,a),t&&t.isConnected&&t.focus()},a=e=>{if(e.key===`Escape`){i();return}if(e.key===`Tab`){let t=n.querySelectorAll(`button, [href], [tabindex]:not([tabindex="-1"])`);if(t.length===0)return;let r=t[0],i=t[t.length-1];e.shiftKey&&document.activeElement===r?(e.preventDefault(),i.focus()):!e.shiftKey&&document.activeElement===i&&(e.preventDefault(),r.focus())}};r.addEventListener(`click`,i),document.addEventListener(`keydown`,a),document.body.appendChild(n),r.focus()}function Vt(e,t=!1){let n=F(e);if(!n)return`<em class="text-dim orchestrate-placeholder">${N(S(`orchestrator.dispatching`))}</em>`;let{text:r,fences:a}=ht(n.replace(/\n{3,}/g,`
|
|
29
|
+
|
|
30
|
+
`)),{text:o,blocks:s}=_t(r,t),{text:c,blocks:l}=St(gt(o,a));kt();let u=mt(c),d=i.parse(u);return d=d.replace(/<table/g,`<div class="table-wrapper"><table`).replace(/<\/table>/g,`</table></div>`),d=Ct(d,l,t),d=P(d),d=Rt(d,s),t||Ht(),Ft(),It(),Pt(),d}var Q=null,$=null;function Ht(){$&&clearTimeout($),Q&&=(cancelAnimationFrame(Q),null),$=setTimeout(()=>{$=null,Q=requestAnimationFrame(()=>{Q=null,B(),At(),zt();let e=document.getElementById(`chatMessages`);e&&W(e)})},100)}function Ut(){$&&=(clearTimeout($),null),Q&&=(cancelAnimationFrame(Q),null)}export{S as _,Vt as a,F as c,ft as d,pt as f,at as g,it as h,Ot as i,E as l,ot as m,N as n,B as o,st as p,W as r,wt as s,Ut as t,dt as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./state-O6NVkWcL.js";import{n as t,r as n,t as r}from"./api-DygAf_G_.js";import{_ as i,l as a,n as o}from"./render-
|
|
1
|
+
import{t as e}from"./state-O6NVkWcL.js";import{n as t,r as n,t as r}from"./api-DygAf_G_.js";import{_ as i,l as a,n as o}from"./render-CQnnZ-_i.js";import{n as s,r as c}from"./locale-CxI5nTcf.js";import{a as l,i as u,r as d,t as f}from"./constants-IeOVgtYz.js";function p(e){let t=document.getElementById(`sttEngine`),r=document.getElementById(`sttGeminiKey`),i=document.getElementById(`sttGeminiModel`),a=document.getElementById(`sttGeminiModelCustom`),o=document.getElementById(`sttWhisperModel`),s=document.getElementById(`sttOpenaiBaseUrl`),c=document.getElementById(`sttOpenaiKey`),l=document.getElementById(`sttOpenaiModel`),u=document.getElementById(`sttVertexJson`);if(t&&(t.value=e.engine||`auto`),r&&(r.placeholder=e.geminiKeySet?`✓ 입력됨 ····${e.geminiKeyLast4||``}`:`AIza...`),i){let t=e.geminiModel||`gemini-2.5-flash-lite`;Array.from(i.options).some(e=>e.value===t)?i.value=t:(i.value=`__custom__`,a&&(a.value=t,a.style.display=``))}o&&(o.value=e.whisperModel||`mlx-community/whisper-large-v3-turbo`),s&&(s.value=e.openaiBaseUrl||``),c&&(c.placeholder=e.openaiKeySet?`✓ 입력됨 ····${e.openaiKeyLast4||``}`:`sk-...`),l&&(l.value=e.openaiModel||``),u&&(u.value=e.vertexConfig||``);function d(){let e=t?.value||`auto`,n=e===`auto`||e===`gemini`,r=e===`openai`,i=e===`vertex`,a=e===`auto`||e===`whisper`;document.querySelectorAll(`.stt-gemini`).forEach(e=>e.style.display=n?``:`none`),document.querySelectorAll(`.stt-openai`).forEach(e=>e.style.display=r?``:`none`),document.querySelectorAll(`.stt-vertex`).forEach(e=>e.style.display=i?``:`none`),document.querySelectorAll(`.stt-whisper`).forEach(e=>e.style.display=a?``:`none`)}d();async function f(){let e={stt:{engine:t?.value||`auto`,geminiModel:(i?.value===`__custom__`?a?.value:i?.value)||`gemini-2.5-flash-lite`,whisperModel:o?.value||``,openaiBaseUrl:s?.value||``,openaiModel:l?.value||``,vertexConfig:u?.value||``}};r?.value&&(e.stt.geminiApiKey=r.value),c?.value&&(e.stt.openaiApiKey=c.value),console.log(`[stt] saving:`,{engine:e.stt.engine,hasGeminiKey:!!e.stt.geminiApiKey,hasOpenaiKey:!!e.stt.openaiApiKey});try{if(await n(`/api/settings`,`PUT`,e),r?.value){let e=r.value.slice(-4);r.value=``,r.placeholder=`✓ 입력됨 ····${e}`}if(c?.value){let e=c.value.slice(-4);c.value=``,c.placeholder=`✓ 입력됨 ····${e}`}}catch(e){console.error(`[stt] save failed:`,e)}}t?.addEventListener(`change`,()=>{d(),f()}),i?.addEventListener(`change`,()=>{a&&(a.style.display=i.value===`__custom__`?``:`none`),i.value!==`__custom__`&&f()}),a?.addEventListener(`blur`,f),r?.addEventListener(`blur`,()=>{r.value&&f()}),c?.addEventListener(`blur`,()=>{c.value&&f()}),s?.addEventListener(`blur`,f),l?.addEventListener(`blur`,f),o?.addEventListener(`blur`,f),u?.addEventListener(`blur`,f)}async function ee(){let e=document.getElementById(`tgToken`)?.value.trim()||``,t=document.getElementById(`tgChatIds`)?.value.trim()||``;await n(`/api/settings`,`PUT`,{telegram:{token:e,allowedChatIds:t?t.split(`,`).map(e=>parseInt(e.trim(),10)).filter(e=>!isNaN(e)):[]}})}async function te(e){document.getElementById(`tgOn`)?.classList.toggle(`active`,e),document.getElementById(`tgOff`)?.classList.toggle(`active`,!e),await n(`/api/settings`,`PUT`,{telegram:{enabled:e}})}async function m(e){document.getElementById(`tgForwardOn`)?.classList.toggle(`active`,e),document.getElementById(`tgForwardOff`)?.classList.toggle(`active`,!e),await n(`/api/settings`,`PUT`,{telegram:{forwardAll:e}})}async function h(e){document.getElementById(`tgMentionOn`)?.classList.toggle(`active`,e),document.getElementById(`tgMentionOff`)?.classList.toggle(`active`,!e),await n(`/api/settings`,`PUT`,{telegram:{mentionOnly:e}})}function g(e){if(!e.telegram)return;let t=e.telegram;document.getElementById(`tgOn`)?.classList.toggle(`active`,!!t.enabled),document.getElementById(`tgOff`)?.classList.toggle(`active`,!t.enabled);let n=document.getElementById(`tgToken`);t.token&&n&&(n.value=t.token);let r=document.getElementById(`tgChatIds`);t.allowedChatIds?.length&&r&&(r.value=t.allowedChatIds.join(`, `));let i=t.forwardAll!==!1;document.getElementById(`tgForwardOn`)?.classList.toggle(`active`,i),document.getElementById(`tgForwardOff`)?.classList.toggle(`active`,!i);let a=t.mentionOnly!==!1;document.getElementById(`tgMentionOn`)?.classList.toggle(`active`,a),document.getElementById(`tgMentionOff`)?.classList.toggle(`active`,!a)}async function _(){let e=document.getElementById(`dcToken`)?.value.trim()||``,t=document.getElementById(`dcGuildId`)?.value.trim()||``,r=document.getElementById(`dcChannelIds`)?.value.trim()||``;await n(`/api/settings`,`PUT`,{discord:{token:e,guildId:t,channelIds:r?r.split(`,`).map(e=>e.trim()).filter(Boolean):[]}})}async function v(e){document.getElementById(`dcOn`)?.classList.toggle(`active`,e),document.getElementById(`dcOff`)?.classList.toggle(`active`,!e),await n(`/api/settings`,`PUT`,{discord:{enabled:e}})}async function y(e){document.getElementById(`dcForwardOn`)?.classList.toggle(`active`,e),document.getElementById(`dcForwardOff`)?.classList.toggle(`active`,!e),await n(`/api/settings`,`PUT`,{discord:{forwardAll:e}})}async function b(e){document.getElementById(`dcAllowBotsOn`)?.classList.toggle(`active`,e),document.getElementById(`dcAllowBotsOff`)?.classList.toggle(`active`,!e),await n(`/api/settings`,`PUT`,{discord:{allowBots:e}})}async function ne(e){document.getElementById(`dcMentionOn`)?.classList.toggle(`active`,e),document.getElementById(`dcMentionOff`)?.classList.toggle(`active`,!e),await n(`/api/settings`,`PUT`,{discord:{mentionOnly:e}})}function re(e){if(!e.discord)return;let t=e.discord;document.getElementById(`dcOn`)?.classList.toggle(`active`,!!t.enabled),document.getElementById(`dcOff`)?.classList.toggle(`active`,!t.enabled);let n=document.getElementById(`dcToken`);t.token&&n&&(n.value=t.token);let r=document.getElementById(`dcGuildId`);t.guildId&&r&&(r.value=t.guildId);let i=document.getElementById(`dcChannelIds`);t.channelIds?.length&&i&&(i.value=t.channelIds.join(`, `));let a=t.forwardAll!==!1;document.getElementById(`dcForwardOn`)?.classList.toggle(`active`,a),document.getElementById(`dcForwardOff`)?.classList.toggle(`active`,!a);let o=!!t.allowBots;document.getElementById(`dcAllowBotsOn`)?.classList.toggle(`active`,o),document.getElementById(`dcAllowBotsOff`)?.classList.toggle(`active`,!o);let s=!!t.mentionOnly;document.getElementById(`dcMentionOn`)?.classList.toggle(`active`,s),document.getElementById(`dcMentionOff`)?.classList.toggle(`active`,!s)}async function ie(e){document.getElementById(`chTelegram`)?.classList.toggle(`active`,e===`telegram`),document.getElementById(`chDiscord`)?.classList.toggle(`active`,e===`discord`),document.getElementById(`channelTelegramSettings`)?.style.setProperty(`display`,e===`telegram`?``:`none`),document.getElementById(`channelDiscordSettings`)?.style.setProperty(`display`,e===`discord`?``:`none`),await n(`/api/settings`,`PUT`,{channel:e})}function ae(e){let t=e.channel||`telegram`;document.getElementById(`chTelegram`)?.classList.toggle(`active`,t===`telegram`),document.getElementById(`chDiscord`)?.classList.toggle(`active`,t===`discord`),document.getElementById(`channelTelegramSettings`)?.style.setProperty(`display`,t===`telegram`?``:`none`),document.getElementById(`channelDiscordSettings`)?.style.setProperty(`display`,t===`discord`?``:`none`)}function x(e){let t=document.getElementById(`fallbackOrderList`);if(!t)return;let n=Object.keys(e.perCli||{}),r=e.fallbackOrder||[],a=Math.min(n.length-1,3),s=``;for(let e=0;e<a;e++){let t=r[e]||``,a=n.map(e=>`<option value="${o(e)}" ${e===t?`selected`:``}>${o(e)}</option>`).join(``);s+=`
|
|
2
2
|
<div class="settings-row sub-row">
|
|
3
3
|
<label style="min-width:60px">Fallback ${e+1}</label>
|
|
4
4
|
<select id="fallback${e}"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as e,m as t,v as n}from"./settings-C8bSXG3q.js";export{t as loadSettings,n as savePerCli,e as updateSettings};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./skills-Ci5t_dsV.js";export{e as loadSkills};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./state-O6NVkWcL.js";import{r as t}from"./api-DygAf_G_.js";import{_ as n,l as r,n as i,p as a,u as o}from"./render-
|
|
1
|
+
import{t as e}from"./state-O6NVkWcL.js";import{r as t}from"./api-DygAf_G_.js";import{_ as n,l as r,n as i,p as a,u as o}from"./render-CQnnZ-_i.js";var s=[`productivity`,`communication`,`devtools`,`ai-media`,`utility`,`smarthome`,`automation`];async function c(){try{e.allSkills=await(await a(`/api/skills`)).json(),l()}catch{let e=document.getElementById(`skillsList`);e&&(e.innerHTML=`<div style="color:var(--text-dim);font-size:11px">${n(`skill.loadFail`)}</div>`)}}function l(){let t=document.getElementById(`skillsList`),a=document.getElementById(`skillsCount`);if(!t||!a)return;let c=e.allSkills,l=c;e.currentSkillFilter===`installed`?l=c.filter(e=>e.enabled):e.currentSkillFilter===`other`?l=c.filter(e=>!s.includes(e.category||``)):e.currentSkillFilter!==`all`&&(l=c.filter(t=>t.category===e.currentSkillFilter));let u=c.filter(e=>e.enabled).length;a.textContent=n(`skill.count`,{active:u,total:c.length}),t.innerHTML=l.map(e=>{let t=[];return e.requires?.env&&t.push(`${r.key} `+e.requires.env.map(e=>i(e)).join(`, `)),e.requires?.bins&&t.push(`${r.settings} `+e.requires.bins.map(e=>i(e)).join(`, `)),e.install&&t.push(i(e.install)),`
|
|
2
2
|
<div class="skill-card ${e.enabled?`enabled`:``}">
|
|
3
3
|
<div class="skill-card-header">
|
|
4
4
|
<span class="skill-emoji">${e.emoji?o(e.emoji):r.tool}</span>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./api-DygAf_G_.js";import{_ as t,n}from"./render-
|
|
1
|
+
import{t as e}from"./api-DygAf_G_.js";import{_ as t,n}from"./render-CQnnZ-_i.js";import{t as r}from"./locale-CxI5nTcf.js";var i=[],a=[],o=-1,s=!1,c=null;function l(e){let t=String(e||``).slice(1).trim().split(/\s+/)[0]||``;return t.includes(`/`)||t.includes(`\\`)}var u=()=>document.getElementById(`cmdDropdown`),d=()=>document.getElementById(`chatInput`);function f(e){let t=String(e||``).toLowerCase();return i.filter(e=>`/${e.name}`.startsWith(t))}function p(){let e=u(),t=d();!e||!t||(c&&=(clearTimeout(c),null),e.style.display=`block`,requestAnimationFrame(()=>e.classList.add(`visible`)),s=!0,t.setAttribute(`aria-expanded`,`true`))}function m(){let e=u(),r=d();if(!e||!r)return;if(!a.length){if(!r.value.startsWith(`/`)||l(r.value)){_();return}e.innerHTML=`
|
|
2
2
|
<div class="cmd-item cmd-empty" role="option" aria-disabled="true">
|
|
3
3
|
${t(`cmd.noMatch`)}
|
|
4
4
|
</div>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./slash-commands-0RvnZU9z.js";export{e as loadCommands};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,d as t,v as n}from"./ui-IWxpAzJ7.js";export{e as cleanupToolActivity,t as loadMessages,n as updateQueueBadge};
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-render-Bjnw0wQ6.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as e}from"./state-O6NVkWcL.js";import{i as t,t as n}from"./api-DygAf_G_.js";import{Z as r}from"./vendor-mermaid-UktBx7L0.js";import{_ as i,a,c as o,d as s,l as c,n as l,o as u,r as d,u as f}from"./render-CQnnZ-_i.js";import{a as p,i as m,r as h,t as ee}from"./idb-cache-DbK81tgv.js";function g(){let e=globalThis.crypto;if(typeof e?.randomUUID==`function`)return e.randomUUID();if(typeof e?.getRandomValues!=`function`)return`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e===`x`?t:t&3|8).toString(16)});let t=new Uint8Array(16);e.getRandomValues(t),t[6]=t[6]&15|64,t[8]=t[8]&63|128;let n=Array.from(t,e=>e.toString(16).padStart(2,`0`)).join(``);return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`}var te=`agentName`,_=`CLI-JAW`,v=_;function ne(){return v}function re(e){v=(e||``).trim()||_,localStorage.setItem(te,v);let t=document.getElementById(`appNameInput`);t&&(t.value=v)}function ie(){v=localStorage.getItem(te)||_;let e=document.getElementById(`appNameInput`);e&&(e.value=v),document.getElementById(`appNameSave`)?.addEventListener(`click`,()=>{let e=document.getElementById(`appNameInput`);e&&re(e.value)}),document.getElementById(`appNameInput`)?.addEventListener(`keydown`,e=>{let t=e;t.key===`Enter`&&(t.preventDefault(),re(t.target.value),t.target.blur())})}var ae=`agentAvatar`,oe=`userAvatar`,se=c.shark,ce=c.user,le={agent:{emoji:se,imageUrl:``,updatedAt:null},user:{emoji:ce,imageUrl:``,updatedAt:null}},ue=!1;function y(e){return le[e]}function de(e){return e===`agent`?`agentAvatarPreview`:`userAvatarPreview`}function fe(e){return e===`agent`?`.agent-icon`:`.user-icon`}function b(e){let t=document.getElementById(de(e));if(t){t.innerHTML=x(e);let n=y(e).imageUrl?`image`:`emoji`;t.setAttribute(`data-avatar-kind`,n)}}function x(e){let t=y(e);return t.imageUrl?`<img class="avatar-image" src="${l(t.imageUrl)}" alt="" loading="lazy" decoding="async">`:t.emoji}function S(e){let t=x(e),n=y(e).imageUrl?`image`:`emoji`;document.querySelectorAll(fe(e)).forEach(e=>{e.innerHTML=t,e.setAttribute(`data-avatar-kind`,n)})}function C(e,t){t?.kind===`image`&&t.imageUrl?(y(e).imageUrl=t.imageUrl,y(e).updatedAt=t.updatedAt??Date.now()):(y(e).imageUrl=``,y(e).updatedAt=t?.updatedAt??null),b(e),S(e)}async function pe(){let e=await n(`/api/avatar`);e&&(C(`agent`,e.agent),C(`user`,e.user))}async function me(e,n){let r=await t(),i=new Headers(n.headers||{});return r&&i.set(`Authorization`,`Bearer ${r}`),fetch(e,{...n,headers:i})}async function he(e,t){let n=await me(`/api/avatar/${e}/upload`,{method:`POST`,headers:{"Content-Type":t.type||`image/png`,"X-Filename":encodeURIComponent(t.name)},body:t}),r=await n.json().catch(()=>null);if(!n.ok)throw Error(r?.error||`avatar upload failed (${n.status})`);C(e,r?.data||r)}async function ge(e){let t=await me(`/api/avatar/${e}/image`,{method:`DELETE`}),n=await t.json().catch(()=>null);if(!t.ok)throw Error(n?.error||`avatar reset failed (${t.status})`);C(e,n?.data||n)}function _e(e){let t=e===`agent`?`agentAvatarUploadBtn`:`userAvatarUploadBtn`,n=e===`agent`?`agentAvatarResetBtn`:`userAvatarResetBtn`,r=e===`agent`?`agentAvatarFile`:`userAvatarFile`;document.getElementById(t)?.addEventListener(`click`,()=>{document.getElementById(r)?.click()}),document.getElementById(n)?.addEventListener(`click`,async()=>{try{await ge(e)}catch(e){console.warn(`[avatar:reset]`,e.message)}}),document.getElementById(r)?.addEventListener(`change`,async t=>{let n=t.target,r=n.files?.[0];if(r)try{await he(e,r)}catch(e){console.warn(`[avatar:upload]`,e.message)}finally{n.value=``}})}function ve(){return x(`agent`)}function ye(){return x(`user`)}async function be(){y(`agent`).emoji=localStorage.getItem(ae)||se,y(`user`).emoji=localStorage.getItem(oe)||ce,b(`agent`),b(`user`),ue||(ue=!0,_e(`agent`),_e(`user`)),await pe(),S(`agent`),S(`user`)}function w(e,t,n){let r=n.initialDeps??[],i,a=!0;function o(){let o;n.key&&n.debug?.call(n)&&(o=Date.now());let s=e();if(!(s.length!==r.length||s.some((e,t)=>r[t]!==e)))return i;r=s;let c;if(n.key&&n.debug?.call(n)&&(c=Date.now()),i=t(...s),n.key&&n.debug?.call(n)){let e=Math.round((Date.now()-o)*100)/100,t=Math.round((Date.now()-c)*100)/100,r=t/16,i=(e,t)=>{for(e=String(e);e.length<t;)e=` `+e;return e};console.info(`%c⏱ ${i(t,5)} /${i(e,5)} ms`,`
|
|
3
|
+
font-size: .6rem;
|
|
4
|
+
font-weight: bold;
|
|
5
|
+
color: hsl(${Math.max(0,Math.min(120-120*r,120))}deg 100% 31%);`,n?.key)}return n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(i),a=!1,i}return o.updateDeps=e=>{r=e},o}function xe(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var Se=(e,t)=>Math.abs(e-t)<1.01,Ce=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},we=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},Te=e=>e,Ee=e=>{let t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let e=t;e<=n;e++)r.push(e);return r},De=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(we(n)),!r.ResizeObserver)return()=>{};let a=new r.ResizeObserver(t=>{let r=()=>{let e=t[0];if(e?.borderBoxSize){let t=e.borderBoxSize[0];if(t){i({width:t.inlineSize,height:t.blockSize});return}}i(we(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return a.observe(n,{box:`border-box`}),()=>{a.unobserve(n)}},Oe={passive:!0},ke=typeof window>`u`?!0:`onscrollend`in window,Ae=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=0,a=e.options.useScrollendEvent&&ke?()=>void 0:Ce(r,()=>{t(i,!1)},e.options.isScrollingResetDelay),o=r=>()=>{let{horizontal:o,isRtl:s}=e.options;i=o?n.scrollLeft*(s&&-1||1):n.scrollTop,a(),t(i,r)},s=o(!0),c=o(!1);n.addEventListener(`scroll`,s,Oe);let l=e.options.useScrollendEvent&&ke;return l&&n.addEventListener(`scrollend`,c,Oe),()=>{n.removeEventListener(`scroll`,s),l&&n.removeEventListener(`scrollend`,c)}},je=(e,t,n)=>{if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},Me=(e,{adjustments:t=0,behavior:n},r)=>{var i,a;let o=e+t;(a=(i=r.scrollElement)?.scrollTo)==null||a.call(i,{[r.options.horizontal?`left`:`top`]:o,behavior:n})},Ne=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var e;return((e=this.targetWindow?.performance)?.now)?.call(e)??Date.now()},this.observer=(()=>{let e=null,t=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{let t=()=>{let t=e.target,n=this.indexFromElement(t);if(!t.isConnected){this.observer.unobserve(t);return}this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}));return{disconnect:()=>{var n;(n=t())==null||n.disconnect(),e=null},observe:e=>t()?.observe(e,{box:`border-box`}),unobserve:e=>t()?.unobserve(e)}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([t,n])=>{n===void 0&&delete e[t]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Te,rangeExtractor:Ee,onChange:()=>{},measureElement:je,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...e}},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=w(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}this.scrollElement=e,this.scrollElement&&`ownerDocument`in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{this.scrollAdjustments=0,this.scrollDirection=t?this.getScrollOffset()<e?`forward`:`backward`:null,this.scrollOffset=e,this.isScrolling=t,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,t)=>{let n=new Map,r=new Map;for(let i=t-1;i>=0;i--){let t=e[i];if(n.has(t.lane))continue;let a=r.get(t.lane);if(a==null||t.end>a.end?r.set(t.lane,t):t.end<a.end&&n.set(t.lane,!0),n.size===this.options.lanes)break}return r.size===this.options.lanes?Array.from(r.values()).sort((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end)[0]:void 0},this.getMeasurementOptions=w(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(e,t,n,r,i,a)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a}),{key:!1}),this.getMeasurements=w(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a},o)=>{if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let s=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1);let c=this.measurementsCache.slice(0,s),l=Array(a).fill(void 0);for(let e=0;e<s;e++){let t=c[e];t&&(l[t.lane]=e)}for(let i=s;i<e;i++){let e=r(i),a=this.laneAssignments.get(i),s,u;if(a!==void 0&&this.options.lanes>1){s=a;let e=l[s],r=e===void 0?void 0:c[e];u=r?r.end+this.options.gap:t+n}else{let e=this.options.lanes===1?c[i-1]:this.getFurthestMeasurement(c,i);u=e?e.end+this.options.gap:t+n,s=e?e.lane:i%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(i,s)}let d=o.get(e),f=typeof d==`number`?d:this.options.estimateSize(i),p=u+f;c[i]={index:i,start:u,size:f,end:p,key:e,lane:s},l[s]=i}return this.measurementsCache=c,c},{key:!1,debug:()=>this.options.debug}),this.calculateRange=w(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>this.range=e.length>0&&t>0?Fe({measurements:e,outerSize:t,scrollOffset:n,lanes:r}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=w(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,r,i)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{if(!this.scrollState||this.scrollState.behavior!==`smooth`)return!0;let t=this.scrollState.index??this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;if(t!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,t-n),i=Math.min(this.options.count-1,t+n);return e>=r&&e<=i}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}let t=this.indexFromElement(e),n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{let n=this.measurementsCache[e];if(!n)return;let r=t-(this.itemSizeCache.get(n.key)??n.size);r!==0&&(this.scrollState?.behavior!==`smooth`&&(this.shouldAdjustScrollPositionOnItemSizeChange===void 0?n.start<this.getScrollOffset()+this.scrollAdjustments:this.shouldAdjustScrollPositionOnItemSizeChange(n,r,this))&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=r,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(n.index),this.itemSizeCache=new Map(this.itemSizeCache.set(n.key,t)),this.notify(!1))},this.getVirtualItems=w(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{let n=[];for(let r=0,i=e.length;r<i;r++){let i=t[e[r]];n.push(i)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length!==0)return xe(t[Pe(0,t.length-1,e=>xe(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if(`scrollHeight`in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getSize(),r=this.getScrollOffset(),i=this.measurementsCache[e];if(!i)return;if(t===`auto`)if(i.end>=r+n-this.options.scrollPaddingEnd)t=`end`;else if(i.start<=r+this.options.scrollPaddingStart)t=`start`;else return[r,t];if(t===`end`&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];let a=t===`end`?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,i.size),t]},this.scrollToOffset=(e,{align:t=`start`,behavior:n=`auto`}={})=>{let r=this.getOffsetForAlignment(e,t);this.scrollState={index:null,align:t,behavior:n,startedAt:this.now(),lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t=`auto`,behavior:n=`auto`}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r,o=this.now();this.scrollState={index:e,align:a,behavior:n,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t=`auto`}={})=>{let n=this.getScrollOffset()+e;this.scrollState={index:null,align:`start`,behavior:t,startedAt:this.now(),lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1)t=e[e.length-1]?.end??0;else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(e)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId??=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()})}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let e=this.scrollState.index==null?void 0:this.getOffsetForIndex(this.scrollState.index,this.scrollState.align),t=e?e[0]:this.scrollState.lastTargetOffset,n=t!==this.scrollState.lastTargetOffset;if(!n&&Se(t,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1){this.scrollState=null;return}}else this.scrollState.stableFrames=0,n&&(this.scrollState.lastTargetOffset=t,this.scrollState.behavior=`auto`,this._scrollToOffset(t,{adjustments:void 0,behavior:`auto`}));this.scheduleScrollReconcile()}},Pe=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else if(a>r)t=i-1;else return i}return e>0?e-1:0};function Fe({measurements:e,outerSize:t,scrollOffset:n,lanes:r}){let i=e.length-1,a=t=>e[t].start;if(e.length<=r)return{startIndex:0,endIndex:i};let o=Pe(0,i,a,n),s=o;if(r===1)for(;s<i&&e[s].end<n+t;)s++;else if(r>1){let a=Array(r).fill(0);for(;s<i&&a.some(e=>e<n+t);){let t=e[s];a[t.lane]=t.end,s++}let c=Array(r).fill(n+t);for(;o>=0&&c.some(e=>e>=n);){let t=e[o];c[t.lane]=t.start,o--}o=Math.max(0,o-o%r),s=Math.min(i,s+(r-1-s%r))}return{startIndex:o,endIndex:s}}var T=80,Ie=5,Le=80;function Re(e){let t=Math.ceil(e.getBoundingClientRect().height);return Number.isFinite(t)&&t>0?t:0}function ze(e,t,n){if(!e[t])return;let r=Re(n);r>0&&(e[t].height=r)}function Be(e,t,n){if(n)for(let[r,i]of t)ze(e,r,i),n.measureElement(i)}var Ve=class{items=[];container;innerEl;_active=!1;virtualizer=null;cleanupFn=null;mounted=new Map;itemGap=0;onLazyRender=null;onPostRender=null;constructor(e){this.container=document.getElementById(e),this.innerEl=document.createElement(`div`),this.innerEl.className=`vs-inner`}get active(){return this._active}get count(){return this.items.length}measureGap(){if(this.itemGap>0)return this.itemGap;let e=document.createElement(`div`);return e.className=`msg`,e.style.position=`absolute`,e.style.visibility=`hidden`,e.textContent=` `,this.innerEl.appendChild(e),this.itemGap=parseFloat(getComputedStyle(e).marginBottom)||0,e.remove(),this.itemGap}invalidateLayout(){if(!this.virtualizer)return;this.itemGap=0;let e=this.measureGap();this.virtualizer.setOptions({...this.virtualizer.options,gap:e}),this.virtualizer.measure(),Be(this.items,this.mounted,this.virtualizer),this.renderItems()}setItems(e,t){this.items=e,t?.autoActivate!==!1&&!this._active&&this.items.length>=1&&this.activate(t?.toBottom??!0)}seedMeasuredHeights(e,t){for(let n=0;n<t.length;n++){let r=e+n;this.items[r]&&(this.items[r].height=t[n])}}activateIfNeeded(e=!1){!this._active&&this.items.length>=1&&this.activate(e)}addItem(e,t){let n={id:e,html:t,height:T};if(this.items.push(n),!this._active&&this.items.length>=1){this.activate(!0);return}this._active&&this.virtualizer&&this.virtualizer.setOptions({...this.virtualizer.options,count:this.items.length})}appendLiveItem(e){if(!this._active)return;let t=e.outerHTML,n=g();this.items.push({id:n,html:t,height:T}),this.virtualizer&&this.virtualizer.setOptions({...this.virtualizer.options,count:this.items.length})}updateItemHtml(e,t){this.items[e]&&(this.items[e].html=t)}scrollToBottom(){this._active&&this.virtualizer&&this.items.length>0&&this.virtualizer.scrollToIndex(this.items.length-1,{align:`end`}),this.container.scrollTop=this.container.scrollHeight}isNearBottom(e=Le){return this.container.scrollHeight-this.container.scrollTop-this.container.clientHeight<e}reconcileBottomAfterLayout(e,t=this.isNearBottom()){t&&requestAnimationFrame(()=>{this.invalidateLayout(),requestAnimationFrame(()=>{this.scrollToBottom()})})}flushToDOM(){this._active&&(this.deactivate(),this.container.innerHTML=this.items.map(e=>e.html).join(``),this.items=[])}clear(){this.deactivate(),this.items=[],this.itemGap=0,this.onLazyRender=null,this.onPostRender=null}activate(e=!1){this._active=!0,this.container.querySelectorAll(`.msg`).forEach((e,t)=>{this.items[t]&&(this.items[t].height=e.getBoundingClientRect().height)}),this.container.classList.add(`vs-active`),this.container.replaceChildren(this.innerEl),this.measureGap(),this.virtualizer=new Ne({count:this.items.length,getScrollElement:()=>this.container,estimateSize:e=>this.items[e]?.height??T,overscan:Ie,gap:this.itemGap,useAnimationFrameWithResizeObserver:!0,onChange:()=>this.renderItems(),observeElementRect:De,observeElementOffset:Ae,scrollToFn:Me,getItemKey:e=>this.items[e]?.id??e,indexAttribute:`data-vs-idx`});let t=[],n=this.virtualizer._didMount();n&&t.push(n);let r=0,i=()=>{cancelAnimationFrame(r),r=requestAnimationFrame(()=>{this.invalidateLayout()})},a=()=>i();if(window.addEventListener(`resize`,a),t.push(()=>{window.removeEventListener(`resize`,a),cancelAnimationFrame(r)}),typeof ResizeObserver<`u`){let e=this.container.clientWidth,n=this.container.clientHeight,r=new ResizeObserver(t=>{let r=t[0]?.contentRect;if(!r)return;let a=Math.round(r.width),o=Math.round(r.height);a===e&&o===n||(e=a,n=o,i())});r.observe(this.container),t.push(()=>r.disconnect())}let o=e=>{if(!this.virtualizer)return;let t=this.isNearBottom();this.reconcileBottomAfterLayout(e,t)},s=e=>{e.persisted&&o(`pageshow`)};window.addEventListener(`pageshow`,s);let c=()=>{document.visibilityState===`visible`&&o(`visibility`)};document.addEventListener(`visibilitychange`,c);let l=()=>o(`focus`);window.addEventListener(`focus`,l),this.cleanupFn=()=>{window.removeEventListener(`pageshow`,s),document.removeEventListener(`visibilitychange`,c),window.removeEventListener(`focus`,l);for(let e of t.reverse())e()},this.virtualizer._willUpdate(),e&&this.items.length>0?(this.container.style.opacity=`0`,this.renderItems(),this.virtualizer.scrollToIndex(this.items.length-1,{align:`end`}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{this.container.style.opacity=``})})):this.renderItems()}deactivate(){this.cleanupFn&&=(this.cleanupFn(),null),this.virtualizer=null,this._active=!1,this.mounted.clear(),this.container.classList.remove(`vs-active`),this.container.innerHTML=``}renderItems(){if(!this.virtualizer)return;this.virtualizer._willUpdate();let e=this.virtualizer.getVirtualItems(),t=this.virtualizer.getTotalSize();this.innerEl.style.height=`${t}px`;let n=new Set(e.map(e=>e.index));for(let[e,t]of this.mounted)n.has(e)||(t.remove(),this.mounted.delete(e));let r=[];for(let t of e){let e=this.mounted.get(t.index);if(!e){let n=this.items[t.index];if(!n)continue;let i=document.createElement(`div`);if(i.innerHTML=n.html,e=i.firstElementChild,!e)continue;e.dataset.vsIdx=String(t.index),this.innerEl.appendChild(e),this.mounted.set(t.index,e),r.push(e)}e.style.transform=`translateY(${t.start}px)`}if(this.onLazyRender){let e=this.innerEl.querySelectorAll(`.lazy-pending`);e.length>0&&this.onLazyRender(Array.from(e))}this.onPostRender&&this.onPostRender(this.innerEl);for(let e of r){let t=Number(e.dataset.vsIdx||`-1`);ze(this.items,t,e),this.virtualizer.measureElement(e)}}},He=null;function E(){return He||=new Ve(`chatMessages`),He}function Ue(e,t){t.registerCallbacks(),t.setItems(e,{autoActivate:!1}),t.activateIfNeeded(!0),t.scrollToBottom()}var We=2e3,Ge=80;function Ke(e){return{chunks:[],fullText:``,textDirty:!1,element:e,pendingRAF:null,isFinalized:!1,lastRenderTime:0}}function qe(e,t=``){let n=Ke(e);return t?(n.chunks=[t],n.fullText=t,n.textDirty=!1,n.element.innerHTML=a(t,!0)+`<span class="stream-cursor" aria-hidden="true"></span>`):n.element.innerHTML=`<span class="stream-cursor" aria-hidden="true"></span>`,n}function D(e){return e.textDirty&&=(e.fullText=e.chunks.join(``),!1),e.fullText}function Je(e,t){e.chunks.push(t),e.textDirty=!0,!e.pendingRAF&&!e.isFinalized&&(e.pendingRAF=requestAnimationFrame(()=>{if(e.pendingRAF=null,e.isFinalized)return;let t=performance.now(),n=D(e);n.length<We||t-e.lastRenderTime>Ge?(e.element.innerHTML=a(n,!0)+`<span class="stream-cursor" aria-hidden="true"></span>`,e.lastRenderTime=t):e.pendingRAF=requestAnimationFrame(()=>{e.pendingRAF=null,!e.isFinalized&&(e.element.innerHTML=a(D(e),!0)+`<span class="stream-cursor" aria-hidden="true"></span>`,e.lastRenderTime=performance.now())})}))}function Ye(e,t=!1){e.isFinalized=!0,e.pendingRAF&&=(cancelAnimationFrame(e.pendingRAF),null);let n=D(e);return t||(e.element.innerHTML=a(n)),n}var Xe=[`cdnjs.cloudflare.com`,`cdn.jsdelivr.net`,`unpkg.com`,`esm.sh`,`fonts.googleapis.com`,`fonts.gstatic.com`],Ze=[/\beval\s*\(/,/\bnew\s+Function\s*\(/,/\bdocument\.cookie\b/,/\bwindow\.opener\b/,/\bwindow\.top\b/,/\bparent\.postMessage\b(?!.*jaw-)/,/\blocation\.href\s*=/,/\bwindow\.location\b/,/\bsetTimeout\s*\(\s*["'`]/,/\bsetInterval\s*\(\s*["'`]/,/\.constructor\s*\.\s*constructor/,/\bdocument\.write\s*\(/,/\binsertAdjacentHTML\s*\(/,/\bimport\s*\(/],Qe=[];function $e(e){let t=[];if(e.length>524288)return{valid:!1,reason:`Payload too large (>512KB)`,warnings:t};let n=/(?:src|href)\s*=\s*["']https?:\/\/([^/"']+)/gi,r;for(;(r=n.exec(e))!==null;){let e=r[1];if(!Xe.some(t=>e===t||e.endsWith(`.`+t)))return{valid:!1,reason:`Blocked domain: ${e}`,warnings:t}}let i=/url\s*\(\s*['"]?https?:\/\/([^)'"]+)/gi;for(;(r=i.exec(e))!==null;){let e=r[1].split(`/`)[0];Xe.some(t=>e===t||e.endsWith(`.`+t))||t.push(`CSS url() references external domain: ${e}`)}for(let n of Ze)if(n.test(e))return{valid:!1,reason:`Dangerous pattern: ${n.source}`,warnings:t};for(let n of Qe)n.test(e)&&t.push(`DOM sink detected: ${n.source}`);return{valid:!0,warnings:t}}function et(){let e=document.createElement(`button`);return e.className=`diagram-copy-btn`,e.type=`button`,e.ariaLabel=`Copy source`,e.title=`Copy`,e.innerHTML=c.copy,e}function tt(){let e=document.createElement(`button`);return e.className=`diagram-save-btn`,e.type=`button`,e.ariaLabel=`Save as image`,e.title=`Save`,e.innerHTML=c.download,e}var nt=[`cdnjs.cloudflare.com`,`cdn.jsdelivr.net`,`unpkg.com`,`esm.sh`,`fonts.googleapis.com`,`fonts.gstatic.com`],O=new Set,k=new Map,A=null;function rt(){if(A)return;let e=document.getElementById(`chatMessages`);e&&(A=new MutationObserver(e=>{if(O.size)for(let t of e)for(let e of t.removedNodes)e instanceof HTMLIFrameElement&&e.contentWindow&&(O.delete(e.contentWindow),k.delete(e.contentWindow)),e instanceof HTMLElement&&e.querySelectorAll(`iframe`).forEach(e=>{e.contentWindow&&(O.delete(e.contentWindow),k.delete(e.contentWindow))})}),A.observe(e,{childList:!0,subtree:!0}))}function it(e){if(e.includes(`"importmap"`)||e.includes(`'importmap'`))return``;let t={},n=e.match(/(?:cdn\.jsdelivr\.net\/npm|unpkg\.com)\/three@([\d.]+)/);if(n){let r=n[1],i=e.includes(`unpkg.com/three@`)?`unpkg.com`:`cdn.jsdelivr.net/npm`;t.three=`https://${i}/three@${r}/${i===`unpkg.com`?`build/three.module.js`:`build/three.module.min.js`}`,t[`three/addons/`]=`https://${i}/three@${r}/examples/jsm/`}return Object.keys(t).length===0?``:`<script type="importmap">${JSON.stringify({imports:t})}<\/script>`}function at(e){let t=`'none'`;(e.includes(`cdn.jsdelivr.net/npm/us-atlas`)||e.includes(`cdn.jsdelivr.net/npm/world-atlas`)||e.includes(`cdn.jsdelivr.net/npm/datamaps`))&&(t=`https://cdn.jsdelivr.net`);let n=/Tone(\.min)?\.js|tone@/.test(e)?`worker-src blob:;`:``,r=nt.map(e=>`https://${e}`),i=r.join(` `),a=[`data:`,`blob:`,...r],o=[`'unsafe-inline'`,`https://fonts.googleapis.com`];/L\.(map|tileLayer|marker|geoJSON|polyline|polygon|circle)\(|leaflet[\w.@/-]*\.(js|css)|tile\.openstreetmap\.org/.test(e)&&(a.push(`https://a.tile.openstreetmap.org`,`https://b.tile.openstreetmap.org`,`https://c.tile.openstreetmap.org`),o.push(`https://cdnjs.cloudflare.com`,`https://cdn.jsdelivr.net`));let s=a.join(` `);return`<meta http-equiv="Content-Security-Policy" content="default-src 'none'; script-src 'unsafe-inline' ${i}; style-src ${o.join(` `)}; img-src ${s}; font-src https://fonts.gstatic.com; connect-src ${t}; ${n} base-uri 'none';">`}function ot(){let e=!document.documentElement.hasAttribute(`data-theme`)||document.documentElement.getAttribute(`data-theme`)===`dark`,t=getComputedStyle(document.documentElement);return{isDark:e,tokens:{"--bg":t.getPropertyValue(`--bg`).trim(),"--surface":t.getPropertyValue(`--surface`).trim(),"--border":t.getPropertyValue(`--border`).trim(),"--text":t.getPropertyValue(`--text`).trim(),"--text-dim":t.getPropertyValue(`--text-dim`).trim(),"--accent":t.getPropertyValue(`--accent`).trim(),"--font-ui":t.getPropertyValue(`--font-ui`).trim(),"--font-mono":t.getPropertyValue(`--font-mono`).trim(),"--radius-sm":t.getPropertyValue(`--radius-sm`).trim(),"--radius-md":t.getPropertyValue(`--radius-md`).trim()}}}function st(e){return`
|
|
6
|
+
<script>
|
|
7
|
+
(function() {
|
|
8
|
+
var __nonce = '${e}';
|
|
9
|
+
|
|
10
|
+
window.addEventListener('message', function(e) {
|
|
11
|
+
if (e.source !== window.parent) return;
|
|
12
|
+
if (!e.data || typeof e.data !== 'object') return;
|
|
13
|
+
|
|
14
|
+
if (e.data.type === 'jaw-theme-update') {
|
|
15
|
+
window.__jawTheme = { isDark: !!e.data.isDark };
|
|
16
|
+
window.__jawTokens = e.data.tokens || {};
|
|
17
|
+
window.dispatchEvent(new CustomEvent('jaw-theme-change', { detail: window.__jawTheme }));
|
|
18
|
+
}
|
|
19
|
+
if (e.data.type === 'jaw-request-resize') {
|
|
20
|
+
postHeight();
|
|
21
|
+
}
|
|
22
|
+
if (e.data.type === 'jaw-request-screenshot') {
|
|
23
|
+
var canvas = document.querySelector('canvas');
|
|
24
|
+
if (canvas) {
|
|
25
|
+
try {
|
|
26
|
+
var dataUrl = canvas.toDataURL('image/png');
|
|
27
|
+
window.parent.postMessage({ type: 'jaw-screenshot', dataUrl: dataUrl, nonce: __nonce }, '*');
|
|
28
|
+
} catch(ex) { /* tainted canvas or other error */ }
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
function postHeight() {
|
|
34
|
+
var h = Math.max(
|
|
35
|
+
document.body.scrollHeight,
|
|
36
|
+
document.body.offsetHeight,
|
|
37
|
+
document.documentElement.scrollHeight
|
|
38
|
+
);
|
|
39
|
+
window.parent.postMessage({ type: 'jaw-diagram-resize', height: h, nonce: __nonce }, '*');
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (typeof ResizeObserver !== 'undefined') {
|
|
43
|
+
var ro = new ResizeObserver(function() {
|
|
44
|
+
clearTimeout(ro._t);
|
|
45
|
+
ro._t = setTimeout(postHeight, 50);
|
|
46
|
+
});
|
|
47
|
+
ro.observe(document.body);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
window.addEventListener('load', function() {
|
|
51
|
+
postHeight();
|
|
52
|
+
// Deferred re-measure for async chart renders (Chart.js animation, CDN loading)
|
|
53
|
+
setTimeout(postHeight, 200);
|
|
54
|
+
setTimeout(postHeight, 800);
|
|
55
|
+
window.parent.postMessage({ type: 'jaw-widget-ready', nonce: __nonce }, '*');
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
var lastSend = 0;
|
|
59
|
+
window.sendPrompt = function(text) {
|
|
60
|
+
var now = Date.now();
|
|
61
|
+
if (now - lastSend < 3000) return;
|
|
62
|
+
lastSend = now;
|
|
63
|
+
window.parent.postMessage({ type: 'jaw-send-prompt', text: String(text).slice(0, 500), nonce: __nonce }, '*');
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
// Ctrl+C / Cmd+C: forward selected text to host for clipboard access
|
|
67
|
+
document.addEventListener('copy', function() {
|
|
68
|
+
var sel = window.getSelection();
|
|
69
|
+
if (sel && sel.toString().trim()) {
|
|
70
|
+
window.parent.postMessage({
|
|
71
|
+
type: 'jaw-copy-text',
|
|
72
|
+
text: sel.toString().slice(0, 512),
|
|
73
|
+
nonce: __nonce
|
|
74
|
+
}, '*');
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
})();
|
|
78
|
+
<\/script>`}var ct=[[/\/p5\.js\/1\.11\.1[1-9]\//g,`/p5.js/1.11.10/`]];function lt(e){for(let[t,n]of ct)e=e.replace(t,n);return e}function ut(e){rt(),dt(),e=lt(e);let t=Array.from(crypto.getRandomValues(new Uint8Array(16)),e=>e.toString(16).padStart(2,`0`)).join(``),n=ot(),r=at(e),i=it(e),a=st(t),o=`<!DOCTYPE html>
|
|
79
|
+
<html>
|
|
80
|
+
<head>
|
|
81
|
+
<meta charset="utf-8">
|
|
82
|
+
${r}
|
|
83
|
+
${i}
|
|
84
|
+
<style>
|
|
85
|
+
:root { ${Object.entries(n.tokens).map(([e,t])=>`${e}: ${t};`).join(`
|
|
86
|
+
`)} }
|
|
87
|
+
* { margin: 0; box-sizing: border-box; }
|
|
88
|
+
body {
|
|
89
|
+
font-family: var(--font-ui), system-ui, sans-serif;
|
|
90
|
+
color: var(--text);
|
|
91
|
+
background: transparent;
|
|
92
|
+
padding: 16px;
|
|
93
|
+
overflow: hidden;
|
|
94
|
+
}
|
|
95
|
+
</style>
|
|
96
|
+
</head>
|
|
97
|
+
<body>
|
|
98
|
+
<script>
|
|
99
|
+
window.__jawTheme = ${JSON.stringify({isDark:n.isDark})};
|
|
100
|
+
window.__jawTokens = ${JSON.stringify(n.tokens).replace(/<\//g,`<\\/`)};
|
|
101
|
+
<\/script>
|
|
102
|
+
${a}
|
|
103
|
+
${e}
|
|
104
|
+
</body>
|
|
105
|
+
</html>`,s=document.createElement(`iframe`);return s.sandbox.add(`allow-scripts`),s.srcdoc=o,s.style.cssText=`width: 100%; min-height: 200px; border: none; overflow: hidden; display: block;`,s.setAttribute(`aria-label`,`Interactive diagram widget`),{iframe:s,nonce:t}}function j(e){(e||document).querySelectorAll(`.diagram-widget-pending`).forEach(e=>{let t=e.dataset.diagramHtml;if(!t)return;let n;try{if(t.length>524288)throw Error(`Widget payload too large`);n=decodeURIComponent(escape(atob(t)))}catch{e.replaceWith(Object.assign(document.createElement(`div`),{className:`diagram-error`,textContent:`Failed to decode widget content`,role:`alert`}));return}let r=$e(n);if(!r.valid){e.replaceWith(Object.assign(document.createElement(`div`),{className:`diagram-error`,textContent:`Widget blocked: ${r.reason}`,role:`alert`}));return}r.warnings.length&&console.warn(`[jaw-diagram] Widget warnings:`,r.warnings);let i=document.createElement(`div`);i.className=`diagram-container diagram-widget`,i.dataset.widgetHtml=t,i.appendChild(tt()),i.appendChild(et());let{iframe:a,nonce:o}=ut(n);i.appendChild(a),e.replaceWith(i);let s=!1;a.addEventListener(`load`,()=>{s?(a.contentWindow&&(O.delete(a.contentWindow),k.delete(a.contentWindow)),console.warn(`[jaw-diagram] iframe navigated — postMessage channel revoked`)):(s=!0,a.contentWindow&&(O.add(a.contentWindow),k.set(a.contentWindow,o),a.contentWindow.postMessage({type:`jaw-request-resize`},`*`),setTimeout(()=>a.contentWindow?.postMessage({type:`jaw-request-resize`},`*`),300),setTimeout(()=>a.contentWindow?.postMessage({type:`jaw-request-resize`},`*`),1e3)))});let c=Number(i.dataset.gen||`0`);i.dataset.gen=String(c);let l=!1,u=e=>{e.source===a.contentWindow&&e.data?.type===`jaw-widget-ready`&&e.data.nonce===o&&(l=!0,window.removeEventListener(`message`,u))};window.addEventListener(`message`,u),setTimeout(()=>{if(window.removeEventListener(`message`,u),Number(i.dataset.gen||`0`)===c&&!l&&i.isConnected){let e=a.contentWindow;e&&(O.delete(e),k.delete(e)),i.innerHTML=`<div class="diagram-error" role="alert">
|
|
106
|
+
Widget failed to load within 10 seconds.
|
|
107
|
+
</div>`,console.warn(`[jaw-diagram] Widget timeout — iframe deregistered`)}},1e4)})}var M=null;function dt(){if(M)return;let e=document.getElementById(`chatMessages`);e&&(M=new MutationObserver(t=>{for(let n of t)for(let t of n.addedNodes)if(t instanceof HTMLElement&&(t.classList?.contains(`diagram-widget-pending`)||t.querySelector?.(`.diagram-widget-pending`))){requestAnimationFrame(()=>j(t.parentElement||e));return}}),M.observe(e,{childList:!0}))}var N=new WeakMap;function ft(e,t){N.has(e)||(N.set(e,window.setTimeout(()=>N.delete(e),100)),document.querySelectorAll(`iframe`).forEach(n=>{n.contentWindow===e&&(n.style.height=`${Math.min(Math.max(t,60),2e3)}px`)}))}function pt(){document.querySelectorAll(`.diagram-widget`).forEach(e=>{let t=e.dataset.widgetHtml;if(!t)return;let n;try{n=decodeURIComponent(escape(atob(t)))}catch{return}let r=e.querySelector(`iframe`);r?.contentWindow&&(O.delete(r.contentWindow),k.delete(r.contentWindow));let i=e;i.dataset.gen=String((Number(i.dataset.gen||`0`)||0)+1);let{iframe:a,nonce:o}=ut(n);e.innerHTML=``,e.appendChild(tt()),e.appendChild(et()),e.appendChild(a);let s=!1;a.addEventListener(`load`,()=>{s?a.contentWindow&&(O.delete(a.contentWindow),k.delete(a.contentWindow)):(s=!0,a.contentWindow&&(O.add(a.contentWindow),k.set(a.contentWindow,o),a.contentWindow.postMessage({type:`jaw-request-resize`},`*`),setTimeout(()=>a.contentWindow?.postMessage({type:`jaw-request-resize`},`*`),300),setTimeout(()=>a.contentWindow?.postMessage({type:`jaw-request-resize`},`*`),1e3)))})})}var mt=0;window.addEventListener(`message`,e=>{if(!e.data||typeof e.data!=`object`||!e.source||e.origin!==`null`||!O.has(e.source)||![...document.querySelectorAll(`iframe`)].find(t=>t.contentWindow===e.source)?.isConnected)return;let t=k.get(e.source);if(!(!t||e.data.nonce!==t))switch(e.data.type){case`jaw-diagram-resize`:{let t=Number(e.data.height);if(!Number.isFinite(t)||t<0)return;ft(e.source,t);break}case`jaw-send-prompt`:{let t=Date.now();if(t-mt<3e3)return;mt=t;let n=String(e.data.text||``).trim().slice(0,500);if(!n)return;let r=document.getElementById(`chatInput`);r&&(r.value=n,r.dispatchEvent(new Event(`input`,{bubbles:!0})),r.focus());break}case`jaw-copy-text`:{let t=String(e.data.text||``).trim().slice(0,512);if(!t)return;navigator.clipboard.writeText(t).catch(()=>{});break}case`jaw-screenshot`:{let t=String(e.data.dataUrl||``);if(!t.startsWith(`data:image/`)||t.length>5242880)return;fetch(t).then(e=>e.blob()).then(e=>{let t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`widget-${Date.now()}.png`,n.click(),setTimeout(()=>URL.revokeObjectURL(t),1e3)}).catch(()=>{});break}case`jaw-widget-ready`:break}});function ht(e){e.dataset.toolItemBound!==`1`&&(e.addEventListener(`click`,e=>{let t=e.target;if(!t)return;let n=t.closest(`.tool-item-toggle`);if(!n)return;let r=n.closest(`.tool-item`),i=r?.querySelector(`.tool-item-details`),a=n.querySelector(`.tool-item-chevron`);if(!r||!i)return;let o=i.classList.contains(`collapsed`);i.classList.toggle(`collapsed`,!o),r.classList.toggle(`expanded`,o),n.setAttribute(`aria-expanded`,o?`true`:`false`),a&&(a.innerHTML=o?c.chevronDown:c.chevronRight)}),e.dataset.toolItemBound=`1`)}function P(){document.querySelectorAll(`.tool-activity-live`).forEach(e=>e.remove()),document.querySelectorAll(`.msg-system.tool-activity`).forEach(e=>e.remove())}function gt(e){let t={};for(let n of e){let e=n.type===`thinking`?`${c.thinking} Thinking`:n.type===`search`?`${c.search} Search`:n.type===`subagent`?`${c.robot} Subagent`:`${c.tool} Tool`;t[e]=(t[e]||0)+1}return Object.entries(t).map(([e,t])=>t>1?`${e}×${t}`:e).join(` + `)}function _t(e,t=120){let n=e.replace(/\s+/g,` `).trim();return n?n.length>t?`${n.slice(0,t-1)}…`:n:``}function vt(e){let t=e||c.tool;return t.trim().startsWith(`<svg`)?t:l(t)}function F(e){let t=`process-step-dot ${e.status}`,n=`process-step-badge ${e.type}`,r=e.type.toUpperCase(),i=l(e.label||e.icon||``),a=vt(e.icon),o=e.detail||``,s=`process-detail-${e.id}`,u=_t(o,e.type===`thinking`?120:80),d=u?`<span class="process-step-snippet">${l(u)}</span>`:``;return`<div class="process-step process-step-expandable" data-step-id="${e.id}" data-type="${e.type}">
|
|
108
|
+
<button class="process-step-toggle" aria-expanded="false" aria-controls="${s}">
|
|
109
|
+
<span class="${t}"></span>
|
|
110
|
+
<span class="process-step-icon" aria-hidden="true">${a}</span>
|
|
111
|
+
<span class="${n}">${r}</span>
|
|
112
|
+
<span class="process-step-main">
|
|
113
|
+
<span class="process-step-label">${i}</span>
|
|
114
|
+
${d}
|
|
115
|
+
</span>
|
|
116
|
+
<span class="process-step-chevron">${c.chevronRight}</span>
|
|
117
|
+
</button>
|
|
118
|
+
<div class="process-step-details collapsed" id="${s}">
|
|
119
|
+
<pre class="process-step-full">${l(o)}</pre>
|
|
120
|
+
</div>
|
|
121
|
+
</div>`}function yt(e=``,t=!1){return`<div class="process-block${t?` collapsed`:``}">
|
|
122
|
+
<button class="process-summary" aria-expanded="${t?`false`:`true`}">
|
|
123
|
+
<span class="process-dot ${t?`done`:`running`}"></span>
|
|
124
|
+
<span class="process-summary-text">${e}</span>
|
|
125
|
+
<span class="process-duration"></span>
|
|
126
|
+
<span class="process-chevron">${t?c.chevronRight:c.chevronDown}</span>
|
|
127
|
+
</button>
|
|
128
|
+
<div class="process-details">
|
|
129
|
+
<div class="process-steps-inner"></div>
|
|
130
|
+
</div>
|
|
131
|
+
</div>`}function bt(e){let t=e.closest(`.process-step`),n=t?.querySelector(`.process-step-details`),r=e.querySelector(`.process-step-chevron`);if(!t||!n)return;let i=n.classList.contains(`collapsed`);n.classList.toggle(`collapsed`,!i),t.classList.toggle(`expanded`,i),e.setAttribute(`aria-expanded`,i?`true`:`false`),r&&(r.innerHTML=i?c.chevronDown:c.chevronRight)}function xt(e){e.dataset.processBlockBound!==`1`&&(e.addEventListener(`click`,e=>{let t=e.target;if(!t)return;let n=t.closest(`.process-step-toggle`);if(n){bt(n);return}let r=t.closest(`.process-summary`);if(r){let e=r.closest(`.process-block`);if(!e)return;let t=e.classList.contains(`collapsed`);e.classList.toggle(`collapsed`,!t),r.setAttribute(`aria-expanded`,t?`true`:`false`);let n=r.querySelector(`.process-chevron`);n&&(n.innerHTML=t?c.chevronDown:c.chevronRight)}}),e.dataset.processBlockBound=`1`)}function I(e,t=!0){let n=yt(gt(e),t),r=document.createElement(`div`);r.innerHTML=n;let i=r.querySelector(`.process-steps-inner`);i&&(i.innerHTML=e.map(F).join(``));let a=r.querySelector(`.process-dot`);if(a){let n=e.some(e=>e.status===`running`);a.classList.toggle(`running`,n&&!t),a.classList.toggle(`done`,!n||t)}return r.innerHTML}function L(e){let t=e.element.querySelector(`.process-summary-text`);t&&(t.innerHTML=gt(e.steps));let n=e.steps.some(e=>e.status===`running`),r=e.element.querySelector(`.process-dot`);r&&(r.classList.toggle(`running`,n&&!e.collapsed),r.classList.toggle(`done`,!n||e.collapsed));let i=e.steps.length>0?Math.round((Date.now()-e.steps[0].startTime)/1e3):0,a=e.element.querySelector(`.process-duration`);a&&(a.textContent=i>0?`${i}s`:``)}function R(e){let t=document.createElement(`div`);t.innerHTML=yt(``,!1);let n=t.firstElementChild,r=e.querySelector(`.msg-content`);return r?r.before(n):e.appendChild(n),{element:n,steps:[],collapsed:!1}}function z(e,t){e.steps.push(t);let n=e.element.querySelector(`.process-steps-inner`);n&&n.insertAdjacentHTML(`beforeend`,F(t)),L(e)}function B(e,t,n){let r=e.steps.findIndex(e=>e.id===t);if(r===-1)return;e.steps[r]=n;let i=e.element.querySelector(`[data-step-id="${t}"]`);if(i){let e=document.createElement(`div`);e.innerHTML=F(n);let t=e.firstElementChild;t&&i.replaceWith(t)}L(e)}function St(e,t,n){let r=e.steps.find(e=>e.id===t);if(!r)return;r.status=n;let i=e.element.querySelector(`[data-step-id="${t}"]`);if(i){let e=i.querySelector(`.process-step-dot`);e&&(e.classList.remove(`running`,`done`,`error`),e.classList.add(n))}L(e)}function V(e){e.collapsed=!0,e.element.classList.add(`collapsed`);let t=e.element.querySelector(`.process-summary`);t&&t.setAttribute(`aria-expanded`,`false`);let n=e.element.querySelector(`.process-chevron`);n&&(n.innerHTML=c.chevronRight);for(let t of e.steps)t.status===`running`&&(t.status=`done`);e.element.querySelectorAll(`.process-step-dot.running`).forEach(e=>{e.classList.remove(`running`),e.classList.add(`done`)}),L(e)}function Ct(e){return e===`thinking`||e===`search`||e===`subagent`?e:`tool`}function H(e){if(!e)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}function wt(e){return ve()}function U(e){return e.map(e=>({id:g(),icon:e.icon?f(e.icon):c.tool,rawIcon:e.rawIcon||e.icon||``,label:e.label||e.name||`tool`,type:Ct(e.toolType),detail:e.detail||``,stepRef:e.stepRef||``,status:e.status||`done`,startTime:Date.now()}))}function Tt(t){let n=document.getElementById(`statusBadge`),r=document.getElementById(`btnSend`);e.agentBusy=t===`running`,document.getElementById(`typingIndicator`)?.classList.toggle(`active`,e.agentBusy),t===`running`?(n&&(n.className=`status-badge status-running`,n.textContent=`running`),r&&(r.innerHTML=c.stop,r.title=i(`btn.stop`),r.classList.add(`stop-mode`)),Dt()):(n&&(n.className=`status-badge status-idle`,n.textContent=`idle`),r&&(r.innerHTML=c.send,r.title=`Send`,r.classList.remove(`stop-mode`)),W())}function Et(e){let t=document.getElementById(`queueBadge`);if(!t){t=document.createElement(`span`),t.id=`queueBadge`,t.className=`queue-badge`;let e=document.getElementById(`btnSend`);e?.parentElement&&(e.parentElement.style.position=`relative`),e&&(e.style.position=`relative`,e.appendChild(t))}t.textContent=e>0?String(e):``,t.style.display=e>0?`flex`:`none`}function Dt(){let t=document.getElementById(`chatMessages`);if(!t||t.querySelector(`.skeleton-msg`)||e.currentAgentDiv&&e.currentAgentDiv.isConnected)return;G();let n=document.createElement(`div`);n.className=`skeleton-msg`,n.innerHTML=`<div class="skeleton-line"></div><div class="skeleton-line"></div><div class="skeleton-line"></div>`,t.appendChild(n),Q()}function W(){document.querySelectorAll(`.skeleton-msg`).forEach(e=>e.remove())}function G(){document.getElementById(`emptyState`)?.classList.remove(`visible`)}function K(){let e=document.getElementById(`chatMessages`);e&&e.children.length===0&&document.getElementById(`emptyState`)?.classList.add(`visible`)}function Ot(e,t,n){let r=document.getElementById(`chatMessages`);if(!r)return;let i=E();G();let a=document.createElement(`div`);a.className=`msg msg-system`+(n?` msg-type-${n}`:``)+(t?` `+t:``),a.innerHTML=e,i.active?i.appendLiveItem(a):r.appendChild(a),Q()}function kt(){P(),e.currentAgentDiv=null,e.currentProcessBlock=null,q=null}function At(t){if(W(),(!e.currentAgentDiv||!e.currentAgentDiv.isConnected)&&(e.currentAgentDiv=J(`agent`,``),e.currentProcessBlock=null),!e.currentProcessBlock){let t=e.currentAgentDiv.querySelector(`.agent-body`);t&&(e.currentProcessBlock=R(t))}if(e.currentProcessBlock){let n=t.rawIcon||t.icon,r=t.status&&t.status!==`running`?t.status:s(t.icon);if(r===`done`||r===`error`){let i=t.stepRef,a=i?[...e.currentProcessBlock.steps].reverse().find(e=>e.status===`running`&&e.stepRef===i):[...e.currentProcessBlock.steps].reverse().find(e=>e.status===`running`&&e.label===t.label);if(a){t.icon=f(t.icon);let i=t.detail?a.detail?`${a.detail}\n${t.detail}`:t.detail:a.detail;B(e.currentProcessBlock,a.id,{...a,...t,id:a.id,rawIcon:n,detail:i,label:t.label||a.label,status:r}),Q();return}if(!t.stepRef){let i=[...e.currentProcessBlock.steps].reverse().find(e=>e.status===`running`);if(i){t.detail&&!i.detail?(t.icon=f(t.icon),B(e.currentProcessBlock,i.id,{...t,id:i.id,rawIcon:n})):St(e.currentProcessBlock,i.id,r),Q();return}}if(t.stepRef&&(r===`done`||r===`error`)){let i=[...e.currentProcessBlock.steps].reverse().find(e=>e.stepRef===t.stepRef&&(e.status===`done`||e.status===`error`));if(i){t.icon=f(t.icon),B(e.currentProcessBlock,i.id,{...i,...t,id:i.id,rawIcon:n,status:r,detail:t.detail}),Q();return}}}if(t.detail){let n=[...e.currentProcessBlock.steps].reverse().find(e=>e.status===`running`&&e.label===t.label&&e.type===t.type&&!e.detail);if(n){B(e.currentProcessBlock,n.id,t),Q();return}}t.rawIcon=n,t.icon=f(t.icon),z(e.currentProcessBlock,t)}Q()}var q=null;function jt(e=[]){document.querySelectorAll(`[data-queued-overlay="true"]`).forEach(e=>e.remove())}function Mt(t){if(!t?.running)return;P(),W(),e.currentAgentDiv=J(`agent`,``,t.cli||null),e.currentProcessBlock=null;let n=e.currentAgentDiv.querySelector(`.agent-body`);if(n&&t.toolLog?.length){let r=R(n);for(let e of U(t.toolLog))z(r,e);e.currentProcessBlock=r}let r=e.currentAgentDiv.querySelector(`.msg-content`);r&&(q=qe(r,t.text||``))}function Nt(t){if(!t)return;W(),(!e.currentAgentDiv||!e.currentAgentDiv.isConnected)&&(e.currentAgentDiv=J(`agent`,``),q=null);let n=e.currentAgentDiv?.querySelector(`.msg-content`);n&&(q||=Ke(n),Je(q,t)),Q()}var Pt=0;function Ft(e){e.querySelectorAll(`.mermaid-pending`).forEach(e=>{delete e.dataset.mermaidQueued,delete e.dataset.mermaidQueuedAt})}function It(t,n){let r=Date.now();if(!e.currentAgentDiv&&r-Pt<500)return;P(),W();let i=!!e.currentProcessBlock;e.currentProcessBlock&&=(V(e.currentProcessBlock),null);let s=n&&n.length>0;if(t||s){(!e.currentAgentDiv||!e.currentAgentDiv.isConnected)&&(e.currentAgentDiv=J(`agent`,``));let r=e.currentAgentDiv?.querySelector(`.msg-content`),c=q?Ye(q,!0):``,l=t||c;q=null;let d=s&&!i?I(U(n),!0):``;r&&(r.innerHTML=d+a(l)),r&&r.setAttribute(`data-raw`,o(l)),r&&j(r);let f=E(),m=!!(f.active&&e.currentAgentDiv&&e.currentAgentDiv.isConnected);if(r&&!m&&u(r,{immediate:!0}),m){let t=e.currentAgentDiv;Ft(t),t.querySelectorAll(`.diagram-widget`).forEach(e=>{let t=e.dataset.widgetHtml;if(!t)return;let n=document.createElement(`div`);n.className=`diagram-widget-pending`,n.dataset.diagramHtml=t,e.replaceWith(n)}),f.appendLiveItem(t),t.remove()}l&&p({role:`assistant`,content:l,tool_log:n?JSON.stringify(n):null,timestamp:Date.now()}).catch(()=>{})}q=null,e.currentAgentDiv=null,Pt=Date.now(),Tt(`idle`),Wt()}function Lt(e){let t=e.match(/^\[(?:사용자가 파일 (\d+)개를 보냈습니다|User sent (\d+) files)\]/);if(t){let n=t[1]||t[2],r=e.match(/(?:사용자 메시지|User message): (.+)$/s);return`📎 [${n} files]${r?` `+r[1].trim():``}`}let n=e.match(/^\[(?:사용자가 파일을 보냈습니다|User sent a file): ([^\]]+)\]/);if(n){let t=n[1].split(`/`).pop()||n[1],r=e.match(/🎤\s*(.{0,80})/)?`🎤 [음성 메시지] `:``,i=e.match(/(?:사용자 메시지|User message): (.+)$/s);return`${r}📎 [${t}]${i?` `+i[1].trim():``}`}return e}function J(e,t,n){let r=document.getElementById(`chatMessages`),s=E();G(),W();let c=a(e===`user`?Lt(t):t),f=l(e===`user`?i(`msg.you`):ne()),p=document.createElement(`div`);e===`agent`?(p.className=`msg msg-agent`,p.innerHTML=`<div class="agent-icon" aria-hidden="true">${wt(n)}</div><div class="agent-body"><div class="msg-content">${c}</div><button class="msg-copy" title="Copy" aria-label="Copy message"></button></div>`):(p.className=`msg msg-${e}`,p.innerHTML=`<div class="user-body"><div class="msg-label">${f}</div><div class="msg-content">${c}</div><button class="msg-copy" title="Copy" aria-label="Copy message"></button></div><div class="user-icon" aria-hidden="true">${ye()}</div>`);let m=p.querySelector(`.msg-content`);m&&m.setAttribute(`data-raw`,o(t));let h=e===`agent`&&!t;return s.active&&!h?s.appendLiveItem(p):(r?.appendChild(p),j(p),!s.active&&!h&&r&&r.querySelectorAll(`.msg`).length>=1&&(r.querySelectorAll(`.msg`).forEach(e=>{s.addItem(g(),e.outerHTML)}),s.onPostRender=e=>{j(e),d(e),u(e,{immediate:!0})})),Q(e===`user`),p}var Rt=null,Y=!0,zt=!1,X=80;function Z(){if(zt)return;let e=document.getElementById(`chatMessages`);e&&(zt=!0,e.addEventListener(`scroll`,()=>{Y=e.scrollHeight-e.scrollTop-e.clientHeight<X},{passive:!0}))}function Bt(){Z();let e=document.getElementById(`chatMessages`);if(!e)return Y;let t=E();return t.active?t.isNearBottom(X):e.scrollHeight-e.scrollTop-e.clientHeight<X}function Vt(e=Bt()){if(Z(),!e)return;Y=!0;let t=E();if(t.active){t.reconcileBottomAfterLayout(`reconnect`,!0);return}requestAnimationFrame(()=>{requestAnimationFrame(()=>{let e=document.getElementById(`chatMessages`);e&&(e.scrollTop=e.scrollHeight)})})}function Q(e=!1){if(Z(),!e&&!Y)return;e&&(Y=!0);let t=E();if(t.active){t.scrollToBottom();return}Rt||=requestAnimationFrame(()=>{Rt=null;let e=document.getElementById(`chatMessages`);e&&(e.scrollTop=e.scrollHeight)})}function Ht(e,t){document.querySelectorAll(`.tab-btn`).forEach(e=>{e.classList.remove(`active`),e.setAttribute(`aria-selected`,`false`)}),document.querySelectorAll(`.tab-content`).forEach(e=>e.classList.remove(`active`)),document.getElementById({agents:`tabAgents`,settings:`tabSettings`,skills:`tabSkills`}[e])?.classList.add(`active`),t&&(t.classList.add(`active`),t.setAttribute(`aria-selected`,`true`)),e===`settings`&&r(()=>import(`./settings-COrhSfDh.js`).then(e=>e.loadSettings()),__vite__mapDeps([0])),e===`agents`&&r(()=>import(`./employees-Do9d6Xi5.js`).then(e=>e.loadEmployees()),__vite__mapDeps([0])),e===`skills`&&r(()=>import(`./skills-BO0V4aHG.js`).then(e=>e.loadSkills()),__vite__mapDeps([0]))}function Ut(){document.getElementById(`tabSettings`)?.classList.contains(`active`)?r(()=>import(`./settings-COrhSfDh.js`).then(e=>e.savePerCli()),__vite__mapDeps([0])):r(()=>import(`./settings-COrhSfDh.js`).then(e=>e.updateSettings()),__vite__mapDeps([0]))}function $(e){let t=document.getElementById(`statMsgs`);t&&(t.textContent=i(`stat.messages`,{count:e}))}async function Wt(){let e=await n(`/api/messages`);e&&$(e.length)}function Gt(e){return e.map(e=>{let t=e.role===`assistant`?`agent`:e.role,n=o(t===`user`?Lt(e.content):e.content),r=l(t===`user`?i(`msg.you`):ne()),s=e.role===`assistant`?H(e.tool_log):[],c=s.length>0?I(U(s),!0):``,u=n?a(n):``,d=t===`agent`?`<div class="msg msg-agent"><div class="agent-icon" aria-hidden="true">${wt(e.cli)}</div><div class="agent-body">${c}<div class="msg-content" data-raw="${l(n)}">${u}</div><button class="msg-copy" title="Copy" aria-label="Copy message"></button></div></div>`:`<div class="msg msg-${t}"><div class="user-body"><div class="msg-label">${r}</div><div class="msg-content" data-raw="${l(n)}">${u}</div><button class="msg-copy" title="Copy" aria-label="Copy message"></button></div><div class="user-icon" aria-hidden="true">${ye()}</div></div>`;return{id:g(),html:d,height:80}})}function Kt(e){e.onLazyRender=t=>{for(let n of t){if(!n.classList.contains(`lazy-pending`))continue;let t=n.getAttribute(`data-raw`)||``;n.innerHTML=t?a(t):``,n.classList.remove(`lazy-pending`),j(n),u(n,{immediate:!0});let r=n.closest(`[data-vs-idx]`);if(r){let t=Number(r.dataset.vsIdx);e.updateItemHtml(t,r.outerHTML)}}},e.onPostRender=e=>{j(e),d(e),u(e,{immediate:!0})}}function qt(e){return{registerCallbacks:()=>Kt(e),setItems:(t,n)=>e.setItems(t,n),activateIfNeeded:t=>e.activateIfNeeded(t),scrollToBottom:()=>e.scrollToBottom()}}async function Jt(){let e=E(),t=document.getElementById(`chatMessages`);try{let e=await n(`/api/settings`);e?.workingDir&&m(e.workingDir)}catch{}let r=await n(`/api/messages`);if(r!==null){e.clear(),t&&(t.innerHTML=``),r.length>=1?Ue(Gt(r),qt(e)):r.forEach(e=>{let t=J(e.role===`assistant`?`agent`:e.role,e.content,e.cli);if(e.role===`assistant`){let n=H(e.tool_log);if(n.length>0){let e=t.querySelector(`.agent-body`);if(e){let t=R(e);for(let e of U(n))z(t,e);V(t)}}}}),ee(r.map(e=>({role:e.role,content:e.content,cli:e.cli??null,tool_log:e.tool_log??null,timestamp:Date.now()}))).catch(()=>{}),$(r.length),K();return}if(t&&t.children.length>0){K();return}let i=await h();i.length>0&&(i.length>=1?Ue(Gt(i),qt(e)):i.forEach(e=>{let t=J(e.role===`assistant`?`agent`:e.role,e.content,e.cli);if(e.role===`assistant`&&e.tool_log){let n=H(e.tool_log);if(n.length>0){let e=t.querySelector(`.agent-body`);if(e){let t=R(e);for(let e of U(n))z(t,e);V(t)}}}}),Ot(`${c.warning} 오프라인 모드 — 캐시된 메시지 표시 중`),$(i.length)),K()}function Yt(){let e=document.getElementById(`chatMessages`);e&&(xt(e),ht(e),e.addEventListener(`click`,e=>{let t=e.target,n=t.closest(`.tool-group-summary`);if(n){let e=n.closest(`.tool-group`),t=n.nextElementSibling;if(e&&t){let r=!e.classList.contains(`expanded`);e.classList.toggle(`expanded`),t.classList.toggle(`collapsed`),n.setAttribute(`aria-expanded`,r?`true`:`false`)}return}let r=t.closest(`.msg-copy`);if(!r)return;let i=r.closest(`.msg`)?.querySelector(`.msg-content`);if(!i)return;let a=i.getAttribute(`data-raw`)||i.innerText||i.textContent||``;navigator.clipboard.writeText(a).then(()=>{r.classList.add(`copied`),r.innerHTML=c.checkSimple,setTimeout(()=>{r.classList.remove(`copied`),r.textContent=``},600)}).catch(()=>{})}))}export{ie as S,Ht as _,kt as a,E as b,Mt as c,Jt as d,Wt as f,At as g,Tt as h,jt as i,Yt as l,Q as m,Ot as n,It as o,Vt as p,Nt as r,Ut as s,J as t,Bt as u,Et as v,be as x,pt as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={xmlns:`http://www.w3.org/2000/svg`,width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`};function t(t,n={}){let r=(`size`in t?t.size:t.width)??e.width,i=(`size`in t?t.size:t.height)??e.height,a=t.aliases?.map(e=>`lucide-${e}`)??[],o=[`lucide`,`lucide-${t.name}`,...a];return n.className&&o.push(n.className),[`svg`,{...e,...`color`in n&&{stroke:n.color},...`size`in n&&n.size&&{width:n.size.toString(10),height:n.size.toString(10)},...`width`in n&&n.width&&{width:n.width.toString(10)},...`height`in n&&n.height&&{height:n.height.toString(10)},...`strokeWidth`in n&&n.strokeWidth&&{"stroke-width":n.strokeWidth.toString(10)},class:o.join(` `),viewBox:`0 0 ${r} ${i}`,...`attributes`in n&&n.attributes},t.node.map(([e,t])=>[e,n.absoluteStrokeWidth?{"vector-effect":`non-scaling-stroke`,...t}:t])]}var n=([e,t,r=[]])=>`<${e} ${Object.entries(t).map(([e,t])=>`${e}="${t}"`).join(` `)}>${r?.map(e=>n(e)).join(``)}</${e}>`;function r(e,r={}){return n(t(e,r))}var i={name:`arrow-left`,size:24,node:[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]},a={name:`arrow-right`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]},o={name:`ban`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M4.929 4.929 19.07 19.071`,key:`196cmz`}]]},s={name:`bot`,size:24,node:[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]},c={name:`brain`,size:24,node:[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]},l={name:`chart-bar`,size:24,node:[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M7 16h8`,key:`srdodz`}],[`path`,{d:`M7 11h12`,key:`127s9w`}],[`path`,{d:`M7 6h3`,key:`w9rmul`}]],aliases:[`bar-chart-horizontal`]},u={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]},d={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]},f={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]},p={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]},m={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]],aliases:[`check-circle-2`]},h={name:`circle-user-round`,size:24,node:[[`path`,{d:`M17.925 20.056a6 6 0 0 0-11.851.001`,key:`z69sun`}],[`circle`,{cx:`12`,cy:`11`,r:`4`,key:`1gt34v`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]],aliases:[`user-circle-2`]},g={name:`circle-x`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-circle`]},_={name:`clipboard-list`,size:24,node:[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`M12 11h4`,key:`1jrz19`}],[`path`,{d:`M12 16h4`,key:`n85exb`}],[`path`,{d:`M8 11h.01`,key:`1dfujw`}],[`path`,{d:`M8 16h.01`,key:`18s6g9`}]]},v={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]},y={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]},b={name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]},x={name:`folder-open`,size:24,node:[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]},S={name:`gamepad-2`,size:24,node:[[`line`,{x1:`6`,x2:`10`,y1:`11`,y2:`11`,key:`1gktln`}],[`line`,{x1:`8`,x2:`8`,y1:`9`,y2:`13`,key:`qnk9ow`}],[`line`,{x1:`15`,x2:`15.01`,y1:`12`,y2:`12`,key:`krot7o`}],[`line`,{x1:`18`,x2:`18.01`,y1:`10`,y2:`10`,key:`1lcuu1`}],[`path`,{d:`M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z`,key:`mfqc10`}]]},C={name:`globe`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]},w={name:`hand-metal`,size:24,node:[[`path`,{d:`M18 12.5V10a2 2 0 0 0-2-2a2 2 0 0 0-2 2v1.4`,key:`wc6myp`}],[`path`,{d:`M14 11V9a2 2 0 1 0-4 0v2`,key:`94qvcw`}],[`path`,{d:`M10 10.5V5a2 2 0 1 0-4 0v9`,key:`m1ah89`}],[`path`,{d:`m7 15-1.76-1.76a2 2 0 0 0-2.83 2.82l3.6 3.6C7.5 21.14 9.2 22 12 22h2a8 8 0 0 0 8-8V7a2 2 0 1 0-4 0v5`,key:`t1skq1`}]]},T={name:`heart-pulse`,size:24,node:[[`path`,{d:`M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5`,key:`mvr1a0`}],[`path`,{d:`M3.22 13H9.5l.5-1 2 4.5 2-7 1.5 3.5h5.27`,key:`auskq0`}]]},E={name:`hourglass`,size:24,node:[[`path`,{d:`M5 22h14`,key:`ehvnwv`}],[`path`,{d:`M5 2h14`,key:`pdyrp9`}],[`path`,{d:`M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22`,key:`1d314k`}],[`path`,{d:`M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2`,key:`1vvvr6`}]]},D={name:`house`,size:24,node:[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]],aliases:[`home`]},ee={name:`key-round`,size:24,node:[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]},O={name:`lightbulb`,size:24,node:[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]},k={name:`link`,size:24,node:[[`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`,key:`1cjeqo`}],[`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`,key:`19qd67`}]]},A={name:`lock-open`,size:24,node:[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 9.9-1`,key:`1mm8w8`}]],aliases:[`unlock`]},j={name:`lock`,size:24,node:[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]},M={name:`message-square`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]},N={name:`mic`,size:24,node:[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`,key:`1vc78b`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`13`,rx:`3`,key:`s6n7sd`}]]},P={name:`notebook-pen`,size:24,node:[[`path`,{d:`M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4`,key:`re6nr2`}],[`path`,{d:`M2 6h4`,key:`aawbzj`}],[`path`,{d:`M2 10h4`,key:`l0bgd4`}],[`path`,{d:`M2 14h4`,key:`1gsvsf`}],[`path`,{d:`M2 18h4`,key:`1bu2t1`}],[`path`,{d:`M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z`,key:`pqwjuv`}]]},F={name:`package`,size:24,node:[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`,key:`1a0edw`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]]},I={name:`palette`,size:24,node:[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]},L={name:`paperclip`,size:24,node:[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]},R={name:`pencil`,size:24,node:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]},z={name:`play`,size:24,node:[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]},B={name:`radio`,size:24,node:[[`path`,{d:`M16.247 7.761a6 6 0 0 1 0 8.478`,key:`1fwjs5`}],[`path`,{d:`M19.075 4.933a10 10 0 0 1 0 14.134`,key:`ehdyv1`}],[`path`,{d:`M4.925 19.067a10 10 0 0 1 0-14.134`,key:`1q22gi`}],[`path`,{d:`M7.753 16.239a6 6 0 0 1 0-8.478`,key:`r2q7qm`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]},V={name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]},H={name:`save`,size:24,node:[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]},U={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]},W={name:`send`,size:24,node:[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]},G={name:`settings`,size:24,node:[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]},K={name:`skip-forward`,size:24,node:[[`path`,{d:`M21 4v16`,key:`7j8fe9`}],[`path`,{d:`M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z`,key:`zs4d6`}]]},q={name:`square`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]},J={name:`target`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`6`,key:`1vlfrh`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]},Y={name:`trash-2`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]},X={name:`triangle-alert`,size:24,node:[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`alert-triangle`]},Z={name:`wrench`,size:24,node:[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]},Q={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]},$={name:`zap`,size:24,node:[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]};export{T as A,h as B,j as C,ee as D,O as E,b as F,u as G,p as H,y as I,s as J,l as K,v as L,C as M,S as N,D as O,x as P,r as Q,_ as R,M as S,k as T,f as U,m as V,d as W,a as X,o as Y,i as Z,L as _,Y as a,P as b,K as c,U as d,H as f,R as g,z as h,X as i,w as j,E as k,G as l,B as m,Q as n,J as o,V as p,c as q,Z as r,q as s,$ as t,W as u,I as v,A as w,N as x,F as y,g as z};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-render-Bjnw0wQ6.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as e}from"./state-O6NVkWcL.js";import{r as t}from"./api-DygAf_G_.js";import{Z as n}from"./vendor-mermaid-UktBx7L0.js";import{_ as r,l as i,m as a,n as o,t as s}from"./render-CQnnZ-_i.js";import{a as c,b as l,c as u,g as d,h as f,i as p,n as m,o as h,p as g,r as _,t as v,u as y,v as b}from"./ui-IWxpAzJ7.js";var x=3e3,S=new Map,C=[],w=(e,t)=>`${e}:${t}`;function T(e=[]){let t=document.getElementById(`pendingQueue`);if(t){if(C=e.slice(),!e.length){j(new Set),t.classList.remove(`visible`),t.innerHTML=``;return}t.classList.add(`visible`),t.innerHTML=`
|
|
3
|
+
<div class="pending-queue-header">
|
|
4
|
+
<span class="pending-queue-title">${i.hourglass} <span data-i18n="queue.pendingTitle">${o(r(`queue.pendingTitle`))}</span> <span class="pending-queue-count">${e.length}</span></span>
|
|
5
|
+
</div>
|
|
6
|
+
<div class="pending-queue-list">
|
|
7
|
+
${e.map(E).join(``)}
|
|
8
|
+
</div>
|
|
9
|
+
`,j(new Set(e.map(e=>e.id))),A()}}function E(e){let t=(e.prompt||``).replace(/\s+/g,` `).trim(),n=t.length>140?t.slice(0,140)+`…`:t,a=e.source?`<span class="pending-row-source">${o(e.source)}</span>`:``,s=o(r(`queue.steer`)),c=o(r(`queue.delete`));return`<div class="pending-row" data-pending-id="${o(e.id)}" title="${o(t)}">
|
|
10
|
+
<span class="pending-row-text">${o(n)}</span>
|
|
11
|
+
${a}
|
|
12
|
+
<button class="pending-row-btn pending-row-steer" data-pending-action="steer" data-i18n-title="queue.steer" title="${s}" aria-label="${s}"><span class="pending-arm-fill" aria-hidden="true"></span><span class="pending-btn-content"><span class="pending-steer-arrow" aria-hidden="true">↳</span><span class="pending-steer-label">${s}</span></span></button>
|
|
13
|
+
<button class="pending-row-btn pending-row-delete" data-pending-action="delete" data-i18n-title="queue.delete" title="${c}" aria-label="${c}"><span class="pending-arm-fill" aria-hidden="true"></span><span class="pending-btn-content">${i.trash}</span></button>
|
|
14
|
+
</div>`}function D(e,t){let n=document.querySelector(`.pending-row[data-pending-id="${CSS.escape(e)}"]`);return n?n.querySelector(`[data-pending-action="${t}"]`):null}function O(e,t){let n=D(e,t);if(!n)return;n.classList.add(`armed`),n.setAttribute(`title`,r(`queue.cancelArm`));let i=n.querySelector(`.pending-arm-fill`);i&&(i.style.animation=`none`,i.offsetWidth,i.style.animation=``)}function k(e,t){let n=D(e,t);n&&(n.classList.remove(`armed`),n.setAttribute(`title`,r(t===`steer`?`queue.steer`:`queue.delete`)))}function A(){for(let e of S.values()){let t=D(e.id,e.action);t&&(t.classList.add(`armed`),t.setAttribute(`title`,r(`queue.cancelArm`)))}}function j(e){for(let[t,n]of S)e.has(n.id)||(clearTimeout(n.timerId),S.delete(t))}function M(e,t){let n=w(e,t),r=setTimeout(()=>P(e,t),x);S.set(n,{id:e,action:t,timerId:r}),O(e,t)}function N(e,t){let n=w(e,t),r=S.get(n);r&&(clearTimeout(r.timerId),S.delete(n),k(e,t))}async function P(e,n){if(S.delete(w(e,n)),await t(n===`steer`?`/api/orchestrate/queue/${encodeURIComponent(e)}/steer`:`/api/orchestrate/queue/${encodeURIComponent(e)}`,n===`steer`?`POST`:`DELETE`,{})==null){k(e,n);return}C=C.filter(t=>t.id!==e),T(C)}function F(e,t){if(S.has(w(e,t))){N(e,t);return}M(e,t)}function I(){let e=document.getElementById(`pendingQueue`);e&&e.addEventListener(`click`,e=>{let t=e.target?.closest(`[data-pending-action]`);if(!t)return;let n=t.closest(`.pending-row`)?.dataset.pendingId;n&&F(n,t.dataset.pendingAction===`steer`?`steer`:`delete`)})}var L=[`P`,`A`,`B`,`C`],R=null;function z(e,t,n){let r=L.indexOf(n);if(r<0)return;let i=e.getBoundingClientRect(),a=t.offsetWidth||36,o=document.getElementById(`dot-${n}`);if(!o)return;let s=L[r+1],c=s?document.getElementById(`dot-${s}`):null;if(c){let e=o.getBoundingClientRect(),n=c.getBoundingClientRect(),r=(e.right+n.left)/2;t.style.left=r-i.left-a/2+`px`}else{let e=o.getBoundingClientRect();t.style.left=e.left-i.left+e.width/2-a/2+`px`}}var B={},V=``,H=0;async function U(e={}){let t=await(await fetch(`/api/orchestrate/snapshot`)).json();V=String(t.orc.scope||``),G(t.orc.state),W(t.workers),b(t.runtime.queuePending),p(t.queued||[]),T(t.queued||[]),e.hydrateRun&&u(t.activeRun),f(t.runtime.busy?`running`:`idle`),n(()=>import(`./employees-Do9d6Xi5.js`).then(e=>{typeof e.renderEmployees==`function`&&e.renderEmployees()}),__vite__mapDeps([0]))}function W(e){for(let e of Object.keys(B))delete B[e];for(let t of e)t.state===`running`&&t.phase&&(B[t.agentId]={phase:t.phase,phaseLabel:t.phaseLabel||``})}function G(t,n){let r=new Set([`IDLE`,`P`,`A`,`B`,`C`,`D`]).has(t)?t:`IDLE`;if(e.orcState=r,r===`IDLE`||r===`D`)document.body.removeAttribute(`data-orc-state`),document.body.style.removeProperty(`--orc-glow`);else{document.body.setAttribute(`data-orc-state`,r);let e=`--orc-glow-${r}`,t=getComputedStyle(document.documentElement).getPropertyValue(e).trim();document.body.style.setProperty(`--orc-glow`,t)}document.body.classList.add(`orc-pulse`),setTimeout(()=>document.body.classList.remove(`orc-pulse`),700);let i=document.getElementById(`orcStateBadge`);i&&(i.textContent={IDLE:``,P:`PLAN`,A:`AUDIT`,B:`BUILD`,C:`CHECK`,D:`DONE`}[r],i.style.display=r===`IDLE`?`none`:`inline-block`);let a=document.getElementById(`pabcRoadmap`),o=document.getElementById(`sharkRunner`),s=document.getElementById(`pabcBrand`);if(a&&o){if(!a.dataset.resizeObserved){a.dataset.resizeObserved=`1`,new ResizeObserver(()=>{R&&o.classList.contains(`running`)&&z(a,o,R)}).observe(a);let e=0;window.addEventListener(`resize`,()=>{cancelAnimationFrame(e),e=requestAnimationFrame(()=>{R&&o.classList.contains(`running`)&&z(a,o,R)})})}if(r===`IDLE`)a.classList.remove(`visible`,`shimmer-out`),o.classList.remove(`running`),R=null;else if(r===`D`){L.forEach(e=>{let t=document.getElementById(`dot-${e}`);t&&(t.className=`pabc-dot done`,t.setAttribute(`data-phase`,e))});for(let e=0;e<4;e++){let t=document.getElementById(`pabc-conn-${e}`);t&&(t.className=`pabc-connector done`)}o.classList.remove(`running`),R=null,a.classList.add(`shimmer-out`),setTimeout(()=>a.classList.remove(`visible`,`shimmer-out`),1e3)}else{a.classList.remove(`shimmer-out`),a.classList.add(`visible`),o.classList.add(`running`);let e=L.indexOf(r);L.forEach((t,n)=>{let r=document.getElementById(`dot-${t}`);r&&(r.className=`pabc-dot ${n<e?`done`:n===e?`active`:`future`}`,r.setAttribute(`data-phase`,t))});for(let t=0;t<4;t++){let n=document.getElementById(`pabc-conn-${t}`);n&&(n.className=`pabc-connector ${t<e?`done`:``}`)}R=r,requestAnimationFrame(()=>z(a,o,r))}s&&n&&(s.textContent=n)}}function K(){let t=`ws://${location.host}`;e.ws=new WebSocket(`${t}?lang=${a()}`),e.ws.onmessage=e=>{let t;try{t=JSON.parse(e.data)}catch{console.warn(`[ws] malformed message:`,e.data);return}if(!t||typeof t!=`object`||typeof t.type!=`string`){console.warn(`[ws] invalid message shape:`,t);return}if(t.type===`agent_status`)t.running===void 0?f(t.status||`idle`):f(t.running?`running`:`idle`),t.agentId&&t.phase&&(B[t.agentId]={phase:t.phase,phaseLabel:t.phaseLabel||``},n(()=>import(`./employees-Do9d6Xi5.js`).then(e=>e.loadEmployees()),__vite__mapDeps([0])));else if(t.type===`queue_update`)b(t.pending||0),U().catch(()=>{});else if(t.type===`worklog_created`)m(`${i.clipboard} Worklog: ${o(t.path||``)}`);else if(t.type===`round_start`){let e=t.agentPhases||t.subtasks||[],n=e.map(e=>o(e.agent||e.name||``)).join(`, `);m(r(`ws.roundStart`,{round:t.round||0,count:e.length,names:n}))}else if(t.type===`round_done`)t.action===`complete`?m(r(`ws.roundDone`,{round:t.round||0})):t.action===`next`?m(r(`ws.roundNext`,{round:t.round||0})):m(r(`ws.roundRetry`,{round:t.round||0}));else if(t.type===`agent_tool`){let e=t.isEmployee?`(E) `:``,n=t.toolType===`thinking`?`thinking`:t.toolType===`search`?`search`:t.toolType===`subagent`?`subagent`:`tool`;d({id:`step-${Date.now()}-${Math.random().toString(36).slice(2,6)}`,type:n,icon:t.icon||i.tool,rawIcon:t.rawIcon||t.icon||``,label:e+(t.label||``),detail:t.detail||``,stepRef:t.stepRef||``,status:t.status||`running`,startTime:Date.now()})}else if(t.type===`agent_output`)_(t.text||``);else if(t.type===`agent_retry`)m(r(`ws.retry`,{cli:o(t.cli||``),delay:t.delay||10}),`tool-activity`);else if(t.type===`agent_fallback`)m(r(`ws.fallback`,{from:o(t.from||``),to:o(t.to||``)}),`tool-activity`);else if(t.type===`agent_smoke`)m(`${i.warning} ${o(t.cli||`agent`)}: smoke response detected — auto-continuing`,`tool-activity`);else if(t.type===`agent_done`)h(t.text||``,t.toolLog);else if(t.type===`orchestrate_done`)h(t.text||``);else if(t.type===`clear`){s(),c(),l().clear();let e=document.getElementById(`chatMessages`);e&&(e.innerHTML=``),n(()=>import(`./idb-cache-C7z4qE00.js`).then(e=>e.clearCache()),[]).catch(()=>{})}else if(t.type===`session_reset`)m(`${i.refresh} Session reset — history preserved`,`tool-activity`);else if(t.type===`agent_added`||t.type===`agent_updated`||t.type===`agent_deleted`)n(()=>import(`./employees-Do9d6Xi5.js`).then(e=>e.loadEmployees()),__vite__mapDeps([0]));else if(t.type===`orc_state`){if(t.scope&&V&&t.scope!==V)return;G(typeof t.state==`string`?t.state:`IDLE`,t.title)}else t.type===`memory_status`?n(()=>import(`./memory-Dpe-qPbZ.js`).then(e=>e.refreshMemorySidebar()),__vite__mapDeps([0])):t.type===`new_message`&&(t.source===`telegram`||t.source===`discord`||t.fromQueue===!0)&&v(t.role===`assistant`?`agent`:t.role||`user`,t.content||``,t.cli)},e.ws.onopen=()=>{console.log(`[ws] connected`);let e=Date.now()-H<1e4,t=y();n(()=>import(`./ui-Cxk1_e0b.js`).then(async n=>{if(n.cleanupToolActivity(),!e)try{await n.loadMessages(),H=Date.now()}catch(e){console.error(`[ws] loadMessages failed`,e)}U({hydrateRun:!0}).catch(()=>{}).finally(()=>g(t))}),__vite__mapDeps([0]))},e.ws.onclose=()=>{console.log(`[ws] disconnected, reconnecting in 2s...`),n(()=>import(`./ui-Cxk1_e0b.js`).then(e=>e.cleanupToolActivity()),__vite__mapDeps([0])),f(`idle`),m(`${i.exec} 연결 끊김 — 재연결 중...`,`tool-activity`),setTimeout(K,2e3)}}function q(e){return B[e]||null}export{q as n,I as r,K as t};
|
package/public/dist/index.html
CHANGED
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
href="https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@400;500;600;700&family=Outfit:wght@400;500;600;700&display=swap"
|
|
26
26
|
rel="stylesheet">
|
|
27
27
|
<!-- Vite handles module bundling in dev (HMR) and production (build) -->
|
|
28
|
-
<script type="module" crossorigin src="/dist/assets/index-
|
|
28
|
+
<script type="module" crossorigin src="/dist/assets/index-yGExjgR_.js"></script>
|
|
29
29
|
<link rel="stylesheet" crossorigin href="/dist/assets/vendor-render-Bjnw0wQ6.css">
|
|
30
|
-
<link rel="stylesheet" crossorigin href="/dist/assets/index-
|
|
30
|
+
<link rel="stylesheet" crossorigin href="/dist/assets/index-qALA03H1.css">
|
|
31
31
|
</head>
|
|
32
32
|
|
|
33
33
|
<body>
|
package/public/js/constants.ts
CHANGED
|
@@ -30,27 +30,14 @@ const FALLBACK_CLI_REGISTRY: CliRegistry = {
|
|
|
30
30
|
label: 'OpenCode',
|
|
31
31
|
efforts: ['minimal', 'low', 'high', 'max'],
|
|
32
32
|
models: [
|
|
33
|
-
'anthropic/claude-opus-4-6-thinking',
|
|
34
|
-
'anthropic/claude-sonnet-4-6-thinking',
|
|
35
|
-
'anthropic/claude-sonnet-4-6',
|
|
36
|
-
'openai/gpt-5.4-xhigh',
|
|
37
|
-
'openai/gpt-5.4-high',
|
|
38
|
-
'openai/gpt-5.3-codex-xhigh',
|
|
39
|
-
'openai/gpt-5.3-codex-high',
|
|
40
|
-
'opencode/big-pickle',
|
|
41
|
-
'opencode-go/glm-5',
|
|
42
33
|
'opencode-go/glm-5.1',
|
|
43
|
-
'opencode-go/kimi-k2.5',
|
|
44
34
|
'opencode-go/kimi-k2.6',
|
|
45
|
-
'opencode-go/mimo-v2-pro',
|
|
46
|
-
'opencode-go/mimo-v2
|
|
47
|
-
'opencode-go/minimax-m2.5',
|
|
35
|
+
'opencode-go/mimo-v2.5-pro',
|
|
36
|
+
'opencode-go/mimo-v2.5',
|
|
48
37
|
'opencode-go/minimax-m2.7',
|
|
49
|
-
'opencode/
|
|
50
|
-
'opencode/
|
|
51
|
-
'opencode/
|
|
52
|
-
'opencode/GPT 5 Nano Free',
|
|
53
|
-
'opencode/Grok Code Fast 1 Free',
|
|
38
|
+
'opencode-go/qwen3.6-plus',
|
|
39
|
+
'opencode-go/deepseek-v4-pro',
|
|
40
|
+
'opencode-go/deepseek-v4-flash',
|
|
54
41
|
],
|
|
55
42
|
},
|
|
56
43
|
copilot: {
|
|
@@ -6,8 +6,9 @@ import { ICONS } from '../icons.js';
|
|
|
6
6
|
|
|
7
7
|
export interface ProcessStep {
|
|
8
8
|
id: string;
|
|
9
|
-
type: 'tool' | 'thinking' | 'search';
|
|
9
|
+
type: 'tool' | 'thinking' | 'search' | 'subagent';
|
|
10
10
|
icon: string;
|
|
11
|
+
rawIcon?: string;
|
|
11
12
|
label: string;
|
|
12
13
|
detail?: string;
|
|
13
14
|
stepRef?: string;
|
|
@@ -26,6 +27,7 @@ function buildSummaryText(steps: ProcessStep[]): string {
|
|
|
26
27
|
for (const s of steps) {
|
|
27
28
|
const key = s.type === 'thinking' ? `${ICONS.thinking} Thinking`
|
|
28
29
|
: s.type === 'search' ? `${ICONS.search} Search`
|
|
30
|
+
: s.type === 'subagent' ? `${ICONS.robot} Subagent`
|
|
29
31
|
: `${ICONS.tool} Tool`;
|
|
30
32
|
counts[key] = (counts[key] || 0) + 1;
|
|
31
33
|
}
|
|
@@ -40,11 +42,17 @@ function previewText(text: string, max = 120): string {
|
|
|
40
42
|
return singleLine.length > max ? `${singleLine.slice(0, max - 1)}…` : singleLine;
|
|
41
43
|
}
|
|
42
44
|
|
|
45
|
+
function renderTrustedIcon(icon: string | undefined): string {
|
|
46
|
+
const value = icon || ICONS.tool;
|
|
47
|
+
return value.trim().startsWith('<svg') ? value : escapeHtml(value);
|
|
48
|
+
}
|
|
49
|
+
|
|
43
50
|
function renderStep(step: ProcessStep): string {
|
|
44
51
|
const dotClass = `process-step-dot ${step.status}`;
|
|
45
52
|
const badgeClass = `process-step-badge ${step.type}`;
|
|
46
53
|
const badgeText = step.type.toUpperCase();
|
|
47
54
|
const label = escapeHtml(step.label || step.icon || '');
|
|
55
|
+
const icon = renderTrustedIcon(step.icon);
|
|
48
56
|
const detail = step.detail || '';
|
|
49
57
|
const detailId = `process-detail-${step.id}`;
|
|
50
58
|
|
|
@@ -57,6 +65,7 @@ function renderStep(step: ProcessStep): string {
|
|
|
57
65
|
return `<div class="process-step process-step-expandable" data-step-id="${step.id}" data-type="${step.type}">
|
|
58
66
|
<button class="process-step-toggle" aria-expanded="false" aria-controls="${detailId}">
|
|
59
67
|
<span class="${dotClass}"></span>
|
|
68
|
+
<span class="process-step-icon" aria-hidden="true">${icon}</span>
|
|
60
69
|
<span class="${badgeClass}">${badgeText}</span>
|
|
61
70
|
<span class="process-step-main">
|
|
62
71
|
<span class="process-step-label">${label}</span>
|
|
@@ -12,7 +12,7 @@ export interface QuotaEntry {
|
|
|
12
12
|
reason?: string;
|
|
13
13
|
}
|
|
14
14
|
export interface SettingsData {
|
|
15
|
-
cli: string; workingDir: string; permissions: string; locale?: string;
|
|
15
|
+
cli: string; workingDir: string; permissions: string; locale?: string; showReasoning?: boolean;
|
|
16
16
|
perCli?: Record<string, PerCliConfig>;
|
|
17
17
|
activeOverrides?: Record<string, PerCliConfig>;
|
|
18
18
|
telegram?: TelegramConfig;
|
|
@@ -7,10 +7,12 @@ import { ICONS } from '../icons.js';
|
|
|
7
7
|
|
|
8
8
|
export interface ToolLogEntry {
|
|
9
9
|
icon: string;
|
|
10
|
+
rawIcon?: string;
|
|
10
11
|
label: string;
|
|
11
12
|
detail?: string;
|
|
12
13
|
toolType?: string;
|
|
13
14
|
stepRef?: string;
|
|
15
|
+
status?: string;
|
|
14
16
|
}
|
|
15
17
|
|
|
16
18
|
function hasExpandableDetail(tl: ToolLogEntry): boolean {
|