chainlesschain 0.45.6 → 0.45.8

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.
@@ -0,0 +1 @@
1
+ import{a5 as k,f as w,r as h}from"./vendor-Ks18OpWK.js";import{u as i}from"./ws-Bve9vKht.js";const A=k("chat",()=>{const u=w([]),f=w(null),s=h({}),o=h({}),r=h({}),p=w(!1);function v(t){return s[t]||(s[t]=[]),s[t]}async function q(){const t=i();u.value=await t.listSessions()}async function y(t="chat"){const e=i(),n=await e.createSession(t);return u.value.unshift({id:n,type:t,title:t==="chat"?"新对话":"新 Agent",createdAt:Date.now(),messageCount:0}),e.onSession(n,a=>S(n,a)),f.value=n,s[n]=[],o[n]={content:"",active:!1},n}function S(t,e){const n=v(t);if(e.type==="response-token")o[t]||(o[t]={content:"",active:!0}),o[t].content+=e.token||"",o[t].active=!0;else if(e.type==="response-complete"){const a=e.content||o[t]?.content||"";n.push({role:"assistant",content:a,timestamp:Date.now()}),o[t]&&(o[t].content="",o[t].active=!1);const c=u.value.find(l=>l.id===t);if(c&&c.title.startsWith("新")){const l=n.find(g=>g.role==="user");l&&(c.title=l.content.slice(0,30))}p.value=!1}else if(e.type==="tool-executing")n.push({role:"tool",tool:e.tool,input:e.input,status:"running",timestamp:Date.now()});else if(e.type==="tool-result"){const a=[...n].reverse().find(c=>c.role==="tool"&&c.tool===e.tool);a&&(a.result=e.result,a.status="done")}else e.type==="question"&&(r[t]={requestId:e.requestId||e.id,question:e.question,choices:e.choices||[]})}async function D(t,e){const n=i();v(t).push({role:"user",content:e,timestamp:Date.now()}),o[t]||(o[t]={content:"",active:!1}),o[t].active=!0,p.value=!0,n.sendSessionMessage(t,e)}function M(t,e){const n=i(),a=r[t];a&&(n.answerQuestion(t,a.requestId,e),delete r[t])}async function Q(t){f.value=t,s[t]||(s[t]=[],o[t]={content:"",active:!1},i().onSession(t,n=>S(t,n)))}return{sessions:u,currentSessionId:f,messages:s,streaming:o,pendingQuestion:r,isLoading:p,loadSessions:q,createSession:y,sendMessage:D,answerQuestion:M,switchSession:Q,getMessages:v}});export{A as u};
@@ -0,0 +1 @@
1
+ html,body{width:100%;height:100%}input::-ms-clear,input::-ms-reveal{display:none}*,*:before,*:after{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:rgba(0,0,0,0)}@-ms-viewport{width:device-width}body{margin:0}[tabindex="-1"]:focus{outline:none}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5em;font-weight:500}p{margin-top:0;margin-bottom:1em}abbr[title],abbr[data-original-title]{-webkit-text-decoration:underline dotted;text-decoration:underline;text-decoration:underline dotted;border-bottom:0;cursor:help}address{margin-bottom:1em;font-style:normal;line-height:inherit}input[type=text],input[type=password],input[type=number],textarea{-webkit-appearance:none}ol,ul,dl{margin-top:0;margin-bottom:1em}ol ol,ul ul,ol ul,ul ol{margin-bottom:0}dt{font-weight:500}dd{margin-bottom:.5em;margin-left:0}blockquote{margin:0 0 1em}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}pre,code,kbd,samp{font-size:1em;font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace}pre{margin-top:0;margin-bottom:1em;overflow:auto}figure{margin:0 0 1em}img{vertical-align:middle;border-style:none}a,area,button,[role=button],input:not([type=range]),label,select,summary,textarea{touch-action:manipulation}table{border-collapse:collapse}caption{padding-top:.75em;padding-bottom:.3em;text-align:left;caption-side:bottom}input,button,select,optgroup,textarea{margin:0;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}button,html [type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{padding:0;border-style:none}input[type=radio],input[type=checkbox]{box-sizing:border-box;padding:0}input[type=date],input[type=time],input[type=datetime-local],input[type=month]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;margin:0;padding:0;border:0}legend{display:block;width:100%;max-width:100%;margin-bottom:.5em;padding:0;color:inherit;font-size:1.5em;line-height:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item}template{display:none}[hidden]{display:none!important}mark{padding:.2em;background-color:#feffe6}
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./AppLayout-D-KJRC1s.js","./vendor-Ks18OpWK.js","./ws-Bve9vKht.js","./_plugin-vue_export-helper-DlAUqK2U.js","./antd-BhDHu4KM.js","./AppLayout-CZDQcPAA.css","./Dashboard-Bmgu7fEn.js","./chat-_a36nOu_.js","./Chat-BsgVc34I.js","./markdown-CNQE8HeM.js","./Chat-V-g0UHcr.css","./Skills--YIq8avF.js","./Skills-BC4Yu_4f.css","./Providers-DlC9S5Nf.js","./Providers-YRgg8NIn.css"])))=>i.map(i=>d[i]);
2
+ import{S as E,U as P,V as L,W as g,X as b,Y as A,k as B,R as O,Z as k}from"./vendor-Ks18OpWK.js";import{t as w,A as R}from"./antd-BhDHu4KM.js";(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const e of document.querySelectorAll('link[rel="modulepreload"]'))l(e);new MutationObserver(e=>{for(const t of e)if(t.type==="childList")for(const r of t.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&l(r)}).observe(document,{childList:!0,subtree:!0});function a(e){const t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin==="use-credentials"?t.credentials="include":e.crossOrigin==="anonymous"?t.credentials="omit":t.credentials="same-origin",t}function l(e){if(e.ep)return;e.ep=!0;const t=a(e);fetch(e.href,t)}})();const S="modulepreload",I=function(p,n){return new URL(p,n).href},y={},d=function(n,a,l){let e=Promise.resolve();if(a&&a.length>0){let v=function(o){return Promise.all(o.map(i=>Promise.resolve(i).then(u=>({status:"fulfilled",value:u}),u=>({status:"rejected",reason:u}))))};const r=document.getElementsByTagName("link"),s=document.querySelector("meta[property=csp-nonce]"),_=s?.nonce||s?.getAttribute("nonce");e=v(a.map(o=>{if(o=I(o,l),o in y)return;y[o]=!0;const i=o.endsWith(".css"),u=i?'[rel="stylesheet"]':"";if(l)for(let m=r.length-1;m>=0;m--){const f=r[m];if(f.href===o&&(!i||f.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${o}"]${u}`))return;const c=document.createElement("link");if(c.rel=i?"stylesheet":S,i||(c.as="script"),c.crossOrigin="",c.href=o,_&&c.setAttribute("nonce",_),document.head.appendChild(c),i)return new Promise((m,f)=>{c.addEventListener("load",m),c.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${o}`)))})}))}function t(r){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=r,window.dispatchEvent(s),!s.defaultPrevented)throw r}return e.then(r=>{for(const s of r||[])s.status==="rejected"&&t(s.reason);return n().catch(t)})},C=[{path:"/",component:()=>d(()=>import("./AppLayout-D-KJRC1s.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url),children:[{path:"",redirect:"/dashboard"},{path:"dashboard",name:"Dashboard",component:()=>d(()=>import("./Dashboard-Bmgu7fEn.js"),__vite__mapDeps([6,1,2,7,4]),import.meta.url)},{path:"chat",name:"Chat",component:()=>d(()=>import("./Chat-BsgVc34I.js"),__vite__mapDeps([8,1,9,4,7,2,3,10]),import.meta.url)},{path:"skills",name:"Skills",component:()=>d(()=>import("./Skills--YIq8avF.js"),__vite__mapDeps([11,1,2,7,3,4,12]),import.meta.url)},{path:"providers",name:"Providers",component:()=>d(()=>import("./Providers-DlC9S5Nf.js"),__vite__mapDeps([13,1,2,3,4,14]),import.meta.url)}]}],N=E({history:P(),routes:C}),T={__name:"App",setup(p){const n={algorithm:w.darkAlgorithm,token:{colorPrimary:"#1677ff",colorBgBase:"#141414",colorBgContainer:"#1f1f1f",colorBgElevated:"#2a2a2a",borderRadius:8,fontFamily:'system-ui, -apple-system, "Segoe UI", sans-serif'},components:{Layout:{siderBg:"#1c1c1c",headerBg:"#1c1c1c",bodyBg:"#141414"},Menu:{darkItemBg:"#1c1c1c",darkSubMenuItemBg:"#171717"}}};return(a,l)=>{const e=g("router-view"),t=g("a-config-provider");return b(),L(t,{theme:n},{default:A(()=>[B(e)]),_:1})}}},h=O(T);h.use(k());h.use(N);h.use(R);h.mount("#app");