@onescience/onecode-web 1.14.50-202609111023 → 1.14.50-202609111047
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/{3Dmol-BSDiGUn_.js → 3Dmol-oozXMdO8.js} +1 -1
- package/assets/{account-system-hIEBb0C2.js → account-system-DKD9iYLE.js} +1 -1
- package/assets/{alert-04-2LFq8K76.js → alert-01-iLtAs75S.js} +1 -1
- package/assets/{alert-05-CPxcVIW7.js → alert-02-DMn01-sY.js} +1 -1
- package/assets/{alert-01-DPxhzwi-.js → alert-04-D5BNddSq.js} +1 -1
- package/assets/{alert-02-DJhkSwSf.js → alert-05-OHlA5fX0.js} +1 -1
- package/assets/alert-06-COIj_slE.js +1 -0
- package/assets/alert-07-884N9JMK.js +1 -0
- package/assets/alert-08-Ci-IX_0W.js +1 -0
- package/assets/alert-10-BiEsE-ut.js +1 -0
- package/assets/{bip-bop-03-C_9VodYJ.js → bip-bop-03-CHMF_I8R.js} +1 -1
- package/assets/{bip-bop-04-BQn96GQb.js → bip-bop-04-CR6IBQh5.js} +1 -1
- package/assets/{bip-bop-06-DUhyGJMm.js → bip-bop-06-Czwpqai-.js} +1 -1
- package/assets/{bip-bop-08-CeqQ7KX5.js → bip-bop-08-Csu9eiyl.js} +1 -1
- package/assets/bip-bop-09-MbaoLqxT.js +1 -0
- package/assets/center-BO4sPNR0.js +15 -0
- package/assets/{current-project-EXMEeabO.js → current-project-3uZyhYQO.js} +1 -1
- package/assets/{dialog-edit-project-B254pmyQ.js → dialog-edit-project-CW4KRXv4.js} +1 -1
- package/assets/{dialog-fork-emqfLkzP.js → dialog-fork-DvBRiV7V.js} +1 -1
- package/assets/{dialog-project-upload-BZGUQDbp.js → dialog-project-upload-DpW39zJX.js} +1 -1
- package/assets/{dialog-select-file-WfqQO3bU.js → dialog-select-file-DRbDToF0.js} +1 -1
- package/assets/{dialog-select-model-CfE_5plV.js → dialog-select-model-9QyCL5qa.js} +2 -2
- package/assets/{dialog-terminal-unavailable-UuRpjwl3.js → dialog-terminal-unavailable-BNR9MrpX.js} +2 -2
- package/assets/{docs-BCslr7DG.js → docs-fDTpjsAo.js} +1 -1
- package/assets/{ghostty-web-Du0THRA_.js → ghostty-web-CMbck5Ns.js} +1 -1
- package/assets/{home-B6p0gQFa.js → home-BYs0hcVA.js} +1 -1
- package/assets/{index-ZiVCMYWM.js → index-8N6rOsri.js} +211 -211
- package/assets/{index-DB3e1HKI.css → index-J5aZNTBC.css} +1 -1
- package/assets/{intro-DnZ9Pm-9.js → intro-Dg3COWxs.js} +1 -1
- package/assets/{nope-02-DL6ln2qg.js → nope-02-GxdAny7s.js} +1 -1
- package/assets/{nope-05-JTWgwaPY.js → nope-05-BFyT2lYm.js} +1 -1
- package/assets/{nope-08-D3SqkUDP.js → nope-08-BAx5CVAJ.js} +1 -1
- package/assets/{nope-11-Cv0_9ycO.js → nope-11-CLzsNL-A.js} +1 -1
- package/assets/nope-12-DmdDTovG.js +1 -0
- package/assets/{onescience-C1y0EEMS.js → onescience-DrKFtyqG.js} +1 -1
- package/assets/{resources--qSz2GSE.js → resources-C849bSBF.js} +1 -1
- package/assets/{selection-DsQv8k7m.js → selection-B5YefTBD.js} +1 -1
- package/assets/{shell-Be-Wd8nm.js → shell-D0MY8Emg.js} +2 -2
- package/assets/skills-DLOo_W0X.js +1 -0
- package/assets/{staplebops-03-DRdnYT0k.js → staplebops-03-D6xswWw7.js} +1 -1
- package/assets/{staplebops-04-DcOcJ3tj.js → staplebops-04-DFFdjPS9.js} +1 -1
- package/assets/{staplebops-06-CTpShXu7.js → staplebops-06-KIoWnLdU.js} +1 -1
- package/assets/{staplebops-07-PTbtZxG4.js → staplebops-07-CYqZKgAp.js} +1 -1
- package/assets/{status-popover-body-BNRC0XvS.js → status-popover-body-w_ZH2Wv4.js} +2 -2
- package/assets/{wizard-BYwkk6b3.js → wizard-jcZD-GOf.js} +1 -1
- package/assets/{yup-01-NPhEMsEc.js → yup-01-CHMS24Fv.js} +1 -1
- package/assets/{yup-03-X0CZGrmX.js → yup-03-Dp0-V-aS.js} +1 -1
- package/assets/{yup-04-D-ZsZfTw.js → yup-04-B4ArjJDp.js} +1 -1
- package/assets/{yup-05-DCwi2-Fh.js → yup-05-DyQhoF7H.js} +1 -1
- package/index.html +11 -11
- package/package.json +2 -2
- package/assets/alert-06-n5VqpIlB.js +0 -1
- package/assets/alert-07-D_pzC6jc.js +0 -1
- package/assets/alert-08--NH6fthN.js +0 -1
- package/assets/alert-10-Dh0MXhIE.js +0 -1
- package/assets/bip-bop-09-Fmsvp3hr.js +0 -1
- package/assets/center-0pTDl_-z.js +0 -13
- package/assets/nope-12-C7hz-s_D.js +0 -1
- package/assets/skills-DJ3E_JVe.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as Ne,m as tt,bR as Ye,dD as Oe,C as it,o as L,dE as at,dF as ke,dG as Ie,dH as ye,dI as Ue,dJ as le,dK as lt,ay as Se,i as t,bZ as Je,c as a,W as w,F as Q,Y as A,S as g,X as Pe,dL as rt,dM as nt,dN as Ae,dO as st,dP as ct,t as n,dQ as ot,dA as dt,e as ut,dR as pt,f as gt,h as bt,g as ht,l as $t,n as vt,q as mt,a0 as Fe,be as Te,z as Le,s as Ce,bf as Re,a4 as We,bk as je,a3 as qe,a5 as De,L as Ee,dS as _t,dT as ft,bY as pe,b3 as yt,dU as St,bi as Qe,b_ as Xe,dV as wt,bW as Ct,R as J,cl as Be,dB as xt,b$ as zt,dC as kt,bd as It}from"./index-ZiVCMYWM.js";var Pt=n("<div class=os-client-capability-wizard-papers><h3>相关论文</h3><ul>"),Ft=n("<div class=os-client-capability-wizard-papers><h3>HPC 软件</h3><span>"),Tt=n("<p class=os-client-capability-wizard-note>工作目录与运行环境由系统自动识别,本步只需填写下列业务参数。"),Lt=n("<p class=os-client-capability-wizard-missing>本步还有 <!> 个必填参数未填写。"),Rt=n("<p class=os-client-capability-wizard-missing>本步有 <!> 个参数类型不正确,请按标注类型修改。"),Wt=n("<p class=os-client-capability-wizard-missing>其他步骤还有 <!> 个必填参数未填写,可点击左侧步骤继续补全。"),jt=n("<p class=os-client-capability-wizard-missing>其他步骤还有 <!> 个参数类型不正确,可点击左侧步骤修改。"),qt=n("<small>"),Dt=n("<ul class=os-client-capability-wizard-output-list>"),Et=n("<div class=os-client-capability-wizard-quality><strong>质量门禁</strong><p>"),Ht=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>创建任务并自动逐步执行'),Mt=n("<li><button type=button class=os-client-capability-wizard-step><span></span><div><p>"),Ot=n('<li><a target=_blank rel="noopener noreferrer">'),Ut=n("<p>"),At=n("<div class=os-client-capability-wizard-step-banner><strong>"),Bt=n("<p class=os-client-capability-wizard-note>本步无需额外用户参数。"),Kt=n("<em>*"),Vt=n("<small class=os-client-capability-wizard-field-type>"),Gt=n("<textarea rows=3>"),Ke=n("<em class=os-client-capability-wizard-field-error>"),Nt=n("<label class=os-client-capability-wizard-field><span>"),Yt=n("<input type=text>"),Jt=n("<p class=os-client-capability-wizard-outputs-empty>本步暂无结构化产出清单。"),Qt=n("<li>");function Xt(e){const d=tt(),[l,$]=Ye({values:Oe(e.scenario),attempted:!1,activeStepIndex:0});it(()=>{$({values:Oe(e.scenario),attempted:!1,activeStepIndex:0})});const S=L(()=>at(e.scenario)),k=L(()=>S()[l.activeStepIndex]??S()[0]),B=L(()=>{const v=k();return v?ke(e.scenario,v):e.scenario.user_input}),R=L(()=>Ie(e.scenario,l.values)),ge=L(()=>ye(e.scenario.user_input,l.values)),K=L(()=>B().filter(v=>Ue(v)?!String(l.values[le(v)]??"").trim():!1)),oe=L(()=>ye(B(),l.values)),I=L(()=>B().filter(v=>String(l.values[le(v)]??"").trim()).length),X=L(()=>{const P=k()?.prompt||e.scenario.ai_prompt?.template||"";return lt(P,l.values)}),G=L(()=>k()?.outputs??[]),re=L(()=>(e.scenario.related_papers??[]).filter(v=>!!String(v.url??"").trim())),N=(v,P)=>{$("values",v,P)},Z=v=>{$("activeStepIndex",v)},xe=()=>{$("attempted",!0);const v=ye(e.scenario.user_input,l.values);if(v.length>0){const W=le(v[0]),x=S().findIndex(te=>ke(e.scenario,te).some(r=>le(r)===W));x>=0&&$("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(W=>ke(e.scenario,W).some(x=>le(x)===de));ee>=0&&$("activeStepIndex",ee),d.show(()=>a(ot,{title:"请补充必填参数",get reason(){return`还有 ${P.length} 个必填参数未填写,补充后即可创建任务并自动逐步执行。`},fields:P,get values(){return l.values},onConfirm:W=>{const x={...l.values,...W};$("values",x),!(ye(e.scenario.user_input,x).length>0||Ie(e.scenario,x).length>0)&&e.onSubmit({values:x})}}))};return(()=>{var v=Ht(),P=v.firstChild,de=P.nextSibling,ee=de.firstChild,W=ee.firstChild,x=W.nextSibling,te=x.firstChild,r=te.nextSibling,b=x.nextSibling,m=ee.nextSibling,h=m.firstChild,j=h.firstChild,Y=j.nextSibling,be=Y.nextSibling,q=h.nextSibling,he=q.firstChild,$e=he.firstChild,V=$e.nextSibling,ue=V.firstChild,ne=ue.nextSibling,ze=ne.nextSibling,ve=ze.nextSibling;ve.nextSibling;var D=he.nextSibling,me=D.nextSibling,ie=me.firstChild,u=ie.nextSibling,p=q.nextSibling,_=p.firstChild,F=_.firstChild;F.firstChild;var T=_.nextSibling,H=T.firstChild,E=H.nextSibling,se=E.firstChild,M=se.nextSibling;M.nextSibling;var ae=T.nextSibling,ce=m.nextSibling,_e=ce.firstChild,fe=_e.nextSibling;return Se(P,"click",e.onClose,!0),Se(W,"click",e.onClose,!0),t(te,()=>e.scenario.name),t(r,()=>Je(e.scenario.problem_and_applicability)),Se(b,"click",e.onClose,!0),t(be,a(Q,{get each(){return S()},children:(i,s)=>(()=>{var c=Mt(),z=c.firstChild,O=z.firstChild,f=O.nextSibling,y=f.firstChild;return z.$$click=()=>Z(s()),t(O,()=>s()+1),t(y,()=>i.name),w(()=>c.classList.toggle("is-active",l.activeStepIndex===s())),c})()})),t(h,a(g,{get when(){return re().length>0},get children(){var i=Pt(),s=i.firstChild,c=s.nextSibling;return t(c,a(Q,{get each(){return re()},children:z=>(()=>{var O=Ot(),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(h,a(g,{get when(){return e.scenario.HPC},get children(){var i=Ft(),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,ve),t(V,()=>B().length,null),t(q,a(g,{get when(){return k()},children:i=>(()=>{var s=At(),c=s.firstChild;return t(c,()=>i().name),t(s,a(g,{get when(){return i().purpose?.trim()},get children(){var z=Ut();return t(z,()=>i().purpose),z}}),null),s})()}),D),t(q,a(g,{get when(){return e.scenario.system_auto_detection?.fields?.length},get children(){return Tt()}}),D),t(q,a(g,{get when(){return Pe(()=>!!l.attempted)()&&K().length>0},get children(){var i=Lt(),s=i.firstChild,c=s.nextSibling;return c.nextSibling,t(i,()=>K().length,c),i}}),D),t(q,a(g,{get when(){return oe().length>0},get children(){var i=Rt(),s=i.firstChild,c=s.nextSibling;return c.nextSibling,t(i,()=>oe().length,c),i}}),D),t(q,a(g,{get when(){return Pe(()=>!!(l.attempted&&R().length>0))()&&K().length===0},get children(){var i=Wt(),s=i.firstChild,c=s.nextSibling;return c.nextSibling,t(i,()=>R().length,c),i}}),D),t(q,a(g,{get when(){return Pe(()=>!!(l.attempted&&ge().length>0))()&&oe().length===0},get children(){var i=jt(),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 Bt()},get children(){return a(Q,{get each(){return B()},children:i=>{const s=le(i),c=Ue(i),z=l.attempted&&c&&!String(l.values[s]??"").trim(),O=rt(i,l.values[s]??""),f=!!O&&(l.attempted||!!String(l.values[s]??"").trim());return(()=>{var y=Nt(),U=y.firstChild;return y.classList.toggle("is-required",!!c),y.classList.toggle("is-invalid",!!(z||f)),t(U,()=>nt(i),null),t(U,a(g,{when:c,get children(){return Kt()}}),null),t(U,a(g,{get when(){return i.input_type},get children(){var o=Vt();return t(o,()=>i.input_type),o}}),null),t(y,a(g,{get when(){return st(i)},get fallback(){return(()=>{var o=Yt();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=Gt();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,()=>ct(i,"")),o}}),null),y})()}})}})),ie.$$click=()=>Z(Math.max(0,l.activeStepIndex-1)),u.$$click=()=>Z(Math.min(S().length-1,l.activeStepIndex+1)),t(F,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 Jt()},get children(){var i=Dt();return t(i,a(Q,{get each(){return G()},children:s=>(()=>{var c=Qt();return t(c,s),c})()})),i}}),null),t(_,a(g,{get when(){return k()?.quality_gate},get children(){var i=Et(),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=X()),v})()}Ne(["click","input"]);function Zt(e,d){return e.replace(/\{\{(\w+)\}\}/g,(l,$)=>d[$]??"")}var ei=n("<div class=os-client-capability-wizard-overlay role=dialog aria-modal=true aria-label=能力向导>"),ti=n("<section class=os-client-capability-wizard-dialog><p>未找到该能力。"),ii=n("<div class=os-client-capability-wizard-scenario-group><span>完整工作流场景"),ai=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>创建任务"),li=n("<section class=os-client-capability-wizard-dialog><p>「<!>」暂无 OneScience 源码或魔搭映射,当前不可使用。"),ri=n("<button type=button><strong></strong><p>"),ni=n("<button type=button><strong></strong><p></p><small> · <!> 步"),Ve=n("<p class=os-client-capability-wizard-empty>请先选择任务场景。"),si=n("<div class=os-client-capability-wizard-required aria-label=该能力需要什么数据><h4>该能力需要什么数据</h4><ul>"),ci=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>"),oi=n("<textarea rows=3>"),di=n("<label class=os-client-capability-wizard-field><span>"),ui=n("<input type=text>"),pi=n("<li>"),gi=n("<div class=os-client-capability-wizard-right-head><strong></strong><p>"),bi=n("<div class=os-client-capability-wizard-outputs aria-label=预计产出><span>预计产出</span><p>");function hi(e){return e==="hpc"?"软件介绍":"模型介绍"}function $i(e){return`使用 ${e} 开始科研任务`}function vi(e){if(!Fe({navigate:e.navigate,action:{type:"prompt",prompt:e.prompt,title:e.title,workflow:e.workflow},isLoggedIn:e.isLoggedIn}))return!1;const d=Te({path:e.path,recent:e.recent,lastCodeWorkspace:e.lastCodeWorkspace})||Le(Ce())||Re(document,e.path);if(!d)return!1;const l=We(d);return je(l,e.prompt),qe(l),e.openProject?.(d),e.touchCode?.(d),De({variant:"success",title:`已为你创建「${e.title}」任务`}),e.navigate(Ee(d)),!0}function Ze(e){const d=_t(e.scenario),l=d[0];if(!l?.promptTemplate.trim()||!Fe({navigate:e.navigate,action:{type:"scenario-run",scenarioId:e.scenario.id||e.scenario.scenario_id,values:e.values},isLoggedIn:e.isLoggedIn}))return!1;const $=Te({path:e.path,recent:e.recent,lastCodeWorkspace:e.lastCodeWorkspace})||Le(Ce())||Re(document,e.path);if(!$)return!1;const S=We($);return ft(S,{title:e.scenario.name,scenarioId:pe(e.scenario),values:e.values,steps:d}),yt("todo"),je(S,St(l,e.values)),qe(S),e.openProject?.($),e.touchCode?.($),De({variant:"success",title:`已创建「${e.scenario.name}」`,description:`将按 ${d.length} 步自动依次执行,缺参或失败时暂停`}),e.navigate(Ee($)),!0}function et(e){if(!Fe({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=Qe(e.resourceId),l=d?.scenarios.find(k=>k.id===e.scenarioId);if(!d||!l||!Xe(d))return!1;const $=Te({path:e.path,recent:e.recent,lastCodeWorkspace:e.lastCodeWorkspace})||Le(Ce())||Re(document,e.path);if(!$)return!1;const S=We($);return je(S,e.prompt),qe(S),e.openProject?.($),e.touchCode?.($),De({variant:"success",title:`已为你创建 ${d.name}「${l.title}」任务`}),e.navigate(Ee($)),!0}function we(e,d){return Zt(e.promptTemplate,d)}function Ge(e){return Object.fromEntries(e.fields.map(d=>[d.id,mi(d)]))}function mi(e){return e.default?.trim()?e.default:e.placeholder?.replace(/^例如[::]\s*/,"").trim()??""}function _i(){const e=dt(),d=ut(),[l]=pt(),$=gt(),S=bt(),k=ht(),B=$t(),R=()=>Qe(e.id??""),ge=()=>kt(d.search),K=()=>xt(d.search,{category:R()?.category??"onemodel",domain:R()?.domain??"materials"}),oe=()=>zt(e.id??"",ge()),[I,X]=Ye({scenarioId:"",values:{},prompt:""}),[G,re]=vt(""),N=()=>R()?.scenarios.find(r=>r.id===I.scenarioId),Z=L(()=>{const r=R();return r?wt({domain:r.domain,name:r.name,id:r.id,category:r.category}):[]}),xe=L(()=>{const r=G();if(r)return Ct(r)??Z().find(b=>pe(b)===r)}),v=()=>({navigate:$,isLoggedIn:!!Ce(),path:S.data.path,recent:It(S.data.project),lastCodeWorkspace:B.projects.lastCode(),openProject:r=>k.projects.open(r),touchCode:r=>B.projects.touchCode(r)}),P=()=>{const r=N();r&&X("prompt",we(r,I.values))};mt(()=>{const r=R();if(!r?.scenarios.length)return;const b=l.scenario,h=(b?r.scenarios.find(Y=>Y.id===b):void 0)??r.scenarios[0],j=Ge(h);X({scenarioId:h.id,values:j,prompt:we(h,j)})});const de=r=>{const m=R()?.scenarios.find(j=>j.id===r);if(!m)return;re("");const h=Ge(m);X({scenarioId:m.id,values:h,prompt:we(m,h)})},ee=r=>{re(r)},W=(r,b)=>{const m=N();if(!m)return;const h={...I.values,[r]:b};X({values:h,prompt:we(m,h)})},x=()=>{const r=R(),b=N();!r||!b||et({resourceId:r.id,scenarioId:b.id,values:{...I.values},prompt:I.prompt,...v()})},te=(r,b)=>{Ze({scenario:r,values:b.values,...v()})};return(()=>{var r=ei();return t(r,a(g,{get when(){return R()},get fallback(){return[a(J,{class:"os-client-capability-wizard-backdrop",get href(){return Be()},"aria-label":"关闭向导"}),(()=>{var b=ti();return b.firstChild,t(b,a(J,{get href(){return Be()},children:"返回能力中心"}),null),b})()]},children:b=>a(g,{get when(){return Xe(b())},get fallback(){return[a(J,{class:"os-client-capability-wizard-backdrop",get href(){return K()},"aria-label":"关闭向导"}),(()=>{var m=li(),h=m.firstChild,j=h.firstChild,Y=j.nextSibling;return Y.nextSibling,t(h,()=>b().name,Y),t(m,a(J,{get href(){return K()},children:"返回模型库"}),null),m})()]},get children(){return[a(J,{class:"os-client-capability-wizard-backdrop",get href(){return K()},"aria-label":"关闭向导"}),(()=>{var m=ai(),h=m.firstChild,j=h.firstChild,Y=j.firstChild,be=h.nextSibling,q=be.firstChild,he=q.firstChild,$e=he.nextSibling,V=q.nextSibling;V.firstChild;var ue=V.nextSibling,ne=ue.firstChild,ze=ne.firstChild,ve=ze.nextSibling,D=ne.nextSibling,me=be.nextSibling,ie=me.firstChild;return t(h,a(J,{class:"os-client-capability-wizard-intro-back",get href(){return oe()},get children(){return hi(b().category)}}),j),t(Y,()=>$i(b().name)),t(h,a(J,{class:"os-client-capability-wizard-close",get href(){return K()},"aria-label":"关闭",children:"×"}),null),t($e,a(Q,{get each(){return b().scenarios},children:u=>(()=>{var p=ri(),_=p.firstChild,F=_.nextSibling;return p.$$click=()=>de(u.id),t(_,()=>u.title),t(F,()=>u.summary),w(T=>{var H=!G()&&I.scenarioId===u.id,E=!G()&&I.scenarioId===u.id;return H!==T.e&&p.classList.toggle("is-active",T.e=H),E!==T.t&&A(p,"aria-pressed",T.t=E),T},{e:void 0,t:void 0}),p})()}),null),t($e,a(g,{get when(){return Z().length>0},get children(){var u=ii();return u.firstChild,t(u,a(Q,{get each(){return Z()},children:p=>(()=>{var _=ni(),F=_.firstChild,T=F.nextSibling,H=T.nextSibling,E=H.firstChild,se=E.nextSibling;return se.nextSibling,_.$$click=()=>ee(pe(p)),t(F,()=>p.name),t(T,()=>Je(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=ci(),_=p.firstChild,F=_.nextSibling,T=F.firstChild,H=T.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(Q,{get each(){return u.fields},children:f=>(()=>{var y=di(),U=y.firstChild;return t(U,()=>f.label),t(y,a(g,{get when(){return f.multiline},get fallback(){return(()=>{var o=ui();return o.$$input=C=>W(f.id,C.currentTarget.value),w(()=>A(o,"placeholder",f.placeholder)),w(()=>o.value=I.values[f.id]??""),o})()},get children(){var o=oi();return o.$$input=C=>W(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=si(),y=f.firstChild,U=y.nextSibling;return t(U,a(Q,{get each(){return u.requiredData},children:o=>(()=>{var C=pi();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=gi(),_=p.firstChild,F=_.nextSibling;return t(_,()=>u.title),t(F,()=>u.summary),p})(),(()=>{var p=bi(),_=p.firstChild,F=_.nextSibling;return t(F,()=>u.expectedOutputs),p})()]}),ne),ve.$$click=P,D.$$input=u=>X("prompt",u.currentTarget.value),t(me,a(J,{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(Xt,{get scenario(){return m()},onClose:()=>re(""),onSubmit:h=>te(m(),h)})})]}})})),r})()}Ne(["click","input"]);const yi=Object.freeze(Object.defineProperty({__proto__:null,CapabilityWizardPage:_i,startCapabilityPromptTask:vi,startCapabilityScenarioRunTask:Ze,startCapabilityWizardTask:et},Symbol.toStringTag,{value:"Module"}));export{Xt as S,Ze as a,et as b,vi as s,yi as w};
|
|
1
|
+
import{b as Ne,m as tt,bS as Ye,dC as Oe,C as it,o as L,dD as at,dE as ke,dF as Ie,dG as ye,dH as Ue,dI as le,dJ as lt,ay as Se,i as t,bZ as Je,c as a,W as w,F as Q,Y as A,S as g,X as Pe,dK as rt,dL as nt,dM as Ae,dN as st,dO as ct,t as n,dP as ot,dz as dt,e as ut,dQ as pt,f as gt,h as bt,g as ht,l as $t,n as vt,q as mt,a0 as Fe,be as Te,z as Le,s as Ce,bf as Re,a4 as We,bk as je,a3 as qe,a5 as De,L as Ee,dR as _t,dS as ft,bY as pe,b3 as yt,dT as St,bi as Qe,bn as Xe,dU as wt,bW as Ct,R as J,ck as Be,dA as xt,b_ as zt,dB as kt,bd as It}from"./index-8N6rOsri.js";var Pt=n("<div class=os-client-capability-wizard-papers><h3>相关论文</h3><ul>"),Ft=n("<div class=os-client-capability-wizard-papers><h3>HPC 软件</h3><span>"),Tt=n("<p class=os-client-capability-wizard-note>工作目录与运行环境由系统自动识别,本步只需填写下列业务参数。"),Lt=n("<p class=os-client-capability-wizard-missing>本步还有 <!> 个必填参数未填写。"),Rt=n("<p class=os-client-capability-wizard-missing>本步有 <!> 个参数类型不正确,请按标注类型修改。"),Wt=n("<p class=os-client-capability-wizard-missing>其他步骤还有 <!> 个必填参数未填写,可点击左侧步骤继续补全。"),jt=n("<p class=os-client-capability-wizard-missing>其他步骤还有 <!> 个参数类型不正确,可点击左侧步骤修改。"),qt=n("<small>"),Dt=n("<ul class=os-client-capability-wizard-output-list>"),Et=n("<div class=os-client-capability-wizard-quality><strong>质量门禁</strong><p>"),Ht=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>创建任务并自动逐步执行'),Mt=n("<li><button type=button class=os-client-capability-wizard-step><span></span><div><p>"),Ot=n('<li><a target=_blank rel="noopener noreferrer">'),Ut=n("<p>"),At=n("<div class=os-client-capability-wizard-step-banner><strong>"),Bt=n("<p class=os-client-capability-wizard-note>本步无需额外用户参数。"),Kt=n("<em>*"),Gt=n("<small class=os-client-capability-wizard-field-type>"),Vt=n("<textarea rows=3>"),Ke=n("<em class=os-client-capability-wizard-field-error>"),Nt=n("<label class=os-client-capability-wizard-field><span>"),Yt=n("<input type=text>"),Jt=n("<p class=os-client-capability-wizard-outputs-empty>本步暂无结构化产出清单。"),Qt=n("<li>");function Xt(e){const d=tt(),[l,$]=Ye({values:Oe(e.scenario),attempted:!1,activeStepIndex:0});it(()=>{$({values:Oe(e.scenario),attempted:!1,activeStepIndex:0})});const S=L(()=>at(e.scenario)),k=L(()=>S()[l.activeStepIndex]??S()[0]),B=L(()=>{const v=k();return v?ke(e.scenario,v):e.scenario.user_input}),R=L(()=>Ie(e.scenario,l.values)),ge=L(()=>ye(e.scenario.user_input,l.values)),K=L(()=>B().filter(v=>Ue(v)?!String(l.values[le(v)]??"").trim():!1)),oe=L(()=>ye(B(),l.values)),I=L(()=>B().filter(v=>String(l.values[le(v)]??"").trim()).length),X=L(()=>{const P=k()?.prompt||e.scenario.ai_prompt?.template||"";return lt(P,l.values)}),V=L(()=>k()?.outputs??[]),re=L(()=>(e.scenario.related_papers??[]).filter(v=>!!String(v.url??"").trim())),N=(v,P)=>{$("values",v,P)},Z=v=>{$("activeStepIndex",v)},xe=()=>{$("attempted",!0);const v=ye(e.scenario.user_input,l.values);if(v.length>0){const W=le(v[0]),x=S().findIndex(te=>ke(e.scenario,te).some(r=>le(r)===W));x>=0&&$("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(W=>ke(e.scenario,W).some(x=>le(x)===de));ee>=0&&$("activeStepIndex",ee),d.show(()=>a(ot,{title:"请补充必填参数",get reason(){return`还有 ${P.length} 个必填参数未填写,补充后即可创建任务并自动逐步执行。`},fields:P,get values(){return l.values},onConfirm:W=>{const x={...l.values,...W};$("values",x),!(ye(e.scenario.user_input,x).length>0||Ie(e.scenario,x).length>0)&&e.onSubmit({values:x})}}))};return(()=>{var v=Ht(),P=v.firstChild,de=P.nextSibling,ee=de.firstChild,W=ee.firstChild,x=W.nextSibling,te=x.firstChild,r=te.nextSibling,b=x.nextSibling,m=ee.nextSibling,h=m.firstChild,j=h.firstChild,Y=j.nextSibling,be=Y.nextSibling,q=h.nextSibling,he=q.firstChild,$e=he.firstChild,G=$e.nextSibling,ue=G.firstChild,ne=ue.nextSibling,ze=ne.nextSibling,ve=ze.nextSibling;ve.nextSibling;var D=he.nextSibling,me=D.nextSibling,ie=me.firstChild,u=ie.nextSibling,p=q.nextSibling,_=p.firstChild,F=_.firstChild;F.firstChild;var T=_.nextSibling,H=T.firstChild,E=H.nextSibling,se=E.firstChild,M=se.nextSibling;M.nextSibling;var ae=T.nextSibling,ce=m.nextSibling,_e=ce.firstChild,fe=_e.nextSibling;return Se(P,"click",e.onClose,!0),Se(W,"click",e.onClose,!0),t(te,()=>e.scenario.name),t(r,()=>Je(e.scenario.problem_and_applicability)),Se(b,"click",e.onClose,!0),t(be,a(Q,{get each(){return S()},children:(i,s)=>(()=>{var c=Mt(),z=c.firstChild,O=z.firstChild,f=O.nextSibling,y=f.firstChild;return z.$$click=()=>Z(s()),t(O,()=>s()+1),t(y,()=>i.name),w(()=>c.classList.toggle("is-active",l.activeStepIndex===s())),c})()})),t(h,a(g,{get when(){return re().length>0},get children(){var i=Pt(),s=i.firstChild,c=s.nextSibling;return t(c,a(Q,{get each(){return re()},children:z=>(()=>{var O=Ot(),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(h,a(g,{get when(){return e.scenario.HPC},get children(){var i=Ft(),s=i.firstChild,c=s.nextSibling;return t(c,()=>e.scenario.HPC),i}}),null),t(G,()=>l.activeStepIndex+1,ue),t(G,()=>S().length,ne),t(G,I,ve),t(G,()=>B().length,null),t(q,a(g,{get when(){return k()},children:i=>(()=>{var s=At(),c=s.firstChild;return t(c,()=>i().name),t(s,a(g,{get when(){return i().purpose?.trim()},get children(){var z=Ut();return t(z,()=>i().purpose),z}}),null),s})()}),D),t(q,a(g,{get when(){return e.scenario.system_auto_detection?.fields?.length},get children(){return Tt()}}),D),t(q,a(g,{get when(){return Pe(()=>!!l.attempted)()&&K().length>0},get children(){var i=Lt(),s=i.firstChild,c=s.nextSibling;return c.nextSibling,t(i,()=>K().length,c),i}}),D),t(q,a(g,{get when(){return oe().length>0},get children(){var i=Rt(),s=i.firstChild,c=s.nextSibling;return c.nextSibling,t(i,()=>oe().length,c),i}}),D),t(q,a(g,{get when(){return Pe(()=>!!(l.attempted&&R().length>0))()&&K().length===0},get children(){var i=Wt(),s=i.firstChild,c=s.nextSibling;return c.nextSibling,t(i,()=>R().length,c),i}}),D),t(q,a(g,{get when(){return Pe(()=>!!(l.attempted&&ge().length>0))()&&oe().length===0},get children(){var i=jt(),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 Bt()},get children(){return a(Q,{get each(){return B()},children:i=>{const s=le(i),c=Ue(i),z=l.attempted&&c&&!String(l.values[s]??"").trim(),O=rt(i,l.values[s]??""),f=!!O&&(l.attempted||!!String(l.values[s]??"").trim());return(()=>{var y=Nt(),U=y.firstChild;return y.classList.toggle("is-required",!!c),y.classList.toggle("is-invalid",!!(z||f)),t(U,()=>nt(i),null),t(U,a(g,{when:c,get children(){return Kt()}}),null),t(U,a(g,{get when(){return i.input_type},get children(){var o=Gt();return t(o,()=>i.input_type),o}}),null),t(y,a(g,{get when(){return st(i)},get fallback(){return(()=>{var o=Yt();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,()=>ct(i,"")),o}}),null),y})()}})}})),ie.$$click=()=>Z(Math.max(0,l.activeStepIndex-1)),u.$$click=()=>Z(Math.min(S().length-1,l.activeStepIndex+1)),t(F,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 V().length>0},get fallback(){return Jt()},get children(){var i=Dt();return t(i,a(Q,{get each(){return V()},children:s=>(()=>{var c=Qt();return t(c,s),c})()})),i}}),null),t(_,a(g,{get when(){return k()?.quality_gate},get children(){var i=Et(),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=X()),v})()}Ne(["click","input"]);function Zt(e,d){return e.replace(/\{\{(\w+)\}\}/g,(l,$)=>d[$]??"")}var ei=n("<div class=os-client-capability-wizard-overlay role=dialog aria-modal=true aria-label=能力向导>"),ti=n("<section class=os-client-capability-wizard-dialog><p>未找到该能力。"),ii=n("<div class=os-client-capability-wizard-scenario-group><span>完整工作流场景"),ai=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>创建任务"),li=n("<section class=os-client-capability-wizard-dialog><p>「<!>」暂无 OneScience 源码或魔搭映射,当前不可使用。"),ri=n("<button type=button><strong></strong><p>"),ni=n("<button type=button><strong></strong><p></p><small> · <!> 步"),Ge=n("<p class=os-client-capability-wizard-empty>请先选择任务场景。"),si=n("<div class=os-client-capability-wizard-required aria-label=该能力需要什么数据><h4>该能力需要什么数据</h4><ul>"),ci=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>"),oi=n("<textarea rows=3>"),di=n("<label class=os-client-capability-wizard-field><span>"),ui=n("<input type=text>"),pi=n("<li>"),gi=n("<div class=os-client-capability-wizard-right-head><strong></strong><p>"),bi=n("<div class=os-client-capability-wizard-outputs aria-label=预计产出><span>预计产出</span><p>");function hi(e){return e==="hpc"?"软件介绍":"模型介绍"}function $i(e){return`使用 ${e} 开始科研任务`}function vi(e){if(!Fe({navigate:e.navigate,action:{type:"prompt",prompt:e.prompt,title:e.title,workflow:e.workflow},isLoggedIn:e.isLoggedIn}))return!1;const d=Te({path:e.path,recent:e.recent,lastCodeWorkspace:e.lastCodeWorkspace})||Le(Ce())||Re(document,e.path);if(!d)return!1;const l=We(d);return je(l,e.prompt),qe(l),e.openProject?.(d),e.touchCode?.(d),De({variant:"success",title:`已为你创建「${e.title}」任务`}),e.navigate(Ee(d)),!0}function Ze(e){const d=_t(e.scenario),l=d[0];if(!l?.promptTemplate.trim()||!Fe({navigate:e.navigate,action:{type:"scenario-run",scenarioId:e.scenario.id||e.scenario.scenario_id,values:e.values},isLoggedIn:e.isLoggedIn}))return!1;const $=Te({path:e.path,recent:e.recent,lastCodeWorkspace:e.lastCodeWorkspace})||Le(Ce())||Re(document,e.path);if(!$)return!1;const S=We($);return ft(S,{title:e.scenario.name,scenarioId:pe(e.scenario),values:e.values,steps:d}),yt("todo"),je(S,St(l,e.values)),qe(S),e.openProject?.($),e.touchCode?.($),De({variant:"success",title:`已创建「${e.scenario.name}」`,description:`将按 ${d.length} 步自动依次执行,缺参或失败时暂停`}),e.navigate(Ee($)),!0}function et(e){if(!Fe({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=Qe(e.resourceId),l=d?.scenarios.find(k=>k.id===e.scenarioId);if(!d||!l||!Xe(d))return!1;const $=Te({path:e.path,recent:e.recent,lastCodeWorkspace:e.lastCodeWorkspace})||Le(Ce())||Re(document,e.path);if(!$)return!1;const S=We($);return je(S,e.prompt),qe(S),e.openProject?.($),e.touchCode?.($),De({variant:"success",title:`已为你创建 ${d.name}「${l.title}」任务`}),e.navigate(Ee($)),!0}function we(e,d){return Zt(e.promptTemplate,d)}function Ve(e){return Object.fromEntries(e.fields.map(d=>[d.id,mi(d)]))}function mi(e){return e.default?.trim()?e.default:e.placeholder?.replace(/^例如[::]\s*/,"").trim()??""}function _i(){const e=dt(),d=ut(),[l]=pt(),$=gt(),S=bt(),k=ht(),B=$t(),R=()=>Qe(e.id??""),ge=()=>kt(d.search),K=()=>xt(d.search,{category:R()?.category??"onemodel",domain:R()?.domain??"materials"}),oe=()=>zt(e.id??"",ge()),[I,X]=Ye({scenarioId:"",values:{},prompt:""}),[V,re]=vt(""),N=()=>R()?.scenarios.find(r=>r.id===I.scenarioId),Z=L(()=>{const r=R();return r?wt({domain:r.domain,name:r.name,id:r.id,category:r.category}):[]}),xe=L(()=>{const r=V();if(r)return Ct(r)??Z().find(b=>pe(b)===r)}),v=()=>({navigate:$,isLoggedIn:!!Ce(),path:S.data.path,recent:It(S.data.project),lastCodeWorkspace:B.projects.lastCode(),openProject:r=>k.projects.open(r),touchCode:r=>B.projects.touchCode(r)}),P=()=>{const r=N();r&&X("prompt",we(r,I.values))};mt(()=>{const r=R();if(!r?.scenarios.length)return;const b=l.scenario,h=(b?r.scenarios.find(Y=>Y.id===b):void 0)??r.scenarios[0],j=Ve(h);X({scenarioId:h.id,values:j,prompt:we(h,j)})});const de=r=>{const m=R()?.scenarios.find(j=>j.id===r);if(!m)return;re("");const h=Ve(m);X({scenarioId:m.id,values:h,prompt:we(m,h)})},ee=r=>{re(r)},W=(r,b)=>{const m=N();if(!m)return;const h={...I.values,[r]:b};X({values:h,prompt:we(m,h)})},x=()=>{const r=R(),b=N();!r||!b||et({resourceId:r.id,scenarioId:b.id,values:{...I.values},prompt:I.prompt,...v()})},te=(r,b)=>{Ze({scenario:r,values:b.values,...v()})};return(()=>{var r=ei();return t(r,a(g,{get when(){return R()},get fallback(){return[a(J,{class:"os-client-capability-wizard-backdrop",get href(){return Be()},"aria-label":"关闭向导"}),(()=>{var b=ti();return b.firstChild,t(b,a(J,{get href(){return Be()},children:"返回能力中心"}),null),b})()]},children:b=>a(g,{get when(){return Xe(b())},get fallback(){return[a(J,{class:"os-client-capability-wizard-backdrop",get href(){return K()},"aria-label":"关闭向导"}),(()=>{var m=li(),h=m.firstChild,j=h.firstChild,Y=j.nextSibling;return Y.nextSibling,t(h,()=>b().name,Y),t(m,a(J,{get href(){return K()},children:"返回模型库"}),null),m})()]},get children(){return[a(J,{class:"os-client-capability-wizard-backdrop",get href(){return K()},"aria-label":"关闭向导"}),(()=>{var m=ai(),h=m.firstChild,j=h.firstChild,Y=j.firstChild,be=h.nextSibling,q=be.firstChild,he=q.firstChild,$e=he.nextSibling,G=q.nextSibling;G.firstChild;var ue=G.nextSibling,ne=ue.firstChild,ze=ne.firstChild,ve=ze.nextSibling,D=ne.nextSibling,me=be.nextSibling,ie=me.firstChild;return t(h,a(J,{class:"os-client-capability-wizard-intro-back",get href(){return oe()},get children(){return hi(b().category)}}),j),t(Y,()=>$i(b().name)),t(h,a(J,{class:"os-client-capability-wizard-close",get href(){return K()},"aria-label":"关闭",children:"×"}),null),t($e,a(Q,{get each(){return b().scenarios},children:u=>(()=>{var p=ri(),_=p.firstChild,F=_.nextSibling;return p.$$click=()=>de(u.id),t(_,()=>u.title),t(F,()=>u.summary),w(T=>{var H=!V()&&I.scenarioId===u.id,E=!V()&&I.scenarioId===u.id;return H!==T.e&&p.classList.toggle("is-active",T.e=H),E!==T.t&&A(p,"aria-pressed",T.t=E),T},{e:void 0,t:void 0}),p})()}),null),t($e,a(g,{get when(){return Z().length>0},get children(){var u=ii();return u.firstChild,t(u,a(Q,{get each(){return Z()},children:p=>(()=>{var _=ni(),F=_.firstChild,T=F.nextSibling,H=T.nextSibling,E=H.firstChild,se=E.nextSibling;return se.nextSibling,_.$$click=()=>ee(pe(p)),t(F,()=>p.name),t(T,()=>Je(p.problem_and_applicability)),t(H,()=>p.scenario_id,E),t(H,()=>p.workflow_steps?.length||p.workflow.length,se),w(M=>{var ae=V()===pe(p),ce=V()===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(G,a(g,{get when(){return N()},keyed:!0,get fallback(){return Ge()},children:u=>(()=>{var p=ci(),_=p.firstChild,F=_.nextSibling,T=F.firstChild,H=T.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(Q,{get each(){return u.fields},children:f=>(()=>{var y=di(),U=y.firstChild;return t(U,()=>f.label),t(y,a(g,{get when(){return f.multiline},get fallback(){return(()=>{var o=ui();return o.$$input=C=>W(f.id,C.currentTarget.value),w(()=>A(o,"placeholder",f.placeholder)),w(()=>o.value=I.values[f.id]??""),o})()},get children(){var o=oi();return o.$$input=C=>W(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=si(),y=f.firstChild,U=y.nextSibling;return t(U,a(Q,{get each(){return u.requiredData},children:o=>(()=>{var C=pi();return t(C,o),C})()})),f}}),null),p})()}),null),t(ue,a(g,{get when(){return N()},keyed:!0,get fallback(){return Ge()},children:u=>[(()=>{var p=gi(),_=p.firstChild,F=_.nextSibling;return t(_,()=>u.title),t(F,()=>u.summary),p})(),(()=>{var p=bi(),_=p.firstChild,F=_.nextSibling;return t(F,()=>u.expectedOutputs),p})()]}),ne),ve.$$click=P,D.$$input=u=>X("prompt",u.currentTarget.value),t(me,a(J,{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(Xt,{get scenario(){return m()},onClose:()=>re(""),onSubmit:h=>te(m(),h)})})]}})})),r})()}Ne(["click","input"]);const yi=Object.freeze(Object.defineProperty({__proto__:null,CapabilityWizardPage:_i,startCapabilityPromptTask:vi,startCapabilityScenarioRunTask:Ze,startCapabilityWizardTask:et},Symbol.toStringTag,{value:"Module"}));export{Xt as S,Ze as a,et as b,vi as s,yi as w};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-
|
|
1
|
+
const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609111047/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-
|
|
1
|
+
const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609111047/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-
|
|
1
|
+
const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609111047/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-
|
|
1
|
+
const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609111047/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-
|
|
12
|
-
<link rel="shortcut icon" href="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-
|
|
13
|
-
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-
|
|
14
|
-
<link rel="manifest" href="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-
|
|
15
|
-
<link rel="preload" href="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-
|
|
16
|
-
<link rel="preload" href="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-
|
|
11
|
+
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609111047/favicon-96x96-v3.png" sizes="96x96" />
|
|
12
|
+
<link rel="shortcut icon" href="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609111047/favicon-v3.ico" />
|
|
13
|
+
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609111047/apple-touch-icon-v3.png" />
|
|
14
|
+
<link rel="manifest" href="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609111047/site.webmanifest" />
|
|
15
|
+
<link rel="preload" href="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609111047/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-202609111047/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-
|
|
20
|
-
<meta property="twitter:image" content="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-
|
|
21
|
-
<script id="oc-theme-preload-script" src="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-
|
|
22
|
-
<script type="module" crossorigin src="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-
|
|
23
|
-
<link rel="stylesheet" crossorigin href="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-
|
|
19
|
+
<meta property="og:image" content="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609111047/social-share.png" />
|
|
20
|
+
<meta property="twitter:image" content="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609111047/social-share.png" />
|
|
21
|
+
<script id="oc-theme-preload-script" src="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609111047/oc-theme-preload.js"></script>
|
|
22
|
+
<script type="module" crossorigin src="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609111047/assets/index-8N6rOsri.js"></script>
|
|
23
|
+
<link rel="stylesheet" crossorigin href="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609111047/assets/index-J5aZNTBC.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-
|
|
3
|
+
"version": "1.14.50-202609111047",
|
|
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-
|
|
8
|
+
"homepage": "https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609111047/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-202609111023/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-202609111023/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-202609111023/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-202609111023/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-202609111023/assets/bip-bop-09-CxEgoAHQ.aac";export{e as default};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import{b as je,n as A,c as r,i as t,S as g,W as D,bg as pa,t as s,bh as ha,a0 as st,bi as Ht,bj as ht,be as bt,z as vt,s as Ce,bf as ft,a4 as Kt,bk as Qt,a3 as Jt,a5 as Ae,L as $t,bl as ba,a2 as Tt,aB as Se,F as z,X as H,Y as T,aA as va,C as We,x as fa,a1 as $a,l as Ye,h as Xe,e as mt,f as Ge,m as ma,o as ce,bd as Ze,bm as Vt,bn as ya,bo as _a,bp as wa,bq as ka,br as Sa,bs as Ee,bt as Ca,bu as xa,bv as Ia,bw as Da,bx as La,by as Ta,bz as Oa,bA as Ea,bB as Aa,bC as Pa,bD as ja,bE as Ra,bF as Fa,bG as qa,bH as Ma,bI as Ua,g as yt,q as ot,bJ as Yt,bK as Ba,bL as za,bM as nt,ay as Xt,bN as Wa,bO as Na,bP as Ha,bQ as Ka,bR as Qa,bS as ct,bT as Ja,bU as Ot,bV as Va,bW as Et,b6 as Ya,bX as Be,bY as Xa,bZ as Ga,b_ as _t,b$ as Za,R as At,c0 as el}from"./index-ZiVCMYWM.js";import{m as tl,O as al,S as ll,s as nl}from"./onescience-C1y0EEMS.js";import{DialogProjectUpload as rl}from"./dialog-project-upload-BZGUQDbp.js";import{d as il,r as sl,s as Pt,w as ol}from"./selection-DsQv8k7m.js";import{s as cl,a as jt,b as dl,S as ul}from"./wizard-BYwkk6b3.js";import"./onescience-docs-CH5KBTI9.js";var gl=s("<p class=os-client-capability-upload-error role=alert>"),pl=s('<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 hl(e){return e.split(/[,,、]/).map(l=>l.trim()).filter(Boolean)}function bl(e){const[l,n]=A(""),[i,a]=A(""),[o,d]=A(""),[c,u]=A(""),$=()=>{n(""),a(""),d(""),u("")},b=()=>{$(),e.onClose()},v=h=>{h.preventDefault();const m=l().trim(),f=i().trim(),E=hl(o());if(!m||!f||E.length===0){u("请填写名称、简介和至少一个标签,以便生成与现有模型卡片一致的展示信息。");return}const Q=ha({name:m,blurb:f,tags:E,domain:e.domain});e.onSaved({id:Q.id,name:Q.name}),b()};return r(g,{get when(){return e.open},get children(){var h=pl(),m=h.firstChild,f=m.nextSibling,E=f.firstChild,Q=E.firstChild,W=Q.nextSibling,de=E.nextSibling,p=de.nextSibling,C=p.firstChild,ue=C.firstChild,le=ue.nextSibling,Y=le.nextSibling,O=C.nextSibling,L=O.firstChild,N=L.nextSibling,y=N.nextSibling,P=O.nextSibling,x=P.firstChild,X=x.firstChild,ne=X.nextSibling,G=ne.nextSibling,I=x.nextSibling,Z=I.firstChild,oe=Z.nextSibling,xe=oe.nextSibling,me=p.nextSibling,Pe=me.firstChild;return m.$$click=b,f.addEventListener("submit",v),W.$$click=b,Y.$$input=re=>n(re.currentTarget.value),y.$$input=re=>a(re.currentTarget.value),G.$$input=re=>d(re.currentTarget.value),t(f,r(g,{get when(){return c()},get children(){var re=gl();return t(re,c),re}}),me),Pe.$$click=b,D(()=>Y.value=l()),D(()=>y.value=i()),D(()=>G.value=o()),D(()=>xe.value=pa(e.domain)),h}})}je(["click","input"]);function vl(e,l){return e.includes("modelscope download --model ")?e:`${e}
|
|
2
|
-
|
|
3
|
-
【从魔搭下载模型】
|
|
4
|
-
${tl(l,{kind:"local"})}`}function fl(e){const l=Ht(e);if(!l)throw new Error(`Unknown capability resource: ${e}`);if(!ht(l))throw new Error(`Capability resource is not installable: ${e}`);const n=ba(l);return{banner:l.install.banner,prompt:n?vl(l.install.prompt,n):l.install.prompt}}function Gt(e){if(!st({navigate:e.navigate,action:{type:"install",resourceId:e.resourceId},isLoggedIn:e.isLoggedIn}))return!1;const l=Ht(e.resourceId);if(!l||!ht(l))return!1;const{banner:n,prompt:i}=fl(e.resourceId),a=bt({path:e.path,recent:e.recent,lastCodeWorkspace:e.lastCodeWorkspace})||vt(Ce())||ft(document,e.path);if(!a)return!1;const o=Kt(a);return Qt(o,i),Jt(o),e.openProject?.(a),e.touchCode?.(a),Ae({variant:"success",title:n}),e.navigate($t(a)),!0}const $l={all:"全部",weather:"地球科学",materials:"材料化学",bio:"生命科学",fluid:"流体仿真"};function ml(e){switch(e){case"local_fs":return"工作区";case"http_dataset":return"公开网址";case"object_store":return"对象存储";case"remote_workspace":return"远端环境";case"onedata_ref":return"公开数据引用";default:return"其他"}}function yl(e){return e==="ready"?"可训练":"未就绪"}function Ve(e){switch(e){case"s3":return"Amazon S3";case"oss":return"阿里云 OSS";case"cos":return"腾讯云 COS"}}function Rt(e){const l=e.trim().toLowerCase();if(l.startsWith("http://")||l.startsWith("https://"))return"http_dataset";if(l.startsWith("s3://")||l.startsWith("oss://")||l.startsWith("cos://"))return"object_store"}function _l(e){switch(e){case"local_fs":return"服务器上可访问的绝对路径(账号工作区或其他有权限的目录)";case"http_dataset":return"公开可访问的网址";case"object_store":return"对象存储路径或地址";case"remote_workspace":return"已连接远端机器上的文件路径"}}function wl(e,l){const n=l.map(c=>c.replace(/\\/g,"/").trim()).filter(c=>c.startsWith("/")||/^[a-zA-Z]:\//.test(c));if(n.length>0&&n.length===l.length){if(n.length===1){const $=n[0];return[{kind:"file",label:$.split("/").filter(Boolean).at(-1)||$,uri:$}]}const c=kl(n),u=n.slice(0,50).map($=>({kind:"file",label:$,uri:$}));return c?[{kind:"folder",label:c,uri:c},...u]:u}const i=e.replace(/\/+$/,""),a=l.map(c=>c.replace(/\\/g,"/").replace(/^\/+/,"")).filter(Boolean);if(a.length===0)return[];if(a.length===1)return[{kind:"file",label:a[0],uri:`${i}/${a[0]}`}];const o=Zt(a),d=a.slice(0,50).map(c=>({kind:"file",label:c,uri:`${i}/${c}`}));return o?[{kind:"folder",label:o,uri:`${i}/${o}`},...d]:d}function kl(e){const l=Zt(e.map(n=>n.replace(/^\/+/,"")));return l?`/${l}`:void 0}function Zt(e){const l=e.map(a=>a.split("/").filter(Boolean)),n=l[0];if(!n||n.length===0)return;let i=0;for(;i<n.length-1;){const a=n[i];if(!l.every(o=>o[i]===a))break;i+=1}if(i!==0)return n.slice(0,i).join("/")}function dt(e){return!e||e<=0?"":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/(1024*1024*1024)).toFixed(1)} GB`}const Sl=new Set(["csv","tsv","xlsx"]),Cl=new Set(["json","jsonl","ndjson"]),xl=new Set(["fasta","fa","fna","faa"]),Il=new Set(["fastq","fq"]),Dl=new Set(["pdb","cif","mmcif","mol","sdf","mol2","xyz","extxyz"]),Ll=new Set(["nc","nc4","cdf","netcdf","h5","hdf5","hdf","he5","npy","npz","mat"]);function ut(e,l){const n=(e.probe?.format_hint||l.format||"unknown").toLowerCase(),i=dt(e.probe?.logical_bytes),a={title:l.title,format:n,subtitle:[i,gt(n)].filter(Boolean).join(" · "),samplePath:e.sample_path};if(e.zarr_summary?.arrays?.length)return{...a,kind:"zarr",format:"zarr",subtitle:[i,"Zarr",`${e.zarr_summary.arrays.length} 个数组`].filter(Boolean).join(" · "),cards:e.zarr_summary.arrays.map(o=>({label:o.path||".",value:`${o.shape.join(" × ")} · ${o.dtype}${o.chunks?.length?` · chunks ${o.chunks.join("×")}`:""}`}))};if(e.directory_listing?.entries.length){const o=e.sample_path||e.directory_listing.sample_path,d=Tl(o||"");return{...a,kind:"directory",format:"directory",subtitle:[e.probe?.entry_count?`${e.probe.entry_count} 个文件`:"目录",i].filter(Boolean).join(" · "),entries:e.directory_listing.entries.map(c=>({path:c.path,is_dir:c.is_dir,size:dt(c.size_bytes)||void 0})),truncated:e.directory_listing.truncated,samplePath:o,nested:e.sample?ut({sample:e.sample,probe:{format_hint:d||"txt"}},{title:o||"样例文件",format:d||"txt"}):void 0}}return e.sample?Sl.has(n)?{...a,kind:"table",...Ol(e.sample,n)}:Cl.has(n)?{...a,kind:"json",body:Pl(e.sample)}:xl.has(n)?{...a,kind:"fasta",sequences:jl(e.sample)}:Il.has(n)?{...a,kind:"fastq",sequences:Rl(e.sample)}:n==="pdf"?{...a,kind:"pdf",lines:e.sample.split(/\n+/).map(o=>o.trim()).filter(Boolean).slice(0,60)}:Ll.has(n)||Fl(e.sample)?{...a,kind:"scientific",cards:ql(e.sample),body:e.sample}:Dl.has(n)?{...a,kind:"structure",lines:e.sample.split(`
|
|
5
|
-
`).slice(0,120)}:{...a,kind:"text",body:e.sample,lines:e.sample.split(`
|
|
6
|
-
`).slice(0,160)}:{...a,kind:"empty",body:[i,gt(n)].filter(Boolean).join(" · ")||"暂无预览内容"}}function gt(e){return{csv:"CSV 表格",tsv:"TSV 表格",xlsx:"Excel 表格",json:"JSON",jsonl:"JSON Lines",ndjson:"JSON Lines",fasta:"FASTA 序列",fa:"FASTA 序列",fna:"FASTA 序列",faa:"FASTA 序列",fastq:"FASTQ 序列",fq:"FASTQ 序列",pdf:"PDF 文本",pdb:"PDB 结构",cif:"CIF 结构",mmcif:"mmCIF 结构",xyz:"XYZ 结构",extxyz:"EXTXYZ 结构",sdf:"SDF 分子",mol:"MOL 分子",nc:"NetCDF",nc4:"NetCDF",netcdf:"NetCDF",h5:"HDF5",hdf5:"HDF5",npy:"NumPy",npz:"NumPy Archive",mat:"MATLAB",zarr:"Zarr",directory:"目录",txt:"文本"}[e]||e.toUpperCase()}function Tl(e){const l=e.split("/").filter(Boolean).at(-1)||"";return(l.includes(".")?l.split(".").pop()?.toLowerCase():"")||""}function Ol(e,l){const n=l==="csv"?",":El(e),i=e.replace(/\r\n/g,`
|
|
7
|
-
`).split(`
|
|
8
|
-
`).map(c=>c.trimEnd()).filter(c=>c.length>0).slice(0,41);if(i.length===0)return{headers:[],rows:[]};const a=i.map(c=>Al(c,n)),o=Math.min(Math.max(...a.map(c=>c.length),1),12),d=c=>Array.from({length:o},(u,$)=>c[$]??"");return{headers:d(a[0]),rows:a.slice(1,21).map(d)}}function El(e){const l=e.split(/\r?\n/).find(a=>a.trim())||"",n=(l.match(/\t/g)||[]).length,i=(l.match(/,/g)||[]).length;return n>=i?" ":","}function Al(e,l){if(l===" ")return e.split(" ");const n=[];let i="",a=!1;for(let o=0;o<e.length;o++){const d=e[o];if(d==='"'){a&&e[o+1]==='"'?(i+='"',o+=1):a=!a;continue}if(d===l&&!a){n.push(i),i="";continue}i+=d}return n.push(i),n}function Pl(e){try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e.split(`
|
|
9
|
-
`).map(l=>l.trim()).filter(Boolean).slice(0,30).map(l=>{try{return JSON.stringify(JSON.parse(l),null,2)}catch{return l}}).join(`
|
|
10
|
-
|
|
11
|
-
`)}}function jl(e){const l=[];let n="",i=[];for(const a of e.split(/\r?\n/)){if(a.startsWith(">")){if((n||i.length)&&l.push({header:n||"sequence",sequence:i.join("")}),l.length>=8)break;n=a.slice(1).trim()||"sequence",i=[];continue}a.trim()&&i.push(a.trim())}return(n||i.length)&&l.length<8&&l.push({header:n||"sequence",sequence:i.join("")}),l}function Rl(e){const l=e.split(/\r?\n/),n=[];for(let i=0;i+1<l.length&&n.length<8;i+=4){const a=(l[i]||"").replace(/^@/,"").trim()||"read",o=(l[i+1]||"").trim();o&&n.push({header:a,sequence:o})}return n}function Fl(e){return/^(netcdf|hdf5|npy|npz|mat variables):/im.test(e)||/\bshape=\(/i.test(e)}function ql(e){return e.split(`
|
|
12
|
-
`).map(l=>l.trimEnd()).filter(Boolean).slice(0,40).map(l=>{const n=l.match(/^\s*(.+?):\s*(.+)$/);return n?{label:n[1].trim(),value:n[2].trim()}:{label:"",value:l.trim()}})}var Ml=s("<span>"),Ul=s("<button type=button class=os-onedata-preview-close>关闭"),Bl=s("<section aria-label=原始数据预览><header class=os-onedata-preview-head><div class=os-onedata-preview-head-main><span></span><div class=os-onedata-preview-titles><strong></strong></div></div></header><div class=os-onedata-preview-body>"),zl=s("<div class=os-onedata-preview-table-wrap><table class=os-onedata-preview-table><thead><tr></tr></thead><tbody>"),Wl=s('<pre class="os-onedata-preview-pre os-onedata-preview-json">'),Nl=s("<ul class=os-onedata-preview-seq-list>"),Hl=s("<div class=os-onedata-preview-pdf>"),Kl=s("<ul class=os-onedata-preview-cards>"),Ql=s("<p class=os-onedata-preview-note>仅显示前若干项"),Jl=s("<div class=os-onedata-preview-directory><ul class=os-onedata-preview-dir-list>"),Vl=s("<div class=os-onedata-preview-structure>"),Yl=s("<p class=os-onedata-preview-empty>"),Ft=s("<pre class=os-onedata-preview-pre>"),Xl=s("<th>"),Gl=s("<tr>"),Zl=s("<td>"),en=s("<li><div class=os-onedata-preview-seq-head><span></span><strong></strong><em> bp</em></div><p class=os-onedata-preview-seq-body>"),tn=s("<p>"),an=s("<span class=os-onedata-preview-card-label>"),qt=s("<span class=os-onedata-preview-card-value>"),ln=s("<li>"),nn=s("<em>"),rn=s("<li><span class=os-onedata-preview-dir-mark></span><code>"),sn=s("<div class=os-onedata-preview-nested><div class=os-onedata-preview-nested-label>样例文件"),on=s("<code>");function Mt(e){return(()=>{var l=Bl(),n=l.firstChild,i=n.firstChild,a=i.firstChild,o=a.nextSibling,d=o.firstChild,c=n.nextSibling;return t(a,()=>gt(e.model.format)),t(d,()=>e.model.title),t(o,r(g,{get when(){return e.model.subtitle},get children(){var u=Ml();return t(u,()=>e.model.subtitle),u}}),null),t(n,r(g,{get when(){return e.onClose},get children(){var u=Ul();return u.$$click=()=>e.onClose?.(),u}}),null),t(c,r(ea,{get model(){return e.model}})),D(u=>{var $=`os-onedata-preview-pane os-onedata-preview-kind-${e.model.kind}`,b=`os-onedata-preview-badge os-onedata-preview-badge-${cn(e.model)}`;return $!==u.e&&Tt(l,u.e=$),b!==u.t&&Tt(a,u.t=b),u},{e:void 0,t:void 0}),l})()}function ea(e){return r(va,{get fallback(){return(()=>{var l=Ft();return t(l,()=>e.model.body||"暂无预览内容"),l})()},get children(){return[r(Se,{get when(){return H(()=>e.model.kind==="table")()&&e.model.headers},get children(){var l=zl(),n=l.firstChild,i=n.firstChild,a=i.firstChild,o=i.nextSibling;return t(a,r(z,{get each(){return e.model.headers},children:d=>(()=>{var c=Xl();return t(c,d||"—"),c})()})),t(o,r(z,{get each(){return e.model.rows},children:d=>(()=>{var c=Gl();return t(c,r(z,{each:d,children:u=>(()=>{var $=Zl();return t($,u),$})()})),c})()})),l}}),r(Se,{get when(){return e.model.kind==="json"},get children(){var l=Wl();return t(l,()=>e.model.body),l}}),r(Se,{get when(){return H(()=>e.model.kind==="fasta"||e.model.kind==="fastq")()&&e.model.sequences},get children(){var l=Nl();return t(l,r(z,{get each(){return e.model.sequences},children:n=>(()=>{var i=en(),a=i.firstChild,o=a.firstChild,d=o.nextSibling,c=d.nextSibling,u=c.firstChild,$=a.nextSibling;return t(o,()=>e.model.kind==="fastq"?"@":">"),t(d,()=>n.header),t(c,()=>n.sequence.length,u),t($,()=>dn(n.sequence)),i})()})),l}}),r(Se,{get when(){return H(()=>e.model.kind==="pdf")()&&e.model.lines},get children(){var l=Hl();return t(l,r(z,{get each(){return e.model.lines},children:n=>(()=>{var i=tn();return t(i,n),i})()})),l}}),r(Se,{get when(){return H(()=>e.model.kind==="zarr"||e.model.kind==="scientific")()&&e.model.cards},get children(){var l=Kl();return t(l,r(z,{get each(){return e.model.cards},children:n=>(()=>{var i=ln();return t(i,r(g,{get when(){return n.label},get fallback(){return(()=>{var a=qt();return t(a,()=>n.value),a})()},get children(){return[(()=>{var a=an();return t(a,()=>n.label),a})(),(()=>{var a=qt();return t(a,()=>n.value),a})()]}})),i})()})),l}}),r(Se,{get when(){return e.model.kind==="directory"},get children(){var l=Jl(),n=l.firstChild;return t(n,r(z,{get each(){return e.model.entries},children:i=>(()=>{var a=rn(),o=a.firstChild,d=o.nextSibling;return t(o,()=>i.is_dir?"DIR":"FILE"),t(d,()=>i.path),t(a,r(g,{get when(){return i.size},get children(){var c=nn();return t(c,()=>i.size),c}}),null),D(()=>T(a,"data-dir",i.is_dir?"true":"false")),a})()})),t(l,r(g,{get when(){return e.model.truncated},get children(){return Ql()}}),null),t(l,r(g,{get when(){return e.model.nested},children:i=>(()=>{var a=sn(),o=a.firstChild;return o.firstChild,t(o,(()=>{var d=H(()=>!!e.model.samplePath);return()=>d()?` · ${e.model.samplePath}`:""})(),null),t(a,r(ea,{get model(){return i()}}),null),a})()}),null),l}}),r(Se,{get when(){return H(()=>e.model.kind==="structure")()&&e.model.lines},get children(){var l=Vl();return t(l,r(z,{get each(){return e.model.lines},children:n=>(()=>{var i=on();return t(i,n||" "),D(()=>T(i,"data-kind",un(n))),i})()})),l}}),r(Se,{get when(){return e.model.kind==="empty"},get children(){var l=Yl();return t(l,()=>e.model.body),l}}),r(Se,{get when(){return H(()=>e.model.kind==="text")()&&e.model.lines},get children(){var l=Ft();return t(l,()=>e.model.lines.join(`
|
|
13
|
-
`)),l}})]}})}function cn(e){return e.kind==="table"?"table":e.kind==="json"?"json":e.kind==="fasta"||e.kind==="fastq"?"seq":e.kind==="pdf"?"pdf":e.kind==="directory"?"dir":e.kind==="zarr"||e.kind==="scientific"?"sci":e.kind==="structure"?"struct":"text"}function dn(e){return e.replace(/(.{10})/g,"$1 ").trim()}function un(e){return/^(ATOM|HETATM)\b/.test(e)?"atom":/^(HEADER|TITLE|COMPND|SOURCE|KEYWDS|EXPDTA|AUTHOR|REMARK|SEQRES|CRYST1|MODEL|ENDMDL|END|DATA_|loop_)\b/i.test(e)?"meta":"plain"}je(["click"]);var Ut=s("<button type=button class=os-client-capability-filter-select-option role=option>"),gn=s("<div class=os-client-capability-filter-select-menu role=listbox>"),pn=s("<div class=os-client-capability-filter-select><button type=button class=os-client-capability-filter-select-trigger aria-haspopup=listbox><span class=os-client-capability-filter-select-value></span><span class=os-client-capability-filter-select-chevron aria-hidden=true>");function ze(e){const[l,n]=A(!1);let i;const a=()=>e.options.find(d=>d.value===e.value)?.label??"",o=()=>!e.value;return We(()=>{if(!l())return;const d=u=>{i?.contains(u.target)||n(!1)},c=u=>{u.key==="Escape"&&n(!1)};document.addEventListener("pointerdown",d),document.addEventListener("keydown",c),fa(()=>{document.removeEventListener("pointerdown",d),document.removeEventListener("keydown",c)})}),(()=>{var d=pn(),c=d.firstChild,u=c.firstChild,$=i;return typeof $=="function"?$a($,d):i=d,c.$$click=b=>{b.stopPropagation(),e.onFocusTab?.(),n(v=>!v)},t(u,(()=>{var b=H(()=>!!o());return()=>b()?e.placeholder:a()})()),t(d,r(g,{get when(){return l()},get children(){var b=gn();return t(b,r(g,{get when(){return H(()=>!!e.uploadLabel)()&&e.onUpload},get children(){var v=Ut();return v.$$click=h=>{h.stopPropagation(),n(!1),e.onUpload?.()},t(v,()=>e.uploadLabel),v}}),null),t(b,r(z,{get each(){return e.options},children:v=>(()=>{var h=Ut();return h.$$click=m=>{m.stopPropagation(),n(!1),e.onChange(v.value)},t(h,()=>v.label),D(m=>{var f=v.value===e.value,E=v.value===e.value;return f!==m.e&&h.classList.toggle("is-selected",m.e=f),E!==m.t&&T(h,"aria-selected",m.t=E),m},{e:void 0,t:void 0}),h})()}),null),D(()=>T(b,"aria-label",e["aria-label"])),b}}),null),D(b=>{var v=o()?"true":"false",h=l()?"true":"false",m=e["aria-label"],f=l();return v!==b.e&&T(d,"data-empty",b.e=v),h!==b.t&&T(d,"data-open",b.t=h),m!==b.a&&T(c,"aria-label",b.a=m),f!==b.o&&T(c,"aria-expanded",b.o=f),b},{e:void 0,t:void 0,a:void 0,o:void 0}),d})()}je(["click"]);var hn=s("<div class=os-onedata-subtabs role=tablist aria-label=可训练数据范围><button type=button>我的</button><button type=button>已公开"),bn=s("<p class=os-client-capability-empty>登录后才能查看和接入自己的数据。"),vn=s("<p class=os-onedata-error>"),fn=s("<div class=os-onedata-field><span>登记粒度"),$n=s("<p class=os-onedata-upload-hint>默认登记整个文件夹为一条原始数据;若只要某个文件可预览,可改选「仅文件」。"),Bt=s("<div class=os-onedata-field><span>远端环境"),mn=s("<form class=os-onedata-register><strong>接入原始数据</strong><p class=os-onedata-upload-hint>「工作区路径」是 OneCode 部署机器上的账号目录,不是你浏览器所在电脑的盘符。若数据在 Windows/Mac,请先上传到工作区,或改用对象存储 / 公开网址 / 已连接远端。</p><div class=os-onedata-actions><button type=button>从这台电脑上传到工作区</button></div><label class=os-onedata-field><span>名称</span><input placeholder=可选,不填则使用路径或网址></label><label class=os-onedata-field><span>数据位置</span><input required></label><div class=os-onedata-field><span>来源</span><div class=os-onedata-source-pills role=radiogroup aria-label=数据来源><button type=button role=radio>工作区路径</button><button type=button role=radio>公开网址</button><button type=button role=radio>对象存储</button><button type=button role=radio>已连接的远端</button></div></div><button type=submit>接入"),rt=s("<ul class=os-onedata-list>"),yn=s('<details class=os-onedata-advanced><summary>对象存储密钥</summary><p>使用个人桶时需要先保存对应云厂商的密钥,界面只保留末几位。</p><form class="os-onedata-register os-onedata-register-nested"><label class=os-onedata-field><span>云厂商</span></label><label class=os-onedata-field><span>访问密钥 ID</span><input required></label><label class=os-onedata-field><span>密钥</span><input required type=password></label><label class=os-onedata-field><span>服务地址(可选)</span><input></label><label class=os-onedata-field><span>地域(可选)</span><input></label><button type=submit>保存密钥'),_n=s("<p class=os-client-capability-empty>还没有原始数据。可从「公开目录」下载后登记,从这台电脑上传到工作区,或填写工作区路径 / 公开网址 / 已连接远端路径。工作区路径须在账号目录内(通常是 …/workspaces/你的账号/…)。"),wn=s("<span class=os-onedata-chip-hint>需要先有一个当前工程下的会话。请在左侧打开或新建会话后再回来点这里。"),kn=s("<span class=os-onedata-chip-hint>勾选上方列表中的原始数据后可点击"),Sn=s("<div class=os-onedata-chip-row><button type=button class=os-onedata-chip-btn>"),Cn=s("<div class=os-onedata-status role=status><p>"),xn=s("<div class=os-onedata-actions><div class=os-onedata-field><span>训练位置"),In=s("<p class=os-client-capability-empty>"),Dn=s('<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></p></header><div class=os-onedata-subtabs role=tablist aria-label="OneData 内容"><button type=button>公开目录</button><button type=button>原始数据</button><button type=button>可训练数据'),Ln=s("<p class=os-onedata-upload-hint>还没有已连接的远端,请先在资源里添加 SSH 节点。"),Tn=s("<li><span> · 末位 </span><button type=button>删除"),On=s("<button type=button class=os-onedata-action-primary>转为可训练数据"),En=s("<li><label class=os-onedata-raw-pick><input type=checkbox><span class=os-onedata-raw-pick-body><strong></strong><span class=os-onedata-card-chips></span><small></small></span></label><div class=os-onedata-actions><button type=button>预览</button><button type=button class=os-onedata-action-danger>删除"),zt=s("<span class=os-onedata-card-chip>"),An=s("<button type=button class=os-onedata-action-primary>加入对话加工"),Pn=s("<button type=button class=os-onedata-status-action>打开会话查看"),jn=s("<p class=os-onedata-upload-hint>还没有已连接的远端。"),Rn=s("<button type=button class=os-onedata-action-primary>发布"),Fn=s("<button type=button>取消发布"),qn=s("<button type=button class=os-onedata-action-primary>接入为我的原始数据"),Mn=s("<button type=button class=os-onedata-action-primary>开始训练"),Un=s("<button type=button class=os-onedata-action-danger>删除"),Bn=s("<li><strong></strong><span class=os-onedata-card-chips></span><small></small><div class=os-onedata-actions><button type=button>预览");function zn(e){const l=Ye(),n=Xe(),i=mt(),a=Ge(),o=ma(),d=ce(()=>new URLSearchParams(i.search)),c=ce(()=>{const k=d().get("onedata");return k==="already"?"already":k==="raw"?"raw":"catalog"}),u=ce(()=>d().get("already")==="public"?"public":"mine"),[$,b]=A([]),[v,h]=A([]),[m,f]=A(""),[E,Q]=A(""),[W,de]=A(),[p,C]=A(!1),[ue,le]=A(""),[Y,O]=A(""),[L,N]=A("local_fs"),[y,P]=A(""),[x,X]=A([]),[ne,G]=A(),[I,Z]=A([]),[oe,xe]=A([]),[me,Pe]=A("local"),[re,Ie]=A([]),[He,Ke]=A("s3"),[Re,be]=A(""),[et,wt]=A(""),[tt,sa]=A(""),[at,oa]=A(""),ge=()=>l.current?.http.url,Fe=()=>!!Ce(),Qe=ce(()=>bt({path:n.data.path,recent:Ze(n.data.project??[]),lastCodeWorkspace:l.projects.lastCode()})||Vt(Ce(),l.projects.lastCode())||vt(Ce())||ft(document,n.data.path)),De=ce(()=>{const k=Qe();if(!k)return;const q=ya(k);if(q)return q;const[ee]=n.child(k,{bootstrap:!1});return(ee.session??[]).find(te=>!te.parentID&&!te.time?.archived)?.id});We(()=>{const k=Qe();!k||!Fe()||n.project.loadSessions(k)});const ca=ce(()=>$l[e.domain]),da=ce(()=>c()==="raw"?"登记服务器上可访问的路径、公开网址或已连接远端上的数据(也可先从「公开目录」下载,或从这台电脑上传)。登记后可以预览,但不能直接训练。":c()==="already"?u()==="public"?"这里是已发布的可训练数据(OneData),可供他人使用;也可接入为自己的原始数据再加工。":"可训练数据来自原始数据直接转化,或对话加工后回写。只有就绪的数据能给模型使用;发布后会出现在「已公开」。":`${e.copy.replace(/[。.]$/,"")}。公开目录是外部下载源,下载后请到「原始数据」登记;转为可训练数据后才能给模型使用。`),ua=()=>{const k=Qe();if(!k){f("请先打开个人工作区项目,再上传文件");return}o.show(()=>r(rl,{directory:k,pathPrefix:"onedata",allowEditDestination:!0,title:"从这台电脑上传到工作区",destinationLabel:"上传目标路径(OneCode 所在环境)",destinationHint:"默认写到当前工作区的 onedata/ 目录。可改成服务器上其他可写路径;单文件不超过 200 MB,单次合计不超过 512 MB。上传不会自动登记。",maxFileBytes:qa,maxTotalBytes:Fa,onUploadedPaths:q=>{const ee=wl(k,q);if(ee.length===0)return;Z(ee);const te=ee[0];if(N("local_fs"),O(te.uri),!ue().trim()){const fe=te.label.split("/").filter(Boolean).at(-1);fe&&le(fe)}f("")}}))},qe=k=>{const q=new URLSearchParams(i.search);for(const[ee,te]of Object.entries(k))te?q.set(ee,te):q.delete(ee);q.set("category","onedata"),a(`${i.pathname}?${q}`)},lt=k=>{G(void 0),qe({onedata:k==="catalog"?"":k})},ve=async()=>{const k=ge();if(!k||!Fe()){b([]),h([]);return}f("");try{const q=e.domain==="all"?void 0:e.domain,[ee,te,fe,Le]=await Promise.all([Aa(k,{domain:q}),Pa(k,{scope:u(),domain:q}),ja(k).catch(()=>[]),Ra(k).catch(()=>({items:[]}))]);b(ee.items),h(te.items),X(fe.filter(ye=>ye.id.startsWith("wrk_")).map(ye=>({id:ye.id,name:ye.name||ye.id}))),Ie(Le.items)}catch(q){f(q instanceof Error?q.message:"无法加载数据")}};We(()=>{e.domain,c(),u(),ve()}),We(()=>{if(c()!=="raw")return;const k=d(),q=k.get("rawUri")?.trim(),ee=k.get("rawTitle")?.trim();if(q){O(q);const te=Rt(q);te&&N(te)}ee&&le(ee)});const ga=ce(()=>v().filter(k=>k.status==="ready")),kt=k=>[k.format,k.connector?ml(k.connector):"",dt(k.logical_bytes),k.status?yl(k.status):"",k.visibility==="public"?"已公开":"",k.build_method==="agent"?"对话加工":""].filter(q=>!!q),St=async k=>{const q=ge(),ee=De();if(!q){f("无法连接服务器,请刷新后重试");return}if(!ee){f("请先在左侧打开或新建一个会话,再加入对话加工");return}if(k.length===0){f("请先勾选要加入对话的原始数据");return}C(!0),f(""),Q(""),de(void 0);try{const te=await Ma(q,ee),fe=Array.from(new Set([...te.raw_ids,...k]));await Ua(q,ee,fe),window.dispatchEvent(new Event("onedata-session-chips-changed")),xe([]),de(ee),Q(`已加入当前会话(共 ${fe.length} 项)。可在该会话输入框上方查看「对话加工用的原始数据」。`)}catch(te){f(Ee(te,"加入对话失败"))}finally{C(!1)}};return(()=>{var k=Dn(),q=k.firstChild,ee=q.firstChild,te=q.nextSibling,fe=te.firstChild,Le=fe.nextSibling;Le.firstChild;var ye=Le.nextSibling;return ye.firstChild,t(ee,da),fe.$$click=()=>lt("catalog"),Le.$$click=()=>lt("raw"),t(Le,(()=>{var _=H(()=>!!$().length);return()=>_()?` ${$().length}`:""})(),null),ye.$$click=()=>lt("already"),t(ye,(()=>{var _=H(()=>!!v().length);return()=>_()?` ${v().length}`:""})(),null),t(k,r(g,{get when(){return c()==="already"},get children(){var _=hn(),w=_.firstChild,R=w.nextSibling;return w.$$click=()=>qe({already:"mine"}),R.$$click=()=>qe({already:"public"}),D(j=>{var ae=u()==="mine",pe=u()==="public";return ae!==j.e&&T(w,"aria-pressed",j.e=ae),pe!==j.t&&T(R,"aria-pressed",j.t=pe),j},{e:void 0,t:void 0}),_}}),null),t(k,r(g,{get when(){return H(()=>!Fe())()&&c()!=="catalog"},get children(){return bn()}}),null),t(k,r(g,{get when(){return m()},get children(){var _=vn();return t(_,m),_}}),null),t(k,r(g,{get when(){return c()==="catalog"},get children(){return r(al,{get filter(){return ca()},get domainLabel(){return e.domainLabel}})}}),null),t(k,r(g,{get when(){return H(()=>c()==="raw")()&&Fe()},get children(){return[(()=>{var _=mn(),w=_.firstChild,R=w.nextSibling,j=R.nextSibling,ae=j.firstChild,pe=j.nextSibling,he=pe.firstChild,_e=he.nextSibling,M=pe.nextSibling,F=M.firstChild,J=F.nextSibling,we=M.nextSibling,V=we.firstChild,B=V.nextSibling,ie=B.firstChild,$e=ie.nextSibling,Te=$e.nextSibling,Me=Te.nextSibling,K=we.nextSibling;return _.addEventListener("submit",async S=>{S.preventDefault();const U=ge();if(U){C(!0),f("");try{await _a(U,{title:ue().trim()||Y().trim(),domain:e.domain==="all"?"unspecified":e.domain,uri:Y().trim(),connector:L(),...L()==="remote_workspace"?{workspace_id:y()}:{}}),le(""),O(""),Z([]),await ve()}catch(se){f(se instanceof Error?se.message:"接入失败")}finally{C(!1)}}}),ae.$$click=ua,_e.$$input=S=>le(S.currentTarget.value),J.$$input=S=>{const U=S.currentTarget.value;O(U),Z([]);const se=Rt(U);se&&N(se)},t(_,r(g,{get when(){return I().length>1},get children(){return[(()=>{var S=fn();return S.firstChild,t(S,r(ze,{"aria-label":"登记粒度",get value(){return Y()},placeholder:"选择登记路径",get options(){return I().map(U=>({value:U.uri,label:U.kind==="folder"?`整个文件夹:${U.label}`:`仅文件:${U.label}`}))},onChange:U=>{const se=I().find(ke=>ke.uri===U);if(O(U),se){const ke=se.label.split("/").filter(Boolean).at(-1);ke&&le(ke)}}}),null),S})(),$n()]}}),we),ie.$$click=()=>N("local_fs"),$e.$$click=()=>N("http_dataset"),Te.$$click=()=>N("object_store"),Me.$$click=()=>N("remote_workspace"),t(_,r(g,{get when(){return L()==="remote_workspace"},get children(){var S=Bt();return S.firstChild,t(S,r(g,{get when(){return x().length>0},get fallback(){return Ln()},get children(){return r(ze,{"aria-label":"远端环境",get value(){return y()},placeholder:"选择已连接的远端",get options(){return x().map(U=>({value:U.id,label:U.name}))},onChange:P})}}),null),S}}),K),D(S=>{var U=p(),se=_l(L()),ke=L()==="local_fs",Je=L()==="local_fs"?"true":"false",Oe=L()==="http_dataset",Ue=L()==="http_dataset"?"true":"false",Ct=L()==="object_store",xt=L()==="object_store"?"true":"false",It=L()==="remote_workspace",Dt=L()==="remote_workspace"?"true":"false",Lt=p()||!Y().trim()||L()==="remote_workspace"&&!y();return U!==S.e&&(ae.disabled=S.e=U),se!==S.t&&T(J,"placeholder",S.t=se),ke!==S.a&&T(ie,"aria-checked",S.a=ke),Je!==S.o&&T(ie,"data-active",S.o=Je),Oe!==S.i&&T($e,"aria-checked",S.i=Oe),Ue!==S.n&&T($e,"data-active",S.n=Ue),Ct!==S.s&&T(Te,"aria-checked",S.s=Ct),xt!==S.h&&T(Te,"data-active",S.h=xt),It!==S.r&&T(Me,"aria-checked",S.r=It),Dt!==S.d&&T(Me,"data-active",S.d=Dt),Lt!==S.l&&(K.disabled=S.l=Lt),S},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0}),D(()=>_e.value=ue()),D(()=>J.value=Y()),_})(),r(g,{get when(){return L()==="object_store"},get children(){var _=yn(),w=_.firstChild,R=w.nextSibling,j=R.nextSibling,ae=j.firstChild;ae.firstChild;var pe=ae.nextSibling,he=pe.firstChild,_e=he.nextSibling,M=pe.nextSibling,F=M.firstChild,J=F.nextSibling,we=M.nextSibling,V=we.firstChild,B=V.nextSibling,ie=we.nextSibling,$e=ie.firstChild,Te=$e.nextSibling,Me=ie.nextSibling;return j.addEventListener("submit",async K=>{K.preventDefault();const S=ge();if(S){C(!0),f("");try{await wa(S,{provider:He(),access_key_id:Re().trim(),secret:et().trim(),...tt().trim()?{endpoint:tt().trim()}:{},...at().trim()?{region:at().trim()}:{}}),be(""),wt(""),await ve()}catch(U){f(U instanceof Error?U.message:"保存密钥失败")}finally{C(!1)}}}),t(ae,r(ze,{"aria-label":"云厂商",get value(){return He()},placeholder:"选择云厂商",get options(){return[{value:"s3",label:Ve("s3")},{value:"oss",label:Ve("oss")},{value:"cos",label:Ve("cos")}]},onChange:K=>Ke(K)}),null),_e.$$input=K=>be(K.currentTarget.value),J.$$input=K=>wt(K.currentTarget.value),B.$$input=K=>sa(K.currentTarget.value),Te.$$input=K=>oa(K.currentTarget.value),t(j,r(g,{get when(){return re().length>0},get children(){var K=rt();return t(K,r(z,{get each(){return re()},children:S=>(()=>{var U=Tn(),se=U.firstChild,ke=se.firstChild,Je=se.nextSibling;return t(se,()=>Ve(S.provider),ke),t(se,()=>S.access_key_id_suffix,null),t(se,(()=>{var Oe=H(()=>!!S.endpoint);return()=>Oe()?` · ${S.endpoint}`:""})(),null),Je.$$click=async()=>{const Oe=ge();if(Oe)try{await ka(Oe,S.provider),await ve()}catch(Ue){f(Ue instanceof Error?Ue.message:"删除密钥失败")}},U})()})),K}}),null),D(K=>{var S=re().length===0,U=p()||!Re().trim()||!et().trim();return S!==K.e&&(_.open=K.e=S),U!==K.t&&(Me.disabled=K.t=U),K},{e:void 0,t:void 0}),D(()=>_e.value=Re()),D(()=>J.value=et()),D(()=>B.value=tt()),D(()=>Te.value=at()),_}}),r(g,{get when(){return $().length===0},get fallback(){return(()=>{var _=rt();return t(_,r(z,{get each(){return $()},children:w=>(()=>{var R=En(),j=R.firstChild,ae=j.firstChild,pe=ae.nextSibling,he=pe.firstChild,_e=he.nextSibling,M=_e.nextSibling,F=j.nextSibling,J=F.firstChild,we=J.nextSibling;return ae.addEventListener("change",V=>{const B=V.currentTarget.checked;xe(ie=>B?[...ie,w.id]:ie.filter($e=>$e!==w.id))}),t(he,()=>w.title),t(_e,r(z,{get each(){return kt(w)},children:V=>(()=>{var B=zt();return t(B,V),B})()})),t(M,()=>w.uri),J.$$click=async()=>{const V=ge();if(V)try{const B=await Sa(V,w.id,y()||void 0);G(ut(B,{title:w.title,format:w.format}))}catch(B){f(Ee(B,"预览失败"))}},t(F,r(g,{get when(){return w.connector!=="onedata_ref"},get fallback(){return(()=>{var V=An();return V.$$click=()=>void St([w.id]),D(B=>{var ie=!De()||p(),$e=De()?"从公开 OneData 拉回的数据需对话加工,不能直接转为可训练数据":"请先在左侧打开或新建一个会话";return ie!==B.e&&(V.disabled=B.e=ie),$e!==B.t&&T(V,"title",B.t=$e),B},{e:void 0,t:void 0}),V})()},get children(){var V=On();return V.$$click=async()=>{const B=ge();if(B){C(!0);try{await Ca(B,w.id),qe({onedata:"already",already:"mine"}),await ve()}catch(ie){f(Ee(ie,"转化失败"))}finally{C(!1)}}},V}}),we),we.$$click=async()=>{if(!window.confirm(`删除原始数据「${w.title}」?此操作不可恢复。`))return;const V=ge();if(V){C(!0);try{await xa(V,w.id),xe(B=>B.filter(ie=>ie!==w.id)),await ve()}catch(B){f(Ee(B,"删除失败"))}finally{C(!1)}}},D(()=>we.disabled=p()),D(()=>ae.checked=oe().includes(w.id)),R})()})),_})()},get children(){return _n()}}),r(g,{get when(){return $().length>0},get children(){return[(()=>{var _=Sn(),w=_.firstChild;return w.$$click=()=>void St(oe()),t(w,()=>p()?"正在加入…":"把选中的原始数据加入当前对话"),t(_,r(g,{get when(){return!De()},get children(){return wn()}}),null),t(_,r(g,{get when(){return H(()=>!!De())()&&oe().length===0},get children(){return kn()}}),null),D(R=>{var j=!De()||oe().length===0||p(),ae=De()?oe().length===0?"请先勾选上方列表中的原始数据":"把选中的原始数据绑定到当前会话,供对话加工":"请先在左侧打开或新建一个会话";return j!==R.e&&(w.disabled=R.e=j),ae!==R.t&&T(w,"title",R.t=ae),R},{e:void 0,t:void 0}),_})(),r(g,{get when(){return E()},get children(){var _=Cn(),w=_.firstChild;return t(w,E),t(_,r(g,{get when(){return H(()=>!!W())()&&Qe()},children:R=>(()=>{var j=Pn();return j.$$click=()=>a($t(R(),W())),j})()}),null),_}})]}}),r(g,{get when(){return ne()},children:_=>r(Mt,{get model(){return _()},onClose:()=>G(void 0)})})]}}),null),t(k,r(g,{get when(){return H(()=>c()==="already")()&&Fe()},get children(){return[r(g,{get when(){return ga().length>0},get children(){var _=xn(),w=_.firstChild;return w.firstChild,t(w,r(ze,{"aria-label":"训练位置",get value(){return me()},placeholder:"选择训练位置",options:[{value:"local",label:"当前执行环境"},{value:"workspace",label:"已连接的远端"},{value:"shared_root",label:"平台共享盘"}],onChange:R=>Pe(R)}),null),t(_,r(g,{get when(){return me()==="workspace"},get children(){var R=Bt();return R.firstChild,t(R,r(g,{get when(){return x().length>0},get fallback(){return jn()},get children(){return r(ze,{"aria-label":"训练远端环境",get value(){return y()},placeholder:"选择远端环境",get options(){return x().map(j=>({value:j.id,label:j.name}))},onChange:P})}}),null),R}}),null),_}}),r(g,{get when(){return v().length===0},get fallback(){return(()=>{var _=rt();return t(_,r(z,{get each(){return v()},children:w=>(()=>{var R=Bn(),j=R.firstChild,ae=j.nextSibling,pe=ae.nextSibling,he=pe.nextSibling,_e=he.firstChild;return t(j,()=>w.title),t(ae,r(z,{get each(){return kt(w)},children:M=>(()=>{var F=zt();return t(F,M),F})()})),t(pe,()=>w.uri),_e.$$click=async()=>{const M=ge();if(M)try{const F=await Ia(M,w.id,u()==="public"&&y()||void 0);G(ut(F,{title:w.title,format:w.format}))}catch(F){f(F instanceof Error?F.message:"预览失败")}},t(he,r(g,{get when(){return H(()=>u()==="mine"&&w.status==="ready")()&&w.visibility!=="public"},get children(){var M=Rn();return M.$$click=async()=>{const F=ge();if(F){C(!0);try{await Da(F,w.id),await ve()}catch(J){f(Ee(J,"发布失败"))}finally{C(!1)}}},M}}),null),t(he,r(g,{get when(){return H(()=>u()==="mine")()&&w.visibility==="public"},get children(){var M=Fn();return M.$$click=async()=>{const F=ge();if(F){C(!0);try{await La(F,w.id),await ve()}catch(J){f(J instanceof Error?J.message:"取消发布失败")}finally{C(!1)}}},M}}),null),t(he,r(g,{get when(){return u()==="public"},get children(){var M=qn();return M.$$click=async()=>{const F=ge();if(F){C(!0);try{await Ta(F,w.id),qe({onedata:"raw"}),await ve()}catch(J){f(J instanceof Error?J.message:"再次接入失败")}finally{C(!1)}}},M}}),null),t(he,r(g,{get when(){return w.status==="ready"},get children(){var M=Mn();return M.$$click=async()=>{const F=ge();if(F){if(me()==="workspace"&&!y()){f("请选择要运行训练的远端环境");return}C(!0);try{await Oa(F,w.id,{target:me(),...me()==="workspace"?{workspace_id:y()}:{}}),await ve()}catch(J){f(Ee(J,"开始训练失败"))}finally{C(!1)}}},M}}),null),t(he,r(g,{get when(){return u()==="mine"},get children(){var M=Un();return M.$$click=async()=>{if(!window.confirm(`删除可训练数据「${w.title}」?此操作不可恢复。`))return;const F=ge();if(F){C(!0);try{await Ea(F,w.id),await ve()}catch(J){f(Ee(J,"删除失败"))}finally{C(!1)}}},D(()=>M.disabled=p()),M}}),null),R})()})),_})()},get children(){var _=In();return t(_,()=>u()==="public"?"还没有已公开的可训练数据。发布后会出现在这里,他人可拉回再加工。":"还没有可训练数据。请先登记原始数据并转化,或等待对话加工完成。"),_}}),r(g,{get when(){return ne()},children:_=>r(Mt,{get model(){return _()},onClose:()=>G(void 0)})})]}}),null),D(_=>{var w=c()==="catalog",R=c()==="raw",j=c()==="already";return w!==_.e&&T(fe,"aria-pressed",_.e=w),R!==_.t&&T(Le,"aria-pressed",_.t=R),j!==_.a&&T(ye,"aria-pressed",_.a=j),_},{e:void 0,t:void 0,a:void 0}),k})()}je(["click","input"]);var Wn=s('<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>开发'),ta=s("<span>"),Nn=s("<div>"),Hn=s("<button type=button class=os-client-capability-oneskills-expand>"),Kn=s("<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>"),Qn=s("<p class=os-client-capability-empty>当前分类暂无技能卡片。"),Jn=s("<span class=os-client-capability-oneskills-count> 个技能"),Vn=s("<p class=os-client-capability-oneskills-error>"),Yn=s("<div class=os-client-capability-oneskills-top-row>"),Xn=s("<div class=os-client-capability-oneskills-overview>"),Gn=s('<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>'),Zn=s("<p class=os-client-capability-empty>正在加载 OneSkills 技能..."),er=s("<p class=os-client-capability-empty>暂无可展示的 OneSkills 技能,请先安装或更新技能。");const Wt=4,pt=new Set(["orchestrator","resource"]);function tr(e,l){return e.layer===l.title||e.tags.includes(l.title)||e.tags.includes(l.id)}function ar(e){return bt(e)||Vt(Ce(),e.lastCodeWorkspace)||vt(Ce())||ft(document,e.path)}function lr(e){const l=()=>e.item.tags.filter(n=>n!==e.item.layer&&n!==e.item.provider).slice(0,3);return(()=>{var n=Wn(),i=n.firstChild,a=i.firstChild,o=i.nextSibling,d=o.nextSibling,c=d.firstChild,u=d.nextSibling,$=u.firstChild,b=$.nextSibling;return Xt(n,"click",e.onOpen,!0),t(a,()=>e.item.title),t(o,()=>e.item.copy),t(c,()=>e.item.provider),t(d,r(z,{get each(){return l()},children:v=>(()=>{var h=ta();return t(h,v),h})()}),null),$.$$click=v=>{v.stopPropagation(),e.onOpen()},b.$$click=v=>{v.stopPropagation(),e.onDevelop()},D(v=>{var h=e.layerId,m=e.canDevelop?void 0:"登录后使用";return h!==v.e&&T(n,"data-layer",v.e=h),m!==v.t&&T(b,"title",v.t=m),v},{e:void 0,t:void 0}),n})()}function Nt(e){const[l,n]=A(!1),i=()=>e.items.length,a=()=>Math.max(0,i()-Wt),o=()=>l()||a()===0?e.items:e.items.slice(0,Wt),d=()=>pt.has(e.group.id);return(()=>{var c=Kn(),u=c.firstChild,$=u.firstChild,b=$.firstChild,v=$.nextSibling;return t(b,()=>e.group.title),t($,r(g,{get when(){return i()>0},get children(){var h=ta();return t(h,i),h}}),null),t(v,()=>e.group.copy),t(c,r(g,{get when(){return i()>0},get fallback(){return Qn()},get children(){return[(()=>{var h=Nn();return t(h,r(z,{get each(){return o()},children:m=>r(lr,{item:m,get layerId(){return e.group.id},get canDevelop(){return e.canDevelop},onOpen:()=>e.onOpen(m),onDevelop:()=>e.onDevelop(m)})})),D(m=>{var f=!d(),E=!!d();return f!==m.e&&h.classList.toggle("os-client-capability-page-grid",m.e=f),E!==m.t&&h.classList.toggle("os-client-capability-oneskills-compact-grid",m.t=E),m},{e:void 0,t:void 0}),h})(),r(g,{get when(){return H(()=>!d())()&&a()>0},get children(){var h=Hn();return h.$$click=()=>n(m=>!m),t(h,(()=>{var m=H(()=>!!l());return()=>m()?"收起":`展开其余 ${a()} 个`})()),D(()=>T(h,"aria-expanded",l())),h}})]}}),null),D(h=>{var m=e.group.id,f=!!e.compact,E=e.group.id;return m!==h.e&&T(c,"id",h.e=m),f!==h.t&&c.classList.toggle("is-compact",h.t=f),E!==h.a&&T(c,"data-layer",h.a=E),h},{e:void 0,t:void 0,a:void 0}),c})()}function nr(){const e=mt(),l=Ge(),n=Ye(),i=Xe(),a=yt(),[o,d]=A([]),[c,u]=A(!1),[$,b]=A(!1),[v,h]=A(),[m,f]=A(!1),[E,Q]=A(),W=ce(()=>!!Ce()?.account.id),de=ce(()=>ar({path:i.data.path,recent:Ze(i.data.project),lastCodeWorkspace:n.projects.lastCode()})),p=async()=>{const y=n.current;if(!y){d([]),u(!0);return}const P=await Ba(y.http.url,{limit:100});d(P.loaded?P.items:[]),u(!0)};ot(()=>{const y=il(e.search)??sl()?.domainId??"all";l(Yt("oneskills",y),{replace:!0}),p()});const C=y=>o().filter(P=>tr(P,y)),ue=()=>Wa.filter(y=>C(y).length>0),le=()=>{const y=ue();return{pair:y.filter(P=>pt.has(P.id)),rest:y.filter(P=>!pt.has(P.id))}},Y=y=>{Q(y),f(!0)},O=()=>{f(!1),Q(void 0)},L=y=>{if(!st({navigate:l,action:{type:"prompt",prompt:""},isLoggedIn:W()}))return;const P=de();if(!P){Ae({variant:"error",title:"无法开发",description:"未检测到工作目录"});return}const x=nl({id:y.id,title:y.title,copy:y.copy,layer:y.layer,tags:y.tags,provider:y.provider}),X=Kt(P);Qt(X,x.prompt,{skill:x.skill}),Jt(X),a.projects.open(P),n.projects.touchCode(P),f(!1),Q(void 0),Ae({variant:"success",title:`已为你创建「${y.title}」开发任务`}),l($t(P))},N=async()=>{if(!st({navigate:l,action:{type:"install",resourceId:"oneskills"},isLoggedIn:W()}))return;const y=n.current,P=de();if(!y){const x=nt();h(x),Ae({variant:"error",title:"更新失败",description:x});return}if(!P){const x=nt();h(x),Ae({variant:"error",title:"更新失败",description:x});return}b(!0),h(void 0);try{const x=await za(y.http.url,P);await p();const X=x.version?`版本 ${x.version} · ${x.skillCount} 个技能`:`${x.skillCount} 个技能`,ne=x.seedSource==="bundled"&&x.seedFallbackReason?"原语已回退内置 seed":x.seedSource==="disk"?"原语已同步磁盘 oneskills":void 0;Ae({variant:"success",title:"OneSkills 已更新",description:ne?`${X} · ${ne}`:X})}catch(x){const X=nt(x instanceof Error?x.message:"更新 OneSkills 失败");h(X),Ae({variant:"error",title:"更新失败",description:X})}finally{b(!1)}};return(()=>{var y=Gn(),P=y.firstChild,x=P.firstChild;x.firstChild;var X=x.nextSibling,ne=X.firstChild,G=ne.firstChild;return t(x,r(g,{get when(){return H(()=>!!c())()&&o().length>0},get children(){var I=Jn(),Z=I.firstChild;return t(I,()=>o().length,Z),I}}),null),t(X,r(g,{get when(){return v()},get children(){var I=Vn();return t(I,v),I}}),ne),G.$$click=()=>void N(),t(G,()=>$()?"更新中...":"更新 OneSkills"),t(y,r(g,{get when(){return c()},get fallback(){return Zn()},get children(){return r(g,{get when(){return o().length>0},get fallback(){return er()},get children(){var I=Xn();return t(I,r(g,{get when(){return le().pair.length>0},get children(){var Z=Yn();return t(Z,r(z,{get each(){return le().pair},children:oe=>r(Nt,{group:oe,get items(){return C(oe)},compact:!0,get canDevelop(){return W()},onOpen:Y,onDevelop:L})})),Z}}),null),t(I,r(z,{get each(){return le().rest},children:Z=>r(Nt,{group:Z,get items(){return C(Z)},get canDevelop(){return W()},onOpen:Y,onDevelop:L})}),null),I}})}}),null),t(y,r(ll,{variant:"workbench",get item(){return E()},get open(){return m()},get serverUrl(){return n.current?.http.url},onClose:O,onDevelop:()=>{const I=E();I&&(O(),L(I))}}),null),D(I=>{var Z=W()?void 0:"登录后使用",oe=$();return Z!==I.e&&T(ne,"title",I.e=Z),oe!==I.t&&(G.disabled=I.t=oe),I},{e:void 0,t:void 0}),y})()}je(["click"]);async function rr(e,l){const n=[];let i=0;for(;;){const a=new URLSearchParams;a.set("limit","200"),a.set("offset",String(i));const o=await Na(`${Ha(e)}/experimental/onescience/scenario?${a}`);if(!o.ok)throw new Error(`scenario catalog failed: ${o.status}`);const d=await o.json(),c=(d.items??[]).map(u=>({...u,model_ids:u.model_ids??[]}));if(n.push(...c),d.nextOffset==null||c.length===0)break;i=d.nextOffset}return Ka(n),n}var ir=s("<span>当前范围:"),sr=s("<strong>全领域"),or=s("<small>OneSkills 原语跨领域通用,不区分材料 / 气象 / 流体 / 生信"),cr=s("<div class=os-client-capability-domain-row role=tablist aria-label=能力中心领域>"),dr=s("<div class=os-client-capability-scenario-grid>"),ur=s("<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=搜索场景>"),gr=s("<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>"),pr=s("<span>当前领域:"),hr=s("<strong>"),br=s("<small>"),vr=s("<button type=button>"),fr=s("<button type=button class=os-client-capability-filter-tab role=tab><div class=os-client-capability-filter-tab-text><strong></strong><small>"),$r=s("<p class=os-client-capability-hint>"),Ne=s("<span>"),mr=s("<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>使用"),yr=s("<button type=button class=os-client-capability-upload-trigger><span aria-hidden=true>+</span>上传私有模型"),_r=s("<label class=os-client-capability-catalog-search><span>搜索</span><input type=search placeholder=按名称、简介或标签筛选>"),wr=s("<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=展示方式>"),kr=s('<section class=os-client-capability-resource-panel><header class="os-client-capability-page-section-head os-client-capability-page-section-head-active"><p>'),Sr=s("<p class=os-client-capability-empty>当前「<!>」领域暂无<!>卡片。"),Cr=s("<button type=button role=tab>"),xr=s("<p class=os-client-capability-empty>没有匹配的结果,试试换个关键词。"),Ir=s("<div class=os-client-capability-catalog role=list>"),Dr=s("<article class=os-client-capability-catalog-row role=listitem>"),Lr=s("<div class=os-client-capability-page-grid>"),aa=s("<span class=os-client-capability-private-badge>私有资产"),la=s("<span class=os-client-capability-unavailable-badge>暂不可用"),Tr=s("<div class=os-client-capability-meta>"),Or=s("<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>"),Er=s("<p class=os-client-capability-unavailable-hint>暂无 OneScience 源码或魔搭映射"),Ar=s("<div class=os-client-capability-catalog-tags>"),Pr=s("<div class=os-client-capability-catalog-copy><div class=os-client-capability-card-title><h4></h4></div><p>"),jr=s("<div>"),Rr=s("<button type=button>安装");const Fr=[{id:"all",label:"全部"},{id:"materials",label:"材料"},{id:"weather",label:"气象"},{id:"fluid",label:"流体"},{id:"bio",label:"生信"}],qr=[{id:"scenario",label:"场景",title:"场景库"},{id:"onemodel",label:"onemodel",title:"模型库"},{id:"hpc",label:"HPC 软件",title:"软件库"},{id:"onedata",label:"onedata",title:"数据集"},{id:"oneskills",label:"oneskills",title:"技能库"}],Mr=[{id:"cards",label:"卡片"},{id:"list",label:"列表"}],na="os-capability-view-mode";function it(e){return e==="all"||e==="materials"||e==="weather"||e==="fluid"||e==="bio"?e:"all"}function Ur(e){return e==="materials"||e==="weather"||e==="fluid"||e==="bio"?e:"materials"}function Br(e,l){const n=e.split("?")[0]??e;return new RegExp(`^${ct.capabilities}/[^/]+`).test(n)?!new URLSearchParams(l).has("domain"):!1}function ti(e){const l=mt(),n=Ge(),i=Pt(l.pathname,l.search),[a,o]=Qa({domainId:it(i.domainId),categoryId:i.categoryId,scenarioQuery:"",activeScenarioId:"",uploadPage:null,scenarioCatalogTick:0}),d=Xe(),c=yt(),u=Ye();ot(()=>{const p=u.current?.http.url;p&&rr(p).then(()=>o("scenarioCatalogTick",C=>C+1)).catch(()=>{})});const $=p=>{ol({categoryId:p.categoryId,domainId:it(p.domainId)})},b=p=>{$(p),n(Yt(p.categoryId,p.domainId),{replace:!0})};We(()=>{const p=l.pathname,C=l.search,ue=Pt(p,C);if(Br(p,C)){o("categoryId",ue.categoryId);return}const le=it(ue.domainId),Y=ue.categoryId;o({domainId:le,categoryId:Y}),$({domainId:le,categoryId:Y});const O=p.split("?")[0]??p,L=O===ct.capabilities||O===`${ct.capabilities}/`,N=new URLSearchParams(C);L&&!N.get("category")&&!N.get("domain")&&b({domainId:le,categoryId:Y})});const v=ce(()=>(Ja(),a.domainId==="all"?Ot():Ot(a.domainId))),h=ce(()=>v().find(p=>p.id===a.categoryId)??v()[0]),m=ce(()=>(a.scenarioCatalogTick,Va(a.domainId,a.scenarioQuery))),f=ce(()=>{if(a.scenarioCatalogTick,!!a.activeScenarioId)return Et(a.activeScenarioId)}),E=p=>{o({categoryId:p,activeScenarioId:"",scenarioQuery:p==="scenario"?a.scenarioQuery:""}),b({domainId:a.domainId,categoryId:p})},Q=()=>o("activeScenarioId",""),W=()=>({navigate:n,isLoggedIn:!!Ce(),path:d.data.path,recent:Ze(d.data.project),lastCodeWorkspace:u.projects.lastCode(),openProject:p=>c.projects.open(p),touchCode:p=>u.projects.touchCode(p)});ot(()=>{const p=Ya();if(p)try{if(p.type==="install"){if(p.resourceId==="oneskills"){o("categoryId","oneskills"),b({domainId:a.domainId,categoryId:"oneskills"});return}if(p.resourceId.startsWith("__"))return;Gt({resourceId:p.resourceId,...W()});return}if(p.type==="prompt"&&p.prompt.trim()){cl({prompt:p.prompt,title:p.title||"能力中心任务",workflow:p.workflow,...W()});return}if(p.type==="scenario-run"){const C=Et(p.scenarioId);if(!C)return;jt({scenario:C,values:p.values,...W()});return}p.type==="wizard"&&dl({resourceId:p.resourceId,scenarioId:p.scenarioId,values:p.values,prompt:p.prompt,...W()})}catch{}});const de=(p,C)=>{jt({scenario:p,values:C.values,...W()})};return(()=>{var p=gr(),C=p.firstChild,ue=C.firstChild,le=ue.nextSibling,Y=C.nextSibling;return t(ue,r(g,{get when(){return a.categoryId==="oneskills"},get fallback(){return[pr(),(()=>{var O=hr();return t(O,()=>Be(a.domainId)),O})(),(()=>{var O=br();return t(O,()=>a.categoryId==="scenario"?"切换领域后,下方场景同步刷新":"切换领域后,下方模型、HPC 软件与数据集内容同步刷新"),O})()]},get children(){return[ir(),sr(),or()]}})),t(C,r(g,{get when(){return a.categoryId!=="oneskills"},get children(){var O=cr();return t(O,r(z,{each:Fr,children:L=>(()=>{var N=vr();return N.$$click=()=>{o({domainId:L.id,activeScenarioId:"",scenarioQuery:""}),b({domainId:L.id,categoryId:a.categoryId})},t(N,()=>L.label),D(y=>{var P=L.id===a.domainId,x=L.id===a.domainId;return P!==y.e&&N.classList.toggle("is-active",y.e=P),x!==y.t&&T(N,"aria-pressed",y.t=x),y},{e:void 0,t:void 0}),N})()})),O}}),le),t(le,r(z,{each:qr,children:O=>(()=>{var L=fr(),N=L.firstChild,y=N.firstChild,P=y.nextSibling;return L.$$click=()=>E(O.id),t(y,()=>O.label),t(P,()=>O.title),D(x=>{var X=a.categoryId===O.id,ne=a.categoryId===O.id;return X!==x.e&&L.classList.toggle("is-active",x.e=X),ne!==x.t&&T(L,"aria-selected",x.t=ne),x},{e:void 0,t:void 0}),L})()})),t(Y,r(g,{get when(){return a.categoryId==="oneskills"},get children(){return r(nr,{})}}),null),t(Y,r(g,{get when(){return a.categoryId==="scenario"},get children(){var O=ur(),L=O.firstChild,N=L.firstChild,y=N.nextSibling,P=y.nextSibling,x=P.firstChild,X=P.nextSibling,ne=X.firstChild;return t(y,()=>m().length),t(P,()=>Be(a.domainId),x),ne.$$input=G=>o("scenarioQuery",G.currentTarget.value),t(O,r(g,{get when(){return m().length>0},get fallback(){return(()=>{var G=$r();return t(G,(()=>{var I=H(()=>!!a.scenarioQuery.trim());return()=>I()?`未找到匹配「${a.scenarioQuery.trim()}」的场景。`:`当前「${Be(a.domainId)}」领域暂无场景卡片。`})()),G})()},get children(){var G=dr();return t(G,r(z,{get each(){return m()},children:I=>(()=>{var Z=mr(),oe=Z.firstChild,xe=oe.firstChild,me=xe.nextSibling,Pe=oe.nextSibling,re=Pe.nextSibling,Ie=re.firstChild,He=Ie.firstChild,Ke=Ie.nextSibling,Re=Ke.firstChild;return Z.$$click=()=>o("activeScenarioId",Xa(I)),t(xe,()=>I.name),t(me,()=>I.scenario_id),t(Pe,()=>Ga(I.problem_and_applicability)),t(re,r(g,{get when(){return I.type?.trim()},get children(){var be=Ne();return t(be,()=>I.type),be}}),Ie),t(re,r(g,{get when(){return I.model?.trim()},get children(){var be=Ne();return t(be,()=>I.model),be}}),Ie),t(re,r(g,{get when(){return I.HPC?.trim()},get children(){var be=Ne();return t(be,()=>I.HPC),be}}),Ie),t(Ie,()=>I.workflow_steps?.length||I.workflow.length,He),t(Ke,()=>I.user_input.length,Re),Z})()})),G}}),null),D(()=>ne.value=a.scenarioQuery),O}}),null),t(Y,r(g,{get when(){return a.categoryId==="onemodel"||a.categoryId==="hpc"},get children(){return r(zr,{get category(){return h()},get domainId(){return a.domainId},get domainLabel(){return Be(a.domainId)},get onUpload(){return a.categoryId==="onemodel"?()=>o("uploadPage","models"):void 0}})}}),null),t(Y,r(g,{get when(){return a.categoryId==="onedata"},get children(){return r(zn,{get domain(){return a.domainId},get domainLabel(){return Be(a.domainId)},get copy(){return h().copy}})}}),null),t(p,r(g,{get when(){return f()},children:O=>r(ul,{get scenario(){return O()},onClose:Q,onSubmit:L=>de(O(),L)})}),null),t(p,r(bl,{get open(){return a.uploadPage!==null},page:"models",get domain(){return Ur(a.domainId)},onClose:()=>o("uploadPage",null),onSaved:()=>{o({categoryId:"onemodel",uploadPage:null,activeScenarioId:""}),b({domainId:a.domainId,categoryId:"onemodel"})}}),null),t(p,()=>e.children,null),p})()}function zr(e){const[l,n]=A(""),[i,a]=A(Qr()),o=()=>({category:e.category.id,domain:e.domainId}),d=ce(()=>{const u=l().trim().toLowerCase();return u?e.category.items.filter($=>[$.name,$.blurb,...$.tags].some(b=>b.toLowerCase().includes(u))):e.category.items}),c=u=>{a(u),Jr(u)};return(()=>{var u=kr(),$=u.firstChild,b=$.firstChild;return t(b,()=>e.category.copy.replace(/[。.]$/,"")),t($,r(g,{get when(){return e.onUpload},get children(){var v=yr();return Xt(v,"click",e.onUpload,!0),v}}),null),t(u,r(g,{get when(){return e.category.items.length>0},get fallback(){return(()=>{var v=Sr(),h=v.firstChild,m=h.nextSibling,f=m.nextSibling,E=f.nextSibling;return E.nextSibling,t(v,()=>e.domainLabel,m),t(v,()=>e.category.id==="hpc"?" HPC 软件":"模型",E),v})()},get children(){return[(()=>{var v=wr(),h=v.firstChild,m=h.firstChild,f=m.nextSibling;return t(v,r(g,{get when(){return e.category.items.length>=6},get children(){var E=_r(),Q=E.firstChild,W=Q.nextSibling;return W.$$input=de=>n(de.currentTarget.value),D(()=>W.value=l()),E}}),h),t(m,(()=>{var E=H(()=>d().length===e.category.items.length);return()=>E()?`共 ${e.category.items.length} 项`:`${d().length} / ${e.category.items.length} 项`})()),t(f,r(z,{each:Mr,children:E=>(()=>{var Q=Cr();return Q.$$click=()=>c(E.id),t(Q,()=>E.label),D(W=>{var de=i()===E.id,p=i()===E.id;return de!==W.e&&T(Q,"aria-selected",W.e=de),p!==W.t&&Q.classList.toggle("is-active",W.t=p),W},{e:void 0,t:void 0}),Q})()})),v})(),r(g,{get when(){return d().length>0},get fallback(){return xr()},get children(){return[r(g,{get when(){return i()==="list"},get children(){return r(Wr,{get items(){return d()},get catalog(){return o()}})}}),r(g,{get when(){return i()==="cards"},get children(){return r(Nr,{get items(){return d()},get catalog(){return o()}})}})]}})]}}),null),u})()}function Wr(e){return(()=>{var l=Ir();return t(l,r(z,{get each(){return e.items},children:n=>{const i=()=>_t(n);return(()=>{var a=Dr();return t(a,r(Hr,{item:n}),null),t(a,r(g,{get when(){return i()},get fallback(){return r(ra,{})},get children(){return r(ia,{item:n,get catalog(){return e.catalog}})}}),null),D(o=>{var d=n.ownership==="private",c=!i(),u=i()?void 0:!0,$=i()?void 0:"暂无 OneScience 源码或魔搭映射,暂不可用";return d!==o.e&&a.classList.toggle("is-private",o.e=d),c!==o.t&&a.classList.toggle("is-unavailable",o.t=c),u!==o.a&&T(a,"aria-disabled",o.a=u),$!==o.o&&T(a,"title",o.o=$),o},{e:void 0,t:void 0,a:void 0,o:void 0}),a})()}})),l})()}function Nr(e){return(()=>{var l=Lr();return t(l,r(z,{get each(){return e.items},children:n=>{const i=()=>_t(n);return(()=>{var a=Or(),o=a.firstChild,d=o.firstChild,c=d.firstChild,u=c.firstChild,$=d.nextSibling;return t(u,()=>n.name),t(c,r(g,{get when(){return n.ownership==="private"},get children(){return aa()}}),null),t(c,r(g,{get when(){return!i()},get children(){return la()}}),null),t(d,r(g,{get when(){return n.tags.length>0},get children(){var b=Tr();return t(b,r(z,{get each(){return n.tags},children:v=>(()=>{var h=Ne();return t(h,v),h})()})),b}}),null),t($,()=>n.blurb),t(a,r(g,{get when(){return i()},get fallback(){return r(ra,{variant:"card"})},get children(){return r(ia,{item:n,variant:"card",get catalog(){return e.catalog}})}}),null),D(b=>{var v=n.ownership==="private",h=!i(),m=i()?void 0:!0,f=i()?void 0:"暂无 OneScience 源码或魔搭映射,暂不可用";return v!==b.e&&a.classList.toggle("is-private",b.e=v),h!==b.t&&a.classList.toggle("is-unavailable",b.t=h),m!==b.a&&T(a,"aria-disabled",b.a=m),f!==b.o&&T(a,"title",b.o=f),b},{e:void 0,t:void 0,a:void 0,o:void 0}),a})()}})),l})()}function ra(e){return(()=>{var l=Er();return D(()=>l.classList.toggle("os-client-capability-unavailable-hint-card",e.variant==="card")),l})()}function Hr(e){return(()=>{var l=Pr(),n=l.firstChild,i=n.firstChild,a=n.nextSibling;return t(i,()=>e.item.name),t(n,r(g,{get when(){return e.item.ownership==="private"},get children(){return aa()}}),null),t(n,r(g,{get when(){return!_t(e.item)},get children(){return la()}}),null),t(a,()=>e.item.blurb),t(l,r(g,{get when(){return e.item.tags.length>0},get children(){var o=Ar();return t(o,r(z,{get each(){return e.item.tags},children:d=>(()=>{var c=Ne();return t(c,d),c})()})),o}}),null),l})()}function ia(e){const l=()=>e.catalog?{category:e.catalog.category,domain:e.catalog.domain}:void 0;return(()=>{var n=jr();return t(n,r(At,{get href(){return Za(e.item.id,l())},children:"详情"}),null),t(n,r(Kr,{get item(){return e.item}}),null),t(n,r(At,{get href(){return el(e.item.id,void 0,l())},"data-primary":"true",children:"使用"}),null),D(i=>{var a=e.variant!=="card",o=e.variant==="card";return a!==i.e&&n.classList.toggle("os-client-capability-catalog-actions",i.e=a),o!==i.t&&n.classList.toggle("os-client-capability-actions",i.t=o),i},{e:void 0,t:void 0}),n})()}function Kr(e){const l=Ge(),n=Xe(),i=yt(),a=Ye(),o=()=>ht(e.item);return(()=>{var d=Rr();return d.$$click=()=>{o()&&Gt({resourceId:e.item.id,navigate:l,isLoggedIn:!!Ce(),path:n.data.path,recent:Ze(n.data.project),lastCodeWorkspace:a.projects.lastCode(),openProject:c=>i.projects.open(c),touchCode:c=>a.projects.touchCode(c)})},D(c=>{var u=!o(),$=o()?void 0:"暂无魔搭安装包";return u!==c.e&&(d.disabled=c.e=u),$!==c.t&&T(d,"title",c.t=$),c},{e:void 0,t:void 0}),d})()}function Qr(){if(typeof localStorage>"u")return"cards";const e=localStorage.getItem(na);return e==="cards"||e==="list"?e:"cards"}function Jr(e){typeof localStorage>"u"||localStorage.setItem(na,e)}je(["input","click"]);export{ti as CapabilityCenterPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609111023/assets/nope-12-BJR1Ka3c.aac";export{e as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as j,f as D,l as I,n as E,o as g,q as X,i as a,c as o,t as v,dW as u,b as z,s as _,bm as H,z as N,r as y,v as C,w as L,x as O,R as Y,U as x,S as B,W as G,Y as J,F as K,X as Q,dX as V}from"./index-ZiVCMYWM.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=j(),s=D(),A=I(),[b,P]=E(0),R=g(()=>(b(),!!_())),d=g(()=>!R()),[n,T]=E(ae(c.search)??"list"),W=g(()=>{b();const e=_();return e&&(H(e,A.projects.lastCode())||N(e))||""}),p=e=>{T(e),s(x(e),{replace:!0})};X(()=>{const e=()=>P(i=>i+1);window.addEventListener(y,e),window.addEventListener(C,e),window.addEventListener(L,e),O(()=>{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,w=m.nextSibling,q=i.nextSibling;return a(f,()=>h().label),a(U,()=>h().hint),a(i,o(B,{get when(){return d()},get children(){var t=Z();return t.firstChild,a(t,o(Y,{get href(){return`/login?redirect=${encodeURIComponent(x(n()))}`},children:"去登录"}),null),t}}),w),a(w,o(K,{each:u,children:t=>(()=>{var r=te(),S=r.firstChild,F=S.nextSibling;return r.$$click=()=>p(t.id),a(S,()=>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(q,o(V,{get directory(){return Q(()=>!!d())()?void 0:W()||void 0},get loginRequired(){return d()},get tab(){return n()},onTabChange:p,variant:"page-body"})),e})()}z(["click"]);export{ne as WorkbenchSkillsPage};
|