@onescience/onecode-web 1.14.50-202609190953 → 1.14.50-202609191621

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/assets/{3Dmol-CvjY_cvM.js → 3Dmol-Cb-yFavP.js} +1 -1
  2. package/assets/{account-system-iVR7os3T.js → account-system-B6NEeP1E.js} +1 -1
  3. package/assets/{alert-04-DGswaApz.js → alert-01-w3bKPSuh.js} +1 -1
  4. package/assets/{alert-05-zLUup1XQ.js → alert-02-DWcqAklJ.js} +1 -1
  5. package/assets/{alert-01-X-9J4A1o.js → alert-04-FRQpk3YA.js} +1 -1
  6. package/assets/{alert-02-DHBFlVfc.js → alert-05-BCdqfndG.js} +1 -1
  7. package/assets/alert-06-dr0ve9EZ.js +1 -0
  8. package/assets/alert-07-D73D8bQT.js +1 -0
  9. package/assets/alert-08-o5Pf90Tr.js +1 -0
  10. package/assets/alert-10-BhCDnQ7Q.js +1 -0
  11. package/assets/{bip-bop-03-Bb2zbmkB.js → bip-bop-03-qMmDljXh.js} +1 -1
  12. package/assets/{bip-bop-04-RFi7-itO.js → bip-bop-04-C9kLH5LW.js} +1 -1
  13. package/assets/{bip-bop-06-Bmlh-7Qz.js → bip-bop-06-BO8twUNJ.js} +1 -1
  14. package/assets/{bip-bop-08-CuLlYsed.js → bip-bop-08-DAi-h-tU.js} +1 -1
  15. package/assets/bip-bop-09-HteL5U8s.js +1 -0
  16. package/assets/{center-Bkwj7_Ni.js → center-Dc4qsMNh.js} +1 -1
  17. package/assets/{dialog-fork-DdOZuk-z.js → dialog-fork-CdB52KRm.js} +1 -1
  18. package/assets/{dialog-project-upload-q0FdbTA9.js → dialog-project-upload-Dl90TcIf.js} +1 -1
  19. package/assets/{dialog-select-file-D4XxBPPs.js → dialog-select-file-CfxIPL8F.js} +1 -1
  20. package/assets/dialog-select-model-5H-GmK-M.js +2 -0
  21. package/assets/{dialog-terminal-unavailable-B3H34CK1.js → dialog-terminal-unavailable-Cv51Zzi3.js} +1 -1
  22. package/assets/{docs-DlV6hyE2.js → docs-ChGaUhs9.js} +1 -1
  23. package/assets/{ghostty-web-BmhExhLy.js → ghostty-web-CVOHDXmf.js} +1 -1
  24. package/assets/{index-5t1ell5L.js → index-CLUM_n0C.js} +234 -234
  25. package/assets/{index-CWdCxJdh.css → index-CX0zdxzc.css} +1 -1
  26. package/assets/{intro-DBjNvdxc.js → intro-DKvWMPhm.js} +1 -1
  27. package/assets/{nope-02-JWH6fDAo.js → nope-02-uZQJ18Kk.js} +1 -1
  28. package/assets/{nope-05-DQu0zdcI.js → nope-05-RkLUzHvx.js} +1 -1
  29. package/assets/{nope-08-kx3ns1eL.js → nope-08-DsG0PaNH.js} +1 -1
  30. package/assets/{nope-11-CsGpaQ-s.js → nope-11-CdQw-KnX.js} +1 -1
  31. package/assets/nope-12-aiRaCr0A.js +1 -0
  32. package/assets/{onescience-kiHJU3TH.js → onescience-Bc0G_4FC.js} +15 -15
  33. package/assets/{resources-DpzdbAvV.js → resources-BpT3OgCa.js} +1 -1
  34. package/assets/{skills-11FhzUVq.js → skills-YWkJlR7k.js} +1 -1
  35. package/assets/{staplebops-03-BFDDoReC.js → staplebops-03-D3GWoLOF.js} +1 -1
  36. package/assets/{staplebops-04-ivfL0_AC.js → staplebops-04-BbA0eSIX.js} +1 -1
  37. package/assets/{staplebops-06-D7hPHJZ9.js → staplebops-06-C-Ekiiqq.js} +1 -1
  38. package/assets/{staplebops-07-PRQfTxbO.js → staplebops-07-DmBuS8Ha.js} +1 -1
  39. package/assets/{wizard-CE5Ve5Ic.js → wizard-CvrgcPvB.js} +1 -1
  40. package/assets/{yup-01-DD8GdkAr.js → yup-01-BgI3G0NU.js} +1 -1
  41. package/assets/{yup-03-DJmWr9DF.js → yup-03-BV2g6B1G.js} +1 -1
  42. package/assets/{yup-04-DokkGzxo.js → yup-04-_O8GZJzA.js} +1 -1
  43. package/assets/{yup-05-CcCL2F1c.js → yup-05-Di5f9A4a.js} +1 -1
  44. package/index.html +11 -11
  45. package/package.json +2 -2
  46. package/assets/alert-06-CF-rVba_.js +0 -1
  47. package/assets/alert-07-CGPwaDHI.js +0 -1
  48. package/assets/alert-08-DnnGwRDF.js +0 -1
  49. package/assets/alert-10-Ddflho21.js +0 -1
  50. package/assets/bip-bop-09-BgjN7mZO.js +0 -1
  51. package/assets/dialog-select-model-Ca7JCRhV.js +0 -2
  52. package/assets/nope-12-OYYOX3ep.js +0 -1
@@ -1 +1 @@
1
- import{cV as p,i as s,a as l,bi as g,aH as h,cW as u,t as b}from"./index-5t1ell5L.js";var v=b('<div class="os-client-capability-page os-client-resources-page"><header class=os-client-resources-head><div class=os-client-resources-head-copy><h2>资源配置</h2><p>SSH 连接配置</p></div></header><section class=os-client-capability-selector aria-label=资源配置><div class=os-client-capability-current-domain><span>当前配置:</span><strong>SSH 连接</strong><small></small></div></section><div class="os-client-capability-page-body os-client-resources-body">');function m(){const r=p();return(()=>{var a=v(),e=a.firstChild;e.firstChild;var i=e.nextSibling,t=i.firstChild,n=t.firstChild,c=n.nextSibling,o=c.nextSibling,d=i.nextSibling;return s(e,l(h,{get href(){return g()},class:"os-client-resources-close","aria-label":"关闭资源配置",children:"×"}),null),s(o,()=>r.t("dialog.ssh.description")),s(d,l(u,{variant:"page"})),a})()}export{m as WorkbenchResourcesPage};
1
+ import{cV as p,i as s,a as l,bi as g,aH as h,cW as u,t as b}from"./index-CLUM_n0C.js";var v=b('<div class="os-client-capability-page os-client-resources-page"><header class=os-client-resources-head><div class=os-client-resources-head-copy><h2>资源配置</h2><p>SSH 连接配置</p></div></header><section class=os-client-capability-selector aria-label=资源配置><div class=os-client-capability-current-domain><span>当前配置:</span><strong>SSH 连接</strong><small></small></div></section><div class="os-client-capability-page-body os-client-resources-body">');function m(){const r=p();return(()=>{var a=v(),e=a.firstChild;e.firstChild;var i=e.nextSibling,t=i.firstChild,n=t.firstChild,c=n.nextSibling,o=c.nextSibling,d=i.nextSibling;return s(e,l(h,{get href(){return g()},class:"os-client-resources-close","aria-label":"关闭资源配置",children:"×"}),null),s(o,()=>r.t("dialog.ssh.description")),s(d,l(u,{variant:"page"})),a})()}export{m as WorkbenchResourcesPage};
@@ -1 +1 @@
1
- import{O as W,P as q,K as H,c as E,D as g,ag as I,i as a,a as o,t as v,cP as u,d as O,k as _,R as K,j as N,cQ as y,cR as C,cS as L,A as Q,aH as z,cT as P,S as B,b as G,x as J,F as V,v as X,cU as Y}from"./index-5t1ell5L.js";var Z=v("<p class=os-client-skills-login-hint>登录后可同步个人空间技能。 "),ee=v('<div class="os-client-capability-page os-client-skills-page"><section class=os-client-capability-selector aria-label=技能设置><div class=os-client-capability-current-domain><span>技能设置:</span><strong></strong><small></small></div><div class="os-client-capability-tabs os-client-skills-tabs"role=tablist aria-label=技能管理视图></div></section><div class=os-client-capability-page-body>'),te=v("<button type=button><strong></strong><small>");function ae(c){const s=new URLSearchParams(c).get("tab");if(s==="list"||s==="repo"||s==="upload")return s}function ne(){const c=W(),s=q(),A=H(),[b,R]=E(0),x=g(()=>(b(),!!_())),d=g(()=>!x()),[n,T]=E(ae(c.search)??"list"),M=g(()=>{b();const e=_();return e&&(K(e,A.projects.lastCode())||N(e))||""}),p=e=>{T(e),s(P(e),{replace:!0})};I(()=>{const e=()=>R(i=>i+1);window.addEventListener(y,e),window.addEventListener(C,e),window.addEventListener(L,e),Q(()=>{window.removeEventListener(y,e),window.removeEventListener(C,e),window.removeEventListener(L,e)})});const h=()=>u.find(e=>e.id===n())??u[0];return(()=>{var e=ee(),i=e.firstChild,m=i.firstChild,U=m.firstChild,f=U.nextSibling,j=f.nextSibling,S=m.nextSibling,D=i.nextSibling;return a(f,()=>h().label),a(j,()=>h().hint),a(i,o(B,{get when(){return d()},get children(){var t=Z();return t.firstChild,a(t,o(z,{get href(){return`/login?redirect=${encodeURIComponent(P(n()))}`},children:"去登录"}),null),t}}),S),a(S,o(V,{each:u,children:t=>(()=>{var r=te(),w=r.firstChild,F=w.nextSibling;return r.$$click=()=>p(t.id),a(w,()=>t.label),a(F,()=>t.hint),G(l=>{var $=n()===t.id,k=n()===t.id;return $!==l.e&&r.classList.toggle("is-active",l.e=$),k!==l.t&&J(r,"aria-pressed",l.t=k),l},{e:void 0,t:void 0}),r})()})),a(D,o(Y,{get directory(){return X(()=>!!d())()?void 0:M()||void 0},get loginRequired(){return d()},get tab(){return n()},onTabChange:p,variant:"page-body"})),e})()}O(["click"]);export{ne as WorkbenchSkillsPage};
1
+ import{O as W,P as q,K as H,c as E,D as g,ag as I,i as a,a as o,t as v,cS as u,d as O,k as _,R as K,j as N,cj as y,ck as C,cl as L,A as z,aH as B,cT as A,S as G,b as J,x as Q,F as V,v as X,cU as Y}from"./index-CLUM_n0C.js";var Z=v("<p class=os-client-skills-login-hint>登录后可同步个人空间技能。 "),ee=v('<div class="os-client-capability-page os-client-skills-page"><section class=os-client-capability-selector aria-label=技能设置><div class=os-client-capability-current-domain><span>技能设置:</span><strong></strong><small></small></div><div class="os-client-capability-tabs os-client-skills-tabs"role=tablist aria-label=技能管理视图></div></section><div class=os-client-capability-page-body>'),te=v("<button type=button><strong></strong><small>");function ae(c){const s=new URLSearchParams(c).get("tab");if(s==="list"||s==="repo"||s==="upload")return s}function ne(){const c=W(),s=q(),P=H(),[b,x]=E(0),R=g(()=>(b(),!!_())),d=g(()=>!R()),[n,T]=E(ae(c.search)??"list"),j=g(()=>{b();const e=_();return e&&(K(e,P.projects.lastCode())||N(e))||""}),p=e=>{T(e),s(A(e),{replace:!0})};I(()=>{const e=()=>x(i=>i+1);window.addEventListener(y,e),window.addEventListener(C,e),window.addEventListener(L,e),z(()=>{window.removeEventListener(y,e),window.removeEventListener(C,e),window.removeEventListener(L,e)})});const h=()=>u.find(e=>e.id===n())??u[0];return(()=>{var e=ee(),i=e.firstChild,m=i.firstChild,M=m.firstChild,f=M.nextSibling,U=f.nextSibling,S=m.nextSibling,D=i.nextSibling;return a(f,()=>h().label),a(U,()=>h().hint),a(i,o(G,{get when(){return d()},get children(){var t=Z();return t.firstChild,a(t,o(B,{get href(){return`/login?redirect=${encodeURIComponent(A(n()))}`},children:"去登录"}),null),t}}),S),a(S,o(V,{each:u,children:t=>(()=>{var r=te(),w=r.firstChild,F=w.nextSibling;return r.$$click=()=>p(t.id),a(w,()=>t.label),a(F,()=>t.hint),J(l=>{var $=n()===t.id,k=n()===t.id;return $!==l.e&&r.classList.toggle("is-active",l.e=$),k!==l.t&&Q(r,"aria-pressed",l.t=k),l},{e:void 0,t:void 0}),r})()})),a(D,o(Y,{get directory(){return X(()=>!!d())()?void 0:j()||void 0},get loginRequired(){return d()},get tab(){return n()},onTabChange:p,variant:"page-body"})),e})()}O(["click"]);export{ne as WorkbenchSkillsPage};
@@ -1 +1 @@
1
- const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609190953/assets/staplebops-03-Aug82oH0.aac";export{e as default};
1
+ const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609191621/assets/staplebops-03-Aug82oH0.aac";export{e as default};
@@ -1 +1 @@
1
- const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609190953/assets/staplebops-04-olyHi8qQ.aac";export{e as default};
1
+ const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609191621/assets/staplebops-04-olyHi8qQ.aac";export{e as default};
@@ -1 +1 @@
1
- const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609190953/assets/staplebops-06-Cj_2vOI4.aac";export{e as default};
1
+ const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609191621/assets/staplebops-06-Cj_2vOI4.aac";export{e as default};
@@ -1 +1 @@
1
- const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609190953/assets/staplebops-07-cqQEvbIf.aac";export{e as default};
1
+ const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609191621/assets/staplebops-07-cqQEvbIf.aac";export{e as default};
@@ -1 +1 @@
1
- import{d as Ve,c as Ge,at as Ke,cx as He,z as tt,D as R,cy as Ne,cz as Be,cA as at,cB as De,cC as xe,cD as it,an as me,i as t,aD as Je,a as i,b as C,F as N,x as q,S as h,v as lt,cE as rt,cF as nt,cG as qe,cH as st,t as r,cI as Qe,cu as ct,O as ot,cJ as dt,P as ut,L as pt,N as gt,K as ht,ag as bt,r as ze,h as ke,j as Ie,k as fe,l as Pe,m as Le,p as Fe,n as Te,o as Ee,w as Re,cK as $t,cL as vt,aC as de,cM as mt,cN as _t,g as Xe,H as Ye,cO as ft,az as yt,aH as K,b6 as Ae,cv as St,aG as wt,cw as Ct,Q as xt}from"./index-5t1ell5L.js";var zt=r("<button type=button class=os-client-capability-wizard-papers-more>"),kt=r("<div class=os-client-capability-wizard-papers><h3>相关论文</h3><ul>"),It=r("<div class=os-client-capability-wizard-papers><h3>HPC 软件</h3><span>"),Pt=r("<p class=os-client-capability-wizard-note>工作目录与运行环境由系统自动识别,本步只需填写下列业务参数。"),Lt=r("<p class=os-client-capability-wizard-missing>还有 <!> 个必填参数未填,可先创建;缺口将由智能体追问,也可点左侧步骤提前补全。"),Ft=r("<small>"),Tt=r("<ul class=os-client-capability-wizard-output-list>"),Et=r("<div class=os-client-capability-wizard-quality><strong>质量门禁</strong><p>"),Rt=r('<div class=os-client-capability-wizard-overlay role=dialog aria-modal=true aria-label=场景向导><button type=button class=os-client-capability-wizard-backdrop aria-label=关闭场景></button><section class=os-client-capability-wizard-dialog><header class=os-client-capability-wizard-head><button type=button class=os-client-capability-wizard-intro-back>返回场景列表</button><div class=os-client-capability-wizard-head-title><h2></h2><p></p></div><button type=button class=os-client-capability-wizard-close aria-label=关闭>×</button></header><div class=os-client-capability-wizard-columns><aside class=os-client-capability-wizard-column aria-label=工作流><h3>工作流</h3><p class=os-client-capability-wizard-note>点击步骤查看对应参数与产出;创建后将自动按序执行。</p><ol class=os-client-capability-wizard-workflow></ol></aside><section class=os-client-capability-wizard-column aria-label=补充信息><div class=os-client-capability-wizard-column-head><h3>本步参数</h3><small>/<!> · 已填 <!>/</small></div><div class=os-client-capability-wizard-fields></div><div class=os-client-capability-wizard-step-nav><button type=button>上一步</button><button type=button>下一步</button></div></section><section class=os-client-capability-wizard-column aria-label="本步产出与 Prompt"><div class=os-client-capability-wizard-outputs aria-label=本步产出><div class=os-client-capability-wizard-outputs-head><span>本步产出</span></div></div><div class=os-client-capability-wizard-column-head><h3>本步 Prompt</h3><small>第 <!> 步</small></div><textarea class=os-client-capability-wizard-prompt rows=12 readonly></textarea></section></div><footer class=os-client-capability-wizard-footer><button type=button>返回能力中心</button><button type=button data-primary=true>创建任务并自动逐步执行'),Wt=r("<li><button type=button class=os-client-capability-wizard-step><span></span><div><p>"),jt=r('<li><a target=_blank rel="noopener noreferrer">'),Ht=r("<p>"),Dt=r("<div class=os-client-capability-wizard-step-banner><strong>"),qt=r("<p class=os-client-capability-wizard-note>本步无需额外用户参数。"),At=r("<em>*"),Mt=r("<textarea rows=3>"),Ot=r("<em class=os-client-capability-wizard-field-hint>,智能体将尝试自动修正"),Ut=r("<em class=os-client-capability-wizard-field-hint>未填时由智能体追问"),Vt=r("<label class=os-client-capability-wizard-field><span>"),Gt=r("<input type=text>"),Kt=r("<p class=os-client-capability-wizard-outputs-empty>本步暂无结构化产出清单。"),Nt=r("<li>");const Me=2;function Bt(e){const[c,z]=Ge(!1),[n,k]=Ke({values:He(e.scenario),activeStepIndex:0});tt(()=>{k({values:He(e.scenario),activeStepIndex:0}),z(!1)});const F=R(()=>Ne(e.scenario)),I=R(()=>F()[n.activeStepIndex]??F()[0]),x=R(()=>{const b=I();return b?Be(e.scenario,b):e.scenario.user_input}),ue=R(()=>at(e.scenario,n.values)),B=R(()=>x().filter(b=>De(b)?!String(n.values[xe(b)]??"").trim():!1)),ye=R(()=>x().filter(b=>String(n.values[xe(b)]??"").trim()).length),T=R(()=>{const O=I()?.prompt||e.scenario.ai_prompt?.template||"";return it(O,n.values)}),M=R(()=>I()?.outputs??[]),H=R(()=>(e.scenario.related_papers??[]).filter(b=>!!String(b.url??"").trim())),ae=R(()=>c()?H():H().slice(0,Me)),A=R(()=>Math.max(0,H().length-Me)),J=(b,O)=>{k("values",b,O)},ie=b=>{k("activeStepIndex",b)},pe=()=>{const b=Qe(e.scenario.user_input,n.values);k("values",b),e.onSubmit({values:b})};return(()=>{var b=Rt(),O=b.firstChild,Se=O.nextSibling,le=Se.firstChild,ge=le.firstChild,he=ge.nextSibling,l=he.firstChild,p=l.nextSibling,f=he.nextSibling,$=le.nextSibling,P=$.firstChild,U=P.firstChild,be=U.nextSibling,$e=be.nextSibling,Q=P.nextSibling,re=Q.firstChild,ne=re.firstChild,V=ne.nextSibling,Y=V.firstChild,ve=Y.nextSibling,we=ve.nextSibling,se=we.nextSibling;se.nextSibling;var G=re.nextSibling,ce=G.nextSibling,d=ce.firstChild,v=d.nextSibling,m=Q.nextSibling,S=m.firstChild,E=S.firstChild;E.firstChild;var D=S.nextSibling,W=D.firstChild,X=W.nextSibling,Z=X.firstChild,j=Z.nextSibling;j.nextSibling;var ee=D.nextSibling,te=$.nextSibling,oe=te.firstChild,Ce=oe.nextSibling;return me(O,"click",e.onClose,!0),me(ge,"click",e.onClose,!0),t(l,()=>e.scenario.name),t(p,()=>Je(e.scenario.problem_and_applicability)),me(f,"click",e.onClose,!0),t($e,i(N,{get each(){return F()},children:(a,s)=>(()=>{var u=Wt(),w=u.firstChild,g=w.firstChild,y=g.nextSibling,L=y.firstChild;return w.$$click=()=>ie(s()),t(g,()=>s()+1),t(L,()=>a.name),C(()=>u.classList.toggle("is-active",n.activeStepIndex===s())),u})()})),t(P,i(h,{get when(){return H().length>0},get children(){var a=kt(),s=a.firstChild,u=s.nextSibling;return t(u,i(N,{get each(){return ae()},children:w=>(()=>{var g=jt(),y=g.firstChild;return t(y,()=>w.title),C(L=>{var o=w.url,_=w.title;return o!==L.e&&q(y,"href",L.e=o),_!==L.t&&q(y,"title",L.t=_),L},{e:void 0,t:void 0}),g})()})),t(a,i(h,{get when(){return A()>0},get children(){var w=zt();return w.$$click=()=>z(g=>!g),t(w,(()=>{var g=lt(()=>!!c());return()=>g()?"收起":`展开其余 ${A()} 篇`})()),w}}),null),C(()=>u.classList.toggle("is-expanded",!!(c()&&A()>0))),a}}),null),t(P,i(h,{get when(){return e.scenario.HPC},get children(){var a=It(),s=a.firstChild,u=s.nextSibling;return t(u,()=>e.scenario.HPC),a}}),null),t(V,()=>n.activeStepIndex+1,Y),t(V,()=>F().length,ve),t(V,ye,se),t(V,()=>x().length,null),t(Q,i(h,{get when(){return I()},children:a=>(()=>{var s=Dt(),u=s.firstChild;return t(u,()=>a().name),t(s,i(h,{get when(){return a().purpose?.trim()},get children(){var w=Ht();return t(w,()=>a().purpose),w}}),null),s})()}),G),t(Q,i(h,{get when(){return e.scenario.system_auto_detection?.fields?.length},get children(){return Pt()}}),G),t(Q,i(h,{get when(){return B().length>0||ue().length>0},get children(){var a=Lt(),s=a.firstChild,u=s.nextSibling;return u.nextSibling,t(a,()=>ue().length,u),a}}),G),t(G,i(h,{get when(){return x().length>0},get fallback(){return qt()},get children(){return i(N,{get each(){return x()},children:a=>{const s=xe(a),u=De(a),w=u&&!String(n.values[s]??"").trim(),g=String(n.values[s]??"").trim()&&rt(a,n.values[s]??"");return(()=>{var y=Vt(),L=y.firstChild;return y.classList.toggle("is-required",!!u),y.classList.toggle("is-gap",!!w),t(L,()=>nt(a),null),t(L,i(h,{when:u,get children(){return At()}}),null),t(y,i(h,{get when(){return st(a)},get fallback(){return(()=>{var o=Gt();return o.$$input=_=>J(s,_.currentTarget.value),C(_=>{var We=a.input_type==="int"||a.input_type==="float"?"decimal":void 0,je=qe(a);return We!==_.e&&q(o,"inputmode",_.e=We),je!==_.t&&q(o,"placeholder",_.t=je),_},{e:void 0,t:void 0}),C(()=>o.value=n.values[s]??""),o})()},get children(){var o=Mt();return o.$$input=_=>J(s,_.currentTarget.value),C(()=>q(o,"placeholder",qe(a))),C(()=>o.value=n.values[s]??""),o}}),null),t(y,i(h,{when:g,get children(){var o=Ot(),_=o.firstChild;return t(o,g,_),o}}),null),t(y,i(h,{when:w,get children(){return Ut()}}),null),y})()}})}})),d.$$click=()=>ie(Math.max(0,n.activeStepIndex-1)),v.$$click=()=>ie(Math.min(F().length-1,n.activeStepIndex+1)),t(E,i(h,{get when(){return I()?.result_subfolder},get children(){var a=Ft();return t(a,()=>I()?.result_subfolder),C(()=>q(a,"title",I()?.result_subfolder)),a}}),null),t(S,i(h,{get when(){return M().length>0},get fallback(){return Kt()},get children(){var a=Tt();return t(a,i(N,{get each(){return M()},children:s=>(()=>{var u=Nt();return t(u,s),u})()})),a}}),null),t(S,i(h,{get when(){return I()?.quality_gate},get children(){var a=Et(),s=a.firstChild,u=s.nextSibling;return t(u,()=>I()?.quality_gate),a}}),null),t(X,()=>n.activeStepIndex+1,j),me(oe,"click",e.onClose,!0),Ce.$$click=pe,C(a=>{var s=n.activeStepIndex<=0,u=n.activeStepIndex>=F().length-1;return s!==a.e&&(d.disabled=a.e=s),u!==a.t&&(v.disabled=a.t=u),a},{e:void 0,t:void 0}),C(()=>ee.value=T()),b})()}Ve(["click","input"]);function Jt(e,c){return e.replace(/\{\{(\w+)\}\}/g,(z,n)=>c[n]??"")}var Qt=r("<div class=os-client-capability-wizard-overlay role=dialog aria-modal=true aria-label=能力向导>"),Xt=r("<section class=os-client-capability-wizard-dialog><p>未找到该能力。"),Yt=r("<div class=os-client-capability-wizard-scenario-group><span>完整工作流场景 · "),Zt=r("<section class=os-client-capability-wizard-dialog><header class=os-client-capability-wizard-head><div class=os-client-capability-wizard-head-title><h2></h2></div></header><div class=os-client-capability-wizard-columns><aside class=os-client-capability-wizard-column aria-label=你想做什么?><h3>你想做什么?</h3><div class=os-client-capability-wizard-scenarios></div></aside><section class=os-client-capability-wizard-column aria-label=补充信息><h3>补充信息</h3></section><section class=os-client-capability-wizard-column aria-label=起始任务><div class=os-client-capability-wizard-column-head><h3>起始任务</h3><button type=button>重新生成</button></div><textarea class=os-client-capability-wizard-prompt rows=14></textarea></section></div><footer class=os-client-capability-wizard-footer><button type=button data-primary=true>创建任务"),ea=r("<section class=os-client-capability-wizard-dialog><p>「<!>」暂无 OneScience 源码或魔搭映射,当前不可使用。"),ta=r("<button type=button><strong></strong><p>"),aa=r("<button type=button><strong></strong><p></p><small> · <!> 步"),Oe=r("<p class=os-client-capability-wizard-empty>请先选择任务场景。"),ia=r("<div class=os-client-capability-wizard-required aria-label=该能力需要什么数据><h4>该能力需要什么数据</h4><ul>"),la=r("<div class=os-client-capability-wizard-middle><div class=os-client-capability-wizard-fields></div><div class=os-client-capability-wizard-summary aria-label=当前能力配置><h4>当前能力配置</h4><dl><div><dt>当前能力</dt><dd></dd></div><div><dt>关键配置</dt><dd></dd></div><div><dt>运行资源</dt><dd></dd></div><div><dt>交付结果</dt><dd>"),ra=r("<textarea rows=3>"),na=r("<label class=os-client-capability-wizard-field><span>"),sa=r("<input type=text>"),ca=r("<li>"),oa=r("<div class=os-client-capability-wizard-right-head><strong></strong><p>"),da=r("<div class=os-client-capability-wizard-outputs aria-label=预计产出><span>预计产出</span><p>");function ua(e){return e==="hpc"?"软件介绍":"模型介绍"}function pa(e){return`使用 ${e} 开始科研任务`}function ga(e){if(!ze({navigate:e.navigate,action:{type:"prompt",prompt:e.prompt,title:e.title,workflow:e.workflow},isLoggedIn:e.isLoggedIn}))return!1;const c=ke({path:e.path,recent:e.recent,lastCodeWorkspace:e.lastCodeWorkspace})||Ie(fe())||Pe(document,e.path);if(!c)return!1;const z=Le(c);return Fe(z,e.prompt),Te(z),e.openProject?.(c),e.touchCode?.(c),Ee({variant:"success",title:`已为你创建「${e.title}」任务`}),e.navigate(Re(c)),!0}function Ze(e){const c=$t(e.scenario),z=c[0];if(!z?.promptTemplate.trim()||!ze({navigate:e.navigate,action:{type:"scenario-run",scenarioId:e.scenario.id||e.scenario.scenario_id,values:e.values},isLoggedIn:e.isLoggedIn}))return!1;const n=ke({path:e.path,recent:e.recent,lastCodeWorkspace:e.lastCodeWorkspace})||Ie(fe())||Pe(document,e.path);if(!n)return!1;const k=Le(n),F=Ne(e.scenario),I=F[0]?Be(e.scenario,F[0]):e.scenario.user_input,x=Qe(e.scenario.user_input,e.values);return vt(k,{title:e.scenario.name,scenarioId:de(e.scenario),values:x,steps:c}),mt("todo"),Fe(k,_t(z,x,I)),Te(k),e.openProject?.(n),e.touchCode?.(n),Ee({variant:"success",title:`已创建「${e.scenario.name}」`,description:`将按 ${c.length} 步自动依次执行,缺参或失败时暂停`}),e.navigate(Re(n)),!0}function et(e){if(!ze({navigate:e.navigate,action:{type:"wizard",resourceId:e.resourceId,scenarioId:e.scenarioId,values:e.values,prompt:e.prompt},isLoggedIn:e.isLoggedIn}))return!1;const c=Xe(e.resourceId),z=c?.scenarios.find(F=>F.id===e.scenarioId);if(!c||!z||!Ye(c))return!1;const n=ke({path:e.path,recent:e.recent,lastCodeWorkspace:e.lastCodeWorkspace})||Ie(fe())||Pe(document,e.path);if(!n)return!1;const k=Le(n);return Fe(k,e.prompt),Te(k),e.openProject?.(n),e.touchCode?.(n),Ee({variant:"success",title:`已为你创建 ${c.name}「${z.title}」任务`}),e.navigate(Re(n)),!0}function _e(e,c){return Jt(e.promptTemplate,c)}function Ue(e){return Object.fromEntries(e.fields.map(c=>[c.id,ha(c)]))}function ha(e){return e.default?.trim()?e.default:e.placeholder?.replace(/^例如[::]\s*/,"").trim()??""}function ba(){const e=ct(),c=ot(),[z]=dt(),n=ut(),k=pt(),F=gt(),I=ht(),x=()=>Xe(e.id??""),ue=()=>Ct(c.search),B=()=>St(c.search,{category:x()?.category??"onemodel",domain:x()?.domain??"materials"}),ye=()=>wt(e.id??"",ue()),[T,M]=Ke({scenarioId:"",values:{},prompt:""}),[H,ae]=Ge(""),A=()=>x()?.scenarios.find(l=>l.id===T.scenarioId),J=R(()=>{const l=x();return l?ft({domain:l.domain,name:l.name,id:l.id,category:l.category}):[]}),ie=R(()=>{const l=H();if(l)return yt(l)??J().find(p=>de(p)===l)}),pe=()=>({navigate:n,isLoggedIn:!!fe(),path:k.data.path,recent:xt(k.data.project),lastCodeWorkspace:I.projects.lastCode(),openProject:l=>F.projects.open(l),touchCode:l=>I.projects.touchCode(l)}),b=()=>{const l=A();l&&M("prompt",_e(l,T.values))};bt(()=>{const l=x();if(!l?.scenarios.length)return;const p=z.scenario,$=(p?l.scenarios.find(U=>U.id===p):void 0)??l.scenarios[0],P=Ue($);M({scenarioId:$.id,values:P,prompt:_e($,P)})});const O=l=>{const f=x()?.scenarios.find(P=>P.id===l);if(!f)return;ae("");const $=Ue(f);M({scenarioId:f.id,values:$,prompt:_e(f,$)})},Se=l=>{ae(l)},le=(l,p)=>{const f=A();if(!f)return;const $={...T.values,[l]:p};M({values:$,prompt:_e(f,$)})},ge=()=>{const l=x(),p=A();!l||!p||et({resourceId:l.id,scenarioId:p.id,values:{...T.values},prompt:T.prompt,...pe()})},he=(l,p)=>{Ze({scenario:l,values:p.values,...pe()})};return(()=>{var l=Qt();return t(l,i(h,{get when(){return x()},get fallback(){return[i(K,{class:"os-client-capability-wizard-backdrop",get href(){return Ae()},"aria-label":"关闭向导"}),(()=>{var p=Xt();return p.firstChild,t(p,i(K,{get href(){return Ae()},children:"返回能力中心"}),null),p})()]},children:p=>i(h,{get when(){return Ye(p())},get fallback(){return[i(K,{class:"os-client-capability-wizard-backdrop",get href(){return B()},"aria-label":"关闭向导"}),(()=>{var f=ea(),$=f.firstChild,P=$.firstChild,U=P.nextSibling;return U.nextSibling,t($,()=>p().name,U),t(f,i(K,{get href(){return B()},children:"返回模型库"}),null),f})()]},get children(){return[i(K,{class:"os-client-capability-wizard-backdrop",get href(){return B()},"aria-label":"关闭向导"}),(()=>{var f=Zt(),$=f.firstChild,P=$.firstChild,U=P.firstChild,be=$.nextSibling,$e=be.firstChild,Q=$e.firstChild,re=Q.nextSibling,ne=$e.nextSibling;ne.firstChild;var V=ne.nextSibling,Y=V.firstChild,ve=Y.firstChild,we=ve.nextSibling,se=Y.nextSibling,G=be.nextSibling,ce=G.firstChild;return t($,i(K,{class:"os-client-capability-wizard-intro-back",get href(){return ye()},get children(){return ua(p().category)}}),P),t(U,()=>pa(p().name)),t($,i(K,{class:"os-client-capability-wizard-close",get href(){return B()},"aria-label":"关闭",children:"×"}),null),t(re,i(N,{get each(){return p().scenarios},children:d=>(()=>{var v=ta(),m=v.firstChild,S=m.nextSibling;return v.$$click=()=>O(d.id),t(m,()=>d.title),t(S,()=>d.summary),C(E=>{var D=!H()&&T.scenarioId===d.id,W=!H()&&T.scenarioId===d.id;return D!==E.e&&v.classList.toggle("is-active",E.e=D),W!==E.t&&q(v,"aria-pressed",E.t=W),E},{e:void 0,t:void 0}),v})()}),null),t(re,i(h,{get when(){return J().length>0},get children(){var d=Yt(),v=d.firstChild;return v.firstChild,t(v,()=>J().length,null),t(d,i(N,{get each(){return J()},children:m=>(()=>{var S=aa(),E=S.firstChild,D=E.nextSibling,W=D.nextSibling,X=W.firstChild,Z=X.nextSibling;return Z.nextSibling,S.$$click=()=>Se(de(m)),t(E,()=>m.name),t(D,()=>Je(m.problem_and_applicability)),t(W,()=>m.scenario_id,X),t(W,()=>m.workflow_steps?.length||m.workflow.length,Z),C(j=>{var ee=H()===de(m),te=H()===de(m);return ee!==j.e&&S.classList.toggle("is-active",j.e=ee),te!==j.t&&q(S,"aria-pressed",j.t=te),j},{e:void 0,t:void 0}),S})()}),null),d}}),null),t(ne,i(h,{get when(){return A()},keyed:!0,get fallback(){return Oe()},children:d=>(()=>{var v=la(),m=v.firstChild,S=m.nextSibling,E=S.firstChild,D=E.nextSibling,W=D.firstChild,X=W.firstChild,Z=X.nextSibling,j=W.nextSibling,ee=j.firstChild,te=ee.nextSibling,oe=j.nextSibling,Ce=oe.firstChild,a=Ce.nextSibling,s=oe.nextSibling,u=s.firstChild,w=u.nextSibling;return t(m,i(N,{get each(){return d.fields},children:g=>(()=>{var y=na(),L=y.firstChild;return t(L,()=>g.label),t(y,i(h,{get when(){return g.multiline},get fallback(){return(()=>{var o=sa();return o.$$input=_=>le(g.id,_.currentTarget.value),C(()=>q(o,"placeholder",g.placeholder)),C(()=>o.value=T.values[g.id]??""),o})()},get children(){var o=ra();return o.$$input=_=>le(g.id,_.currentTarget.value),C(()=>q(o,"placeholder",g.placeholder)),C(()=>o.value=T.values[g.id]??""),o}}),null),y})()})),t(Z,()=>d.capabilitySummary.current),t(te,()=>d.capabilitySummary.keyConfig),t(a,()=>d.capabilitySummary.resources),t(w,()=>d.capabilitySummary.deliverables),t(v,i(h,{get when(){return d.requiredData?.length},get children(){var g=ia(),y=g.firstChild,L=y.nextSibling;return t(L,i(N,{get each(){return d.requiredData},children:o=>(()=>{var _=ca();return t(_,o),_})()})),g}}),null),v})()}),null),t(V,i(h,{get when(){return A()},keyed:!0,get fallback(){return Oe()},children:d=>[(()=>{var v=oa(),m=v.firstChild,S=m.nextSibling;return t(m,()=>d.title),t(S,()=>d.summary),v})(),(()=>{var v=da(),m=v.firstChild,S=m.nextSibling;return t(S,()=>d.expectedOutputs),v})()]}),Y),we.$$click=b,se.$$input=d=>M("prompt",d.currentTarget.value),t(G,i(K,{get href(){return B()},children:"返回能力中心"}),ce),ce.$$click=ge,C(()=>ce.disabled=!T.prompt.trim()),C(()=>se.value=T.prompt),f})(),i(h,{get when(){return ie()},children:f=>i(Bt,{get scenario(){return f()},onClose:()=>ae(""),onSubmit:$=>he(f(),$)})})]}})})),l})()}Ve(["click","input"]);const va=Object.freeze(Object.defineProperty({__proto__:null,CapabilityWizardPage:ba,startCapabilityPromptTask:ga,startCapabilityScenarioRunTask:Ze,startCapabilityWizardTask:et},Symbol.toStringTag,{value:"Module"}));export{Bt as S,Ze as a,et as b,ga as s,va as w};
1
+ import{d as Ve,c as Ge,at as Ke,cA as He,z as tt,D as E,cB as Ne,cC as Be,cD as at,cE as De,cF as xe,cG as it,an as me,i as t,aD as Qe,a as i,b as C,F as N,x as q,S as h,v as lt,cH as rt,cI as nt,cJ as qe,cK as st,t as r,cL as Je,cx as ct,O as ot,cM as dt,P as ut,L as pt,N as gt,K as ht,ag as bt,r as ze,h as ke,j as Ie,k as fe,l as Pe,m as Le,p as Fe,n as Te,o as Re,w as Ee,cN as $t,cO as vt,aC as de,cP as mt,cQ as _t,g as Xe,H as Ye,cR as ft,az as yt,aH as K,b6 as Ae,cy as St,aG as wt,cz as Ct,Q as xt}from"./index-CLUM_n0C.js";var zt=r("<button type=button class=os-client-capability-wizard-papers-more>"),kt=r("<div class=os-client-capability-wizard-papers><h3>相关论文</h3><ul>"),It=r("<div class=os-client-capability-wizard-papers><h3>HPC 软件</h3><span>"),Pt=r("<p class=os-client-capability-wizard-note>工作目录与运行环境由系统自动识别,本步只需填写下列业务参数。"),Lt=r("<p class=os-client-capability-wizard-missing>还有 <!> 个必填参数未填,可先创建;缺口将由智能体追问,也可点左侧步骤提前补全。"),Ft=r("<small>"),Tt=r("<ul class=os-client-capability-wizard-output-list>"),Rt=r("<div class=os-client-capability-wizard-quality><strong>质量门禁</strong><p>"),Et=r('<div class=os-client-capability-wizard-overlay role=dialog aria-modal=true aria-label=场景向导><button type=button class=os-client-capability-wizard-backdrop aria-label=关闭场景></button><section class=os-client-capability-wizard-dialog><header class=os-client-capability-wizard-head><button type=button class=os-client-capability-wizard-intro-back>返回场景列表</button><div class=os-client-capability-wizard-head-title><h2></h2><p></p></div><button type=button class=os-client-capability-wizard-close aria-label=关闭>×</button></header><div class=os-client-capability-wizard-columns><aside class=os-client-capability-wizard-column aria-label=工作流><h3>工作流</h3><p class=os-client-capability-wizard-note>点击步骤查看对应参数与产出;创建后将自动按序执行。</p><ol class=os-client-capability-wizard-workflow></ol></aside><section class=os-client-capability-wizard-column aria-label=补充信息><div class=os-client-capability-wizard-column-head><h3>本步参数</h3><small>/<!> · 已填 <!>/</small></div><div class=os-client-capability-wizard-fields></div><div class=os-client-capability-wizard-step-nav><button type=button>上一步</button><button type=button>下一步</button></div></section><section class=os-client-capability-wizard-column aria-label="本步产出与 Prompt"><div class=os-client-capability-wizard-outputs aria-label=本步产出><div class=os-client-capability-wizard-outputs-head><span>本步产出</span></div></div><div class=os-client-capability-wizard-column-head><h3>本步 Prompt</h3><small>第 <!> 步</small></div><textarea class=os-client-capability-wizard-prompt rows=12 readonly></textarea></section></div><footer class=os-client-capability-wizard-footer><button type=button>返回能力中心</button><button type=button data-primary=true>创建任务并自动逐步执行'),Wt=r("<li><button type=button class=os-client-capability-wizard-step><span></span><div><p>"),jt=r('<li><a target=_blank rel="noopener noreferrer">'),Ht=r("<p>"),Dt=r("<div class=os-client-capability-wizard-step-banner><strong>"),qt=r("<p class=os-client-capability-wizard-note>本步无需额外用户参数。"),At=r("<em>*"),Mt=r("<textarea rows=3>"),Ot=r("<em class=os-client-capability-wizard-field-hint>,智能体将尝试自动修正"),Ut=r("<em class=os-client-capability-wizard-field-hint>未填时由智能体追问"),Vt=r("<label class=os-client-capability-wizard-field><span>"),Gt=r("<input type=text>"),Kt=r("<p class=os-client-capability-wizard-outputs-empty>本步暂无结构化产出清单。"),Nt=r("<li>");const Me=2;function Bt(e){const[c,z]=Ge(!1),[n,k]=Ke({values:He(e.scenario),activeStepIndex:0});tt(()=>{k({values:He(e.scenario),activeStepIndex:0}),z(!1)});const F=E(()=>Ne(e.scenario)),I=E(()=>F()[n.activeStepIndex]??F()[0]),x=E(()=>{const b=I();return b?Be(e.scenario,b):e.scenario.user_input}),ue=E(()=>at(e.scenario,n.values)),B=E(()=>x().filter(b=>De(b)?!String(n.values[xe(b)]??"").trim():!1)),ye=E(()=>x().filter(b=>String(n.values[xe(b)]??"").trim()).length),T=E(()=>{const O=I()?.prompt||e.scenario.ai_prompt?.template||"";return it(O,n.values)}),M=E(()=>I()?.outputs??[]),H=E(()=>(e.scenario.related_papers??[]).filter(b=>!!String(b.url??"").trim())),ae=E(()=>c()?H():H().slice(0,Me)),A=E(()=>Math.max(0,H().length-Me)),Q=(b,O)=>{k("values",b,O)},ie=b=>{k("activeStepIndex",b)},pe=()=>{const b=Je(e.scenario.user_input,n.values);k("values",b),e.onSubmit({values:b})};return(()=>{var b=Et(),O=b.firstChild,Se=O.nextSibling,le=Se.firstChild,ge=le.firstChild,he=ge.nextSibling,l=he.firstChild,p=l.nextSibling,f=he.nextSibling,$=le.nextSibling,P=$.firstChild,U=P.firstChild,be=U.nextSibling,$e=be.nextSibling,J=P.nextSibling,re=J.firstChild,ne=re.firstChild,V=ne.nextSibling,Y=V.firstChild,ve=Y.nextSibling,we=ve.nextSibling,se=we.nextSibling;se.nextSibling;var G=re.nextSibling,ce=G.nextSibling,d=ce.firstChild,v=d.nextSibling,m=J.nextSibling,S=m.firstChild,R=S.firstChild;R.firstChild;var D=S.nextSibling,W=D.firstChild,X=W.nextSibling,Z=X.firstChild,j=Z.nextSibling;j.nextSibling;var ee=D.nextSibling,te=$.nextSibling,oe=te.firstChild,Ce=oe.nextSibling;return me(O,"click",e.onClose,!0),me(ge,"click",e.onClose,!0),t(l,()=>e.scenario.name),t(p,()=>Qe(e.scenario.problem_and_applicability)),me(f,"click",e.onClose,!0),t($e,i(N,{get each(){return F()},children:(a,s)=>(()=>{var u=Wt(),w=u.firstChild,g=w.firstChild,y=g.nextSibling,L=y.firstChild;return w.$$click=()=>ie(s()),t(g,()=>s()+1),t(L,()=>a.name),C(()=>u.classList.toggle("is-active",n.activeStepIndex===s())),u})()})),t(P,i(h,{get when(){return H().length>0},get children(){var a=kt(),s=a.firstChild,u=s.nextSibling;return t(u,i(N,{get each(){return ae()},children:w=>(()=>{var g=jt(),y=g.firstChild;return t(y,()=>w.title),C(L=>{var o=w.url,_=w.title;return o!==L.e&&q(y,"href",L.e=o),_!==L.t&&q(y,"title",L.t=_),L},{e:void 0,t:void 0}),g})()})),t(a,i(h,{get when(){return A()>0},get children(){var w=zt();return w.$$click=()=>z(g=>!g),t(w,(()=>{var g=lt(()=>!!c());return()=>g()?"收起":`展开其余 ${A()} 篇`})()),w}}),null),C(()=>u.classList.toggle("is-expanded",!!(c()&&A()>0))),a}}),null),t(P,i(h,{get when(){return e.scenario.HPC},get children(){var a=It(),s=a.firstChild,u=s.nextSibling;return t(u,()=>e.scenario.HPC),a}}),null),t(V,()=>n.activeStepIndex+1,Y),t(V,()=>F().length,ve),t(V,ye,se),t(V,()=>x().length,null),t(J,i(h,{get when(){return I()},children:a=>(()=>{var s=Dt(),u=s.firstChild;return t(u,()=>a().name),t(s,i(h,{get when(){return a().purpose?.trim()},get children(){var w=Ht();return t(w,()=>a().purpose),w}}),null),s})()}),G),t(J,i(h,{get when(){return e.scenario.system_auto_detection?.fields?.length},get children(){return Pt()}}),G),t(J,i(h,{get when(){return B().length>0||ue().length>0},get children(){var a=Lt(),s=a.firstChild,u=s.nextSibling;return u.nextSibling,t(a,()=>ue().length,u),a}}),G),t(G,i(h,{get when(){return x().length>0},get fallback(){return qt()},get children(){return i(N,{get each(){return x()},children:a=>{const s=xe(a),u=De(a),w=u&&!String(n.values[s]??"").trim(),g=String(n.values[s]??"").trim()&&rt(a,n.values[s]??"");return(()=>{var y=Vt(),L=y.firstChild;return y.classList.toggle("is-required",!!u),y.classList.toggle("is-gap",!!w),t(L,()=>nt(a),null),t(L,i(h,{when:u,get children(){return At()}}),null),t(y,i(h,{get when(){return st(a)},get fallback(){return(()=>{var o=Gt();return o.$$input=_=>Q(s,_.currentTarget.value),C(_=>{var We=a.input_type==="int"||a.input_type==="float"?"decimal":void 0,je=qe(a);return We!==_.e&&q(o,"inputmode",_.e=We),je!==_.t&&q(o,"placeholder",_.t=je),_},{e:void 0,t:void 0}),C(()=>o.value=n.values[s]??""),o})()},get children(){var o=Mt();return o.$$input=_=>Q(s,_.currentTarget.value),C(()=>q(o,"placeholder",qe(a))),C(()=>o.value=n.values[s]??""),o}}),null),t(y,i(h,{when:g,get children(){var o=Ot(),_=o.firstChild;return t(o,g,_),o}}),null),t(y,i(h,{when:w,get children(){return Ut()}}),null),y})()}})}})),d.$$click=()=>ie(Math.max(0,n.activeStepIndex-1)),v.$$click=()=>ie(Math.min(F().length-1,n.activeStepIndex+1)),t(R,i(h,{get when(){return I()?.result_subfolder},get children(){var a=Ft();return t(a,()=>I()?.result_subfolder),C(()=>q(a,"title",I()?.result_subfolder)),a}}),null),t(S,i(h,{get when(){return M().length>0},get fallback(){return Kt()},get children(){var a=Tt();return t(a,i(N,{get each(){return M()},children:s=>(()=>{var u=Nt();return t(u,s),u})()})),a}}),null),t(S,i(h,{get when(){return I()?.quality_gate},get children(){var a=Rt(),s=a.firstChild,u=s.nextSibling;return t(u,()=>I()?.quality_gate),a}}),null),t(X,()=>n.activeStepIndex+1,j),me(oe,"click",e.onClose,!0),Ce.$$click=pe,C(a=>{var s=n.activeStepIndex<=0,u=n.activeStepIndex>=F().length-1;return s!==a.e&&(d.disabled=a.e=s),u!==a.t&&(v.disabled=a.t=u),a},{e:void 0,t:void 0}),C(()=>ee.value=T()),b})()}Ve(["click","input"]);function Qt(e,c){return e.replace(/\{\{(\w+)\}\}/g,(z,n)=>c[n]??"")}var Jt=r("<div class=os-client-capability-wizard-overlay role=dialog aria-modal=true aria-label=能力向导>"),Xt=r("<section class=os-client-capability-wizard-dialog><p>未找到该能力。"),Yt=r("<div class=os-client-capability-wizard-scenario-group><span>完整工作流场景 · "),Zt=r("<section class=os-client-capability-wizard-dialog><header class=os-client-capability-wizard-head><div class=os-client-capability-wizard-head-title><h2></h2></div></header><div class=os-client-capability-wizard-columns><aside class=os-client-capability-wizard-column aria-label=你想做什么?><h3>你想做什么?</h3><div class=os-client-capability-wizard-scenarios></div></aside><section class=os-client-capability-wizard-column aria-label=补充信息><h3>补充信息</h3></section><section class=os-client-capability-wizard-column aria-label=起始任务><div class=os-client-capability-wizard-column-head><h3>起始任务</h3><button type=button>重新生成</button></div><textarea class=os-client-capability-wizard-prompt rows=14></textarea></section></div><footer class=os-client-capability-wizard-footer><button type=button data-primary=true>创建任务"),ea=r("<section class=os-client-capability-wizard-dialog><p>「<!>」暂无 OneScience 源码或魔搭映射,当前不可使用。"),ta=r("<button type=button><strong></strong><p>"),aa=r("<button type=button><strong></strong><p></p><small> · <!> 步"),Oe=r("<p class=os-client-capability-wizard-empty>请先选择任务场景。"),ia=r("<div class=os-client-capability-wizard-required aria-label=该能力需要什么数据><h4>该能力需要什么数据</h4><ul>"),la=r("<div class=os-client-capability-wizard-middle><div class=os-client-capability-wizard-fields></div><div class=os-client-capability-wizard-summary aria-label=当前能力配置><h4>当前能力配置</h4><dl><div><dt>当前能力</dt><dd></dd></div><div><dt>关键配置</dt><dd></dd></div><div><dt>运行资源</dt><dd></dd></div><div><dt>交付结果</dt><dd>"),ra=r("<textarea rows=3>"),na=r("<label class=os-client-capability-wizard-field><span>"),sa=r("<input type=text>"),ca=r("<li>"),oa=r("<div class=os-client-capability-wizard-right-head><strong></strong><p>"),da=r("<div class=os-client-capability-wizard-outputs aria-label=预计产出><span>预计产出</span><p>");function ua(e){return e==="hpc"?"软件介绍":"模型介绍"}function pa(e){return`使用 ${e} 开始科研任务`}function ga(e){if(!ze({navigate:e.navigate,action:{type:"prompt",prompt:e.prompt,title:e.title,workflow:e.workflow},isLoggedIn:e.isLoggedIn}))return!1;const c=ke({path:e.path,recent:e.recent,lastCodeWorkspace:e.lastCodeWorkspace})||Ie(fe())||Pe(document,e.path);if(!c)return!1;const z=Le(c);return Fe(z,e.prompt),Te(z),e.openProject?.(c),e.touchCode?.(c),Re({variant:"success",title:`已为你创建「${e.title}」任务`}),e.navigate(Ee(c)),!0}function Ze(e){const c=$t(e.scenario),z=c[0];if(!z?.promptTemplate.trim()||!ze({navigate:e.navigate,action:{type:"scenario-run",scenarioId:e.scenario.id||e.scenario.scenario_id,values:e.values},isLoggedIn:e.isLoggedIn}))return!1;const n=ke({path:e.path,recent:e.recent,lastCodeWorkspace:e.lastCodeWorkspace})||Ie(fe())||Pe(document,e.path);if(!n)return!1;const k=Le(n),F=Ne(e.scenario),I=F[0]?Be(e.scenario,F[0]):e.scenario.user_input,x=Je(e.scenario.user_input,e.values);return vt(k,{title:e.scenario.name,scenarioId:de(e.scenario),values:x,steps:c}),mt("todo"),Fe(k,_t(z,x,I)),Te(k),e.openProject?.(n),e.touchCode?.(n),Re({variant:"success",title:`已创建「${e.scenario.name}」`,description:`将按 ${c.length} 步自动依次执行,缺参或失败时暂停`}),e.navigate(Ee(n)),!0}function et(e){if(!ze({navigate:e.navigate,action:{type:"wizard",resourceId:e.resourceId,scenarioId:e.scenarioId,values:e.values,prompt:e.prompt},isLoggedIn:e.isLoggedIn}))return!1;const c=Xe(e.resourceId),z=c?.scenarios.find(F=>F.id===e.scenarioId);if(!c||!z||!Ye(c))return!1;const n=ke({path:e.path,recent:e.recent,lastCodeWorkspace:e.lastCodeWorkspace})||Ie(fe())||Pe(document,e.path);if(!n)return!1;const k=Le(n);return Fe(k,e.prompt),Te(k),e.openProject?.(n),e.touchCode?.(n),Re({variant:"success",title:`已为你创建 ${c.name}「${z.title}」任务`}),e.navigate(Ee(n)),!0}function _e(e,c){return Qt(e.promptTemplate,c)}function Ue(e){return Object.fromEntries(e.fields.map(c=>[c.id,ha(c)]))}function ha(e){return e.default?.trim()?e.default:e.placeholder?.replace(/^例如[::]\s*/,"").trim()??""}function ba(){const e=ct(),c=ot(),[z]=dt(),n=ut(),k=pt(),F=gt(),I=ht(),x=()=>Xe(e.id??""),ue=()=>Ct(c.search),B=()=>St(c.search,{category:x()?.category??"onemodel",domain:x()?.domain??"materials"}),ye=()=>wt(e.id??"",ue()),[T,M]=Ke({scenarioId:"",values:{},prompt:""}),[H,ae]=Ge(""),A=()=>x()?.scenarios.find(l=>l.id===T.scenarioId),Q=E(()=>{const l=x();return l?ft({domain:l.domain,name:l.name,id:l.id,category:l.category}):[]}),ie=E(()=>{const l=H();if(l)return yt(l)??Q().find(p=>de(p)===l)}),pe=()=>({navigate:n,isLoggedIn:!!fe(),path:k.data.path,recent:xt(k.data.project),lastCodeWorkspace:I.projects.lastCode(),openProject:l=>F.projects.open(l),touchCode:l=>I.projects.touchCode(l)}),b=()=>{const l=A();l&&M("prompt",_e(l,T.values))};bt(()=>{const l=x();if(!l?.scenarios.length)return;const p=z.scenario,$=(p?l.scenarios.find(U=>U.id===p):void 0)??l.scenarios[0],P=Ue($);M({scenarioId:$.id,values:P,prompt:_e($,P)})});const O=l=>{const f=x()?.scenarios.find(P=>P.id===l);if(!f)return;ae("");const $=Ue(f);M({scenarioId:f.id,values:$,prompt:_e(f,$)})},Se=l=>{ae(l)},le=(l,p)=>{const f=A();if(!f)return;const $={...T.values,[l]:p};M({values:$,prompt:_e(f,$)})},ge=()=>{const l=x(),p=A();!l||!p||et({resourceId:l.id,scenarioId:p.id,values:{...T.values},prompt:T.prompt,...pe()})},he=(l,p)=>{Ze({scenario:l,values:p.values,...pe()})};return(()=>{var l=Jt();return t(l,i(h,{get when(){return x()},get fallback(){return[i(K,{class:"os-client-capability-wizard-backdrop",get href(){return Ae()},"aria-label":"关闭向导"}),(()=>{var p=Xt();return p.firstChild,t(p,i(K,{get href(){return Ae()},children:"返回能力中心"}),null),p})()]},children:p=>i(h,{get when(){return Ye(p())},get fallback(){return[i(K,{class:"os-client-capability-wizard-backdrop",get href(){return B()},"aria-label":"关闭向导"}),(()=>{var f=ea(),$=f.firstChild,P=$.firstChild,U=P.nextSibling;return U.nextSibling,t($,()=>p().name,U),t(f,i(K,{get href(){return B()},children:"返回模型库"}),null),f})()]},get children(){return[i(K,{class:"os-client-capability-wizard-backdrop",get href(){return B()},"aria-label":"关闭向导"}),(()=>{var f=Zt(),$=f.firstChild,P=$.firstChild,U=P.firstChild,be=$.nextSibling,$e=be.firstChild,J=$e.firstChild,re=J.nextSibling,ne=$e.nextSibling;ne.firstChild;var V=ne.nextSibling,Y=V.firstChild,ve=Y.firstChild,we=ve.nextSibling,se=Y.nextSibling,G=be.nextSibling,ce=G.firstChild;return t($,i(K,{class:"os-client-capability-wizard-intro-back",get href(){return ye()},get children(){return ua(p().category)}}),P),t(U,()=>pa(p().name)),t($,i(K,{class:"os-client-capability-wizard-close",get href(){return B()},"aria-label":"关闭",children:"×"}),null),t(re,i(N,{get each(){return p().scenarios},children:d=>(()=>{var v=ta(),m=v.firstChild,S=m.nextSibling;return v.$$click=()=>O(d.id),t(m,()=>d.title),t(S,()=>d.summary),C(R=>{var D=!H()&&T.scenarioId===d.id,W=!H()&&T.scenarioId===d.id;return D!==R.e&&v.classList.toggle("is-active",R.e=D),W!==R.t&&q(v,"aria-pressed",R.t=W),R},{e:void 0,t:void 0}),v})()}),null),t(re,i(h,{get when(){return Q().length>0},get children(){var d=Yt(),v=d.firstChild;return v.firstChild,t(v,()=>Q().length,null),t(d,i(N,{get each(){return Q()},children:m=>(()=>{var S=aa(),R=S.firstChild,D=R.nextSibling,W=D.nextSibling,X=W.firstChild,Z=X.nextSibling;return Z.nextSibling,S.$$click=()=>Se(de(m)),t(R,()=>m.name),t(D,()=>Qe(m.problem_and_applicability)),t(W,()=>m.scenario_id,X),t(W,()=>m.workflow_steps?.length||m.workflow.length,Z),C(j=>{var ee=H()===de(m),te=H()===de(m);return ee!==j.e&&S.classList.toggle("is-active",j.e=ee),te!==j.t&&q(S,"aria-pressed",j.t=te),j},{e:void 0,t:void 0}),S})()}),null),d}}),null),t(ne,i(h,{get when(){return A()},keyed:!0,get fallback(){return Oe()},children:d=>(()=>{var v=la(),m=v.firstChild,S=m.nextSibling,R=S.firstChild,D=R.nextSibling,W=D.firstChild,X=W.firstChild,Z=X.nextSibling,j=W.nextSibling,ee=j.firstChild,te=ee.nextSibling,oe=j.nextSibling,Ce=oe.firstChild,a=Ce.nextSibling,s=oe.nextSibling,u=s.firstChild,w=u.nextSibling;return t(m,i(N,{get each(){return d.fields},children:g=>(()=>{var y=na(),L=y.firstChild;return t(L,()=>g.label),t(y,i(h,{get when(){return g.multiline},get fallback(){return(()=>{var o=sa();return o.$$input=_=>le(g.id,_.currentTarget.value),C(()=>q(o,"placeholder",g.placeholder)),C(()=>o.value=T.values[g.id]??""),o})()},get children(){var o=ra();return o.$$input=_=>le(g.id,_.currentTarget.value),C(()=>q(o,"placeholder",g.placeholder)),C(()=>o.value=T.values[g.id]??""),o}}),null),y})()})),t(Z,()=>d.capabilitySummary.current),t(te,()=>d.capabilitySummary.keyConfig),t(a,()=>d.capabilitySummary.resources),t(w,()=>d.capabilitySummary.deliverables),t(v,i(h,{get when(){return d.requiredData?.length},get children(){var g=ia(),y=g.firstChild,L=y.nextSibling;return t(L,i(N,{get each(){return d.requiredData},children:o=>(()=>{var _=ca();return t(_,o),_})()})),g}}),null),v})()}),null),t(V,i(h,{get when(){return A()},keyed:!0,get fallback(){return Oe()},children:d=>[(()=>{var v=oa(),m=v.firstChild,S=m.nextSibling;return t(m,()=>d.title),t(S,()=>d.summary),v})(),(()=>{var v=da(),m=v.firstChild,S=m.nextSibling;return t(S,()=>d.expectedOutputs),v})()]}),Y),we.$$click=b,se.$$input=d=>M("prompt",d.currentTarget.value),t(G,i(K,{get href(){return B()},children:"返回能力中心"}),ce),ce.$$click=ge,C(()=>ce.disabled=!T.prompt.trim()),C(()=>se.value=T.prompt),f})(),i(h,{get when(){return ie()},children:f=>i(Bt,{get scenario(){return f()},onClose:()=>ae(""),onSubmit:$=>he(f(),$)})})]}})})),l})()}Ve(["click","input"]);const va=Object.freeze(Object.defineProperty({__proto__:null,CapabilityWizardPage:ba,startCapabilityPromptTask:ga,startCapabilityScenarioRunTask:Ze,startCapabilityWizardTask:et},Symbol.toStringTag,{value:"Module"}));export{Bt as S,Ze as a,et as b,ga as s,va as w};
@@ -1 +1 @@
1
- const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609190953/assets/yup-01-BtRq6dLN.aac";export{e as default};
1
+ const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609191621/assets/yup-01-BtRq6dLN.aac";export{e as default};
@@ -1 +1 @@
1
- const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609190953/assets/yup-03-BHLEoqSS.aac";export{e as default};
1
+ const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609191621/assets/yup-03-BHLEoqSS.aac";export{e as default};
@@ -1 +1 @@
1
- const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609190953/assets/yup-04-C7yadpJT.aac";export{e as default};
1
+ const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609191621/assets/yup-04-C7yadpJT.aac";export{e as default};
@@ -1 +1 @@
1
- const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609190953/assets/yup-05-CuuaeyjC.aac";export{e as default};
1
+ const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609191621/assets/yup-05-CuuaeyjC.aac";export{e as default};
package/index.html CHANGED
@@ -8,19 +8,19 @@
8
8
  name="description"
9
9
  content="OneScience is an AI for Science workspace for research discovery, agent workflows, and scientific knowledge."
10
10
  />
11
- <link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609190953/favicon-96x96-v3.png" sizes="96x96" />
12
- <link rel="shortcut icon" href="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609190953/favicon-v3.ico" />
13
- <link rel="apple-touch-icon" sizes="180x180" href="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609190953/apple-touch-icon-v3.png" />
14
- <link rel="manifest" href="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609190953/site.webmanifest" />
15
- <link rel="preload" href="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609190953/assets/fonts/inter-400.woff2" as="font" type="font/woff2" crossorigin />
16
- <link rel="preload" href="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609190953/assets/fonts/noto-sc-400.woff2" as="font" type="font/woff2" crossorigin />
11
+ <link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609191621/favicon-96x96-v3.png" sizes="96x96" />
12
+ <link rel="shortcut icon" href="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609191621/favicon-v3.ico" />
13
+ <link rel="apple-touch-icon" sizes="180x180" href="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609191621/apple-touch-icon-v3.png" />
14
+ <link rel="manifest" href="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609191621/site.webmanifest" />
15
+ <link rel="preload" href="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609191621/assets/fonts/inter-400.woff2" as="font" type="font/woff2" crossorigin />
16
+ <link rel="preload" href="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609191621/assets/fonts/noto-sc-400.woff2" as="font" type="font/woff2" crossorigin />
17
17
  <meta name="theme-color" content="#F8F7F7" />
18
18
  <meta name="theme-color" content="#131010" media="(prefers-color-scheme: dark)" />
19
- <meta property="og:image" content="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609190953/social-share.png" />
20
- <meta property="twitter:image" content="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609190953/social-share.png" />
21
- <script id="oc-theme-preload-script" src="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609190953/oc-theme-preload.js"></script>
22
- <script type="module" crossorigin src="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609190953/assets/index-5t1ell5L.js"></script>
23
- <link rel="stylesheet" crossorigin href="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609190953/assets/index-CWdCxJdh.css">
19
+ <meta property="og:image" content="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609191621/social-share.png" />
20
+ <meta property="twitter:image" content="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609191621/social-share.png" />
21
+ <script id="oc-theme-preload-script" src="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609191621/oc-theme-preload.js"></script>
22
+ <script type="module" crossorigin src="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609191621/assets/index-CLUM_n0C.js"></script>
23
+ <link rel="stylesheet" crossorigin href="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609191621/assets/index-CX0zdxzc.css">
24
24
  </head>
25
25
  <body class="antialiased overscroll-none text-12-regular overflow-hidden">
26
26
  <noscript>You need to enable JavaScript to run this app.</noscript>
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@onescience/onecode-web",
3
- "version": "1.14.50-202609190953",
3
+ "version": "1.14.50-202609191621",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "description": "OneCode web UI static assets for CDN delivery.",
8
- "homepage": "https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609190953/index.html",
8
+ "homepage": "https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609191621/index.html",
9
9
  "jsdelivr": "index.html",
10
10
  "files": [
11
11
  "**/*"
@@ -1 +0,0 @@
1
- const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609190953/assets/alert-06-GK5Tqy6u.aac";export{e as default};
@@ -1 +0,0 @@
1
- const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609190953/assets/alert-07-0r0kiLGz.aac";export{e as default};
@@ -1 +0,0 @@
1
- const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609190953/assets/alert-08-CZowNquU.aac";export{e as default};
@@ -1 +0,0 @@
1
- const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609190953/assets/alert-10-Ck5hR7zH.aac";export{e as default};
@@ -1 +0,0 @@
1
- const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609190953/assets/bip-bop-09-CxEgoAHQ.aac";export{e as default};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-5t1ell5L.js","assets/index-CWdCxJdh.css"])))=>i.map(i=>d[i]);
2
- import{cV as _,i as d,a as n,S as h,t as f,C as S,L as k,c as M,ag as T,dw as P,E as z,at as B,dx as x,b5 as j,dy as D,dz as y,dA as A,dB as F,D as R,dC as w,dD as G,dE as V,dF as H,dG as K,dH as v,dl as q,bq as I,dI as L}from"./index-5t1ell5L.js";var N=f('<div class="flex flex-col gap-1 py-1"><div class=text-13-medium></div><div class="text-12-regular text-text-invert-base"></div><div class="text-12-regular text-text-invert-base">'),W=f('<div class="text-12-regular text-text-invert-base">');const J=o=>{const r=_(),l=e=>{const i=`${e.id} ${e.name}`.toLowerCase();return/claude|anthropic/.test(i)?r.t("model.provider.anthropic"):/gpt|o[1-4]|codex|openai/.test(i)?r.t("model.provider.openai"):/gemini|palm|bard|google/.test(i)?r.t("model.provider.google"):/grok|xai/.test(i)?r.t("model.provider.xai"):/llama|meta/.test(i)?r.t("model.provider.meta"):e.provider.name},u=e=>e==="text"?r.t("model.input.text"):e==="image"?r.t("model.input.image"):e==="audio"?r.t("model.input.audio"):e==="video"?r.t("model.input.video"):e==="pdf"?r.t("model.input.pdf"):e,a=()=>{const e=[];o.latest&&e.push(r.t("model.tag.latest")),o.free&&e.push(r.t("model.tag.free")),o.limited&&e.push(r.t("model.tag.limited"));const i=e.length?` (${e.join(", ")})`:"";return`${l(o.model)} ${o.model.name}${i}`},g=()=>{if(o.model.capabilities){const c=o.model.capabilities.input,p=["text","image","audio","video","pdf"].filter(s=>c[s]).map(s=>u(s));return p.length?p.join(", "):void 0}const e=o.model.modalities?.input;if(!e)return;const i=e.map(c=>u(c));return i.length?i.join(", "):void 0},m=()=>o.model.capabilities?o.model.capabilities.reasoning?r.t("model.tooltip.reasoning.allowed"):r.t("model.tooltip.reasoning.none"):o.model.reasoning?r.t("model.tooltip.reasoning.allowed"):r.t("model.tooltip.reasoning.none"),t=()=>r.t("model.tooltip.context",{limit:o.model.limit.context.toLocaleString()});return(()=>{var e=N(),i=e.firstChild,c=i.nextSibling,b=c.nextSibling;return d(i,a),d(e,n(h,{get when(){return g()},children:p=>(()=>{var s=W();return d(s,()=>r.t("model.tooltip.allows",{inputs:p()})),s})()}),c),d(c,m),d(b,t),e})()};var Q=f('<div class="flex items-center justify-between w-full gap-2 pr-1"><span class=truncate>'),U=f('<div class="w-full flex items-center gap-x-2 text-13-regular"><span class=truncate>'),X=f('<div class="flex items-center gap-1">'),Y=f('<div class="px-3 py-8 text-14-regular text-text-weak">');const $=(o,r,l)=>o==="opencode"&&(!r||r.input===0)||o==="onescience"&&l==="glm-5.2",C=(o,r)=>o==="onescience"&&r!=="glm-5.2",E=o=>{const r=o.model??A().model,l=_(),u=S(),a=k(),g=F(),m=R(()=>r.list().filter(e=>o.provider?e.provider.id===o.provider:!0).filter(e=>r.visible({modelID:e.id,providerID:e.provider.id})).map(e=>({...e,search:[e.provider.name,e.provider.id,e.name,e.id,e.family,$(e.provider.id,e.cost,e.id)?"free 免费":"",C(e.provider.id,e.id)?"limited 限免":"",e.latest?"latest 最新":""].join(" ")})));return n(q,{get class(){return`flex-1 min-h-0 [&_[data-slot=list-scroll]]:flex-1 [&_[data-slot=list-scroll]]:min-h-0 ${o.class??""}`},get search(){return{placeholder:l.t("dialog.model.search.placeholder"),autofocus:!0,action:o.action}},get emptyMessage(){return l.t("dialog.model.empty")},key:t=>`${t.provider.id}:${t.id}`,items:m,get current(){return r.current()},scrollToCurrent:!1,filterKeys:["search"],sortBy:(t,e)=>t.name.localeCompare(e.name),groupBy:t=>t.provider.name,sortGroupsBy:(t,e)=>{const i=t.items[0].provider.id,c=e.items[0].provider.id;return v.includes(i)&&!v.includes(c)?-1:!v.includes(i)&&v.includes(c)?1:v.indexOf(i)-v.indexOf(c)},groupHeader:t=>{const e=t.items[0].provider.id,i=g.connected().find(s=>s.id===e)??g.all().find(s=>s.id===e),c=G(e,a.data.config.public_providers),b=e!=="onescience"&&e!=="opencode"&&e!=="opencode-go"&&!c&&i?.source!=="env",p=V(e,a.data.config.provider?.[e],i,a.data.config.public_providers);return(()=>{var s=Q(),O=s.firstChild;return d(O,()=>t.category),d(s,n(h,{when:b,get children(){return n(P,{size:"small",variant:"ghost",class:"shrink-0 h-6 px-1.5 text-12-medium",onClick:()=>{u.show(()=>p?n(H,{providerID:e,back:"picker"}):n(K,{provider:e,back:"picker"}))},get children(){return l.t("common.edit")}})}}),null),s})()},itemWrapper:(t,e)=>n(D,{class:"w-full",placement:"right-start",gutter:12,get value(){return n(J,{model:t,get latest(){return t.latest},get free(){return $(t.provider.id,t.cost,t.id)},get limited(){return C(t.provider.id,t.id)}})},children:e}),onSelect:t=>{r.set(t?{modelID:t.id,providerID:t.provider.id}:void 0,{recent:!0}),o.onSelect()},children:t=>(()=>{var e=U(),i=e.firstChild;return d(i,()=>t.name),d(e,n(h,{get when(){return $(t.provider.id,t.cost,t.id)},get children(){return n(w,{get children(){return l.t("model.tag.free")}})}}),null),d(e,n(h,{get when(){return C(t.provider.id,t.id)},get children(){return n(w,{get children(){return l.t("model.tag.limited")}})}}),null),d(e,n(h,{get when(){return t.latest},get children(){return n(w,{get children(){return l.t("model.tag.latest")}})}}),null),e})()})};function ee(o){const[r,l]=B({open:!1,dismiss:null}),u=S(),a=e=>{l("dismiss",e),l("open",!1)},g=()=>{a("manage"),u.show(()=>n(I,{tab:"models"}))},m=()=>{a("provider"),L(()=>import("./index-5t1ell5L.js").then(e=>e.dO),__vite__mapDeps([0,1])).then(e=>{u.show(()=>n(e.DialogSelectProvider,{}))})},t=_();return n(x,{get open(){return r.open},onOpenChange:e=>{e&&l("dismiss",null),l("open",e)},modal:!1,placement:"top-start",gutter:4,get children(){return[n(x.Trigger,j({get as(){return o.triggerAs??"div"}},()=>o.triggerProps,{get children(){return o.children}})),n(x.Portal,{get children(){return n(x.Content,{class:"w-72 h-80 flex flex-col p-2 rounded-md border border-border-base bg-surface-raised-stronger-non-alpha shadow-md z-50 outline-none overflow-hidden",onEscapeKeyDown:e=>{a("escape"),e.preventDefault(),e.stopPropagation()},onPointerDownOutside:()=>a("outside"),onFocusOutside:()=>a("outside"),onCloseAutoFocus:e=>{const i=r.dismiss;i==="outside"&&e.preventDefault(),(i==="escape"||i==="select")&&(e.preventDefault(),o.onClose?.(i)),l("dismiss",null)},get children(){return[n(x.Title,{class:"sr-only",get children(){return t.t("dialog.model.select.title")}}),n(E,{get provider(){return o.provider},get model(){return o.model},onSelect:()=>a("select"),class:"p-1",get action(){return(()=>{var e=X();return d(e,n(D,{placement:"top",get value(){return t.t("command.provider.connect")},get children(){return n(y,{icon:"plus-small",variant:"ghost",iconSize:"normal",class:"size-6",get"aria-label"(){return t.t("command.provider.connect")},onClick:m})}}),null),d(e,n(D,{placement:"top",get value(){return t.t("settings.models.title")},get children(){return n(y,{icon:"sliders",variant:"ghost",iconSize:"normal",class:"size-6",get"aria-label"(){return t.t("settings.models.title")},onClick:g})}}),null),e})()}})]}})}})]}})}const te=o=>{const r=S(),l=_(),u=k(),[a,g]=M(u.data.provider.all.length>0);T(()=>{a()||u.ensureProviders().then(()=>g(!0)).catch(()=>g(!0))});const m=()=>{L(()=>import("./index-5t1ell5L.js").then(e=>e.dO),__vite__mapDeps([0,1])).then(e=>{r.show(()=>n(e.DialogSelectProvider,{}))})},t=()=>{r.show(()=>n(I,{tab:"models"}))};return n(z,{get title(){return l.t("dialog.model.select.title")},get action(){return n(P,{class:"h-7 -my-1 text-14-medium",icon:"plus-small",tabIndex:-1,onClick:m,get children(){return l.t("command.provider.connect")}})},get children(){return[n(h,{get when(){return a()||u.data.provider.all.length>0},get fallback(){return(()=>{var e=Y();return d(e,()=>l.t("toast.provider.catalogLoading.description")),e})()},get children(){return n(E,{get provider(){return o.provider},get model(){return o.model},onSelect:()=>r.close()})}}),n(P,{variant:"ghost",class:"ml-3 mt-5 mb-6 text-text-base self-start",onClick:t,get children(){return l.t("settings.models.title")}})]}})};export{te as DialogSelectModel,ee as ModelSelectorPopover};
@@ -1 +0,0 @@
1
- const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609190953/assets/nope-12-BJR1Ka3c.aac";export{e as default};