@onescience/onecode-web 1.14.50-202609080918 → 1.14.50-202609081145

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 (57) hide show
  1. package/assets/{3Dmol-RKDiXaRg.js → 3Dmol-yKn7g_OH.js} +1 -1
  2. package/assets/{account-system-DFYTCeNL.js → account-system-BBzbYGVI.js} +1 -1
  3. package/assets/{alert-04-jmqtByAD.js → alert-01-4vQjfQlo.js} +1 -1
  4. package/assets/{alert-05-CE6tI9A0.js → alert-02-DBXe19YL.js} +1 -1
  5. package/assets/{alert-01-B6SjnkXH.js → alert-04-Dh9kihP-.js} +1 -1
  6. package/assets/{alert-02-Bn6728rM.js → alert-05-DGW7VOcd.js} +1 -1
  7. package/assets/alert-06-Ch8bS0da.js +1 -0
  8. package/assets/alert-07-CAyq_qRF.js +1 -0
  9. package/assets/alert-08-C9TKX8fn.js +1 -0
  10. package/assets/alert-10-CI_TfWOv.js +1 -0
  11. package/assets/{bip-bop-03-hI-vWCWS.js → bip-bop-03-BlpKS-LK.js} +1 -1
  12. package/assets/{bip-bop-04-Cgr5t3Zo.js → bip-bop-04-tC9I1t9d.js} +1 -1
  13. package/assets/{bip-bop-06-eb5ijA50.js → bip-bop-06-CxlEnYna.js} +1 -1
  14. package/assets/{bip-bop-08-khYj4LJQ.js → bip-bop-08-B16UdwaS.js} +1 -1
  15. package/assets/bip-bop-09-Dz_Piwgq.js +1 -0
  16. package/assets/center-DkDQ492x.js +5 -0
  17. package/assets/{dialog-edit-project-tcU9hl39.js → dialog-edit-project-9AEtXVZR.js} +1 -1
  18. package/assets/{dialog-fork-uQ5csZRc.js → dialog-fork-B7p6NlOf.js} +1 -1
  19. package/assets/{dialog-project-upload-CsReduwu.js → dialog-project-upload-DiHGJYuE.js} +1 -1
  20. package/assets/{dialog-select-file-BfPPNy9k.js → dialog-select-file-CUd5WRFD.js} +1 -1
  21. package/assets/{dialog-select-model-C52crykE.js → dialog-select-model-UtT_TqAw.js} +2 -2
  22. package/assets/{dialog-terminal-unavailable-BkHYaj5Y.js → dialog-terminal-unavailable-DojtZN6v.js} +1 -1
  23. package/assets/{docs-CNwLKp7S.js → docs-DAl1qa5J.js} +1 -1
  24. package/assets/{ghostty-web-BjYePGZA.js → ghostty-web-CG7EXZFg.js} +1 -1
  25. package/assets/{home-ChQHvRIz.js → home-B2engr06.js} +1 -1
  26. package/assets/{index-BwlDF8Yo.js → index-CjqsrRCL.js} +11 -11
  27. package/assets/{index-C08Qpyxg.css → index-qvfonuvp.css} +1 -1
  28. package/assets/{intro-ClyaOLOp.js → intro-B5yQbN-k.js} +1 -1
  29. package/assets/{nope-02-eTwBuVFA.js → nope-02-B5EjAkH1.js} +1 -1
  30. package/assets/{nope-05-nRSq_Cvk.js → nope-05-Cu1IzAU8.js} +1 -1
  31. package/assets/{nope-08-CT0ZPkUQ.js → nope-08-DSn4eqwy.js} +1 -1
  32. package/assets/{nope-11-Dee-nhac.js → nope-11-BS7hXU3W.js} +1 -1
  33. package/assets/nope-12-Cu6aPMkh.js +1 -0
  34. package/assets/{onescience-BoAw7Siq.js → onescience-LsLZkI7t.js} +1 -1
  35. package/assets/{resources-DGV7mmBh.js → resources-CInc-819.js} +1 -1
  36. package/assets/{selection-rjfgbO6y.js → selection-DZfvLSGx.js} +1 -1
  37. package/assets/{shell-Bdw4x3qZ.js → shell-DoZVKGp4.js} +2 -2
  38. package/assets/{skills-CReL5hzR.js → skills-uxPlU4Zy.js} +1 -1
  39. package/assets/{staplebops-03-Bnug52UI.js → staplebops-03-xkuuNMNR.js} +1 -1
  40. package/assets/{staplebops-04-tlRw4aZh.js → staplebops-04-Csd7gBG5.js} +1 -1
  41. package/assets/{staplebops-06-BQHHghSz.js → staplebops-06-NlxQqLpp.js} +1 -1
  42. package/assets/{staplebops-07-CBHBHWCe.js → staplebops-07-BBP1uR4u.js} +1 -1
  43. package/assets/{status-popover-body-BSpw3lkO.js → status-popover-body-mUwk7heS.js} +2 -2
  44. package/assets/{wizard-vRbib2EA.js → wizard-CV21yDeu.js} +1 -1
  45. package/assets/{yup-01-CTfekeWH.js → yup-01-BceRj1Ih.js} +1 -1
  46. package/assets/{yup-03-DZ9dhDcC.js → yup-03-B4xs6sVx.js} +1 -1
  47. package/assets/{yup-04-EIrCkyiu.js → yup-04-CCdDP81m.js} +1 -1
  48. package/assets/{yup-05-C5sTiBKc.js → yup-05-DhlXzbEx.js} +1 -1
  49. package/index.html +11 -11
  50. package/package.json +2 -2
  51. package/assets/alert-06-BAi_L4zP.js +0 -1
  52. package/assets/alert-07-Cn7ZOenp.js +0 -1
  53. package/assets/alert-08-D6LHIgAM.js +0 -1
  54. package/assets/alert-10-be3tLNNN.js +0 -1
  55. package/assets/bip-bop-09-DFPW_zRQ.js +0 -1
  56. package/assets/center-BVBFp6ru.js +0 -5
  57. package/assets/nope-12-BcNQ0hvD.js +0 -1
@@ -1 +1 @@
1
- import{b as Ne,m as et,bm as Xe,da as Oe,x as tt,o as L,db as it,dc as ke,dd as Ie,de as ye,df as Ue,dg as le,dh as at,ak as Se,i as t,c as a,Q as w,F as Z,T as A,S as g,R as Pe,di as lt,dj as rt,dk as Ae,dl as nt,dm as st,t as n,dn as ct,d7 as ot,e as dt,dp as ut,f as pt,h as gt,g as ht,l as bt,n as vt,ag as $t,X as Te,aX as Fe,r as Le,s as Ce,aZ as je,Z as Re,ba as qe,Y as We,_ as De,E as Ee,dq as mt,dr as _t,bt as pe,ds as ft,dt as yt,b8 as Ye,bu as Ze,du as St,br as wt,L as Y,bT as Be,d8 as Ct,bv as xt,d9 as zt,aY as kt}from"./index-BwlDF8Yo.js";var It=n("<div class=os-client-capability-wizard-papers><h3>相关论文</h3><ul>"),Pt=n("<div class=os-client-capability-wizard-papers><h3>HPC 软件</h3><span>"),Tt=n("<p class=os-client-capability-wizard-note>工作目录与运行环境由系统自动识别,本步只需填写下列业务参数。"),Ft=n("<p class=os-client-capability-wizard-missing>本步还有 <!> 个必填参数未填写。"),Lt=n("<p class=os-client-capability-wizard-missing>本步有 <!> 个参数类型不正确,请按标注类型修改。"),jt=n("<p class=os-client-capability-wizard-missing>其他步骤还有 <!> 个必填参数未填写,可点击左侧步骤继续补全。"),Rt=n("<p class=os-client-capability-wizard-missing>其他步骤还有 <!> 个参数类型不正确,可点击左侧步骤修改。"),qt=n("<small>"),Wt=n("<ul class=os-client-capability-wizard-output-list>"),Dt=n("<div class=os-client-capability-wizard-quality><strong>质量门禁</strong><p>"),Et=n('<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>创建任务并自动逐步执行'),Ht=n("<li><button type=button class=os-client-capability-wizard-step><span></span><div><p>"),Mt=n('<li><a target=_blank rel="noopener noreferrer">'),Ot=n("<p>"),Ut=n("<div class=os-client-capability-wizard-step-banner><strong>"),At=n("<p class=os-client-capability-wizard-note>本步无需额外用户参数。"),Bt=n("<em>*"),Kt=n("<small class=os-client-capability-wizard-field-type>"),Vt=n("<textarea rows=3>"),Ke=n("<em class=os-client-capability-wizard-field-error>"),Gt=n("<label class=os-client-capability-wizard-field><span>"),Nt=n("<input type=text>"),Xt=n("<p class=os-client-capability-wizard-outputs-empty>本步暂无结构化产出清单。"),Yt=n("<li>");function Zt(e){const d=et(),[l,v]=Xe({values:Oe(e.scenario),attempted:!1,activeStepIndex:0});tt(()=>{v({values:Oe(e.scenario),attempted:!1,activeStepIndex:0})});const S=L(()=>it(e.scenario)),k=L(()=>S()[l.activeStepIndex]??S()[0]),B=L(()=>{const $=k();return $?ke(e.scenario,$):e.scenario.user_input}),j=L(()=>Ie(e.scenario,l.values)),ge=L(()=>ye(e.scenario.user_input,l.values)),K=L(()=>B().filter($=>Ue($)?!String(l.values[le($)]??"").trim():!1)),oe=L(()=>ye(B(),l.values)),I=L(()=>B().filter($=>String(l.values[le($)]??"").trim()).length),Q=L(()=>{const P=k()?.prompt||e.scenario.ai_prompt?.template||"";return at(P,l.values)}),G=L(()=>k()?.outputs??[]),re=L(()=>(e.scenario.related_papers??[]).filter($=>!!String($.url??"").trim())),N=($,P)=>{v("values",$,P)},J=$=>{v("activeStepIndex",$)},xe=()=>{v("attempted",!0);const $=ye(e.scenario.user_input,l.values);if($.length>0){const R=le($[0]),x=S().findIndex(te=>ke(e.scenario,te).some(r=>le(r)===R));x>=0&&v("activeStepIndex",x);return}const P=Ie(e.scenario,l.values);if(P.length===0){e.onSubmit({values:{...l.values}});return}const de=le(P[0]),ee=S().findIndex(R=>ke(e.scenario,R).some(x=>le(x)===de));ee>=0&&v("activeStepIndex",ee),d.show(()=>a(ct,{title:"请补充必填参数",get reason(){return`还有 ${P.length} 个必填参数未填写,补充后即可创建任务并自动逐步执行。`},fields:P,get values(){return l.values},onConfirm:R=>{const x={...l.values,...R};v("values",x),!(ye(e.scenario.user_input,x).length>0||Ie(e.scenario,x).length>0)&&e.onSubmit({values:x})}}))};return(()=>{var $=Et(),P=$.firstChild,de=P.nextSibling,ee=de.firstChild,R=ee.firstChild,x=R.nextSibling,te=x.firstChild,r=te.nextSibling,h=x.nextSibling,m=ee.nextSibling,b=m.firstChild,q=b.firstChild,X=q.nextSibling,he=X.nextSibling,W=b.nextSibling,be=W.firstChild,ve=be.firstChild,V=ve.nextSibling,ue=V.firstChild,ne=ue.nextSibling,ze=ne.nextSibling,$e=ze.nextSibling;$e.nextSibling;var D=be.nextSibling,me=D.nextSibling,ie=me.firstChild,u=ie.nextSibling,p=W.nextSibling,_=p.firstChild,T=_.firstChild;T.firstChild;var F=_.nextSibling,H=F.firstChild,E=H.nextSibling,se=E.firstChild,M=se.nextSibling;M.nextSibling;var ae=F.nextSibling,ce=m.nextSibling,_e=ce.firstChild,fe=_e.nextSibling;return Se(P,"click",e.onClose,!0),Se(R,"click",e.onClose,!0),t(te,()=>e.scenario.name),t(r,()=>e.scenario.problem_and_applicability),Se(h,"click",e.onClose,!0),t(he,a(Z,{get each(){return S()},children:(i,s)=>(()=>{var c=Ht(),z=c.firstChild,O=z.firstChild,f=O.nextSibling,y=f.firstChild;return z.$$click=()=>J(s()),t(O,()=>s()+1),t(y,()=>i.name),w(()=>c.classList.toggle("is-active",l.activeStepIndex===s())),c})()})),t(b,a(g,{get when(){return re().length>0},get children(){var i=It(),s=i.firstChild,c=s.nextSibling;return t(c,a(Z,{get each(){return re()},children:z=>(()=>{var O=Mt(),f=O.firstChild;return t(f,()=>z.title),w(y=>{var U=z.url,o=z.title;return U!==y.e&&A(f,"href",y.e=U),o!==y.t&&A(f,"title",y.t=o),y},{e:void 0,t:void 0}),O})()})),i}}),null),t(b,a(g,{get when(){return e.scenario.HPC},get children(){var i=Pt(),s=i.firstChild,c=s.nextSibling;return t(c,()=>e.scenario.HPC),i}}),null),t(V,()=>l.activeStepIndex+1,ue),t(V,()=>S().length,ne),t(V,I,$e),t(V,()=>B().length,null),t(W,a(g,{get when(){return k()},children:i=>(()=>{var s=Ut(),c=s.firstChild;return t(c,()=>i().name),t(s,a(g,{get when(){return i().purpose?.trim()},get children(){var z=Ot();return t(z,()=>i().purpose),z}}),null),s})()}),D),t(W,a(g,{get when(){return e.scenario.system_auto_detection?.fields?.length},get children(){return Tt()}}),D),t(W,a(g,{get when(){return Pe(()=>!!l.attempted)()&&K().length>0},get children(){var i=Ft(),s=i.firstChild,c=s.nextSibling;return c.nextSibling,t(i,()=>K().length,c),i}}),D),t(W,a(g,{get when(){return oe().length>0},get children(){var i=Lt(),s=i.firstChild,c=s.nextSibling;return c.nextSibling,t(i,()=>oe().length,c),i}}),D),t(W,a(g,{get when(){return Pe(()=>!!(l.attempted&&j().length>0))()&&K().length===0},get children(){var i=jt(),s=i.firstChild,c=s.nextSibling;return c.nextSibling,t(i,()=>j().length,c),i}}),D),t(W,a(g,{get when(){return Pe(()=>!!(l.attempted&&ge().length>0))()&&oe().length===0},get children(){var i=Rt(),s=i.firstChild,c=s.nextSibling;return c.nextSibling,t(i,()=>ge().length,c),i}}),D),t(D,a(g,{get when(){return B().length>0},get fallback(){return At()},get children(){return a(Z,{get each(){return B()},children:i=>{const s=le(i),c=Ue(i),z=l.attempted&&c&&!String(l.values[s]??"").trim(),O=lt(i,l.values[s]??""),f=!!O&&(l.attempted||!!String(l.values[s]??"").trim());return(()=>{var y=Gt(),U=y.firstChild;return y.classList.toggle("is-required",!!c),y.classList.toggle("is-invalid",!!(z||f)),t(U,()=>rt(i),null),t(U,a(g,{when:c,get children(){return Bt()}}),null),t(U,a(g,{get when(){return i.input_type},get children(){var o=Kt();return t(o,()=>i.input_type),o}}),null),t(y,a(g,{get when(){return nt(i)},get fallback(){return(()=>{var o=Nt();return o.$$input=C=>N(s,C.currentTarget.value),w(C=>{var He=i.input_type==="int"||i.input_type==="float"?"decimal":void 0,Me=Ae(i);return He!==C.e&&A(o,"inputmode",C.e=He),Me!==C.t&&A(o,"placeholder",C.t=Me),C},{e:void 0,t:void 0}),w(()=>o.value=l.values[s]??""),o})()},get children(){var o=Vt();return o.$$input=C=>N(s,C.currentTarget.value),w(()=>A(o,"placeholder",Ae(i))),w(()=>o.value=l.values[s]??""),o}}),null),t(y,a(g,{when:f,get children(){var o=Ke();return t(o,O),o}}),null),t(y,a(g,{when:z&&!f,get children(){var o=Ke();return t(o,()=>st(i,"")),o}}),null),y})()}})}})),ie.$$click=()=>J(Math.max(0,l.activeStepIndex-1)),u.$$click=()=>J(Math.min(S().length-1,l.activeStepIndex+1)),t(T,a(g,{get when(){return k()?.result_subfolder},get children(){var i=qt();return t(i,()=>k()?.result_subfolder),w(()=>A(i,"title",k()?.result_subfolder)),i}}),null),t(_,a(g,{get when(){return G().length>0},get fallback(){return Xt()},get children(){var i=Wt();return t(i,a(Z,{get each(){return G()},children:s=>(()=>{var c=Yt();return t(c,s),c})()})),i}}),null),t(_,a(g,{get when(){return k()?.quality_gate},get children(){var i=Dt(),s=i.firstChild,c=s.nextSibling;return t(c,()=>k()?.quality_gate),i}}),null),t(E,()=>l.activeStepIndex+1,M),Se(_e,"click",e.onClose,!0),fe.$$click=xe,w(i=>{var s=l.activeStepIndex<=0,c=l.activeStepIndex>=S().length-1;return s!==i.e&&(ie.disabled=i.e=s),c!==i.t&&(u.disabled=i.t=c),i},{e:void 0,t:void 0}),w(()=>ae.value=Q()),$})()}Ne(["click","input"]);function Qt(e,d){return e.replace(/\{\{(\w+)\}\}/g,(l,v)=>d[v]??"")}var Jt=n("<div class=os-client-capability-wizard-overlay role=dialog aria-modal=true aria-label=能力向导>"),ei=n("<section class=os-client-capability-wizard-dialog><p>未找到该能力。"),ti=n("<div class=os-client-capability-wizard-scenario-group><span>完整工作流场景"),ii=n("<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>创建任务"),ai=n("<section class=os-client-capability-wizard-dialog><p>「<!>」暂无 OneScience 源码或魔搭映射,当前不可使用。"),li=n("<button type=button><strong></strong><p>"),ri=n("<button type=button><strong></strong><p></p><small> · <!> 步"),Ve=n("<p class=os-client-capability-wizard-empty>请先选择任务场景。"),ni=n("<div class=os-client-capability-wizard-required aria-label=该能力需要什么数据><h4>该能力需要什么数据</h4><ul>"),si=n("<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>"),ci=n("<textarea rows=3>"),oi=n("<label class=os-client-capability-wizard-field><span>"),di=n("<input type=text>"),ui=n("<li>"),pi=n("<div class=os-client-capability-wizard-right-head><strong></strong><p>"),gi=n("<div class=os-client-capability-wizard-outputs aria-label=预计产出><span>预计产出</span><p>");function hi(e){return e==="hpc"?"软件介绍":"模型介绍"}function bi(e){return`使用 ${e} 开始科研任务`}function vi(e){if(!Te({navigate:e.navigate,action:{type:"prompt",prompt:e.prompt,title:e.title,workflow:e.workflow},isLoggedIn:e.isLoggedIn}))return!1;const d=Fe({path:e.path,recent:e.recent,lastCodeWorkspace:e.lastCodeWorkspace})||Le(Ce())||je(document,e.path);if(!d)return!1;const l=Re(d);return qe(l,e.prompt),We(l),e.openProject?.(d),e.touchCode?.(d),De({variant:"success",title:`已为你创建「${e.title}」任务`}),e.navigate(Ee(d)),!0}function Qe(e){const d=mt(e.scenario),l=d[0];if(!l?.promptTemplate.trim()||!Te({navigate:e.navigate,action:{type:"scenario-run",scenarioId:e.scenario.id||e.scenario.scenario_id,values:e.values},isLoggedIn:e.isLoggedIn}))return!1;const v=Fe({path:e.path,recent:e.recent,lastCodeWorkspace:e.lastCodeWorkspace})||Le(Ce())||je(document,e.path);if(!v)return!1;const S=Re(v);return _t(S,{title:e.scenario.name,scenarioId:pe(e.scenario),values:e.values,steps:d}),ft("todo"),qe(S,yt(l,e.values)),We(S),e.openProject?.(v),e.touchCode?.(v),De({variant:"success",title:`已创建「${e.scenario.name}」`,description:`将按 ${d.length} 步自动依次执行,缺参或失败时暂停`}),e.navigate(Ee(v)),!0}function Je(e){if(!Te({navigate:e.navigate,action:{type:"wizard",resourceId:e.resourceId,scenarioId:e.scenarioId,values:e.values,prompt:e.prompt},isLoggedIn:e.isLoggedIn}))return!1;const d=Ye(e.resourceId),l=d?.scenarios.find(k=>k.id===e.scenarioId);if(!d||!l||!Ze(d))return!1;const v=Fe({path:e.path,recent:e.recent,lastCodeWorkspace:e.lastCodeWorkspace})||Le(Ce())||je(document,e.path);if(!v)return!1;const S=Re(v);return qe(S,e.prompt),We(S),e.openProject?.(v),e.touchCode?.(v),De({variant:"success",title:`已为你创建 ${d.name}「${l.title}」任务`}),e.navigate(Ee(v)),!0}function we(e,d){return Qt(e.promptTemplate,d)}function Ge(e){return Object.fromEntries(e.fields.map(d=>[d.id,$i(d)]))}function $i(e){return e.default?.trim()?e.default:e.placeholder?.replace(/^例如[::]\s*/,"").trim()??""}function mi(){const e=ot(),d=dt(),[l]=ut(),v=pt(),S=gt(),k=ht(),B=bt(),j=()=>Ye(e.id??""),ge=()=>zt(d.search),K=()=>Ct(d.search,{category:j()?.category??"onemodel",domain:j()?.domain??"materials"}),oe=()=>xt(e.id??"",ge()),[I,Q]=Xe({scenarioId:"",values:{},prompt:""}),[G,re]=vt(""),N=()=>j()?.scenarios.find(r=>r.id===I.scenarioId),J=L(()=>{const r=j();return r?St({domain:r.domain,name:r.name,id:r.id,category:r.category}):[]}),xe=L(()=>{const r=G();if(r)return wt(r)??J().find(h=>pe(h)===r)}),$=()=>({navigate:v,isLoggedIn:!!Ce(),path:S.data.path,recent:kt(S.data.project),lastCodeWorkspace:B.projects.lastCode(),openProject:r=>k.projects.open(r),touchCode:r=>B.projects.touchCode(r)}),P=()=>{const r=N();r&&Q("prompt",we(r,I.values))};$t(()=>{const r=j();if(!r?.scenarios.length)return;const h=l.scenario,b=(h?r.scenarios.find(X=>X.id===h):void 0)??r.scenarios[0],q=Ge(b);Q({scenarioId:b.id,values:q,prompt:we(b,q)})});const de=r=>{const m=j()?.scenarios.find(q=>q.id===r);if(!m)return;re("");const b=Ge(m);Q({scenarioId:m.id,values:b,prompt:we(m,b)})},ee=r=>{re(r)},R=(r,h)=>{const m=N();if(!m)return;const b={...I.values,[r]:h};Q({values:b,prompt:we(m,b)})},x=()=>{const r=j(),h=N();!r||!h||Je({resourceId:r.id,scenarioId:h.id,values:{...I.values},prompt:I.prompt,...$()})},te=(r,h)=>{Qe({scenario:r,values:h.values,...$()})};return(()=>{var r=Jt();return t(r,a(g,{get when(){return j()},get fallback(){return[a(Y,{class:"os-client-capability-wizard-backdrop",get href(){return Be()},"aria-label":"关闭向导"}),(()=>{var h=ei();return h.firstChild,t(h,a(Y,{get href(){return Be()},children:"返回能力中心"}),null),h})()]},children:h=>a(g,{get when(){return Ze(h())},get fallback(){return[a(Y,{class:"os-client-capability-wizard-backdrop",get href(){return K()},"aria-label":"关闭向导"}),(()=>{var m=ai(),b=m.firstChild,q=b.firstChild,X=q.nextSibling;return X.nextSibling,t(b,()=>h().name,X),t(m,a(Y,{get href(){return K()},children:"返回模型库"}),null),m})()]},get children(){return[a(Y,{class:"os-client-capability-wizard-backdrop",get href(){return K()},"aria-label":"关闭向导"}),(()=>{var m=ii(),b=m.firstChild,q=b.firstChild,X=q.firstChild,he=b.nextSibling,W=he.firstChild,be=W.firstChild,ve=be.nextSibling,V=W.nextSibling;V.firstChild;var ue=V.nextSibling,ne=ue.firstChild,ze=ne.firstChild,$e=ze.nextSibling,D=ne.nextSibling,me=he.nextSibling,ie=me.firstChild;return t(b,a(Y,{class:"os-client-capability-wizard-intro-back",get href(){return oe()},get children(){return hi(h().category)}}),q),t(X,()=>bi(h().name)),t(b,a(Y,{class:"os-client-capability-wizard-close",get href(){return K()},"aria-label":"关闭",children:"×"}),null),t(ve,a(Z,{get each(){return h().scenarios},children:u=>(()=>{var p=li(),_=p.firstChild,T=_.nextSibling;return p.$$click=()=>de(u.id),t(_,()=>u.title),t(T,()=>u.summary),w(F=>{var H=!G()&&I.scenarioId===u.id,E=!G()&&I.scenarioId===u.id;return H!==F.e&&p.classList.toggle("is-active",F.e=H),E!==F.t&&A(p,"aria-pressed",F.t=E),F},{e:void 0,t:void 0}),p})()}),null),t(ve,a(g,{get when(){return J().length>0},get children(){var u=ti();return u.firstChild,t(u,a(Z,{get each(){return J()},children:p=>(()=>{var _=ri(),T=_.firstChild,F=T.nextSibling,H=F.nextSibling,E=H.firstChild,se=E.nextSibling;return se.nextSibling,_.$$click=()=>ee(pe(p)),t(T,()=>p.name),t(F,()=>p.problem_and_applicability),t(H,()=>p.scenario_id,E),t(H,()=>p.workflow_steps?.length||p.workflow.length,se),w(M=>{var ae=G()===pe(p),ce=G()===pe(p);return ae!==M.e&&_.classList.toggle("is-active",M.e=ae),ce!==M.t&&A(_,"aria-pressed",M.t=ce),M},{e:void 0,t:void 0}),_})()}),null),u}}),null),t(V,a(g,{get when(){return N()},keyed:!0,get fallback(){return Ve()},children:u=>(()=>{var p=si(),_=p.firstChild,T=_.nextSibling,F=T.firstChild,H=F.nextSibling,E=H.firstChild,se=E.firstChild,M=se.nextSibling,ae=E.nextSibling,ce=ae.firstChild,_e=ce.nextSibling,fe=ae.nextSibling,i=fe.firstChild,s=i.nextSibling,c=fe.nextSibling,z=c.firstChild,O=z.nextSibling;return t(_,a(Z,{get each(){return u.fields},children:f=>(()=>{var y=oi(),U=y.firstChild;return t(U,()=>f.label),t(y,a(g,{get when(){return f.multiline},get fallback(){return(()=>{var o=di();return o.$$input=C=>R(f.id,C.currentTarget.value),w(()=>A(o,"placeholder",f.placeholder)),w(()=>o.value=I.values[f.id]??""),o})()},get children(){var o=ci();return o.$$input=C=>R(f.id,C.currentTarget.value),w(()=>A(o,"placeholder",f.placeholder)),w(()=>o.value=I.values[f.id]??""),o}}),null),y})()})),t(M,()=>u.capabilitySummary.current),t(_e,()=>u.capabilitySummary.keyConfig),t(s,()=>u.capabilitySummary.resources),t(O,()=>u.capabilitySummary.deliverables),t(p,a(g,{get when(){return u.requiredData?.length},get children(){var f=ni(),y=f.firstChild,U=y.nextSibling;return t(U,a(Z,{get each(){return u.requiredData},children:o=>(()=>{var C=ui();return t(C,o),C})()})),f}}),null),p})()}),null),t(ue,a(g,{get when(){return N()},keyed:!0,get fallback(){return Ve()},children:u=>[(()=>{var p=pi(),_=p.firstChild,T=_.nextSibling;return t(_,()=>u.title),t(T,()=>u.summary),p})(),(()=>{var p=gi(),_=p.firstChild,T=_.nextSibling;return t(T,()=>u.expectedOutputs),p})()]}),ne),$e.$$click=P,D.$$input=u=>Q("prompt",u.currentTarget.value),t(me,a(Y,{get href(){return K()},children:"返回能力中心"}),ie),ie.$$click=x,w(()=>ie.disabled=!I.prompt.trim()),w(()=>D.value=I.prompt),m})(),a(g,{get when(){return xe()},children:m=>a(Zt,{get scenario(){return m()},onClose:()=>re(""),onSubmit:b=>te(m(),b)})})]}})})),r})()}Ne(["click","input"]);const fi=Object.freeze(Object.defineProperty({__proto__:null,CapabilityWizardPage:mi,startCapabilityPromptTask:vi,startCapabilityScenarioRunTask:Qe,startCapabilityWizardTask:Je},Symbol.toStringTag,{value:"Module"}));export{Zt as S,Qe as a,Je as b,vi as s,fi as w};
1
+ import{b as Ne,m as et,bm as Xe,da as Oe,x as tt,o as L,db as it,dc as ke,dd as Ie,de as ye,df as Ue,dg as le,dh as at,ak as Se,i as t,c as a,Q as w,F as Z,T as A,S as g,R as Pe,di as lt,dj as rt,dk as Ae,dl as nt,dm as st,t as n,dn as ct,d7 as ot,e as dt,dp as ut,f as pt,h as gt,g as ht,l as bt,n as vt,ag as $t,X as Te,aX as Fe,r as Le,s as Ce,aZ as je,Z as Re,ba as qe,Y as We,_ as De,E as Ee,dq as mt,dr as _t,bt as pe,ds as ft,dt as yt,b8 as Ye,bu as Ze,du as St,br as wt,L as Y,bT as Be,d8 as Ct,bv as xt,d9 as zt,aY as kt}from"./index-CjqsrRCL.js";var It=n("<div class=os-client-capability-wizard-papers><h3>相关论文</h3><ul>"),Pt=n("<div class=os-client-capability-wizard-papers><h3>HPC 软件</h3><span>"),Tt=n("<p class=os-client-capability-wizard-note>工作目录与运行环境由系统自动识别,本步只需填写下列业务参数。"),Ft=n("<p class=os-client-capability-wizard-missing>本步还有 <!> 个必填参数未填写。"),Lt=n("<p class=os-client-capability-wizard-missing>本步有 <!> 个参数类型不正确,请按标注类型修改。"),jt=n("<p class=os-client-capability-wizard-missing>其他步骤还有 <!> 个必填参数未填写,可点击左侧步骤继续补全。"),Rt=n("<p class=os-client-capability-wizard-missing>其他步骤还有 <!> 个参数类型不正确,可点击左侧步骤修改。"),qt=n("<small>"),Wt=n("<ul class=os-client-capability-wizard-output-list>"),Dt=n("<div class=os-client-capability-wizard-quality><strong>质量门禁</strong><p>"),Et=n('<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>创建任务并自动逐步执行'),Ht=n("<li><button type=button class=os-client-capability-wizard-step><span></span><div><p>"),Mt=n('<li><a target=_blank rel="noopener noreferrer">'),Ot=n("<p>"),Ut=n("<div class=os-client-capability-wizard-step-banner><strong>"),At=n("<p class=os-client-capability-wizard-note>本步无需额外用户参数。"),Bt=n("<em>*"),Kt=n("<small class=os-client-capability-wizard-field-type>"),Vt=n("<textarea rows=3>"),Ke=n("<em class=os-client-capability-wizard-field-error>"),Gt=n("<label class=os-client-capability-wizard-field><span>"),Nt=n("<input type=text>"),Xt=n("<p class=os-client-capability-wizard-outputs-empty>本步暂无结构化产出清单。"),Yt=n("<li>");function Zt(e){const d=et(),[l,v]=Xe({values:Oe(e.scenario),attempted:!1,activeStepIndex:0});tt(()=>{v({values:Oe(e.scenario),attempted:!1,activeStepIndex:0})});const S=L(()=>it(e.scenario)),k=L(()=>S()[l.activeStepIndex]??S()[0]),B=L(()=>{const $=k();return $?ke(e.scenario,$):e.scenario.user_input}),j=L(()=>Ie(e.scenario,l.values)),ge=L(()=>ye(e.scenario.user_input,l.values)),K=L(()=>B().filter($=>Ue($)?!String(l.values[le($)]??"").trim():!1)),oe=L(()=>ye(B(),l.values)),I=L(()=>B().filter($=>String(l.values[le($)]??"").trim()).length),Q=L(()=>{const P=k()?.prompt||e.scenario.ai_prompt?.template||"";return at(P,l.values)}),G=L(()=>k()?.outputs??[]),re=L(()=>(e.scenario.related_papers??[]).filter($=>!!String($.url??"").trim())),N=($,P)=>{v("values",$,P)},J=$=>{v("activeStepIndex",$)},xe=()=>{v("attempted",!0);const $=ye(e.scenario.user_input,l.values);if($.length>0){const R=le($[0]),x=S().findIndex(te=>ke(e.scenario,te).some(r=>le(r)===R));x>=0&&v("activeStepIndex",x);return}const P=Ie(e.scenario,l.values);if(P.length===0){e.onSubmit({values:{...l.values}});return}const de=le(P[0]),ee=S().findIndex(R=>ke(e.scenario,R).some(x=>le(x)===de));ee>=0&&v("activeStepIndex",ee),d.show(()=>a(ct,{title:"请补充必填参数",get reason(){return`还有 ${P.length} 个必填参数未填写,补充后即可创建任务并自动逐步执行。`},fields:P,get values(){return l.values},onConfirm:R=>{const x={...l.values,...R};v("values",x),!(ye(e.scenario.user_input,x).length>0||Ie(e.scenario,x).length>0)&&e.onSubmit({values:x})}}))};return(()=>{var $=Et(),P=$.firstChild,de=P.nextSibling,ee=de.firstChild,R=ee.firstChild,x=R.nextSibling,te=x.firstChild,r=te.nextSibling,h=x.nextSibling,m=ee.nextSibling,b=m.firstChild,q=b.firstChild,X=q.nextSibling,he=X.nextSibling,W=b.nextSibling,be=W.firstChild,ve=be.firstChild,V=ve.nextSibling,ue=V.firstChild,ne=ue.nextSibling,ze=ne.nextSibling,$e=ze.nextSibling;$e.nextSibling;var D=be.nextSibling,me=D.nextSibling,ie=me.firstChild,u=ie.nextSibling,p=W.nextSibling,_=p.firstChild,T=_.firstChild;T.firstChild;var F=_.nextSibling,H=F.firstChild,E=H.nextSibling,se=E.firstChild,M=se.nextSibling;M.nextSibling;var ae=F.nextSibling,ce=m.nextSibling,_e=ce.firstChild,fe=_e.nextSibling;return Se(P,"click",e.onClose,!0),Se(R,"click",e.onClose,!0),t(te,()=>e.scenario.name),t(r,()=>e.scenario.problem_and_applicability),Se(h,"click",e.onClose,!0),t(he,a(Z,{get each(){return S()},children:(i,s)=>(()=>{var c=Ht(),z=c.firstChild,O=z.firstChild,f=O.nextSibling,y=f.firstChild;return z.$$click=()=>J(s()),t(O,()=>s()+1),t(y,()=>i.name),w(()=>c.classList.toggle("is-active",l.activeStepIndex===s())),c})()})),t(b,a(g,{get when(){return re().length>0},get children(){var i=It(),s=i.firstChild,c=s.nextSibling;return t(c,a(Z,{get each(){return re()},children:z=>(()=>{var O=Mt(),f=O.firstChild;return t(f,()=>z.title),w(y=>{var U=z.url,o=z.title;return U!==y.e&&A(f,"href",y.e=U),o!==y.t&&A(f,"title",y.t=o),y},{e:void 0,t:void 0}),O})()})),i}}),null),t(b,a(g,{get when(){return e.scenario.HPC},get children(){var i=Pt(),s=i.firstChild,c=s.nextSibling;return t(c,()=>e.scenario.HPC),i}}),null),t(V,()=>l.activeStepIndex+1,ue),t(V,()=>S().length,ne),t(V,I,$e),t(V,()=>B().length,null),t(W,a(g,{get when(){return k()},children:i=>(()=>{var s=Ut(),c=s.firstChild;return t(c,()=>i().name),t(s,a(g,{get when(){return i().purpose?.trim()},get children(){var z=Ot();return t(z,()=>i().purpose),z}}),null),s})()}),D),t(W,a(g,{get when(){return e.scenario.system_auto_detection?.fields?.length},get children(){return Tt()}}),D),t(W,a(g,{get when(){return Pe(()=>!!l.attempted)()&&K().length>0},get children(){var i=Ft(),s=i.firstChild,c=s.nextSibling;return c.nextSibling,t(i,()=>K().length,c),i}}),D),t(W,a(g,{get when(){return oe().length>0},get children(){var i=Lt(),s=i.firstChild,c=s.nextSibling;return c.nextSibling,t(i,()=>oe().length,c),i}}),D),t(W,a(g,{get when(){return Pe(()=>!!(l.attempted&&j().length>0))()&&K().length===0},get children(){var i=jt(),s=i.firstChild,c=s.nextSibling;return c.nextSibling,t(i,()=>j().length,c),i}}),D),t(W,a(g,{get when(){return Pe(()=>!!(l.attempted&&ge().length>0))()&&oe().length===0},get children(){var i=Rt(),s=i.firstChild,c=s.nextSibling;return c.nextSibling,t(i,()=>ge().length,c),i}}),D),t(D,a(g,{get when(){return B().length>0},get fallback(){return At()},get children(){return a(Z,{get each(){return B()},children:i=>{const s=le(i),c=Ue(i),z=l.attempted&&c&&!String(l.values[s]??"").trim(),O=lt(i,l.values[s]??""),f=!!O&&(l.attempted||!!String(l.values[s]??"").trim());return(()=>{var y=Gt(),U=y.firstChild;return y.classList.toggle("is-required",!!c),y.classList.toggle("is-invalid",!!(z||f)),t(U,()=>rt(i),null),t(U,a(g,{when:c,get children(){return Bt()}}),null),t(U,a(g,{get when(){return i.input_type},get children(){var o=Kt();return t(o,()=>i.input_type),o}}),null),t(y,a(g,{get when(){return nt(i)},get fallback(){return(()=>{var o=Nt();return o.$$input=C=>N(s,C.currentTarget.value),w(C=>{var He=i.input_type==="int"||i.input_type==="float"?"decimal":void 0,Me=Ae(i);return He!==C.e&&A(o,"inputmode",C.e=He),Me!==C.t&&A(o,"placeholder",C.t=Me),C},{e:void 0,t:void 0}),w(()=>o.value=l.values[s]??""),o})()},get children(){var o=Vt();return o.$$input=C=>N(s,C.currentTarget.value),w(()=>A(o,"placeholder",Ae(i))),w(()=>o.value=l.values[s]??""),o}}),null),t(y,a(g,{when:f,get children(){var o=Ke();return t(o,O),o}}),null),t(y,a(g,{when:z&&!f,get children(){var o=Ke();return t(o,()=>st(i,"")),o}}),null),y})()}})}})),ie.$$click=()=>J(Math.max(0,l.activeStepIndex-1)),u.$$click=()=>J(Math.min(S().length-1,l.activeStepIndex+1)),t(T,a(g,{get when(){return k()?.result_subfolder},get children(){var i=qt();return t(i,()=>k()?.result_subfolder),w(()=>A(i,"title",k()?.result_subfolder)),i}}),null),t(_,a(g,{get when(){return G().length>0},get fallback(){return Xt()},get children(){var i=Wt();return t(i,a(Z,{get each(){return G()},children:s=>(()=>{var c=Yt();return t(c,s),c})()})),i}}),null),t(_,a(g,{get when(){return k()?.quality_gate},get children(){var i=Dt(),s=i.firstChild,c=s.nextSibling;return t(c,()=>k()?.quality_gate),i}}),null),t(E,()=>l.activeStepIndex+1,M),Se(_e,"click",e.onClose,!0),fe.$$click=xe,w(i=>{var s=l.activeStepIndex<=0,c=l.activeStepIndex>=S().length-1;return s!==i.e&&(ie.disabled=i.e=s),c!==i.t&&(u.disabled=i.t=c),i},{e:void 0,t:void 0}),w(()=>ae.value=Q()),$})()}Ne(["click","input"]);function Qt(e,d){return e.replace(/\{\{(\w+)\}\}/g,(l,v)=>d[v]??"")}var Jt=n("<div class=os-client-capability-wizard-overlay role=dialog aria-modal=true aria-label=能力向导>"),ei=n("<section class=os-client-capability-wizard-dialog><p>未找到该能力。"),ti=n("<div class=os-client-capability-wizard-scenario-group><span>完整工作流场景"),ii=n("<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>创建任务"),ai=n("<section class=os-client-capability-wizard-dialog><p>「<!>」暂无 OneScience 源码或魔搭映射,当前不可使用。"),li=n("<button type=button><strong></strong><p>"),ri=n("<button type=button><strong></strong><p></p><small> · <!> 步"),Ve=n("<p class=os-client-capability-wizard-empty>请先选择任务场景。"),ni=n("<div class=os-client-capability-wizard-required aria-label=该能力需要什么数据><h4>该能力需要什么数据</h4><ul>"),si=n("<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>"),ci=n("<textarea rows=3>"),oi=n("<label class=os-client-capability-wizard-field><span>"),di=n("<input type=text>"),ui=n("<li>"),pi=n("<div class=os-client-capability-wizard-right-head><strong></strong><p>"),gi=n("<div class=os-client-capability-wizard-outputs aria-label=预计产出><span>预计产出</span><p>");function hi(e){return e==="hpc"?"软件介绍":"模型介绍"}function bi(e){return`使用 ${e} 开始科研任务`}function vi(e){if(!Te({navigate:e.navigate,action:{type:"prompt",prompt:e.prompt,title:e.title,workflow:e.workflow},isLoggedIn:e.isLoggedIn}))return!1;const d=Fe({path:e.path,recent:e.recent,lastCodeWorkspace:e.lastCodeWorkspace})||Le(Ce())||je(document,e.path);if(!d)return!1;const l=Re(d);return qe(l,e.prompt),We(l),e.openProject?.(d),e.touchCode?.(d),De({variant:"success",title:`已为你创建「${e.title}」任务`}),e.navigate(Ee(d)),!0}function Qe(e){const d=mt(e.scenario),l=d[0];if(!l?.promptTemplate.trim()||!Te({navigate:e.navigate,action:{type:"scenario-run",scenarioId:e.scenario.id||e.scenario.scenario_id,values:e.values},isLoggedIn:e.isLoggedIn}))return!1;const v=Fe({path:e.path,recent:e.recent,lastCodeWorkspace:e.lastCodeWorkspace})||Le(Ce())||je(document,e.path);if(!v)return!1;const S=Re(v);return _t(S,{title:e.scenario.name,scenarioId:pe(e.scenario),values:e.values,steps:d}),ft("todo"),qe(S,yt(l,e.values)),We(S),e.openProject?.(v),e.touchCode?.(v),De({variant:"success",title:`已创建「${e.scenario.name}」`,description:`将按 ${d.length} 步自动依次执行,缺参或失败时暂停`}),e.navigate(Ee(v)),!0}function Je(e){if(!Te({navigate:e.navigate,action:{type:"wizard",resourceId:e.resourceId,scenarioId:e.scenarioId,values:e.values,prompt:e.prompt},isLoggedIn:e.isLoggedIn}))return!1;const d=Ye(e.resourceId),l=d?.scenarios.find(k=>k.id===e.scenarioId);if(!d||!l||!Ze(d))return!1;const v=Fe({path:e.path,recent:e.recent,lastCodeWorkspace:e.lastCodeWorkspace})||Le(Ce())||je(document,e.path);if(!v)return!1;const S=Re(v);return qe(S,e.prompt),We(S),e.openProject?.(v),e.touchCode?.(v),De({variant:"success",title:`已为你创建 ${d.name}「${l.title}」任务`}),e.navigate(Ee(v)),!0}function we(e,d){return Qt(e.promptTemplate,d)}function Ge(e){return Object.fromEntries(e.fields.map(d=>[d.id,$i(d)]))}function $i(e){return e.default?.trim()?e.default:e.placeholder?.replace(/^例如[::]\s*/,"").trim()??""}function mi(){const e=ot(),d=dt(),[l]=ut(),v=pt(),S=gt(),k=ht(),B=bt(),j=()=>Ye(e.id??""),ge=()=>zt(d.search),K=()=>Ct(d.search,{category:j()?.category??"onemodel",domain:j()?.domain??"materials"}),oe=()=>xt(e.id??"",ge()),[I,Q]=Xe({scenarioId:"",values:{},prompt:""}),[G,re]=vt(""),N=()=>j()?.scenarios.find(r=>r.id===I.scenarioId),J=L(()=>{const r=j();return r?St({domain:r.domain,name:r.name,id:r.id,category:r.category}):[]}),xe=L(()=>{const r=G();if(r)return wt(r)??J().find(h=>pe(h)===r)}),$=()=>({navigate:v,isLoggedIn:!!Ce(),path:S.data.path,recent:kt(S.data.project),lastCodeWorkspace:B.projects.lastCode(),openProject:r=>k.projects.open(r),touchCode:r=>B.projects.touchCode(r)}),P=()=>{const r=N();r&&Q("prompt",we(r,I.values))};$t(()=>{const r=j();if(!r?.scenarios.length)return;const h=l.scenario,b=(h?r.scenarios.find(X=>X.id===h):void 0)??r.scenarios[0],q=Ge(b);Q({scenarioId:b.id,values:q,prompt:we(b,q)})});const de=r=>{const m=j()?.scenarios.find(q=>q.id===r);if(!m)return;re("");const b=Ge(m);Q({scenarioId:m.id,values:b,prompt:we(m,b)})},ee=r=>{re(r)},R=(r,h)=>{const m=N();if(!m)return;const b={...I.values,[r]:h};Q({values:b,prompt:we(m,b)})},x=()=>{const r=j(),h=N();!r||!h||Je({resourceId:r.id,scenarioId:h.id,values:{...I.values},prompt:I.prompt,...$()})},te=(r,h)=>{Qe({scenario:r,values:h.values,...$()})};return(()=>{var r=Jt();return t(r,a(g,{get when(){return j()},get fallback(){return[a(Y,{class:"os-client-capability-wizard-backdrop",get href(){return Be()},"aria-label":"关闭向导"}),(()=>{var h=ei();return h.firstChild,t(h,a(Y,{get href(){return Be()},children:"返回能力中心"}),null),h})()]},children:h=>a(g,{get when(){return Ze(h())},get fallback(){return[a(Y,{class:"os-client-capability-wizard-backdrop",get href(){return K()},"aria-label":"关闭向导"}),(()=>{var m=ai(),b=m.firstChild,q=b.firstChild,X=q.nextSibling;return X.nextSibling,t(b,()=>h().name,X),t(m,a(Y,{get href(){return K()},children:"返回模型库"}),null),m})()]},get children(){return[a(Y,{class:"os-client-capability-wizard-backdrop",get href(){return K()},"aria-label":"关闭向导"}),(()=>{var m=ii(),b=m.firstChild,q=b.firstChild,X=q.firstChild,he=b.nextSibling,W=he.firstChild,be=W.firstChild,ve=be.nextSibling,V=W.nextSibling;V.firstChild;var ue=V.nextSibling,ne=ue.firstChild,ze=ne.firstChild,$e=ze.nextSibling,D=ne.nextSibling,me=he.nextSibling,ie=me.firstChild;return t(b,a(Y,{class:"os-client-capability-wizard-intro-back",get href(){return oe()},get children(){return hi(h().category)}}),q),t(X,()=>bi(h().name)),t(b,a(Y,{class:"os-client-capability-wizard-close",get href(){return K()},"aria-label":"关闭",children:"×"}),null),t(ve,a(Z,{get each(){return h().scenarios},children:u=>(()=>{var p=li(),_=p.firstChild,T=_.nextSibling;return p.$$click=()=>de(u.id),t(_,()=>u.title),t(T,()=>u.summary),w(F=>{var H=!G()&&I.scenarioId===u.id,E=!G()&&I.scenarioId===u.id;return H!==F.e&&p.classList.toggle("is-active",F.e=H),E!==F.t&&A(p,"aria-pressed",F.t=E),F},{e:void 0,t:void 0}),p})()}),null),t(ve,a(g,{get when(){return J().length>0},get children(){var u=ti();return u.firstChild,t(u,a(Z,{get each(){return J()},children:p=>(()=>{var _=ri(),T=_.firstChild,F=T.nextSibling,H=F.nextSibling,E=H.firstChild,se=E.nextSibling;return se.nextSibling,_.$$click=()=>ee(pe(p)),t(T,()=>p.name),t(F,()=>p.problem_and_applicability),t(H,()=>p.scenario_id,E),t(H,()=>p.workflow_steps?.length||p.workflow.length,se),w(M=>{var ae=G()===pe(p),ce=G()===pe(p);return ae!==M.e&&_.classList.toggle("is-active",M.e=ae),ce!==M.t&&A(_,"aria-pressed",M.t=ce),M},{e:void 0,t:void 0}),_})()}),null),u}}),null),t(V,a(g,{get when(){return N()},keyed:!0,get fallback(){return Ve()},children:u=>(()=>{var p=si(),_=p.firstChild,T=_.nextSibling,F=T.firstChild,H=F.nextSibling,E=H.firstChild,se=E.firstChild,M=se.nextSibling,ae=E.nextSibling,ce=ae.firstChild,_e=ce.nextSibling,fe=ae.nextSibling,i=fe.firstChild,s=i.nextSibling,c=fe.nextSibling,z=c.firstChild,O=z.nextSibling;return t(_,a(Z,{get each(){return u.fields},children:f=>(()=>{var y=oi(),U=y.firstChild;return t(U,()=>f.label),t(y,a(g,{get when(){return f.multiline},get fallback(){return(()=>{var o=di();return o.$$input=C=>R(f.id,C.currentTarget.value),w(()=>A(o,"placeholder",f.placeholder)),w(()=>o.value=I.values[f.id]??""),o})()},get children(){var o=ci();return o.$$input=C=>R(f.id,C.currentTarget.value),w(()=>A(o,"placeholder",f.placeholder)),w(()=>o.value=I.values[f.id]??""),o}}),null),y})()})),t(M,()=>u.capabilitySummary.current),t(_e,()=>u.capabilitySummary.keyConfig),t(s,()=>u.capabilitySummary.resources),t(O,()=>u.capabilitySummary.deliverables),t(p,a(g,{get when(){return u.requiredData?.length},get children(){var f=ni(),y=f.firstChild,U=y.nextSibling;return t(U,a(Z,{get each(){return u.requiredData},children:o=>(()=>{var C=ui();return t(C,o),C})()})),f}}),null),p})()}),null),t(ue,a(g,{get when(){return N()},keyed:!0,get fallback(){return Ve()},children:u=>[(()=>{var p=pi(),_=p.firstChild,T=_.nextSibling;return t(_,()=>u.title),t(T,()=>u.summary),p})(),(()=>{var p=gi(),_=p.firstChild,T=_.nextSibling;return t(T,()=>u.expectedOutputs),p})()]}),ne),$e.$$click=P,D.$$input=u=>Q("prompt",u.currentTarget.value),t(me,a(Y,{get href(){return K()},children:"返回能力中心"}),ie),ie.$$click=x,w(()=>ie.disabled=!I.prompt.trim()),w(()=>D.value=I.prompt),m})(),a(g,{get when(){return xe()},children:m=>a(Zt,{get scenario(){return m()},onClose:()=>re(""),onSubmit:b=>te(m(),b)})})]}})})),r})()}Ne(["click","input"]);const fi=Object.freeze(Object.defineProperty({__proto__:null,CapabilityWizardPage:mi,startCapabilityPromptTask:vi,startCapabilityScenarioRunTask:Qe,startCapabilityWizardTask:Je},Symbol.toStringTag,{value:"Module"}));export{Zt as S,Qe as a,Je as b,vi as s,fi as w};
@@ -1 +1 @@
1
- const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609080918/assets/yup-01-BtRq6dLN.aac";export{e as default};
1
+ const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609081145/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-202609080918/assets/yup-03-BHLEoqSS.aac";export{e as default};
1
+ const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609081145/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-202609080918/assets/yup-04-C7yadpJT.aac";export{e as default};
1
+ const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609081145/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-202609080918/assets/yup-05-CuuaeyjC.aac";export{e as default};
1
+ const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609081145/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-202609080918/favicon-96x96-v3.png" sizes="96x96" />
12
- <link rel="shortcut icon" href="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609080918/favicon-v3.ico" />
13
- <link rel="apple-touch-icon" sizes="180x180" href="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609080918/apple-touch-icon-v3.png" />
14
- <link rel="manifest" href="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609080918/site.webmanifest" />
15
- <link rel="preload" href="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609080918/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-202609080918/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-202609081145/favicon-96x96-v3.png" sizes="96x96" />
12
+ <link rel="shortcut icon" href="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609081145/favicon-v3.ico" />
13
+ <link rel="apple-touch-icon" sizes="180x180" href="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609081145/apple-touch-icon-v3.png" />
14
+ <link rel="manifest" href="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609081145/site.webmanifest" />
15
+ <link rel="preload" href="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609081145/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-202609081145/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-202609080918/social-share.png" />
20
- <meta property="twitter:image" content="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609080918/social-share.png" />
21
- <script id="oc-theme-preload-script" src="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609080918/oc-theme-preload.js"></script>
22
- <script type="module" crossorigin src="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609080918/assets/index-BwlDF8Yo.js"></script>
23
- <link rel="stylesheet" crossorigin href="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609080918/assets/index-C08Qpyxg.css">
19
+ <meta property="og:image" content="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609081145/social-share.png" />
20
+ <meta property="twitter:image" content="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609081145/social-share.png" />
21
+ <script id="oc-theme-preload-script" src="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609081145/oc-theme-preload.js"></script>
22
+ <script type="module" crossorigin src="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609081145/assets/index-CjqsrRCL.js"></script>
23
+ <link rel="stylesheet" crossorigin href="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609081145/assets/index-qvfonuvp.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-202609080918",
3
+ "version": "1.14.50-202609081145",
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-202609080918/index.html",
8
+ "homepage": "https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609081145/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-202609080918/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-202609080918/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-202609080918/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-202609080918/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-202609080918/assets/bip-bop-09-CxEgoAHQ.aac";export{e as default};
@@ -1,5 +0,0 @@
1
- import{b as Te,n as P,c as r,i as t,S as u,Q as k,b6 as Pt,t as i,b7 as Tt,X as Me,b8 as ut,b9 as Ne,aX as Be,r as Ve,s as ge,aZ as Ge,Z as pt,ba as gt,Y as bt,_ as we,E as ht,bb as Et,bc as yt,bd as vt,l as Ee,h as Re,e as Je,f as Oe,o as ne,aY as Ue,be as $t,bf as Rt,x as mt,T as V,F as G,R as ce,g as Ye,ag as Fe,bg as ft,bh as Ot,bi as Ut,bj as Ke,ak as _t,bk as jt,bl as At,bm as qt,bn as Qe,bo as Kt,bp as at,bq as Wt,br as rt,a$ as Ht,bs as Ie,bt as Mt,bu as Xe,bv as Ft,L as lt,bw as Qt}from"./index-BwlDF8Yo.js";import{m as zt,O as Nt,S as Bt,s as Vt}from"./onescience-BoAw7Siq.js";import{d as Gt,r as Jt,s as nt,w as Yt}from"./selection-rjfgbO6y.js";import{s as Xt,a as it,b as Zt,S as ea}from"./wizard-vRbib2EA.js";import"./onescience-docs-CH5KBTI9.js";var ta=i("<p class=os-client-capability-upload-error role=alert>"),aa=i('<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><form class=os-client-capability-upload-dialog><header class=os-client-capability-upload-head><div class=os-client-capability-upload-head-copy><div class=os-client-capability-upload-eyebrow>私有资产 · 模型</div><h2>上传私有模型</h2><p>填写与模型卡片一致的基础信息。保存后会出现在当前领域的 onemodel 列表,并标注为私有资产。</p></div><button type=button class=os-client-capability-upload-close aria-label=关闭>×</button></header><div class=os-client-capability-upload-notice role=note><strong>后台登记为 AI 原语</strong><p>AI 原语是后台知识资产体系,不对用户单独展示。上传后会自动登记,供 Agent 检索与编排时利用该模型知识。</p></div><div class=os-client-capability-upload-body><label class=os-client-capability-upload-field><span>名称<span class=os-client-capability-upload-required> *</span></span><small>显示在模型卡片标题</small><input maxlength=64 required placeholder="例如:团队内部微调 MACE"></label><label class=os-client-capability-upload-field><span>简介<span class=os-client-capability-upload-required> *</span></span><small>对应卡片正文,建议 1–2 句说明用途与适用场景</small><textarea maxlength=160 required rows=3 placeholder="例如:面向界面体系的内部势函数,可用于弛豫与短时程 MD 冒烟"></textarea></label><div class=os-client-capability-upload-grid data-cols=2><label class=os-client-capability-upload-field><span>标签<span class=os-client-capability-upload-required> *</span></span><small>逗号分隔,将显示为卡片标签;系统会自动加上「私有」</small><input required placeholder="例如:mlff, 界面, 内部模型"></label><label class=os-client-capability-upload-field><span>领域</span><small>跟随当前能力中心领域,卡片会出现在该领域下</small><input class=is-readonly readonly></label></div></div><footer class=os-client-capability-upload-actions><button type=button>取消</button><button type=submit data-primary=true>保存并发布');function ra(e){return e.split(/[,,、]/).map(a=>a.trim()).filter(Boolean)}function la(e){const[a,n]=P(""),[s,l]=P(""),[c,y]=P(""),[g,C]=P(""),D=()=>{n(""),l(""),y(""),C("")},_=()=>{D(),e.onClose()},f=p=>{p.preventDefault();const d=a().trim(),O=s().trim(),v=ra(c());if(!d||!O||v.length===0){C("请填写名称、简介和至少一个标签,以便生成与现有模型卡片一致的展示信息。");return}const M=Tt({name:d,blurb:O,tags:v,domain:e.domain});e.onSaved({id:M.id,name:M.name}),_()};return r(u,{get when(){return e.open},get children(){var p=aa(),d=p.firstChild,O=d.nextSibling,v=O.firstChild,M=v.firstChild,q=M.nextSibling,Z=v.nextSibling,o=Z.nextSibling,j=o.firstChild,ie=j.firstChild,F=ie.nextSibling,J=F.nextSibling,x=j.nextSibling,K=x.firstChild,Q=K.nextSibling,b=Q.nextSibling,I=x.nextSibling,w=I.firstChild,W=w.firstChild,ee=W.nextSibling,Y=ee.nextSibling,S=w.nextSibling,N=S.firstChild,se=N.nextSibling,be=se.nextSibling,$e=o.nextSibling,he=$e.firstChild;return d.$$click=_,O.addEventListener("submit",f),q.$$click=_,J.$$input=te=>n(te.currentTarget.value),b.$$input=te=>l(te.currentTarget.value),Y.$$input=te=>y(te.currentTarget.value),t(O,r(u,{get when(){return g()},get children(){var te=ta();return t(te,g),te}}),$e),he.$$click=_,k(()=>J.value=a()),k(()=>b.value=s()),k(()=>Y.value=c()),k(()=>be.value=Pt(e.domain)),p}})}Te(["click","input"]);function na(e,a){return e.includes("modelscope download --model ")?e:`${e}
2
-
3
- 【从魔搭下载模型】
4
- ${zt(a,{kind:"local"})}`}function ia(e){const a=ut(e);if(!a)throw new Error(`Unknown capability resource: ${e}`);if(!Ne(a))throw new Error(`Capability resource is not installable: ${e}`);const n=Et(a);return{banner:a.install.banner,prompt:n?na(a.install.prompt,n):a.install.prompt}}function wt(e){if(!Me({navigate:e.navigate,action:{type:"install",resourceId:e.resourceId},isLoggedIn:e.isLoggedIn}))return!1;const a=ut(e.resourceId);if(!a||!Ne(a))return!1;const{banner:n,prompt:s}=ia(e.resourceId),l=Be({path:e.path,recent:e.recent,lastCodeWorkspace:e.lastCodeWorkspace})||Ve(ge())||Ge(document,e.path);if(!l)return!1;const c=pt(l);return gt(c,s),bt(c),e.openProject?.(l),e.touchCode?.(l),we({variant:"success",title:n}),e.navigate(ht(l)),!0}async function ae(e,a,n){const s=await yt(`${vt(e)}${a}`,{...n,headers:{"content-type":"application/json",...n?.headers??{}}});if(!s.ok){const l=await s.text().catch(()=>"");throw new Error(l||`Request failed (${s.status})`)}return await s.json()}function sa(e,a){const n=new URLSearchParams;return a?.domain&&a.domain!=="all"&&n.set("domain",a.domain),ae(e,`/experimental/onescience/raw-source?${n}`)}function oa(e,a){const n=new URLSearchParams({scope:a.scope});return a.domain&&a.domain!=="all"&&n.set("domain",a.domain),ae(e,`/experimental/onescience/already?${n}`)}function ca(e,a){return ae(e,"/experimental/onescience/raw-source",{method:"POST",body:JSON.stringify(a)})}function da(e,a){return ae(e,`/experimental/onescience/raw-source/${encodeURIComponent(a)}/convert`,{method:"POST"})}function ua(e,a,n){const s=new URLSearchParams;n&&s.set("viewer_workspace_id",n);const l=s.size?`?${s}`:"";return ae(e,`/experimental/onescience/raw-source/${encodeURIComponent(a)}/preview${l}`)}function pa(e,a,n){const s=new URLSearchParams;n&&s.set("viewer_workspace_id",n);const l=s.size?`?${s}`:"";return ae(e,`/experimental/onescience/already/${encodeURIComponent(a)}/preview${l}`)}function ga(e,a,n){return ae(e,`/experimental/onescience/session/${encodeURIComponent(a)}/chips`,{method:"PUT",body:JSON.stringify({raw_ids:n})})}function ba(e,a){return ae(e,`/experimental/onescience/already/${encodeURIComponent(a)}/publish`,{method:"POST"})}function ha(e,a){return ae(e,`/experimental/onescience/already/${encodeURIComponent(a)}/unpublish`,{method:"POST"})}function ya(e,a){return ae(e,`/experimental/onescience/already/${encodeURIComponent(a)}/reingest`,{method:"POST"})}function va(e,a,n){return ae(e,`/experimental/onescience/already/${encodeURIComponent(a)}/training`,{method:"POST",body:JSON.stringify(n)})}function $a(e){return ae(e,"/experimental/workspace")}function ma(e){return ae(e,"/experimental/onescience/object-store-key")}function fa(e,a){return ae(e,"/experimental/onescience/object-store-key",{method:"PUT",body:JSON.stringify(a)})}function _a(e,a){return ae(e,`/experimental/onescience/object-store-key/${encodeURIComponent(a)}`,{method:"DELETE"})}const wa={all:"全部",weather:"地球科学",materials:"材料化学",bio:"生命科学",fluid:"流体仿真"};var Sa=i('<div class=os-onedata-subtabs role=tablist aria-label="Already 范围"><button type=button>我的</button><button type=button>公共'),ka=i("<p class=os-client-capability-empty>登录后才能查看和接入登记库。"),Ca=i("<p class=os-onedata-error>"),We=i("<ul class=os-onedata-list>"),Ia=i('<form class=os-onedata-register><strong>个人对象存储 Key</strong><select><option value=s3>s3</option><option value=oss>oss</option><option value=cos>cos</option></select><input required placeholder="Access Key ID"><input required type=password placeholder=Secret><input><input placeholder=region(可选)><button type=submit>保存 Key'),xa=i("<select required><option value>选择远端执行环境"),La=i('<form class=os-onedata-register><strong>+ 接入原始数据</strong><input placeholder=名称><input required placeholder="本机路径、s3://bucket/key、远端路径或 http(s) 地址"><select><option value=local_fs>本机路径</option><option value=http_dataset>无认证 HTTP</option><option value=object_store>对象存储(平台桶路径或 s3/oss/cos URI)</option><option value=remote_workspace>已连接的远端 wrk_*</option></select><button type=submit>接入'),Da=i("<p class=os-client-capability-empty>还没有原始数据。接入本机路径、公开 HTTP,或已连接的远端路径。"),Pa=i("<button type=button class=os-onedata-chip-btn>把选中的原始数据挂到当前会话芯片"),st=i("<pre class=os-onedata-preview>"),Ta=i("<ul>"),Ea=i("<section class=os-onedata-selector aria-label=模型选择数据(只读)><h3>选择数据(只读)</h3><p>训练只接受 ready 的 Already(alr_)。种子 id / raw_ 不能写入 datasetRefs。"),Ra=i("<select><option value>选择作业目标"),Oa=i("<div class=os-onedata-actions><select><option value=local>作业目标:本机</option><option value=workspace>作业目标:远端 wrk_*</option><option value=shared_root>作业目标:平台共享根"),Ua=i("<p class=os-client-capability-empty>"),ja=i('<section class="os-client-capability-resource-panel os-onedata-catalog"><header class="os-client-capability-page-section-head os-client-capability-page-section-head-active"><p>。先登记为原始数据,转为 Already 后才能给模型用。</p></header><div class=os-onedata-subtabs role=tablist aria-label="OneData 登记库"><button type=button>原始数据</button><button type=button>Already</button></div><section class=os-onedata-platform><header class=os-client-capability-page-section-head><div><strong>平台目录</strong><p>种子与魔搭卡,只读。下载后请回到上方「原始数据」按实际路径接入;不能把种子 id 当成训练数据。'),Aa=i("<li><span> · …</span><button type=button>删除"),ot=i("<option>"),qa=i("<li><label><input type=checkbox><strong></strong><span> · </span><small></small></label><div class=os-onedata-actions><button type=button>预览</button><button type=button>转为 Already"),Ka=i("<p class=os-client-capability-empty>还没有 ready 的 Already。"),Wa=i("<li><code></code> "),Ha=i("<button type=button>发布"),Ma=i("<button type=button>取消发布"),Fa=i("<button type=button>作为原始数据接入"),Qa=i("<button type=button>开训"),za=i("<li><strong></strong><span></span><small></small><div class=os-onedata-actions><button type=button>预览");function Na(e){const a=Ee(),n=Re(),s=Je(),l=Oe(),c=ne(()=>new URLSearchParams(s.search)),y=ne(()=>c().get("onedata")==="already"?"already":"raw"),g=ne(()=>c().get("already")==="public"?"public":"mine"),[C,D]=P([]),[_,f]=P([]),[p,d]=P(""),[O,v]=P(!1),[M,q]=P(""),[Z,o]=P(""),[j,ie]=P("local_fs"),[F,J]=P(""),[x,K]=P([]),[Q,b]=P(""),[I,w]=P([]),[W,ee]=P("local"),[Y,S]=P([]),[N,se]=P("s3"),[be,$e]=P(""),[he,te]=P(""),[de,je]=P(""),[Se,Ae]=P(""),z=()=>a.current?.http.url,Le=()=>!!ge(),Dt=ne(()=>Be({path:n.data.path,recent:Ue(n.data.project??[]),lastCodeWorkspace:a.projects.lastCode()})||$t(ge(),a.projects.lastCode())||Ve(ge())||Ge(document,n.data.path)),Ze=ne(()=>{const T=Dt();if(!T)return;const X=Rt(T);if(X)return X;const[re]=n.child(T,{bootstrap:!1});return(re.session??[]).find(ye=>!ye.parentID&&!ye.time?.archived)?.id}),ke=T=>{const X=new URLSearchParams(s.search);for(const[re,ye]of Object.entries(T))X.set(re,ye);X.set("category","onedata"),l(`${s.pathname}?${X}`)},et=T=>ke({onedata:T}),ue=async()=>{const T=z();if(!T||!Le()){D([]),f([]);return}d("");try{const X=e.domain==="all"?void 0:e.domain,[re,ye,De,Ce]=await Promise.all([sa(T,{domain:X}),oa(T,{scope:g(),domain:X}),$a(T).catch(()=>[]),ma(T).catch(()=>({items:[]}))]);D(re.items),f(ye.items),K(De.filter(ve=>ve.id.startsWith("wrk_")).map(ve=>({id:ve.id,name:ve.name||ve.id}))),S(Ce.items)}catch(X){d(X instanceof Error?X.message:"无法加载登记库")}};mt(()=>{e.domain,y(),g(),ue()});const qe=ne(()=>_().filter(T=>T.status==="ready")),tt=(T,X)=>T.zarr_summary?.arrays?.length?T.zarr_summary.arrays.map(re=>`${re.path||"."} shape=${re.shape.join("×")} dtype=${re.dtype} chunks=${re.chunks.join("×")}`).join(`
5
- `):T.sample?T.sample:`规模 ${T.probe?.logical_bytes??0} bytes · ${T.probe?.format_hint??X}`;return(()=>{var T=ja(),X=T.firstChild,re=X.firstChild,ye=re.firstChild,De=X.nextSibling,Ce=De.firstChild,ve=Ce.nextSibling,me=De.nextSibling;return me.firstChild,t(re,()=>e.copy.replace(/[。.]$/,""),ye),Ce.$$click=()=>et("raw"),ve.$$click=()=>et("already"),t(T,r(u,{get when(){return y()==="already"},get children(){var h=Sa(),$=h.firstChild,L=$.nextSibling;return $.$$click=()=>ke({already:"mine"}),L.$$click=()=>ke({already:"public"}),k(E=>{var A=g()==="mine",B=g()==="public";return A!==E.e&&V($,"aria-pressed",E.e=A),B!==E.t&&V(L,"aria-pressed",E.t=B),E},{e:void 0,t:void 0}),h}}),me),t(T,r(u,{get when(){return!Le()},get children(){return ka()}}),me),t(T,r(u,{get when(){return p()},get children(){var h=Ca();return t(h,p),h}}),me),t(T,r(u,{get when(){return ce(()=>y()==="raw")()&&Le()},get children(){return[(()=>{var h=Ia(),$=h.firstChild,L=$.nextSibling,E=L.nextSibling,A=E.nextSibling,B=A.nextSibling,U=B.nextSibling,le=U.nextSibling;return h.addEventListener("submit",async m=>{m.preventDefault();const R=z();if(R){v(!0),d("");try{await fa(R,{provider:N(),access_key_id:be().trim(),secret:he().trim(),...de().trim()?{endpoint:de().trim()}:{},...Se().trim()?{region:Se().trim()}:{}}),$e(""),te(""),await ue()}catch(H){d(H instanceof Error?H.message:"保存对象存储 Key 失败")}finally{v(!1)}}}),L.addEventListener("change",m=>se(m.currentTarget.value)),E.$$input=m=>$e(m.currentTarget.value),A.$$input=m=>te(m.currentTarget.value),B.$$input=m=>je(m.currentTarget.value),U.$$input=m=>Ae(m.currentTarget.value),t(h,r(u,{get when(){return Y().length>0},get children(){var m=We();return t(m,r(G,{get each(){return Y()},children:R=>(()=>{var H=Aa(),fe=H.firstChild,pe=fe.firstChild,oe=fe.nextSibling;return t(fe,()=>R.provider,pe),t(fe,()=>R.access_key_id_suffix,null),t(fe,(()=>{var _e=ce(()=>!!R.endpoint);return()=>_e()?` · ${R.endpoint}`:""})(),null),oe.$$click=async()=>{const _e=z();if(_e)try{await _a(_e,R.provider),await ue()}catch(Pe){d(Pe instanceof Error?Pe.message:"删除 Key 失败")}},H})()})),m}}),null),k(m=>{var R=N()==="s3"?"endpoint(可选)":"endpoint(必填)",H=O()||!be().trim()||!he().trim();return R!==m.e&&V(B,"placeholder",m.e=R),H!==m.t&&(le.disabled=m.t=H),m},{e:void 0,t:void 0}),k(()=>L.value=N()),k(()=>E.value=be()),k(()=>A.value=he()),k(()=>B.value=de()),k(()=>U.value=Se()),h})(),(()=>{var h=La(),$=h.firstChild,L=$.nextSibling,E=L.nextSibling,A=E.nextSibling,B=A.nextSibling;return h.addEventListener("submit",async U=>{U.preventDefault();const le=z();if(le){v(!0),d("");try{await ca(le,{title:M().trim()||Z().trim(),domain:e.domain==="all"?"unspecified":e.domain,uri:Z().trim(),connector:j(),...j()==="remote_workspace"?{workspace_id:F()}:{}}),q(""),o(""),await ue()}catch(m){d(m instanceof Error?m.message:"接入失败")}finally{v(!1)}}}),L.$$input=U=>q(U.currentTarget.value),E.$$input=U=>o(U.currentTarget.value),A.addEventListener("change",U=>ie(U.currentTarget.value)),t(h,r(u,{get when(){return j()==="remote_workspace"},get children(){var U=xa();return U.firstChild,U.addEventListener("change",le=>J(le.currentTarget.value)),t(U,r(G,{get each(){return x()},children:le=>(()=>{var m=ot();return t(m,()=>le.name),k(()=>m.value=le.id),m})()}),null),k(()=>U.value=F()),U}}),B),k(()=>B.disabled=O()||!Z().trim()||j()==="remote_workspace"&&!F()),k(()=>L.value=M()),k(()=>E.value=Z()),k(()=>A.value=j()),h})(),r(u,{get when(){return C().length===0},get fallback(){return(()=>{var h=We();return t(h,r(G,{get each(){return C()},children:$=>(()=>{var L=qa(),E=L.firstChild,A=E.firstChild,B=A.nextSibling,U=B.nextSibling,le=U.firstChild,m=U.nextSibling,R=E.nextSibling,H=R.firstChild,fe=H.nextSibling;return A.addEventListener("change",pe=>{const oe=pe.currentTarget.checked;w(_e=>oe?[..._e,$.id]:_e.filter(Pe=>Pe!==$.id))}),t(B,()=>$.title),t(U,()=>$.format,le),t(U,()=>$.connector,null),t(m,()=>$.uri),H.$$click=async()=>{const pe=z();if(pe)try{const oe=await ua(pe,$.id,F()||void 0);b(tt(oe,$.format))}catch(oe){d(oe instanceof Error?oe.message:"预览失败")}},fe.$$click=async()=>{const pe=z();if(pe){v(!0);try{await da(pe,$.id),ke({onedata:"already",already:"mine"}),await ue()}catch(oe){d(oe instanceof Error?oe.message:"转化失败")}finally{v(!1)}}},k(()=>A.checked=I().includes($.id)),L})()})),h})()},get children(){return Da()}}),r(u,{get when(){return ce(()=>!!Ze())()&&I().length>0},get children(){var h=Pa();return h.$$click=async()=>{const $=z(),L=Ze();if(!(!$||!L))try{await ga($,L,I())}catch(E){d(E instanceof Error?E.message:"挂载芯片失败")}},h}}),r(u,{get when(){return Q()},get children(){var h=st();return t(h,Q),h}})]}}),me),t(T,r(u,{get when(){return ce(()=>y()==="already")()&&Le()},get children(){return[r(u,{get when(){return g()==="mine"},get children(){var h=Ea(),$=h.firstChild;return $.nextSibling,t(h,r(u,{get when(){return qe().length>0},get fallback(){return Ka()},get children(){var L=Ta();return t(L,r(G,{get each(){return qe()},children:E=>(()=>{var A=Wa(),B=A.firstChild;return B.nextSibling,t(B,()=>E.id),t(A,()=>E.title,null),A})()})),L}}),null),h}}),r(u,{get when(){return qe().length>0},get children(){var h=Oa(),$=h.firstChild;return $.addEventListener("change",L=>ee(L.currentTarget.value)),t(h,r(u,{get when(){return W()==="workspace"},get children(){var L=Ra();return L.firstChild,L.addEventListener("change",E=>J(E.currentTarget.value)),t(L,r(G,{get each(){return x()},children:E=>(()=>{var A=ot();return t(A,()=>E.name),k(()=>A.value=E.id),A})()}),null),k(()=>L.value=F()),L}}),null),k(()=>$.value=W()),h}}),r(u,{get when(){return _().length===0},get fallback(){return(()=>{var h=We();return t(h,r(G,{get each(){return _()},children:$=>(()=>{var L=za(),E=L.firstChild,A=E.nextSibling,B=A.nextSibling,U=B.nextSibling,le=U.firstChild;return t(E,()=>$.title),t(A,()=>$.status,null),t(A,()=>$.visibility==="public"?" · 已发布":"",null),t(B,()=>$.uri),le.$$click=async()=>{const m=z();if(m)try{const R=await pa(m,$.id,g()==="public"&&F()||void 0);b(tt(R,$.format))}catch(R){d(R instanceof Error?R.message:"预览失败")}},t(U,r(u,{get when(){return ce(()=>g()==="mine"&&$.status==="ready")()&&$.visibility!=="public"},get children(){var m=Ha();return m.$$click=async()=>{const R=z();if(R){v(!0);try{await ba(R,$.id),await ue()}catch(H){d(H instanceof Error?H.message:"发布失败")}finally{v(!1)}}},m}}),null),t(U,r(u,{get when(){return ce(()=>g()==="mine")()&&$.visibility==="public"},get children(){var m=Ma();return m.$$click=async()=>{const R=z();if(R){v(!0);try{await ha(R,$.id),await ue()}catch(H){d(H instanceof Error?H.message:"取消发布失败")}finally{v(!1)}}},m}}),null),t(U,r(u,{get when(){return g()==="public"},get children(){var m=Fa();return m.$$click=async()=>{const R=z();if(R){v(!0);try{await ya(R,$.id),ke({onedata:"raw"}),await ue()}catch(H){d(H instanceof Error?H.message:"再次接入失败")}finally{v(!1)}}},m}}),null),t(U,r(u,{get when(){return $.status==="ready"},get children(){var m=Qa();return m.$$click=async()=>{const R=z();if(R){if(W()==="workspace"&&!F()){d("请选择作业目标 wrk_*");return}v(!0);try{await va(R,$.id,{target:W(),...W()==="workspace"?{workspace_id:F()}:{}}),await ue()}catch(H){d(H instanceof Error?H.message:"开训失败")}finally{v(!1)}}},m}}),null),L})()})),h})()},get children(){var h=Ua();return t(h,()=>g()==="public"?"还没有公共 Already。":"还没有 Already。从原始数据转化,或等对话加工回写。"),h}}),r(u,{get when(){return Q()},get children(){var h=st();return t(h,Q),h}})]}}),me),t(me,r(Nt,{get filter(){return wa[e.domain]},get domainLabel(){return e.domainLabel}}),null),k(h=>{var $=y()==="raw",L=y()==="already";return $!==h.e&&V(Ce,"aria-pressed",h.e=$),L!==h.t&&V(ve,"aria-pressed",h.t=L),h},{e:void 0,t:void 0}),T})()}Te(["click","input"]);var Ba=i('<article class="os-client-capability-card os-client-capability-skill-card"><div class=os-client-capability-skill-card-head><h4></h4></div><p></p><div class=os-client-capability-meta><span class=os-client-capability-skill-provider></span></div><div class=os-client-capability-actions><button type=button>详情</button><button type=button data-primary=true>开发'),St=i("<span>"),Va=i("<div>"),Ga=i("<button type=button class=os-client-capability-oneskills-expand>"),Ja=i("<section class=os-client-capability-oneskills-section><header class=os-client-capability-oneskills-section-head><div class=os-client-capability-oneskills-section-title><h3></h3></div><p>"),Ya=i("<p class=os-client-capability-empty>当前分类暂无技能卡片。"),Xa=i("<span class=os-client-capability-oneskills-count> 个技能"),Za=i("<p class=os-client-capability-oneskills-error>"),er=i("<div class=os-client-capability-oneskills-top-row>"),tr=i("<div class=os-client-capability-oneskills-overview>"),ar=i('<section class="os-client-capability-resource-panel os-client-capability-oneskills-panel"><header class=os-client-capability-oneskills-toolbar><div class=os-client-capability-oneskills-toolbar-copy><p>按 OneSkills 分层浏览官方技能,查看详情或进入开发。</p></div><div class=os-client-capability-oneskills-actions><span class=inline-flex><button type=button class=os-client-capability-oneskills-upgrade>'),rr=i("<p class=os-client-capability-empty>正在加载 OneSkills 技能..."),lr=i("<p class=os-client-capability-empty>暂无可展示的 OneSkills 技能,请先安装或更新技能。");const ct=4,ze=new Set(["orchestrator","resource"]);function nr(e,a){return e.layer===a.title||e.tags.includes(a.title)||e.tags.includes(a.id)}function ir(e){return Be(e)||$t(ge(),e.lastCodeWorkspace)||Ve(ge())||Ge(document,e.path)}function sr(e){const a=()=>e.item.tags.filter(n=>n!==e.item.layer&&n!==e.item.provider).slice(0,3);return(()=>{var n=Ba(),s=n.firstChild,l=s.firstChild,c=s.nextSibling,y=c.nextSibling,g=y.firstChild,C=y.nextSibling,D=C.firstChild,_=D.nextSibling;return _t(n,"click",e.onOpen,!0),t(l,()=>e.item.title),t(c,()=>e.item.copy),t(g,()=>e.item.provider),t(y,r(G,{get each(){return a()},children:f=>(()=>{var p=St();return t(p,f),p})()}),null),D.$$click=f=>{f.stopPropagation(),e.onOpen()},_.$$click=f=>{f.stopPropagation(),e.onDevelop()},k(f=>{var p=e.layerId,d=e.canDevelop?void 0:"登录后使用";return p!==f.e&&V(n,"data-layer",f.e=p),d!==f.t&&V(_,"title",f.t=d),f},{e:void 0,t:void 0}),n})()}function dt(e){const[a,n]=P(!1),s=()=>e.items.length,l=()=>Math.max(0,s()-ct),c=()=>a()||l()===0?e.items:e.items.slice(0,ct),y=()=>ze.has(e.group.id);return(()=>{var g=Ja(),C=g.firstChild,D=C.firstChild,_=D.firstChild,f=D.nextSibling;return t(_,()=>e.group.title),t(D,r(u,{get when(){return s()>0},get children(){var p=St();return t(p,s),p}}),null),t(f,()=>e.group.copy),t(g,r(u,{get when(){return s()>0},get fallback(){return Ya()},get children(){return[(()=>{var p=Va();return t(p,r(G,{get each(){return c()},children:d=>r(sr,{item:d,get layerId(){return e.group.id},get canDevelop(){return e.canDevelop},onOpen:()=>e.onOpen(d),onDevelop:()=>e.onDevelop(d)})})),k(d=>{var O=!y(),v=!!y();return O!==d.e&&p.classList.toggle("os-client-capability-page-grid",d.e=O),v!==d.t&&p.classList.toggle("os-client-capability-oneskills-compact-grid",d.t=v),d},{e:void 0,t:void 0}),p})(),r(u,{get when(){return ce(()=>!y())()&&l()>0},get children(){var p=Ga();return p.$$click=()=>n(d=>!d),t(p,(()=>{var d=ce(()=>!!a());return()=>d()?"收起":`展开其余 ${l()} 个`})()),k(()=>V(p,"aria-expanded",a())),p}})]}}),null),k(p=>{var d=e.group.id,O=!!e.compact,v=e.group.id;return d!==p.e&&V(g,"id",p.e=d),O!==p.t&&g.classList.toggle("is-compact",p.t=O),v!==p.a&&V(g,"data-layer",p.a=v),p},{e:void 0,t:void 0,a:void 0}),g})()}function or(){const e=Je(),a=Oe(),n=Ee(),s=Re(),l=Ye(),[c,y]=P([]),[g,C]=P(!1),[D,_]=P(!1),[f,p]=P(),[d,O]=P(!1),[v,M]=P(),q=ne(()=>!!ge()?.account.id),Z=ne(()=>ir({path:s.data.path,recent:Ue(s.data.project),lastCodeWorkspace:n.projects.lastCode()})),o=async()=>{const b=n.current;if(!b){y([]),C(!0);return}const I=await Ot(b.http.url,{limit:100});y(I.loaded?I.items:[]),C(!0)};Fe(()=>{const b=Gt(e.search)??Jt()?.domainId??"all";a(ft("oneskills",b),{replace:!0}),o()});const j=b=>c().filter(I=>nr(I,b)),ie=()=>jt.filter(b=>j(b).length>0),F=()=>{const b=ie();return{pair:b.filter(I=>ze.has(I.id)),rest:b.filter(I=>!ze.has(I.id))}},J=b=>{M(b),O(!0)},x=()=>{O(!1),M(void 0)},K=b=>{if(!Me({navigate:a,action:{type:"prompt",prompt:""},isLoggedIn:q()}))return;const I=Z();if(!I){we({variant:"error",title:"无法开发",description:"未检测到工作目录"});return}const w=Vt({id:b.id,title:b.title,copy:b.copy,layer:b.layer,tags:b.tags,provider:b.provider}),W=pt(I);gt(W,w.prompt,{skill:w.skill}),bt(W),l.projects.open(I),n.projects.touchCode(I),O(!1),M(void 0),we({variant:"success",title:`已为你创建「${b.title}」开发任务`}),a(ht(I))},Q=async()=>{if(!Me({navigate:a,action:{type:"install",resourceId:"oneskills"},isLoggedIn:q()}))return;const b=n.current,I=Z();if(!b){const w=Ke();p(w),we({variant:"error",title:"更新失败",description:w});return}if(!I){const w=Ke();p(w),we({variant:"error",title:"更新失败",description:w});return}_(!0),p(void 0);try{const w=await Ut(b.http.url,I);await o();const W=w.version?`版本 ${w.version} · ${w.skillCount} 个技能`:`${w.skillCount} 个技能`,ee=w.seedSource==="bundled"&&w.seedFallbackReason?"原语已回退内置 seed":w.seedSource==="disk"?"原语已同步磁盘 oneskills":void 0;we({variant:"success",title:"OneSkills 已更新",description:ee?`${W} · ${ee}`:W})}catch(w){const W=Ke(w instanceof Error?w.message:"更新 OneSkills 失败");p(W),we({variant:"error",title:"更新失败",description:W})}finally{_(!1)}};return(()=>{var b=ar(),I=b.firstChild,w=I.firstChild;w.firstChild;var W=w.nextSibling,ee=W.firstChild,Y=ee.firstChild;return t(w,r(u,{get when(){return ce(()=>!!g())()&&c().length>0},get children(){var S=Xa(),N=S.firstChild;return t(S,()=>c().length,N),S}}),null),t(W,r(u,{get when(){return f()},get children(){var S=Za();return t(S,f),S}}),ee),Y.$$click=()=>void Q(),t(Y,()=>D()?"更新中...":"更新 OneSkills"),t(b,r(u,{get when(){return g()},get fallback(){return rr()},get children(){return r(u,{get when(){return c().length>0},get fallback(){return lr()},get children(){var S=tr();return t(S,r(u,{get when(){return F().pair.length>0},get children(){var N=er();return t(N,r(G,{get each(){return F().pair},children:se=>r(dt,{group:se,get items(){return j(se)},compact:!0,get canDevelop(){return q()},onOpen:J,onDevelop:K})})),N}}),null),t(S,r(G,{get each(){return F().rest},children:N=>r(dt,{group:N,get items(){return j(N)},get canDevelop(){return q()},onOpen:J,onDevelop:K})}),null),S}})}}),null),t(b,r(Bt,{variant:"workbench",get item(){return v()},get open(){return d()},get serverUrl(){return n.current?.http.url},onClose:x,onDevelop:()=>{const S=v();S&&(x(),K(S))}}),null),k(S=>{var N=q()?void 0:"登录后使用",se=D();return N!==S.e&&V(ee,"title",S.e=N),se!==S.t&&(Y.disabled=S.t=se),S},{e:void 0,t:void 0}),b})()}Te(["click"]);async function cr(e,a){const n=new URLSearchParams;n.set("limit","200");const s=await yt(`${vt(e)}/experimental/onescience/scenario?${n}`);if(!s.ok)throw new Error(`scenario catalog failed: ${s.status}`);const c=((await s.json()).items??[]).map(y=>({...y,model_ids:y.model_ids??[]}));return At(c),c}var dr=i("<span>当前范围:"),ur=i("<strong>全领域"),pr=i("<small>OneSkills 原语跨领域通用,不区分材料 / 气象 / 流体 / 生信"),gr=i("<div class=os-client-capability-domain-row role=tablist aria-label=能力中心领域>"),br=i("<div class=os-client-capability-scenario-grid>"),hr=i("<section class=os-client-capability-scenario-panel><div class=os-client-capability-scenario-toolbar><span>场景卡片</span><strong></strong><small> · 点击卡片打开场景弹窗</small><label class=os-client-capability-scenario-search><input type=search placeholder=搜索场景名称、ID、模型、HPC… aria-label=搜索场景>"),yr=i("<div class=os-client-capability-page><section class=os-client-capability-selector aria-label=能力中心筛选><div class=os-client-capability-current-domain></div><div class=os-client-capability-filter-tabs aria-label=能力类型></div></section><div class=os-client-capability-page-body>"),vr=i("<span>当前领域:"),$r=i("<strong>"),mr=i("<small>"),fr=i("<button type=button>"),_r=i("<button type=button class=os-client-capability-filter-tab role=tab><div class=os-client-capability-filter-tab-text><strong></strong><small>"),wr=i("<p class=os-client-capability-hint>"),xe=i("<span>"),Sr=i("<button type=button class=os-client-capability-scenario-card><div class=os-client-capability-scenario-card-head><h4></h4><span></span></div><p></p><div class=os-client-capability-scenario-card-meta><span> 步工作流</span><span> 个字段</span></div><div class=os-client-capability-scenario-card-action><span>使用"),kr=i("<button type=button class=os-client-capability-upload-trigger><span aria-hidden=true>+</span>上传私有模型"),Cr=i("<label class=os-client-capability-catalog-search><span>搜索</span><input type=search placeholder=按名称、简介或标签筛选>"),Ir=i("<div class=os-client-capability-catalog-toolbar><div class=os-client-capability-catalog-toolbar-side><span class=os-client-capability-catalog-count></span><div class=os-client-capability-view-switch role=tablist aria-label=展示方式>"),xr=i('<section class=os-client-capability-resource-panel><header class="os-client-capability-page-section-head os-client-capability-page-section-head-active"><p>'),Lr=i("<p class=os-client-capability-empty>当前「<!>」领域暂无<!>卡片。"),Dr=i("<button type=button role=tab>"),Pr=i("<p class=os-client-capability-empty>没有匹配的结果,试试换个关键词。"),Tr=i("<div class=os-client-capability-catalog role=list>"),Er=i("<article class=os-client-capability-catalog-row role=listitem>"),Rr=i("<div class=os-client-capability-page-grid>"),kt=i("<span class=os-client-capability-private-badge>私有资产"),Ct=i("<span class=os-client-capability-unavailable-badge>暂不可用"),Or=i("<div class=os-client-capability-meta>"),Ur=i("<article class=os-client-capability-card><div class=os-client-capability-card-body><div class=os-client-capability-card-head><div class=os-client-capability-card-title><h4></h4></div></div><p>"),jr=i("<p class=os-client-capability-unavailable-hint>暂无 OneScience 源码或魔搭映射"),Ar=i("<div class=os-client-capability-catalog-tags>"),qr=i("<div class=os-client-capability-catalog-copy><div class=os-client-capability-card-title><h4></h4></div><p>"),Kr=i("<div>"),Wr=i("<button type=button>安装");const Hr=[{id:"all",label:"全部"},{id:"materials",label:"材料"},{id:"weather",label:"气象"},{id:"fluid",label:"流体"},{id:"bio",label:"生信"}],Mr=[{id:"scenario",label:"场景",title:"场景库"},{id:"onemodel",label:"onemodel",title:"模型库"},{id:"hpc",label:"HPC 软件",title:"软件库"},{id:"onedata",label:"onedata",title:"数据集"},{id:"oneskills",label:"oneskills",title:"技能库"}],Fr=[{id:"cards",label:"卡片"},{id:"list",label:"列表"}],It="os-capability-view-mode";function He(e){return e==="all"||e==="materials"||e==="weather"||e==="fluid"||e==="bio"?e:"all"}function Qr(e){return e==="materials"||e==="weather"||e==="fluid"||e==="bio"?e:"materials"}function zr(e,a){const n=e.split("?")[0]??e;return new RegExp(`^${Qe.capabilities}/[^/]+`).test(n)?!new URLSearchParams(a).has("domain"):!1}function ll(e){const a=Je(),n=Oe(),s=nt(a.pathname,a.search),[l,c]=qt({domainId:He(s.domainId),categoryId:s.categoryId,scenarioQuery:"",activeScenarioId:"",uploadPage:null,scenarioCatalogTick:0}),y=Re(),g=Ye(),C=Ee();Fe(()=>{const o=C.current?.http.url;o&&cr(o).then(()=>c("scenarioCatalogTick",j=>j+1)).catch(()=>{})});const D=o=>{Yt({categoryId:o.categoryId,domainId:He(o.domainId)})},_=o=>{D(o),n(ft(o.categoryId,o.domainId),{replace:!0})};mt(()=>{const o=a.pathname,j=a.search,ie=nt(o,j);if(zr(o,j)){c("categoryId",ie.categoryId);return}const F=He(ie.domainId),J=ie.categoryId;c({domainId:F,categoryId:J}),D({domainId:F,categoryId:J});const x=o.split("?")[0]??o,K=x===Qe.capabilities||x===`${Qe.capabilities}/`,Q=new URLSearchParams(j);K&&!Q.get("category")&&!Q.get("domain")&&_({domainId:F,categoryId:J})});const f=ne(()=>(Kt(),l.domainId==="all"?at():at(l.domainId))),p=ne(()=>f().find(o=>o.id===l.categoryId)??f()[0]),d=ne(()=>(l.scenarioCatalogTick,Wt(l.domainId,l.scenarioQuery))),O=ne(()=>{if(l.scenarioCatalogTick,!!l.activeScenarioId)return rt(l.activeScenarioId)}),v=o=>{c({categoryId:o,activeScenarioId:"",scenarioQuery:o==="scenario"?l.scenarioQuery:""}),_({domainId:l.domainId,categoryId:o})},M=()=>c("activeScenarioId",""),q=()=>({navigate:n,isLoggedIn:!!ge(),path:y.data.path,recent:Ue(y.data.project),lastCodeWorkspace:C.projects.lastCode(),openProject:o=>g.projects.open(o),touchCode:o=>C.projects.touchCode(o)});Fe(()=>{const o=Ht();if(o)try{if(o.type==="install"){if(o.resourceId==="oneskills"){c("categoryId","oneskills"),_({domainId:l.domainId,categoryId:"oneskills"});return}if(o.resourceId.startsWith("__"))return;wt({resourceId:o.resourceId,...q()});return}if(o.type==="prompt"&&o.prompt.trim()){Xt({prompt:o.prompt,title:o.title||"能力中心任务",workflow:o.workflow,...q()});return}if(o.type==="scenario-run"){const j=rt(o.scenarioId);if(!j)return;it({scenario:j,values:o.values,...q()});return}o.type==="wizard"&&Zt({resourceId:o.resourceId,scenarioId:o.scenarioId,values:o.values,prompt:o.prompt,...q()})}catch{}});const Z=(o,j)=>{it({scenario:o,values:j.values,...q()})};return(()=>{var o=yr(),j=o.firstChild,ie=j.firstChild,F=ie.nextSibling,J=j.nextSibling;return t(ie,r(u,{get when(){return l.categoryId==="oneskills"},get fallback(){return[vr(),(()=>{var x=$r();return t(x,()=>Ie(l.domainId)),x})(),(()=>{var x=mr();return t(x,()=>l.categoryId==="scenario"?"切换领域后,下方场景同步刷新":"切换领域后,下方模型、HPC 软件与数据集内容同步刷新"),x})()]},get children(){return[dr(),ur(),pr()]}})),t(j,r(u,{get when(){return l.categoryId!=="oneskills"},get children(){var x=gr();return t(x,r(G,{each:Hr,children:K=>(()=>{var Q=fr();return Q.$$click=()=>{c({domainId:K.id,activeScenarioId:"",scenarioQuery:""}),_({domainId:K.id,categoryId:l.categoryId})},t(Q,()=>K.label),k(b=>{var I=K.id===l.domainId,w=K.id===l.domainId;return I!==b.e&&Q.classList.toggle("is-active",b.e=I),w!==b.t&&V(Q,"aria-pressed",b.t=w),b},{e:void 0,t:void 0}),Q})()})),x}}),F),t(F,r(G,{each:Mr,children:x=>(()=>{var K=_r(),Q=K.firstChild,b=Q.firstChild,I=b.nextSibling;return K.$$click=()=>v(x.id),t(b,()=>x.label),t(I,()=>x.title),k(w=>{var W=l.categoryId===x.id,ee=l.categoryId===x.id;return W!==w.e&&K.classList.toggle("is-active",w.e=W),ee!==w.t&&V(K,"aria-selected",w.t=ee),w},{e:void 0,t:void 0}),K})()})),t(J,r(u,{get when(){return l.categoryId==="oneskills"},get children(){return r(or,{})}}),null),t(J,r(u,{get when(){return l.categoryId==="scenario"},get children(){var x=hr(),K=x.firstChild,Q=K.firstChild,b=Q.nextSibling,I=b.nextSibling,w=I.firstChild,W=I.nextSibling,ee=W.firstChild;return t(b,()=>d().length),t(I,()=>Ie(l.domainId),w),ee.$$input=Y=>c("scenarioQuery",Y.currentTarget.value),t(x,r(u,{get when(){return d().length>0},get fallback(){return(()=>{var Y=wr();return t(Y,(()=>{var S=ce(()=>!!l.scenarioQuery.trim());return()=>S()?`未找到匹配「${l.scenarioQuery.trim()}」的场景。`:`当前「${Ie(l.domainId)}」领域暂无场景卡片。`})()),Y})()},get children(){var Y=br();return t(Y,r(G,{get each(){return d()},children:S=>(()=>{var N=Sr(),se=N.firstChild,be=se.firstChild,$e=be.nextSibling,he=se.nextSibling,te=he.nextSibling,de=te.firstChild,je=de.firstChild,Se=de.nextSibling,Ae=Se.firstChild;return N.$$click=()=>c("activeScenarioId",Mt(S)),t(be,()=>S.name),t($e,()=>S.scenario_id),t(he,()=>S.problem_and_applicability),t(te,r(u,{get when(){return S.type?.trim()},get children(){var z=xe();return t(z,()=>S.type),z}}),de),t(te,r(u,{get when(){return S.model?.trim()},get children(){var z=xe();return t(z,()=>S.model),z}}),de),t(te,r(u,{get when(){return S.HPC?.trim()},get children(){var z=xe();return t(z,()=>S.HPC),z}}),de),t(de,()=>S.workflow_steps?.length||S.workflow.length,je),t(Se,()=>S.user_input.length,Ae),N})()})),Y}}),null),k(()=>ee.value=l.scenarioQuery),x}}),null),t(J,r(u,{get when(){return l.categoryId==="onemodel"||l.categoryId==="hpc"},get children(){return r(Nr,{get category(){return p()},get domainId(){return l.domainId},get domainLabel(){return Ie(l.domainId)},get onUpload(){return l.categoryId==="onemodel"?()=>c("uploadPage","models"):void 0}})}}),null),t(J,r(u,{get when(){return l.categoryId==="onedata"},get children(){return r(Na,{get domain(){return l.domainId},get domainLabel(){return Ie(l.domainId)},get copy(){return p().copy}})}}),null),t(o,r(u,{get when(){return O()},children:x=>r(ea,{get scenario(){return x()},onClose:M,onSubmit:K=>Z(x(),K)})}),null),t(o,r(la,{get open(){return l.uploadPage!==null},page:"models",get domain(){return Qr(l.domainId)},onClose:()=>c("uploadPage",null),onSaved:()=>{c({categoryId:"onemodel",uploadPage:null,activeScenarioId:""}),_({domainId:l.domainId,categoryId:"onemodel"})}}),null),t(o,()=>e.children,null),o})()}function Nr(e){const[a,n]=P(""),[s,l]=P(Yr()),c=()=>({category:e.category.id,domain:e.domainId}),y=ne(()=>{const C=a().trim().toLowerCase();return C?e.category.items.filter(D=>[D.name,D.blurb,...D.tags].some(_=>_.toLowerCase().includes(C))):e.category.items}),g=C=>{l(C),Xr(C)};return(()=>{var C=xr(),D=C.firstChild,_=D.firstChild;return t(_,()=>e.category.copy.replace(/[。.]$/,"")),t(D,r(u,{get when(){return e.onUpload},get children(){var f=kr();return _t(f,"click",e.onUpload,!0),f}}),null),t(C,r(u,{get when(){return e.category.items.length>0},get fallback(){return(()=>{var f=Lr(),p=f.firstChild,d=p.nextSibling,O=d.nextSibling,v=O.nextSibling;return v.nextSibling,t(f,()=>e.domainLabel,d),t(f,()=>e.category.id==="hpc"?" HPC 软件":"模型",v),f})()},get children(){return[(()=>{var f=Ir(),p=f.firstChild,d=p.firstChild,O=d.nextSibling;return t(f,r(u,{get when(){return e.category.items.length>=6},get children(){var v=Cr(),M=v.firstChild,q=M.nextSibling;return q.$$input=Z=>n(Z.currentTarget.value),k(()=>q.value=a()),v}}),p),t(d,(()=>{var v=ce(()=>y().length===e.category.items.length);return()=>v()?`共 ${e.category.items.length} 项`:`${y().length} / ${e.category.items.length} 项`})()),t(O,r(G,{each:Fr,children:v=>(()=>{var M=Dr();return M.$$click=()=>g(v.id),t(M,()=>v.label),k(q=>{var Z=s()===v.id,o=s()===v.id;return Z!==q.e&&V(M,"aria-selected",q.e=Z),o!==q.t&&M.classList.toggle("is-active",q.t=o),q},{e:void 0,t:void 0}),M})()})),f})(),r(u,{get when(){return y().length>0},get fallback(){return Pr()},get children(){return[r(u,{get when(){return s()==="list"},get children(){return r(Br,{get items(){return y()},get catalog(){return c()}})}}),r(u,{get when(){return s()==="cards"},get children(){return r(Vr,{get items(){return y()},get catalog(){return c()}})}})]}})]}}),null),C})()}function Br(e){return(()=>{var a=Tr();return t(a,r(G,{get each(){return e.items},children:n=>{const s=()=>Xe(n);return(()=>{var l=Er();return t(l,r(Gr,{item:n}),null),t(l,r(u,{get when(){return s()},get fallback(){return r(xt,{})},get children(){return r(Lt,{item:n,get catalog(){return e.catalog}})}}),null),k(c=>{var y=n.ownership==="private",g=!s(),C=s()?void 0:!0,D=s()?void 0:"暂无 OneScience 源码或魔搭映射,暂不可用";return y!==c.e&&l.classList.toggle("is-private",c.e=y),g!==c.t&&l.classList.toggle("is-unavailable",c.t=g),C!==c.a&&V(l,"aria-disabled",c.a=C),D!==c.o&&V(l,"title",c.o=D),c},{e:void 0,t:void 0,a:void 0,o:void 0}),l})()}})),a})()}function Vr(e){return(()=>{var a=Rr();return t(a,r(G,{get each(){return e.items},children:n=>{const s=()=>Xe(n);return(()=>{var l=Ur(),c=l.firstChild,y=c.firstChild,g=y.firstChild,C=g.firstChild,D=y.nextSibling;return t(C,()=>n.name),t(g,r(u,{get when(){return n.ownership==="private"},get children(){return kt()}}),null),t(g,r(u,{get when(){return!s()},get children(){return Ct()}}),null),t(y,r(u,{get when(){return n.tags.length>0},get children(){var _=Or();return t(_,r(G,{get each(){return n.tags},children:f=>(()=>{var p=xe();return t(p,f),p})()})),_}}),null),t(D,()=>n.blurb),t(l,r(u,{get when(){return s()},get fallback(){return r(xt,{variant:"card"})},get children(){return r(Lt,{item:n,variant:"card",get catalog(){return e.catalog}})}}),null),k(_=>{var f=n.ownership==="private",p=!s(),d=s()?void 0:!0,O=s()?void 0:"暂无 OneScience 源码或魔搭映射,暂不可用";return f!==_.e&&l.classList.toggle("is-private",_.e=f),p!==_.t&&l.classList.toggle("is-unavailable",_.t=p),d!==_.a&&V(l,"aria-disabled",_.a=d),O!==_.o&&V(l,"title",_.o=O),_},{e:void 0,t:void 0,a:void 0,o:void 0}),l})()}})),a})()}function xt(e){return(()=>{var a=jr();return k(()=>a.classList.toggle("os-client-capability-unavailable-hint-card",e.variant==="card")),a})()}function Gr(e){return(()=>{var a=qr(),n=a.firstChild,s=n.firstChild,l=n.nextSibling;return t(s,()=>e.item.name),t(n,r(u,{get when(){return e.item.ownership==="private"},get children(){return kt()}}),null),t(n,r(u,{get when(){return!Xe(e.item)},get children(){return Ct()}}),null),t(l,()=>e.item.blurb),t(a,r(u,{get when(){return e.item.tags.length>0},get children(){var c=Ar();return t(c,r(G,{get each(){return e.item.tags},children:y=>(()=>{var g=xe();return t(g,y),g})()})),c}}),null),a})()}function Lt(e){const a=()=>e.catalog?{category:e.catalog.category,domain:e.catalog.domain}:void 0;return(()=>{var n=Kr();return t(n,r(lt,{get href(){return Ft(e.item.id,a())},children:"详情"}),null),t(n,r(Jr,{get item(){return e.item}}),null),t(n,r(lt,{get href(){return Qt(e.item.id,void 0,a())},"data-primary":"true",children:"使用"}),null),k(s=>{var l=e.variant!=="card",c=e.variant==="card";return l!==s.e&&n.classList.toggle("os-client-capability-catalog-actions",s.e=l),c!==s.t&&n.classList.toggle("os-client-capability-actions",s.t=c),s},{e:void 0,t:void 0}),n})()}function Jr(e){const a=Oe(),n=Re(),s=Ye(),l=Ee(),c=()=>Ne(e.item);return(()=>{var y=Wr();return y.$$click=()=>{c()&&wt({resourceId:e.item.id,navigate:a,isLoggedIn:!!ge(),path:n.data.path,recent:Ue(n.data.project),lastCodeWorkspace:l.projects.lastCode(),openProject:g=>s.projects.open(g),touchCode:g=>l.projects.touchCode(g)})},k(g=>{var C=!c(),D=c()?void 0:"暂无魔搭安装包";return C!==g.e&&(y.disabled=g.e=C),D!==g.t&&V(y,"title",g.t=D),g},{e:void 0,t:void 0}),y})()}function Yr(){if(typeof localStorage>"u")return"cards";const e=localStorage.getItem(It);return e==="cards"||e==="list"?e:"cards"}function Xr(e){typeof localStorage>"u"||localStorage.setItem(It,e)}Te(["input","click"]);export{ll as CapabilityCenterPage};
@@ -1 +0,0 @@
1
- const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609080918/assets/nope-12-BJR1Ka3c.aac";export{e as default};