@onescience/onecode-web 1.14.50-202609041106 → 1.14.50-202609071715
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-7YMNJqfC.js → 3Dmol-B1rQmimB.js} +1 -1
- package/assets/{account-system-Cw5e9KGB.js → account-system-Djs3bQsY.js} +1 -1
- package/assets/{alert-04-CcZgG6bJ.js → alert-01-BzJJ-zh_.js} +1 -1
- package/assets/{alert-05-D7-V4rRk.js → alert-02-DuklsSJE.js} +1 -1
- package/assets/{alert-01-CYAeyCMP.js → alert-04-DQgxnbZj.js} +1 -1
- package/assets/{alert-02-a2ki0UoQ.js → alert-05-DieKTu9h.js} +1 -1
- package/assets/alert-06-CdNX1MFF.js +1 -0
- package/assets/alert-07-D8bcb829.js +1 -0
- package/assets/alert-08-DwxXD9Jv.js +1 -0
- package/assets/alert-10-O1JGraHb.js +1 -0
- package/assets/{bip-bop-03-CQtp5UBI.js → bip-bop-03-8uYDh5fD.js} +1 -1
- package/assets/{bip-bop-04-B5JxsVo8.js → bip-bop-04-D7J2V_pQ.js} +1 -1
- package/assets/{bip-bop-06-CM-arrml.js → bip-bop-06-DVe4G3q4.js} +1 -1
- package/assets/{bip-bop-08-CZmdmAH8.js → bip-bop-08-BR47Ixqy.js} +1 -1
- package/assets/bip-bop-09-Ba1Kwga0.js +1 -0
- package/assets/center-BHSp0APF.js +5 -0
- package/assets/{dialog-edit-project-DHNm7Ey_.js → dialog-edit-project-Dsv8HvjS.js} +1 -1
- package/assets/{dialog-fork-CI25AsCv.js → dialog-fork-CA3inOLr.js} +1 -1
- package/assets/{dialog-project-upload-CkgODEoQ.js → dialog-project-upload-Bs1_9kHj.js} +2 -2
- package/assets/{dialog-select-file-CExSniO7.js → dialog-select-file-BrLiSa0e.js} +1 -1
- package/assets/{dialog-select-model-DA1fqH_v.js → dialog-select-model-CMF-xmbD.js} +2 -2
- package/assets/{dialog-terminal-unavailable-BJfv1EHP.js → dialog-terminal-unavailable-BOUZ3KsI.js} +2 -2
- package/assets/{docs-wIg32xY_.js → docs-BzOnK23f.js} +1 -1
- package/assets/{ghostty-web-v5wxn2ZG.js → ghostty-web-l4q7-PU1.js} +1 -1
- package/assets/{home-8jUqij3D.js → home-C3y_A1-6.js} +1 -1
- package/assets/{index-DSFO1zPs.js → index-BfLPI17v.js} +333 -333
- package/assets/{index-DgFAbOBA.css → index-BwtL4rk2.css} +1 -1
- package/assets/{intro-f3CyX3LG.js → intro-BJgVhMkF.js} +1 -1
- package/assets/{nope-02-Dud-xmOl.js → nope-02-CruCGsk0.js} +1 -1
- package/assets/{nope-05-CRb47w2t.js → nope-05-Dxj-phOs.js} +1 -1
- package/assets/{nope-08-C6-KHO6r.js → nope-08-DcEjC0yF.js} +1 -1
- package/assets/{nope-11-CLbBShpj.js → nope-11-Dkkp3vCv.js} +1 -1
- package/assets/nope-12-DAx93zTR.js +1 -0
- package/assets/{onescience-DnetzwjT.js → onescience-DMXJ1nYb.js} +1 -1
- package/assets/{resources-vDDc_MJX.js → resources-BtRvjjW6.js} +1 -1
- package/assets/{selection-BwmaAH41.js → selection-BDKVpung.js} +1 -1
- package/assets/{shell-Cbn2njzj.js → shell-M6Hcceef.js} +2 -2
- package/assets/{skills-DYlf3B0U.js → skills-Cr1Txx6V.js} +1 -1
- package/assets/{staplebops-03-D24uBgZq.js → staplebops-03-C9ZA5vYl.js} +1 -1
- package/assets/{staplebops-04-uT3rFS3Z.js → staplebops-04-C8RBLMc9.js} +1 -1
- package/assets/{staplebops-06-CKdUVJT0.js → staplebops-06-hRBlO_Jx.js} +1 -1
- package/assets/{staplebops-07-DLe3dmB5.js → staplebops-07-C4Pmn4wy.js} +1 -1
- package/assets/{status-popover-body-D7ovCoeA.js → status-popover-body-CwhO-ly1.js} +2 -2
- package/assets/{wizard-1E0A0kso.js → wizard-DfNLXs5i.js} +1 -1
- package/assets/{yup-01-CXyCbhDP.js → yup-01-CCyquaXC.js} +1 -1
- package/assets/{yup-03-DlREv1-t.js → yup-03-DUKtblGi.js} +1 -1
- package/assets/{yup-04-Dy8s-aaY.js → yup-04-Djw3oL2g.js} +1 -1
- package/assets/{yup-05-DzUfJrew.js → yup-05-BPnDQKpc.js} +1 -1
- package/index.html +11 -11
- package/package.json +2 -2
- package/assets/alert-06-cxwQaG-M.js +0 -1
- package/assets/alert-07-Co7x1ur1.js +0 -1
- package/assets/alert-08-CF8mI3pz.js +0 -1
- package/assets/alert-10-DELx7y93.js +0 -1
- package/assets/bip-bop-09-DG1FB07M.js +0 -1
- package/assets/center-B41zMqFC.js +0 -4
- package/assets/nope-12-DKbH8IN1.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as Ge,m as Je,be as Ne,d1 as He,x as et,o as W,d2 as tt,d3 as xe,d4 as ze,d5 as Me,d6 as oe,d7 as it,d8 as at,ak as _e,i as t,c as a,S as g,Q as f,F as U,T as A,R as Oe,d9 as lt,da as Ee,db as rt,t as l,dc as nt,c_ as st,e as ct,dd as ot,f as dt,h as ut,g as pt,l as gt,n as ht,ag as bt,X as Ie,aQ as Pe,r as Le,s as fe,aS as Fe,Z as Te,b3 as je,Y as Re,_ as We,E as qe,de as $t,df as vt,dg as _t,b1 as Qe,bl as Be,dh as mt,bj as ft,L as Y,bK as Ue,c$ as yt,bm as St,d0 as wt,aR as Ct}from"./index-DSFO1zPs.js";var xt=l("<div class=os-client-capability-wizard-papers><h3>HPC 软件</h3><span>"),zt=l("<div class=os-client-capability-wizard-papers><h3>相关论文"),kt=l("<p class=os-client-capability-wizard-note>工作目录与运行环境由系统自动识别,本步只需填写下列业务参数。"),It=l("<p class=os-client-capability-wizard-missing>本步还有 <!> 个必填参数未填写。"),Pt=l("<p class=os-client-capability-wizard-missing>其他步骤还有 <!> 个必填参数未填写,可点击左侧步骤继续补全。"),ke=l("<small>"),Lt=l("<ul class=os-client-capability-wizard-output-list>"),Ft=l("<div class=os-client-capability-wizard-quality><strong>质量门禁</strong><p>"),Tt=l('<div class="os-client-capability-wizard-outputs os-client-capability-wizard-overall"aria-label=全局交付要点><div class=os-client-capability-wizard-outputs-head><span>全局交付要点</span></div><ul class=os-client-capability-wizard-output-list>'),jt=l('<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>创建任务并自动逐步执行'),Rt=l("<em>参数 <!>/"),Wt=l("<li><button type=button class=os-client-capability-wizard-step><span></span><div><p>"),qt=l("<a target=_blank rel=noreferrer> · "),Dt=l("<div class=os-client-capability-wizard-step-banner><strong>"),Ht=l("<p>"),Mt=l("<p class=os-client-capability-wizard-note>本步无需额外用户参数。"),Ot=l("<em>*"),Et=l("<textarea rows=3>"),Ut=l("<label class=os-client-capability-wizard-field><span>"),At=l("<input type=text>"),Vt=l("<p class=os-client-capability-wizard-outputs-empty>本步暂无结构化产出清单。"),Ae=l("<li>");function Kt(e){const d=Je(),[s,$]=Ne({values:He(e.scenario),attempted:!1,activeStepIndex:0});et(()=>{$({values:He(e.scenario),attempted:!1,activeStepIndex:0})});const y=W(()=>tt(e.scenario)),k=W(()=>y()[s.activeStepIndex]??y()[0]),V=W(()=>{const v=k();return v?xe(e.scenario,v):e.scenario.user_input}),F=W(()=>ze(e.scenario,s.values)),de=W(()=>V().filter(v=>Me(v)?!String(s.values[oe(v)]??"").trim():!1)),Z=W(()=>V().filter(v=>String(s.values[oe(v)]??"").trim()).length),ye=W(()=>{const T=k()?.prompt||e.scenario.ai_prompt?.template||"";return it(T,s.values)}),C=W(()=>k()?.outputs??[]),K=W(()=>at(e.scenario)),G=()=>(e.scenario.related_papers??[]).slice(0,3),ae=(v,T)=>{$("values",v,T)},M=v=>{$("activeStepIndex",v)},ue=()=>{$("attempted",!0);const v=ze(e.scenario,s.values);if(v.length===0){e.onSubmit({values:{...s.values}});return}const T=oe(v[0]),le=y().findIndex(N=>xe(e.scenario,N).some(q=>oe(q)===T));le>=0&&$("activeStepIndex",le),d.show(()=>a(nt,{title:"请补充必填参数",get reason(){return`还有 ${v.length} 个必填参数未填写,补充后即可创建任务并自动逐步执行。`},fields:v,get values(){return s.values},onConfirm:N=>{const q={...s.values,...N};$("values",q),!(ze(e.scenario,q).length>0)&&e.onSubmit({values:q})}}))};return(()=>{var v=jt(),T=v.firstChild,le=T.nextSibling,N=le.firstChild,q=N.firstChild,re=q.nextSibling,be=re.firstChild,Se=be.nextSibling,r=re.nextSibling,p=N.nextSibling,b=p.firstChild,_=b.firstChild,j=_.nextSibling,Q=j.nextSibling,O=b.nextSibling,pe=O.firstChild,we=pe.firstChild,B=we.nextSibling,ne=B.firstChild,ge=ne.nextSibling,he=ge.nextSibling,$e=he.nextSibling;$e.nextSibling;var X=pe.nextSibling,ve=X.nextSibling,se=ve.firstChild,ce=se.nextSibling,u=O.nextSibling,o=u.firstChild,m=o.firstChild;m.firstChild;var x=o.nextSibling,P=x.firstChild,R=P.nextSibling,D=R.firstChild,J=D.nextSibling;J.nextSibling;var E=x.nextSibling,ee=p.nextSibling,te=ee.firstChild,Ce=te.nextSibling;return _e(T,"click",e.onClose,!0),_e(q,"click",e.onClose,!0),t(be,()=>e.scenario.name),t(Se,()=>e.scenario.problem_and_applicability),_e(r,"click",e.onClose,!0),t(Q,a(U,{get each(){return y()},children:(i,n)=>{const c=()=>xe(e.scenario,i),w=()=>c().filter(H=>String(s.values[oe(H)]??"").trim()).length,S=()=>c().length;return(()=>{var H=Wt(),h=H.firstChild,L=h.firstChild,ie=L.nextSibling,I=ie.firstChild;return h.$$click=()=>M(n()),t(L,()=>n()+1),t(I,()=>i.name),t(ie,a(g,{get when(){return i.purpose},get children(){var z=ke();return t(z,()=>i.purpose),z}}),null),t(ie,a(g,{get when(){return S()>0},get children(){var z=Rt(),Ze=z.firstChild,De=Ze.nextSibling;return De.nextSibling,t(z,w,De),t(z,S,null),z}}),null),f(()=>H.classList.toggle("is-active",s.activeStepIndex===n())),H})()}})),t(b,a(g,{get when(){return e.scenario.HPC},get children(){var i=xt(),n=i.firstChild,c=n.nextSibling;return t(c,()=>e.scenario.HPC),i}}),null),t(b,a(g,{get when(){return G().length>0},get children(){var i=zt();return i.firstChild,t(i,a(U,{get each(){return G()},children:n=>(()=>{var c=qt(),w=c.firstChild;return t(c,()=>n.paper_id,w),t(c,()=>n.relation,null),f(()=>A(c,"href",n.url)),c})()}),null),i}}),null),t(B,()=>s.activeStepIndex+1,ne),t(B,()=>y().length,ge),t(B,Z,$e),t(B,()=>V().length,null),t(O,a(g,{get when(){return k()},children:i=>(()=>{var n=Dt(),c=n.firstChild;return t(c,()=>i().name),t(n,a(g,{get when(){return i().purpose},children:w=>(()=>{var S=Ht();return t(S,w),S})()}),null),n})()}),X),t(O,a(g,{get when(){return e.scenario.system_auto_detection?.fields?.length},get children(){return kt()}}),X),t(O,a(g,{get when(){return Oe(()=>!!s.attempted)()&&de().length>0},get children(){var i=It(),n=i.firstChild,c=n.nextSibling;return c.nextSibling,t(i,()=>de().length,c),i}}),X),t(O,a(g,{get when(){return Oe(()=>!!(s.attempted&&F().length>0))()&&de().length===0},get children(){var i=Pt(),n=i.firstChild,c=n.nextSibling;return c.nextSibling,t(i,()=>F().length,c),i}}),X),t(X,a(g,{get when(){return V().length>0},get fallback(){return Mt()},get children(){return a(U,{get each(){return V()},children:i=>{const n=oe(i),c=Me(i),w=s.attempted&&c&&!String(s.values[n]??"").trim();return(()=>{var S=Ut(),H=S.firstChild;return S.classList.toggle("is-required",!!c),S.classList.toggle("is-invalid",!!w),t(H,()=>lt(i),null),t(H,a(g,{when:c,get children(){return Ot()}}),null),t(S,a(g,{get when(){return rt(i)},get fallback(){return(()=>{var h=At();return h.$$input=L=>ae(n,L.currentTarget.value),f(()=>A(h,"placeholder",Ee(i))),f(()=>h.value=s.values[n]??""),h})()},get children(){var h=Et();return h.$$input=L=>ae(n,L.currentTarget.value),f(()=>A(h,"placeholder",Ee(i))),f(()=>h.value=s.values[n]??""),h}}),null),S})()}})}})),se.$$click=()=>M(Math.max(0,s.activeStepIndex-1)),ce.$$click=()=>M(Math.min(y().length-1,s.activeStepIndex+1)),t(m,a(g,{get when(){return k()?.result_subfolder},get children(){var i=ke();return t(i,()=>k()?.result_subfolder),f(()=>A(i,"title",k()?.result_subfolder)),i}}),null),t(o,a(g,{get when(){return C().length>0},get fallback(){return Vt()},get children(){var i=Lt();return t(i,a(U,{get each(){return C()},children:n=>(()=>{var c=Ae();return t(c,n),c})()})),i}}),null),t(o,a(g,{get when(){return k()?.quality_gate},get children(){var i=Ft(),n=i.firstChild,c=n.nextSibling;return t(c,()=>k()?.quality_gate),i}}),null),t(u,a(g,{get when(){return K().length>0},get children(){var i=Tt(),n=i.firstChild;n.firstChild;var c=n.nextSibling;return t(n,a(g,{get when(){return e.scenario.results_folder},get children(){var w=ke();return t(w,()=>e.scenario.results_folder),f(()=>A(w,"title",e.scenario.results_folder)),w}}),null),t(c,a(U,{get each(){return K().slice(0,6)},children:w=>(()=>{var S=Ae();return t(S,w),S})()})),i}}),x),t(R,()=>s.activeStepIndex+1,J),_e(te,"click",e.onClose,!0),Ce.$$click=ue,f(i=>{var n=s.activeStepIndex<=0,c=s.activeStepIndex>=y().length-1;return n!==i.e&&(se.disabled=i.e=n),c!==i.t&&(ce.disabled=i.t=c),i},{e:void 0,t:void 0}),f(()=>E.value=ye()),v})()}Ge(["click","input"]);function Gt(e,d){return e.replace(/\{\{(\w+)\}\}/g,(s,$)=>d[$]??"")}var Nt=l("<div class=os-client-capability-wizard-overlay role=dialog aria-modal=true aria-label=能力向导>"),Qt=l("<section class=os-client-capability-wizard-dialog><p>未找到该能力。"),Bt=l("<div class=os-client-capability-wizard-scenario-group><span>完整工作流场景"),Xt=l("<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>创建任务"),Yt=l("<section class=os-client-capability-wizard-dialog><p>「<!>」暂无 OneScience 源码或魔搭映射,当前不可使用。"),Zt=l("<button type=button><strong></strong><p>"),Jt=l("<button type=button><strong></strong><p></p><small> · <!> 步"),Ve=l("<p class=os-client-capability-wizard-empty>请先选择任务场景。"),ei=l("<div class=os-client-capability-wizard-required aria-label=该能力需要什么数据><h4>该能力需要什么数据</h4><ul>"),ti=l("<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>"),ii=l("<textarea rows=3>"),ai=l("<label class=os-client-capability-wizard-field><span>"),li=l("<input type=text>"),ri=l("<li>"),ni=l("<div class=os-client-capability-wizard-right-head><strong></strong><p>"),si=l("<div class=os-client-capability-wizard-outputs aria-label=预计产出><span>预计产出</span><p>");function ci(e){return e==="hpc"?"软件介绍":"模型介绍"}function oi(e){return`使用 ${e} 开始科研任务`}function di(e){if(!Ie({navigate:e.navigate,action:{type:"prompt",prompt:e.prompt,title:e.title,workflow:e.workflow},isLoggedIn:e.isLoggedIn}))return!1;const d=Pe({path:e.path,recent:e.recent,lastCodeWorkspace:e.lastCodeWorkspace})||Le(fe())||Fe(document,e.path);if(!d)return!1;const s=Te(d);return je(s,e.prompt),Re(s),e.openProject?.(d),e.touchCode?.(d),We({variant:"success",title:`已为你创建「${e.title}」任务`}),e.navigate(qe(d)),!0}function Xe(e){const d=$t(e.scenario),s=d[0];if(!s?.promptTemplate.trim()||!Ie({navigate:e.navigate,action:{type:"scenario-run",scenarioId:e.scenario.scenario_id,values:e.values},isLoggedIn:e.isLoggedIn}))return!1;const $=Pe({path:e.path,recent:e.recent,lastCodeWorkspace:e.lastCodeWorkspace})||Le(fe())||Fe(document,e.path);if(!$)return!1;const y=Te($);return vt(y,{title:e.scenario.name,scenarioId:e.scenario.scenario_id,values:e.values,steps:d}),je(y,_t(s,e.values)),Re(y),e.openProject?.($),e.touchCode?.($),We({variant:"success",title:`已创建「${e.scenario.name}」`,description:`将按 ${d.length} 步自动依次执行,缺参或失败时暂停`}),e.navigate(qe($)),!0}function Ye(e){if(!Ie({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),s=d?.scenarios.find(k=>k.id===e.scenarioId);if(!d||!s||!Be(d))return!1;const $=Pe({path:e.path,recent:e.recent,lastCodeWorkspace:e.lastCodeWorkspace})||Le(fe())||Fe(document,e.path);if(!$)return!1;const y=Te($);return je(y,e.prompt),Re(y),e.openProject?.($),e.touchCode?.($),We({variant:"success",title:`已为你创建 ${d.name}「${s.title}」任务`}),e.navigate(qe($)),!0}function me(e,d){return Gt(e.promptTemplate,d)}function Ke(e){return Object.fromEntries(e.fields.map(d=>[d.id,ui(d)]))}function ui(e){return e.default?.trim()?e.default:e.placeholder?.replace(/^例如[::]\s*/,"").trim()??""}function pi(){const e=st(),d=ct(),[s]=ot(),$=dt(),y=ut(),k=pt(),V=gt(),F=()=>Qe(e.id??""),de=()=>wt(d.search),Z=()=>yt(d.search,{category:F()?.category??"onemodel",domain:F()?.domain??"materials"}),ye=()=>St(e.id??"",de()),[C,K]=Ne({scenarioId:"",values:{},prompt:""}),[G,ae]=ht(""),M=()=>F()?.scenarios.find(r=>r.id===C.scenarioId),ue=W(()=>{const r=F();return r?mt({domain:r.domain,name:r.name,id:r.id}):[]}),v=W(()=>{const r=G();if(r)return ft(r)??ue().find(p=>p.scenario_id===r)}),T=()=>({navigate:$,isLoggedIn:!!fe(),path:y.data.path,recent:Ct(y.data.project),lastCodeWorkspace:V.projects.lastCode(),openProject:r=>k.projects.open(r),touchCode:r=>V.projects.touchCode(r)}),le=()=>{const r=M();r&&K("prompt",me(r,C.values))};bt(()=>{const r=F();if(!r?.scenarios.length)return;const p=s.scenario,_=(p?r.scenarios.find(Q=>Q.id===p):void 0)??r.scenarios[0],j=Ke(_);K({scenarioId:_.id,values:j,prompt:me(_,j)})});const N=r=>{const b=F()?.scenarios.find(j=>j.id===r);if(!b)return;ae("");const _=Ke(b);K({scenarioId:b.id,values:_,prompt:me(b,_)})},q=r=>{ae(r)},re=(r,p)=>{const b=M();if(!b)return;const _={...C.values,[r]:p};K({values:_,prompt:me(b,_)})},be=()=>{const r=F(),p=M();!r||!p||Ye({resourceId:r.id,scenarioId:p.id,values:{...C.values},prompt:C.prompt,...T()})},Se=(r,p)=>{Xe({scenario:r,values:p.values,...T()})};return(()=>{var r=Nt();return t(r,a(g,{get when(){return F()},get fallback(){return[a(Y,{class:"os-client-capability-wizard-backdrop",get href(){return Ue()},"aria-label":"关闭向导"}),(()=>{var p=Qt();return p.firstChild,t(p,a(Y,{get href(){return Ue()},children:"返回能力中心"}),null),p})()]},children:p=>a(g,{get when(){return Be(p())},get fallback(){return[a(Y,{class:"os-client-capability-wizard-backdrop",get href(){return Z()},"aria-label":"关闭向导"}),(()=>{var b=Yt(),_=b.firstChild,j=_.firstChild,Q=j.nextSibling;return Q.nextSibling,t(_,()=>p().name,Q),t(b,a(Y,{get href(){return Z()},children:"返回模型库"}),null),b})()]},get children(){return[a(Y,{class:"os-client-capability-wizard-backdrop",get href(){return Z()},"aria-label":"关闭向导"}),(()=>{var b=Xt(),_=b.firstChild,j=_.firstChild,Q=j.firstChild,O=_.nextSibling,pe=O.firstChild,we=pe.firstChild,B=we.nextSibling,ne=pe.nextSibling;ne.firstChild;var ge=ne.nextSibling,he=ge.firstChild,$e=he.firstChild,X=$e.nextSibling,ve=he.nextSibling,se=O.nextSibling,ce=se.firstChild;return t(_,a(Y,{class:"os-client-capability-wizard-intro-back",get href(){return ye()},get children(){return ci(p().category)}}),j),t(Q,()=>oi(p().name)),t(_,a(Y,{class:"os-client-capability-wizard-close",get href(){return Z()},"aria-label":"关闭",children:"×"}),null),t(B,a(U,{get each(){return p().scenarios},children:u=>(()=>{var o=Zt(),m=o.firstChild,x=m.nextSibling;return o.$$click=()=>N(u.id),t(m,()=>u.title),t(x,()=>u.summary),f(P=>{var R=!G()&&C.scenarioId===u.id,D=!G()&&C.scenarioId===u.id;return R!==P.e&&o.classList.toggle("is-active",P.e=R),D!==P.t&&A(o,"aria-pressed",P.t=D),P},{e:void 0,t:void 0}),o})()}),null),t(B,a(g,{get when(){return ue().length>0},get children(){var u=Bt();return u.firstChild,t(u,a(U,{get each(){return ue()},children:o=>(()=>{var m=Jt(),x=m.firstChild,P=x.nextSibling,R=P.nextSibling,D=R.firstChild,J=D.nextSibling;return J.nextSibling,m.$$click=()=>q(o.scenario_id),t(x,()=>o.name),t(P,()=>o.problem_and_applicability),t(R,()=>o.scenario_id,D),t(R,()=>o.workflow_steps?.length||o.workflow.length,J),f(E=>{var ee=G()===o.scenario_id,te=G()===o.scenario_id;return ee!==E.e&&m.classList.toggle("is-active",E.e=ee),te!==E.t&&A(m,"aria-pressed",E.t=te),E},{e:void 0,t:void 0}),m})()}),null),u}}),null),t(ne,a(g,{get when(){return M()},keyed:!0,get fallback(){return Ve()},children:u=>(()=>{var o=ti(),m=o.firstChild,x=m.nextSibling,P=x.firstChild,R=P.nextSibling,D=R.firstChild,J=D.firstChild,E=J.nextSibling,ee=D.nextSibling,te=ee.firstChild,Ce=te.nextSibling,i=ee.nextSibling,n=i.firstChild,c=n.nextSibling,w=i.nextSibling,S=w.firstChild,H=S.nextSibling;return t(m,a(U,{get each(){return u.fields},children:h=>(()=>{var L=ai(),ie=L.firstChild;return t(ie,()=>h.label),t(L,a(g,{get when(){return h.multiline},get fallback(){return(()=>{var I=li();return I.$$input=z=>re(h.id,z.currentTarget.value),f(()=>A(I,"placeholder",h.placeholder)),f(()=>I.value=C.values[h.id]??""),I})()},get children(){var I=ii();return I.$$input=z=>re(h.id,z.currentTarget.value),f(()=>A(I,"placeholder",h.placeholder)),f(()=>I.value=C.values[h.id]??""),I}}),null),L})()})),t(E,()=>u.capabilitySummary.current),t(Ce,()=>u.capabilitySummary.keyConfig),t(c,()=>u.capabilitySummary.resources),t(H,()=>u.capabilitySummary.deliverables),t(o,a(g,{get when(){return u.requiredData?.length},get children(){var h=ei(),L=h.firstChild,ie=L.nextSibling;return t(ie,a(U,{get each(){return u.requiredData},children:I=>(()=>{var z=ri();return t(z,I),z})()})),h}}),null),o})()}),null),t(ge,a(g,{get when(){return M()},keyed:!0,get fallback(){return Ve()},children:u=>[(()=>{var o=ni(),m=o.firstChild,x=m.nextSibling;return t(m,()=>u.title),t(x,()=>u.summary),o})(),(()=>{var o=si(),m=o.firstChild,x=m.nextSibling;return t(x,()=>u.expectedOutputs),o})()]}),he),X.$$click=le,ve.$$input=u=>K("prompt",u.currentTarget.value),t(se,a(Y,{get href(){return Z()},children:"返回能力中心"}),ce),ce.$$click=be,f(()=>ce.disabled=!C.prompt.trim()),f(()=>ve.value=C.prompt),b})(),a(g,{get when(){return v()},children:b=>a(Kt,{get scenario(){return b()},onClose:()=>ae(""),onSubmit:_=>Se(b(),_)})})]}})})),r})()}Ge(["click","input"]);const hi=Object.freeze(Object.defineProperty({__proto__:null,CapabilityWizardPage:pi,startCapabilityPromptTask:di,startCapabilityScenarioRunTask:Xe,startCapabilityWizardTask:Ye},Symbol.toStringTag,{value:"Module"}));export{Kt as S,Xe as a,Ye as b,di as s,hi as w};
|
|
1
|
+
import{b as Ke,m as Je,bf as Ne,d2 as He,x as et,o as W,d3 as tt,d4 as xe,d5 as ze,d6 as Me,d7 as oe,d8 as it,d9 as at,ak as _e,i as t,c as a,S as g,Q as f,F as U,T as A,R as Oe,da as lt,db as Ee,dc as rt,t as l,dd as nt,c$ as st,e as ct,de as ot,f as dt,h as ut,g as pt,l as gt,n as ht,ag as bt,X as Ie,aQ as Pe,r as Le,s as fe,aS as Fe,Z as Te,b3 as Re,Y as je,_ as We,E as qe,df as $t,dg as vt,dh as _t,b1 as Qe,bm as Be,di as mt,bk as ft,L as Y,bL as Ue,d0 as yt,bn as St,d1 as wt,aR as Ct}from"./index-BfLPI17v.js";var xt=l("<div class=os-client-capability-wizard-papers><h3>HPC 软件</h3><span>"),zt=l("<div class=os-client-capability-wizard-papers><h3>相关论文"),kt=l("<p class=os-client-capability-wizard-note>工作目录与运行环境由系统自动识别,本步只需填写下列业务参数。"),It=l("<p class=os-client-capability-wizard-missing>本步还有 <!> 个必填参数未填写。"),Pt=l("<p class=os-client-capability-wizard-missing>其他步骤还有 <!> 个必填参数未填写,可点击左侧步骤继续补全。"),ke=l("<small>"),Lt=l("<ul class=os-client-capability-wizard-output-list>"),Ft=l("<div class=os-client-capability-wizard-quality><strong>质量门禁</strong><p>"),Tt=l('<div class="os-client-capability-wizard-outputs os-client-capability-wizard-overall"aria-label=全局交付要点><div class=os-client-capability-wizard-outputs-head><span>全局交付要点</span></div><ul class=os-client-capability-wizard-output-list>'),Rt=l('<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>创建任务并自动逐步执行'),jt=l("<em>参数 <!>/"),Wt=l("<li><button type=button class=os-client-capability-wizard-step><span></span><div><p>"),qt=l("<a target=_blank rel=noreferrer> · "),Dt=l("<div class=os-client-capability-wizard-step-banner><strong>"),Ht=l("<p>"),Mt=l("<p class=os-client-capability-wizard-note>本步无需额外用户参数。"),Ot=l("<em>*"),Et=l("<textarea rows=3>"),Ut=l("<label class=os-client-capability-wizard-field><span>"),At=l("<input type=text>"),Vt=l("<p class=os-client-capability-wizard-outputs-empty>本步暂无结构化产出清单。"),Ae=l("<li>");function Gt(e){const d=Je(),[s,$]=Ne({values:He(e.scenario),attempted:!1,activeStepIndex:0});et(()=>{$({values:He(e.scenario),attempted:!1,activeStepIndex:0})});const y=W(()=>tt(e.scenario)),k=W(()=>y()[s.activeStepIndex]??y()[0]),V=W(()=>{const v=k();return v?xe(e.scenario,v):e.scenario.user_input}),F=W(()=>ze(e.scenario,s.values)),de=W(()=>V().filter(v=>Me(v)?!String(s.values[oe(v)]??"").trim():!1)),Z=W(()=>V().filter(v=>String(s.values[oe(v)]??"").trim()).length),ye=W(()=>{const T=k()?.prompt||e.scenario.ai_prompt?.template||"";return it(T,s.values)}),C=W(()=>k()?.outputs??[]),G=W(()=>at(e.scenario)),K=()=>(e.scenario.related_papers??[]).slice(0,3),ae=(v,T)=>{$("values",v,T)},M=v=>{$("activeStepIndex",v)},ue=()=>{$("attempted",!0);const v=ze(e.scenario,s.values);if(v.length===0){e.onSubmit({values:{...s.values}});return}const T=oe(v[0]),le=y().findIndex(N=>xe(e.scenario,N).some(q=>oe(q)===T));le>=0&&$("activeStepIndex",le),d.show(()=>a(nt,{title:"请补充必填参数",get reason(){return`还有 ${v.length} 个必填参数未填写,补充后即可创建任务并自动逐步执行。`},fields:v,get values(){return s.values},onConfirm:N=>{const q={...s.values,...N};$("values",q),!(ze(e.scenario,q).length>0)&&e.onSubmit({values:q})}}))};return(()=>{var v=Rt(),T=v.firstChild,le=T.nextSibling,N=le.firstChild,q=N.firstChild,re=q.nextSibling,be=re.firstChild,Se=be.nextSibling,r=re.nextSibling,p=N.nextSibling,b=p.firstChild,_=b.firstChild,R=_.nextSibling,Q=R.nextSibling,O=b.nextSibling,pe=O.firstChild,we=pe.firstChild,B=we.nextSibling,ne=B.firstChild,ge=ne.nextSibling,he=ge.nextSibling,$e=he.nextSibling;$e.nextSibling;var X=pe.nextSibling,ve=X.nextSibling,se=ve.firstChild,ce=se.nextSibling,u=O.nextSibling,o=u.firstChild,m=o.firstChild;m.firstChild;var x=o.nextSibling,P=x.firstChild,j=P.nextSibling,D=j.firstChild,J=D.nextSibling;J.nextSibling;var E=x.nextSibling,ee=p.nextSibling,te=ee.firstChild,Ce=te.nextSibling;return _e(T,"click",e.onClose,!0),_e(q,"click",e.onClose,!0),t(be,()=>e.scenario.name),t(Se,()=>e.scenario.problem_and_applicability),_e(r,"click",e.onClose,!0),t(Q,a(U,{get each(){return y()},children:(i,n)=>{const c=()=>xe(e.scenario,i),w=()=>c().filter(H=>String(s.values[oe(H)]??"").trim()).length,S=()=>c().length;return(()=>{var H=Wt(),h=H.firstChild,L=h.firstChild,ie=L.nextSibling,I=ie.firstChild;return h.$$click=()=>M(n()),t(L,()=>n()+1),t(I,()=>i.name),t(ie,a(g,{get when(){return i.purpose},get children(){var z=ke();return t(z,()=>i.purpose),z}}),null),t(ie,a(g,{get when(){return S()>0},get children(){var z=jt(),Ze=z.firstChild,De=Ze.nextSibling;return De.nextSibling,t(z,w,De),t(z,S,null),z}}),null),f(()=>H.classList.toggle("is-active",s.activeStepIndex===n())),H})()}})),t(b,a(g,{get when(){return e.scenario.HPC},get children(){var i=xt(),n=i.firstChild,c=n.nextSibling;return t(c,()=>e.scenario.HPC),i}}),null),t(b,a(g,{get when(){return K().length>0},get children(){var i=zt();return i.firstChild,t(i,a(U,{get each(){return K()},children:n=>(()=>{var c=qt(),w=c.firstChild;return t(c,()=>n.paper_id,w),t(c,()=>n.relation,null),f(()=>A(c,"href",n.url)),c})()}),null),i}}),null),t(B,()=>s.activeStepIndex+1,ne),t(B,()=>y().length,ge),t(B,Z,$e),t(B,()=>V().length,null),t(O,a(g,{get when(){return k()},children:i=>(()=>{var n=Dt(),c=n.firstChild;return t(c,()=>i().name),t(n,a(g,{get when(){return i().purpose},children:w=>(()=>{var S=Ht();return t(S,w),S})()}),null),n})()}),X),t(O,a(g,{get when(){return e.scenario.system_auto_detection?.fields?.length},get children(){return kt()}}),X),t(O,a(g,{get when(){return Oe(()=>!!s.attempted)()&&de().length>0},get children(){var i=It(),n=i.firstChild,c=n.nextSibling;return c.nextSibling,t(i,()=>de().length,c),i}}),X),t(O,a(g,{get when(){return Oe(()=>!!(s.attempted&&F().length>0))()&&de().length===0},get children(){var i=Pt(),n=i.firstChild,c=n.nextSibling;return c.nextSibling,t(i,()=>F().length,c),i}}),X),t(X,a(g,{get when(){return V().length>0},get fallback(){return Mt()},get children(){return a(U,{get each(){return V()},children:i=>{const n=oe(i),c=Me(i),w=s.attempted&&c&&!String(s.values[n]??"").trim();return(()=>{var S=Ut(),H=S.firstChild;return S.classList.toggle("is-required",!!c),S.classList.toggle("is-invalid",!!w),t(H,()=>lt(i),null),t(H,a(g,{when:c,get children(){return Ot()}}),null),t(S,a(g,{get when(){return rt(i)},get fallback(){return(()=>{var h=At();return h.$$input=L=>ae(n,L.currentTarget.value),f(()=>A(h,"placeholder",Ee(i))),f(()=>h.value=s.values[n]??""),h})()},get children(){var h=Et();return h.$$input=L=>ae(n,L.currentTarget.value),f(()=>A(h,"placeholder",Ee(i))),f(()=>h.value=s.values[n]??""),h}}),null),S})()}})}})),se.$$click=()=>M(Math.max(0,s.activeStepIndex-1)),ce.$$click=()=>M(Math.min(y().length-1,s.activeStepIndex+1)),t(m,a(g,{get when(){return k()?.result_subfolder},get children(){var i=ke();return t(i,()=>k()?.result_subfolder),f(()=>A(i,"title",k()?.result_subfolder)),i}}),null),t(o,a(g,{get when(){return C().length>0},get fallback(){return Vt()},get children(){var i=Lt();return t(i,a(U,{get each(){return C()},children:n=>(()=>{var c=Ae();return t(c,n),c})()})),i}}),null),t(o,a(g,{get when(){return k()?.quality_gate},get children(){var i=Ft(),n=i.firstChild,c=n.nextSibling;return t(c,()=>k()?.quality_gate),i}}),null),t(u,a(g,{get when(){return G().length>0},get children(){var i=Tt(),n=i.firstChild;n.firstChild;var c=n.nextSibling;return t(n,a(g,{get when(){return e.scenario.results_folder},get children(){var w=ke();return t(w,()=>e.scenario.results_folder),f(()=>A(w,"title",e.scenario.results_folder)),w}}),null),t(c,a(U,{get each(){return G().slice(0,6)},children:w=>(()=>{var S=Ae();return t(S,w),S})()})),i}}),x),t(j,()=>s.activeStepIndex+1,J),_e(te,"click",e.onClose,!0),Ce.$$click=ue,f(i=>{var n=s.activeStepIndex<=0,c=s.activeStepIndex>=y().length-1;return n!==i.e&&(se.disabled=i.e=n),c!==i.t&&(ce.disabled=i.t=c),i},{e:void 0,t:void 0}),f(()=>E.value=ye()),v})()}Ke(["click","input"]);function Kt(e,d){return e.replace(/\{\{(\w+)\}\}/g,(s,$)=>d[$]??"")}var Nt=l("<div class=os-client-capability-wizard-overlay role=dialog aria-modal=true aria-label=能力向导>"),Qt=l("<section class=os-client-capability-wizard-dialog><p>未找到该能力。"),Bt=l("<div class=os-client-capability-wizard-scenario-group><span>完整工作流场景"),Xt=l("<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>创建任务"),Yt=l("<section class=os-client-capability-wizard-dialog><p>「<!>」暂无 OneScience 源码或魔搭映射,当前不可使用。"),Zt=l("<button type=button><strong></strong><p>"),Jt=l("<button type=button><strong></strong><p></p><small> · <!> 步"),Ve=l("<p class=os-client-capability-wizard-empty>请先选择任务场景。"),ei=l("<div class=os-client-capability-wizard-required aria-label=该能力需要什么数据><h4>该能力需要什么数据</h4><ul>"),ti=l("<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>"),ii=l("<textarea rows=3>"),ai=l("<label class=os-client-capability-wizard-field><span>"),li=l("<input type=text>"),ri=l("<li>"),ni=l("<div class=os-client-capability-wizard-right-head><strong></strong><p>"),si=l("<div class=os-client-capability-wizard-outputs aria-label=预计产出><span>预计产出</span><p>");function ci(e){return e==="hpc"?"软件介绍":"模型介绍"}function oi(e){return`使用 ${e} 开始科研任务`}function di(e){if(!Ie({navigate:e.navigate,action:{type:"prompt",prompt:e.prompt,title:e.title,workflow:e.workflow},isLoggedIn:e.isLoggedIn}))return!1;const d=Pe({path:e.path,recent:e.recent,lastCodeWorkspace:e.lastCodeWorkspace})||Le(fe())||Fe(document,e.path);if(!d)return!1;const s=Te(d);return Re(s,e.prompt),je(s),e.openProject?.(d),e.touchCode?.(d),We({variant:"success",title:`已为你创建「${e.title}」任务`}),e.navigate(qe(d)),!0}function Xe(e){const d=$t(e.scenario),s=d[0];if(!s?.promptTemplate.trim()||!Ie({navigate:e.navigate,action:{type:"scenario-run",scenarioId:e.scenario.scenario_id,values:e.values},isLoggedIn:e.isLoggedIn}))return!1;const $=Pe({path:e.path,recent:e.recent,lastCodeWorkspace:e.lastCodeWorkspace})||Le(fe())||Fe(document,e.path);if(!$)return!1;const y=Te($);return vt(y,{title:e.scenario.name,scenarioId:e.scenario.scenario_id,values:e.values,steps:d}),Re(y,_t(s,e.values)),je(y),e.openProject?.($),e.touchCode?.($),We({variant:"success",title:`已创建「${e.scenario.name}」`,description:`将按 ${d.length} 步自动依次执行,缺参或失败时暂停`}),e.navigate(qe($)),!0}function Ye(e){if(!Ie({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),s=d?.scenarios.find(k=>k.id===e.scenarioId);if(!d||!s||!Be(d))return!1;const $=Pe({path:e.path,recent:e.recent,lastCodeWorkspace:e.lastCodeWorkspace})||Le(fe())||Fe(document,e.path);if(!$)return!1;const y=Te($);return Re(y,e.prompt),je(y),e.openProject?.($),e.touchCode?.($),We({variant:"success",title:`已为你创建 ${d.name}「${s.title}」任务`}),e.navigate(qe($)),!0}function me(e,d){return Kt(e.promptTemplate,d)}function Ge(e){return Object.fromEntries(e.fields.map(d=>[d.id,ui(d)]))}function ui(e){return e.default?.trim()?e.default:e.placeholder?.replace(/^例如[::]\s*/,"").trim()??""}function pi(){const e=st(),d=ct(),[s]=ot(),$=dt(),y=ut(),k=pt(),V=gt(),F=()=>Qe(e.id??""),de=()=>wt(d.search),Z=()=>yt(d.search,{category:F()?.category??"onemodel",domain:F()?.domain??"materials"}),ye=()=>St(e.id??"",de()),[C,G]=Ne({scenarioId:"",values:{},prompt:""}),[K,ae]=ht(""),M=()=>F()?.scenarios.find(r=>r.id===C.scenarioId),ue=W(()=>{const r=F();return r?mt({domain:r.domain,name:r.name,id:r.id}):[]}),v=W(()=>{const r=K();if(r)return ft(r)??ue().find(p=>p.scenario_id===r)}),T=()=>({navigate:$,isLoggedIn:!!fe(),path:y.data.path,recent:Ct(y.data.project),lastCodeWorkspace:V.projects.lastCode(),openProject:r=>k.projects.open(r),touchCode:r=>V.projects.touchCode(r)}),le=()=>{const r=M();r&&G("prompt",me(r,C.values))};bt(()=>{const r=F();if(!r?.scenarios.length)return;const p=s.scenario,_=(p?r.scenarios.find(Q=>Q.id===p):void 0)??r.scenarios[0],R=Ge(_);G({scenarioId:_.id,values:R,prompt:me(_,R)})});const N=r=>{const b=F()?.scenarios.find(R=>R.id===r);if(!b)return;ae("");const _=Ge(b);G({scenarioId:b.id,values:_,prompt:me(b,_)})},q=r=>{ae(r)},re=(r,p)=>{const b=M();if(!b)return;const _={...C.values,[r]:p};G({values:_,prompt:me(b,_)})},be=()=>{const r=F(),p=M();!r||!p||Ye({resourceId:r.id,scenarioId:p.id,values:{...C.values},prompt:C.prompt,...T()})},Se=(r,p)=>{Xe({scenario:r,values:p.values,...T()})};return(()=>{var r=Nt();return t(r,a(g,{get when(){return F()},get fallback(){return[a(Y,{class:"os-client-capability-wizard-backdrop",get href(){return Ue()},"aria-label":"关闭向导"}),(()=>{var p=Qt();return p.firstChild,t(p,a(Y,{get href(){return Ue()},children:"返回能力中心"}),null),p})()]},children:p=>a(g,{get when(){return Be(p())},get fallback(){return[a(Y,{class:"os-client-capability-wizard-backdrop",get href(){return Z()},"aria-label":"关闭向导"}),(()=>{var b=Yt(),_=b.firstChild,R=_.firstChild,Q=R.nextSibling;return Q.nextSibling,t(_,()=>p().name,Q),t(b,a(Y,{get href(){return Z()},children:"返回模型库"}),null),b})()]},get children(){return[a(Y,{class:"os-client-capability-wizard-backdrop",get href(){return Z()},"aria-label":"关闭向导"}),(()=>{var b=Xt(),_=b.firstChild,R=_.firstChild,Q=R.firstChild,O=_.nextSibling,pe=O.firstChild,we=pe.firstChild,B=we.nextSibling,ne=pe.nextSibling;ne.firstChild;var ge=ne.nextSibling,he=ge.firstChild,$e=he.firstChild,X=$e.nextSibling,ve=he.nextSibling,se=O.nextSibling,ce=se.firstChild;return t(_,a(Y,{class:"os-client-capability-wizard-intro-back",get href(){return ye()},get children(){return ci(p().category)}}),R),t(Q,()=>oi(p().name)),t(_,a(Y,{class:"os-client-capability-wizard-close",get href(){return Z()},"aria-label":"关闭",children:"×"}),null),t(B,a(U,{get each(){return p().scenarios},children:u=>(()=>{var o=Zt(),m=o.firstChild,x=m.nextSibling;return o.$$click=()=>N(u.id),t(m,()=>u.title),t(x,()=>u.summary),f(P=>{var j=!K()&&C.scenarioId===u.id,D=!K()&&C.scenarioId===u.id;return j!==P.e&&o.classList.toggle("is-active",P.e=j),D!==P.t&&A(o,"aria-pressed",P.t=D),P},{e:void 0,t:void 0}),o})()}),null),t(B,a(g,{get when(){return ue().length>0},get children(){var u=Bt();return u.firstChild,t(u,a(U,{get each(){return ue()},children:o=>(()=>{var m=Jt(),x=m.firstChild,P=x.nextSibling,j=P.nextSibling,D=j.firstChild,J=D.nextSibling;return J.nextSibling,m.$$click=()=>q(o.scenario_id),t(x,()=>o.name),t(P,()=>o.problem_and_applicability),t(j,()=>o.scenario_id,D),t(j,()=>o.workflow_steps?.length||o.workflow.length,J),f(E=>{var ee=K()===o.scenario_id,te=K()===o.scenario_id;return ee!==E.e&&m.classList.toggle("is-active",E.e=ee),te!==E.t&&A(m,"aria-pressed",E.t=te),E},{e:void 0,t:void 0}),m})()}),null),u}}),null),t(ne,a(g,{get when(){return M()},keyed:!0,get fallback(){return Ve()},children:u=>(()=>{var o=ti(),m=o.firstChild,x=m.nextSibling,P=x.firstChild,j=P.nextSibling,D=j.firstChild,J=D.firstChild,E=J.nextSibling,ee=D.nextSibling,te=ee.firstChild,Ce=te.nextSibling,i=ee.nextSibling,n=i.firstChild,c=n.nextSibling,w=i.nextSibling,S=w.firstChild,H=S.nextSibling;return t(m,a(U,{get each(){return u.fields},children:h=>(()=>{var L=ai(),ie=L.firstChild;return t(ie,()=>h.label),t(L,a(g,{get when(){return h.multiline},get fallback(){return(()=>{var I=li();return I.$$input=z=>re(h.id,z.currentTarget.value),f(()=>A(I,"placeholder",h.placeholder)),f(()=>I.value=C.values[h.id]??""),I})()},get children(){var I=ii();return I.$$input=z=>re(h.id,z.currentTarget.value),f(()=>A(I,"placeholder",h.placeholder)),f(()=>I.value=C.values[h.id]??""),I}}),null),L})()})),t(E,()=>u.capabilitySummary.current),t(Ce,()=>u.capabilitySummary.keyConfig),t(c,()=>u.capabilitySummary.resources),t(H,()=>u.capabilitySummary.deliverables),t(o,a(g,{get when(){return u.requiredData?.length},get children(){var h=ei(),L=h.firstChild,ie=L.nextSibling;return t(ie,a(U,{get each(){return u.requiredData},children:I=>(()=>{var z=ri();return t(z,I),z})()})),h}}),null),o})()}),null),t(ge,a(g,{get when(){return M()},keyed:!0,get fallback(){return Ve()},children:u=>[(()=>{var o=ni(),m=o.firstChild,x=m.nextSibling;return t(m,()=>u.title),t(x,()=>u.summary),o})(),(()=>{var o=si(),m=o.firstChild,x=m.nextSibling;return t(x,()=>u.expectedOutputs),o})()]}),he),X.$$click=le,ve.$$input=u=>G("prompt",u.currentTarget.value),t(se,a(Y,{get href(){return Z()},children:"返回能力中心"}),ce),ce.$$click=be,f(()=>ce.disabled=!C.prompt.trim()),f(()=>ve.value=C.prompt),b})(),a(g,{get when(){return v()},children:b=>a(Gt,{get scenario(){return b()},onClose:()=>ae(""),onSubmit:_=>Se(b(),_)})})]}})})),r})()}Ke(["click","input"]);const hi=Object.freeze(Object.defineProperty({__proto__:null,CapabilityWizardPage:pi,startCapabilityPromptTask:di,startCapabilityScenarioRunTask:Xe,startCapabilityWizardTask:Ye},Symbol.toStringTag,{value:"Module"}));export{Gt as S,Xe as a,Ye as b,di as s,hi 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-202609071715/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-202609071715/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-202609071715/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-202609071715/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-202609071715/favicon-96x96-v3.png" sizes="96x96" />
|
|
12
|
+
<link rel="shortcut icon" href="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609071715/favicon-v3.ico" />
|
|
13
|
+
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609071715/apple-touch-icon-v3.png" />
|
|
14
|
+
<link rel="manifest" href="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609071715/site.webmanifest" />
|
|
15
|
+
<link rel="preload" href="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609071715/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-202609071715/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-202609071715/social-share.png" />
|
|
20
|
+
<meta property="twitter:image" content="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609071715/social-share.png" />
|
|
21
|
+
<script id="oc-theme-preload-script" src="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609071715/oc-theme-preload.js"></script>
|
|
22
|
+
<script type="module" crossorigin src="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609071715/assets/index-BfLPI17v.js"></script>
|
|
23
|
+
<link rel="stylesheet" crossorigin href="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609071715/assets/index-BwtL4rk2.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-202609071715",
|
|
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-202609071715/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-202609041106/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-202609041106/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-202609041106/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-202609041106/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-202609041106/assets/bip-bop-09-CxEgoAHQ.aac";export{e as default};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{b as re,n as H,c as l,i as t,S as $,Q as D,a$ as Ne,t as d,b0 as Ve,X as ae,b1 as Ie,b2 as se,aQ as xe,r as Le,s as V,aS as De,Z as Pe,b3 as Oe,Y as Ee,_ as B,E as Te,b4 as Ge,e as Re,f as oe,l as ce,h as de,g as ue,o as N,aR as ge,ag as le,b5 as Ue,R as K,F as A,T as M,b6 as Ke,b7 as Ye,b8 as Xe,b9 as ee,ak as je,ba as Ze,bb as Je,bc as et,bd as tt,be as at,x as lt,bf as ie,bg as it,bh as $e,bi as nt,bj as fe,aU as rt,bk as G,bl as pe,bm as st,L as _e,bn as ot}from"./index-DSFO1zPs.js";import{m as ct,O as dt,S as ut,s as gt}from"./onescience-DnetzwjT.js";import{d as pt,r as bt,s as Ce,w as vt}from"./selection-BwmaAH41.js";import{s as ht,a as Se,b as yt,S as mt}from"./wizard-1E0A0kso.js";import"./onescience-docs-CH5KBTI9.js";var $t=d("<p class=os-client-capability-upload-error role=alert>"),ft=d('<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 _t(e){return e.split(/[,,、]/).map(i=>i.trim()).filter(Boolean)}function Ct(e){const[i,n]=H(""),[o,a]=H(""),[s,g]=H(""),[b,f]=H(""),S=()=>{n(""),a(""),g(""),f("")},y=()=>{S(),e.onClose()},v=c=>{c.preventDefault();const p=i().trim(),w=o().trim(),k=_t(s());if(!p||!w||k.length===0){f("请填写名称、简介和至少一个标签,以便生成与现有模型卡片一致的展示信息。");return}const P=Ve({name:p,blurb:w,tags:k,domain:e.domain});e.onSaved({id:P.id,name:P.name}),y()};return l($,{get when(){return e.open},get children(){var c=ft(),p=c.firstChild,w=p.nextSibling,k=w.firstChild,P=k.firstChild,x=P.nextSibling,Q=k.nextSibling,r=Q.nextSibling,L=r.firstChild,q=L.firstChild,W=q.nextSibling,R=W.nextSibling,_=L.nextSibling,I=_.firstChild,E=I.nextSibling,u=E.nextSibling,C=_.nextSibling,h=C.firstChild,O=h.firstChild,U=O.nextSibling,j=U.nextSibling,m=h.nextSibling,T=m.firstChild,z=T.nextSibling,Y=z.nextSibling,X=r.nextSibling,Z=X.firstChild;return p.$$click=y,w.addEventListener("submit",v),x.$$click=y,R.$$input=F=>n(F.currentTarget.value),u.$$input=F=>a(F.currentTarget.value),j.$$input=F=>g(F.currentTarget.value),t(w,l($,{get when(){return b()},get children(){var F=$t();return t(F,b),F}}),X),Z.$$click=y,D(()=>R.value=i()),D(()=>u.value=o()),D(()=>j.value=s()),D(()=>Y.value=Ne(e.domain)),c}})}re(["click","input"]);function St(e,i){return e.includes("modelscope download --model ")?e:`${e}
|
|
2
|
-
|
|
3
|
-
【从魔搭下载模型】
|
|
4
|
-
${ct(i,{kind:"local"})}`}function kt(e){const i=Ie(e);if(!i)throw new Error(`Unknown capability resource: ${e}`);if(!se(i))throw new Error(`Capability resource is not installable: ${e}`);const n=Ge(i);return{banner:i.install.banner,prompt:n?St(i.install.prompt,n):i.install.prompt}}function Me(e){if(!ae({navigate:e.navigate,action:{type:"install",resourceId:e.resourceId},isLoggedIn:e.isLoggedIn}))return!1;const i=Ie(e.resourceId);if(!i||!se(i))return!1;const{banner:n,prompt:o}=kt(e.resourceId),a=xe({path:e.path,recent:e.recent,lastCodeWorkspace:e.lastCodeWorkspace})||Le(V())||De(document,e.path);if(!a)return!1;const s=Pe(a);return Oe(s,o),Ee(s),e.openProject?.(a),e.touchCode?.(a),B({variant:"success",title:n}),e.navigate(Te(a)),!0}const wt={all:"全部",weather:"地球科学",materials:"材料化学",bio:"生命科学",fluid:"流体仿真"};var It=d('<section class=os-client-capability-resource-panel><header class="os-client-capability-page-section-head os-client-capability-page-section-head-active"><p>');function xt(e){return(()=>{var i=It(),n=i.firstChild,o=n.firstChild;return t(o,()=>e.copy.replace(/[。.]$/,"")),t(i,l(dt,{get filter(){return wt[e.domain]},get domainLabel(){return e.domainLabel}}),null),i})()}var Lt=d('<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>开发'),He=d("<span>"),Dt=d("<div>"),Pt=d("<button type=button class=os-client-capability-oneskills-expand>"),Ot=d("<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>"),Et=d("<p class=os-client-capability-empty>当前分类暂无技能卡片。"),Tt=d("<span class=os-client-capability-oneskills-count> 个技能"),Rt=d("<p class=os-client-capability-oneskills-error>"),Ut=d("<div class=os-client-capability-oneskills-top-row>"),jt=d("<div class=os-client-capability-oneskills-overview>"),Mt=d('<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>'),Ht=d("<p class=os-client-capability-empty>正在加载 OneSkills 技能..."),Wt=d("<p class=os-client-capability-empty>暂无可展示的 OneSkills 技能,请先安装或更新技能。");const ke=4,ne=new Set(["orchestrator","resource"]);function At(e,i){return e.layer===i.title||e.tags.includes(i.title)||e.tags.includes(i.id)}function Qt(e){return xe(e)||Ke(V(),e.lastCodeWorkspace)||Le(V())||De(document,e.path)}function Ft(e){const i=()=>e.item.tags.filter(n=>n!==e.item.layer&&n!==e.item.provider).slice(0,3);return(()=>{var n=Lt(),o=n.firstChild,a=o.firstChild,s=o.nextSibling,g=s.nextSibling,b=g.firstChild,f=g.nextSibling,S=f.firstChild,y=S.nextSibling;return je(n,"click",e.onOpen,!0),t(a,()=>e.item.title),t(s,()=>e.item.copy),t(b,()=>e.item.provider),t(g,l(A,{get each(){return i()},children:v=>(()=>{var c=He();return t(c,v),c})()}),null),S.$$click=v=>{v.stopPropagation(),e.onOpen()},y.$$click=v=>{v.stopPropagation(),e.onDevelop()},D(v=>{var c=e.layerId,p=e.canDevelop?void 0:"登录后使用";return c!==v.e&&M(n,"data-layer",v.e=c),p!==v.t&&M(y,"title",v.t=p),v},{e:void 0,t:void 0}),n})()}function we(e){const[i,n]=H(!1),o=()=>e.items.length,a=()=>Math.max(0,o()-ke),s=()=>i()||a()===0?e.items:e.items.slice(0,ke),g=()=>ne.has(e.group.id);return(()=>{var b=Ot(),f=b.firstChild,S=f.firstChild,y=S.firstChild,v=S.nextSibling;return t(y,()=>e.group.title),t(S,l($,{get when(){return o()>0},get children(){var c=He();return t(c,o),c}}),null),t(v,()=>e.group.copy),t(b,l($,{get when(){return o()>0},get fallback(){return Et()},get children(){return[(()=>{var c=Dt();return t(c,l(A,{get each(){return s()},children:p=>l(Ft,{item:p,get layerId(){return e.group.id},get canDevelop(){return e.canDevelop},onOpen:()=>e.onOpen(p),onDevelop:()=>e.onDevelop(p)})})),D(p=>{var w=!g(),k=!!g();return w!==p.e&&c.classList.toggle("os-client-capability-page-grid",p.e=w),k!==p.t&&c.classList.toggle("os-client-capability-oneskills-compact-grid",p.t=k),p},{e:void 0,t:void 0}),c})(),l($,{get when(){return K(()=>!g())()&&a()>0},get children(){var c=Pt();return c.$$click=()=>n(p=>!p),t(c,(()=>{var p=K(()=>!!i());return()=>p()?"收起":`展开其余 ${a()} 个`})()),D(()=>M(c,"aria-expanded",i())),c}})]}}),null),D(c=>{var p=e.group.id,w=!!e.compact,k=e.group.id;return p!==c.e&&M(b,"id",c.e=p),w!==c.t&&b.classList.toggle("is-compact",c.t=w),k!==c.a&&M(b,"data-layer",c.a=k),c},{e:void 0,t:void 0,a:void 0}),b})()}function qt(){const e=Re(),i=oe(),n=ce(),o=de(),a=ue(),[s,g]=H([]),[b,f]=H(!1),[S,y]=H(!1),[v,c]=H(),[p,w]=H(!1),[k,P]=H(),x=N(()=>!!V()?.account.id),Q=N(()=>Qt({path:o.data.path,recent:ge(o.data.project),lastCodeWorkspace:n.projects.lastCode()})),r=async()=>{const u=n.current;if(!u){g([]),f(!0);return}const C=await Ye(u.http.url,{limit:100});g(C.loaded?C.items:[]),f(!0)};le(()=>{const u=pt(e.search)??bt()?.domainId??"all";i(Ue("oneskills",u),{replace:!0}),r()});const L=u=>s().filter(C=>At(C,u)),q=()=>Ze.filter(u=>L(u).length>0),W=()=>{const u=q();return{pair:u.filter(C=>ne.has(C.id)),rest:u.filter(C=>!ne.has(C.id))}},R=u=>{P(u),w(!0)},_=()=>{w(!1),P(void 0)},I=u=>{if(!ae({navigate:i,action:{type:"prompt",prompt:""},isLoggedIn:x()}))return;const C=Q();if(!C){B({variant:"error",title:"无法开发",description:"未检测到工作目录"});return}const h=gt({id:u.id,title:u.title,copy:u.copy,layer:u.layer,tags:u.tags,provider:u.provider}),O=Pe(C);Oe(O,h.prompt,{skill:h.skill}),Ee(O),a.projects.open(C),n.projects.touchCode(C),w(!1),P(void 0),B({variant:"success",title:`已为你创建「${u.title}」开发任务`}),i(Te(C))},E=async()=>{if(!ae({navigate:i,action:{type:"install",resourceId:"oneskills"},isLoggedIn:x()}))return;const u=n.current,C=Q();if(!u){const h=ee();c(h),B({variant:"error",title:"更新失败",description:h});return}if(!C){const h=ee();c(h),B({variant:"error",title:"更新失败",description:h});return}y(!0),c(void 0);try{const h=await Xe(u.http.url,C);await r();const O=h.version?`版本 ${h.version} · ${h.skillCount} 个技能`:`${h.skillCount} 个技能`,U=h.seedSource==="bundled"&&h.seedFallbackReason?"原语已回退内置 seed":h.seedSource==="disk"?"原语已同步磁盘 oneskills":void 0;B({variant:"success",title:"OneSkills 已更新",description:U?`${O} · ${U}`:O})}catch(h){const O=ee(h instanceof Error?h.message:"更新 OneSkills 失败");c(O),B({variant:"error",title:"更新失败",description:O})}finally{y(!1)}};return(()=>{var u=Mt(),C=u.firstChild,h=C.firstChild;h.firstChild;var O=h.nextSibling,U=O.firstChild,j=U.firstChild;return t(h,l($,{get when(){return K(()=>!!b())()&&s().length>0},get children(){var m=Tt(),T=m.firstChild;return t(m,()=>s().length,T),m}}),null),t(O,l($,{get when(){return v()},get children(){var m=Rt();return t(m,v),m}}),U),j.$$click=()=>void E(),t(j,()=>S()?"更新中...":"更新 OneSkills"),t(u,l($,{get when(){return b()},get fallback(){return Ht()},get children(){return l($,{get when(){return s().length>0},get fallback(){return Wt()},get children(){var m=jt();return t(m,l($,{get when(){return W().pair.length>0},get children(){var T=Ut();return t(T,l(A,{get each(){return W().pair},children:z=>l(we,{group:z,get items(){return L(z)},compact:!0,get canDevelop(){return x()},onOpen:R,onDevelop:I})})),T}}),null),t(m,l(A,{get each(){return W().rest},children:T=>l(we,{group:T,get items(){return L(T)},get canDevelop(){return x()},onOpen:R,onDevelop:I})}),null),m}})}}),null),t(u,l(ut,{variant:"workbench",get item(){return k()},get open(){return p()},get serverUrl(){return n.current?.http.url},onClose:_,onDevelop:()=>{const m=k();m&&(_(),I(m))}}),null),D(m=>{var T=x()?void 0:"登录后使用",z=S();return T!==m.e&&M(U,"title",m.e=T),z!==m.t&&(j.disabled=m.t=z),m},{e:void 0,t:void 0}),u})()}re(["click"]);async function zt(e,i){const n=new URLSearchParams;n.set("limit","200");const o=await Je(`${et(e)}/experimental/onescience/scenario?${n}`);if(!o.ok)throw new Error(`scenario catalog failed: ${o.status}`);const s=((await o.json()).items??[]).map(g=>({...g,model_ids:g.model_ids?.length?g.model_ids:[g.model.trim().toLowerCase()]}));return tt(s),s}var Bt=d("<span>当前范围:"),Nt=d("<strong>全领域"),Vt=d("<small>OneSkills 原语跨领域通用,不区分材料 / 气象 / 流体 / 生信"),Gt=d("<div class=os-client-capability-domain-row role=tablist aria-label=能力中心领域>"),Kt=d("<div class=os-client-capability-scenario-grid>"),Yt=d("<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=搜索场景>"),Xt=d("<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>"),Zt=d("<span>当前领域:"),Jt=d("<strong>"),ea=d("<small>"),ta=d("<button type=button>"),aa=d("<button type=button class=os-client-capability-filter-tab role=tab><div class=os-client-capability-filter-tab-text><strong></strong><small>"),la=d("<p class=os-client-capability-hint>"),be=d("<span>"),ia=d("<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><span> 步工作流</span><span> 个字段</span></div><div class=os-client-capability-scenario-card-action><span>使用"),na=d("<button type=button class=os-client-capability-upload-trigger><span aria-hidden=true>+</span>上传私有模型"),ra=d("<label class=os-client-capability-catalog-search><span>搜索</span><input type=search placeholder=按名称、简介或标签筛选>"),sa=d("<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=展示方式>"),oa=d('<section class=os-client-capability-resource-panel><header class="os-client-capability-page-section-head os-client-capability-page-section-head-active"><p>'),ca=d("<p class=os-client-capability-empty>当前「<!>」领域暂无<!>卡片。"),da=d("<button type=button role=tab>"),ua=d("<p class=os-client-capability-empty>没有匹配的结果,试试换个关键词。"),ga=d("<div class=os-client-capability-catalog role=list>"),pa=d("<article class=os-client-capability-catalog-row role=listitem>"),ba=d("<div class=os-client-capability-page-grid>"),We=d("<span class=os-client-capability-private-badge>私有资产"),Ae=d("<span class=os-client-capability-unavailable-badge>暂不可用"),va=d("<div class=os-client-capability-meta>"),ha=d("<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>"),ya=d("<p class=os-client-capability-unavailable-hint>暂无 OneScience 源码或魔搭映射"),ma=d("<div class=os-client-capability-catalog-tags>"),$a=d("<div class=os-client-capability-catalog-copy><div class=os-client-capability-card-title><h4></h4></div><p>"),fa=d("<div>"),_a=d("<button type=button>安装");const Ca=[{id:"all",label:"全部"},{id:"materials",label:"材料"},{id:"weather",label:"气象"},{id:"fluid",label:"流体"},{id:"bio",label:"生信"}],Sa=[{id:"scenario",label:"场景",title:"场景库"},{id:"onemodel",label:"onemodel",title:"模型库"},{id:"hpc",label:"HPC 软件",title:"软件库"},{id:"onedata",label:"onedata",title:"数据集"},{id:"oneskills",label:"oneskills",title:"技能库"}],ka=[{id:"cards",label:"卡片"},{id:"list",label:"列表"}],Qe="os-capability-view-mode";function te(e){return e==="all"||e==="materials"||e==="weather"||e==="fluid"||e==="bio"?e:"all"}function wa(e){return e==="materials"||e==="weather"||e==="fluid"||e==="bio"?e:"materials"}function Ia(e,i){const n=e.split("?")[0]??e;return new RegExp(`^${ie.capabilities}/[^/]+`).test(n)?!new URLSearchParams(i).has("domain"):!1}function Wa(e){const i=Re(),n=oe(),o=Ce(i.pathname,i.search),[a,s]=at({domainId:te(o.domainId),categoryId:o.categoryId,scenarioQuery:"",activeScenarioId:"",uploadPage:null,scenarioCatalogTick:0}),g=de(),b=ue(),f=ce();le(()=>{const r=f.current?.http.url;r&&zt(r).then(()=>s("scenarioCatalogTick",L=>L+1)).catch(()=>{})});const S=r=>{vt({categoryId:r.categoryId,domainId:te(r.domainId)})},y=r=>{S(r),n(Ue(r.categoryId,r.domainId),{replace:!0})};lt(()=>{const r=i.pathname,L=i.search,q=Ce(r,L);if(Ia(r,L)){s("categoryId",q.categoryId);return}const W=te(q.domainId),R=q.categoryId;s({domainId:W,categoryId:R}),S({domainId:W,categoryId:R});const _=r.split("?")[0]??r,I=_===ie.capabilities||_===`${ie.capabilities}/`,E=new URLSearchParams(L);I&&!E.get("category")&&!E.get("domain")&&y({domainId:W,categoryId:R})});const v=N(()=>(it(),a.domainId==="all"?$e():$e(a.domainId))),c=N(()=>v().find(r=>r.id===a.categoryId)??v()[0]),p=N(()=>(a.scenarioCatalogTick,nt(a.domainId,a.scenarioQuery))),w=N(()=>{if(a.scenarioCatalogTick,!!a.activeScenarioId)return fe(a.activeScenarioId)}),k=r=>{s({categoryId:r,activeScenarioId:"",scenarioQuery:r==="scenario"?a.scenarioQuery:""}),y({domainId:a.domainId,categoryId:r})},P=()=>s("activeScenarioId",""),x=()=>({navigate:n,isLoggedIn:!!V(),path:g.data.path,recent:ge(g.data.project),lastCodeWorkspace:f.projects.lastCode(),openProject:r=>b.projects.open(r),touchCode:r=>f.projects.touchCode(r)});le(()=>{const r=rt();if(r)try{if(r.type==="install"){if(r.resourceId==="oneskills"){s("categoryId","oneskills"),y({domainId:a.domainId,categoryId:"oneskills"});return}if(r.resourceId.startsWith("__"))return;Me({resourceId:r.resourceId,...x()});return}if(r.type==="prompt"&&r.prompt.trim()){ht({prompt:r.prompt,title:r.title||"能力中心任务",workflow:r.workflow,...x()});return}if(r.type==="scenario-run"){const L=fe(r.scenarioId);if(!L)return;Se({scenario:L,values:r.values,...x()});return}r.type==="wizard"&&yt({resourceId:r.resourceId,scenarioId:r.scenarioId,values:r.values,prompt:r.prompt,...x()})}catch{}});const Q=(r,L)=>{Se({scenario:r,values:L.values,...x()})};return(()=>{var r=Xt(),L=r.firstChild,q=L.firstChild,W=q.nextSibling,R=L.nextSibling;return t(q,l($,{get when(){return a.categoryId==="oneskills"},get fallback(){return[Zt(),(()=>{var _=Jt();return t(_,()=>G(a.domainId)),_})(),(()=>{var _=ea();return t(_,()=>a.categoryId==="scenario"?"切换领域后,下方场景同步刷新":"切换领域后,下方模型、HPC 软件与数据集内容同步刷新"),_})()]},get children(){return[Bt(),Nt(),Vt()]}})),t(L,l($,{get when(){return a.categoryId!=="oneskills"},get children(){var _=Gt();return t(_,l(A,{each:Ca,children:I=>(()=>{var E=ta();return E.$$click=()=>{s({domainId:I.id,activeScenarioId:"",scenarioQuery:""}),y({domainId:I.id,categoryId:a.categoryId})},t(E,()=>I.label),D(u=>{var C=I.id===a.domainId,h=I.id===a.domainId;return C!==u.e&&E.classList.toggle("is-active",u.e=C),h!==u.t&&M(E,"aria-pressed",u.t=h),u},{e:void 0,t:void 0}),E})()})),_}}),W),t(W,l(A,{each:Sa,children:_=>(()=>{var I=aa(),E=I.firstChild,u=E.firstChild,C=u.nextSibling;return I.$$click=()=>k(_.id),t(u,()=>_.label),t(C,()=>_.title),D(h=>{var O=a.categoryId===_.id,U=a.categoryId===_.id;return O!==h.e&&I.classList.toggle("is-active",h.e=O),U!==h.t&&M(I,"aria-selected",h.t=U),h},{e:void 0,t:void 0}),I})()})),t(R,l($,{get when(){return a.categoryId==="oneskills"},get children(){return l(qt,{})}}),null),t(R,l($,{get when(){return a.categoryId==="scenario"},get children(){var _=Yt(),I=_.firstChild,E=I.firstChild,u=E.nextSibling,C=u.nextSibling,h=C.firstChild,O=C.nextSibling,U=O.firstChild;return t(u,()=>p().length),t(C,()=>G(a.domainId),h),U.$$input=j=>s("scenarioQuery",j.currentTarget.value),t(_,l($,{get when(){return p().length>0},get fallback(){return(()=>{var j=la();return t(j,(()=>{var m=K(()=>!!a.scenarioQuery.trim());return()=>m()?`未找到匹配「${a.scenarioQuery.trim()}」的场景。`:`当前「${G(a.domainId)}」领域暂无场景卡片。`})()),j})()},get children(){var j=Kt();return t(j,l(A,{get each(){return p()},children:m=>(()=>{var T=ia(),z=T.firstChild,Y=z.firstChild,X=Y.nextSibling,Z=z.nextSibling,F=Z.nextSibling,ve=F.firstChild,he=ve.nextSibling,J=he.nextSibling,ze=J.firstChild,ye=J.nextSibling,Be=ye.firstChild;return T.$$click=()=>s("activeScenarioId",m.scenario_id),t(Y,()=>m.name),t(X,()=>m.scenario_id),t(Z,()=>m.problem_and_applicability),t(ve,()=>m.type),t(he,()=>m.model),t(F,l($,{get when(){return m.HPC},get children(){var me=be();return t(me,()=>m.HPC),me}}),J),t(J,()=>m.workflow_steps?.length||m.workflow.length,ze),t(ye,()=>m.user_input.length,Be),T})()})),j}}),null),D(()=>U.value=a.scenarioQuery),_}}),null),t(R,l($,{get when(){return a.categoryId==="onemodel"||a.categoryId==="hpc"},get children(){return l(xa,{get category(){return c()},get domainId(){return a.domainId},get domainLabel(){return G(a.domainId)},get onUpload(){return a.categoryId==="onemodel"?()=>s("uploadPage","models"):void 0}})}}),null),t(R,l($,{get when(){return a.categoryId==="onedata"},get children(){return l(xt,{get domain(){return a.domainId},get domainLabel(){return G(a.domainId)},get copy(){return c().copy}})}}),null),t(r,l($,{get when(){return w()},children:_=>l(mt,{get scenario(){return _()},onClose:P,onSubmit:I=>Q(_(),I)})}),null),t(r,l(Ct,{get open(){return a.uploadPage!==null},page:"models",get domain(){return wa(a.domainId)},onClose:()=>s("uploadPage",null),onSaved:()=>{s({categoryId:"onemodel",uploadPage:null,activeScenarioId:""}),y({domainId:a.domainId,categoryId:"onemodel"})}}),null),t(r,()=>e.children,null),r})()}function xa(e){const[i,n]=H(""),[o,a]=H(Ea()),s=()=>({category:e.category.id,domain:e.domainId}),g=N(()=>{const f=i().trim().toLowerCase();return f?e.category.items.filter(S=>[S.name,S.blurb,...S.tags].some(y=>y.toLowerCase().includes(f))):e.category.items}),b=f=>{a(f),Ta(f)};return(()=>{var f=oa(),S=f.firstChild,y=S.firstChild;return t(y,()=>e.category.copy.replace(/[。.]$/,"")),t(S,l($,{get when(){return e.onUpload},get children(){var v=na();return je(v,"click",e.onUpload,!0),v}}),null),t(f,l($,{get when(){return e.category.items.length>0},get fallback(){return(()=>{var v=ca(),c=v.firstChild,p=c.nextSibling,w=p.nextSibling,k=w.nextSibling;return k.nextSibling,t(v,()=>e.domainLabel,p),t(v,()=>e.category.id==="hpc"?" HPC 软件":"模型",k),v})()},get children(){return[(()=>{var v=sa(),c=v.firstChild,p=c.firstChild,w=p.nextSibling;return t(v,l($,{get when(){return e.category.items.length>=6},get children(){var k=ra(),P=k.firstChild,x=P.nextSibling;return x.$$input=Q=>n(Q.currentTarget.value),D(()=>x.value=i()),k}}),c),t(p,(()=>{var k=K(()=>g().length===e.category.items.length);return()=>k()?`共 ${e.category.items.length} 项`:`${g().length} / ${e.category.items.length} 项`})()),t(w,l(A,{each:ka,children:k=>(()=>{var P=da();return P.$$click=()=>b(k.id),t(P,()=>k.label),D(x=>{var Q=o()===k.id,r=o()===k.id;return Q!==x.e&&M(P,"aria-selected",x.e=Q),r!==x.t&&P.classList.toggle("is-active",x.t=r),x},{e:void 0,t:void 0}),P})()})),v})(),l($,{get when(){return g().length>0},get fallback(){return ua()},get children(){return[l($,{get when(){return o()==="list"},get children(){return l(La,{get items(){return g()},get catalog(){return s()}})}}),l($,{get when(){return o()==="cards"},get children(){return l(Da,{get items(){return g()},get catalog(){return s()}})}})]}})]}}),null),f})()}function La(e){return(()=>{var i=ga();return t(i,l(A,{get each(){return e.items},children:n=>{const o=()=>pe(n);return(()=>{var a=pa();return t(a,l(Pa,{item:n}),null),t(a,l($,{get when(){return o()},get fallback(){return l(Fe,{})},get children(){return l(qe,{item:n,get catalog(){return e.catalog}})}}),null),D(s=>{var g=n.ownership==="private",b=!o(),f=o()?void 0:!0,S=o()?void 0:"暂无 OneScience 源码或魔搭映射,暂不可用";return g!==s.e&&a.classList.toggle("is-private",s.e=g),b!==s.t&&a.classList.toggle("is-unavailable",s.t=b),f!==s.a&&M(a,"aria-disabled",s.a=f),S!==s.o&&M(a,"title",s.o=S),s},{e:void 0,t:void 0,a:void 0,o:void 0}),a})()}})),i})()}function Da(e){return(()=>{var i=ba();return t(i,l(A,{get each(){return e.items},children:n=>{const o=()=>pe(n);return(()=>{var a=ha(),s=a.firstChild,g=s.firstChild,b=g.firstChild,f=b.firstChild,S=g.nextSibling;return t(f,()=>n.name),t(b,l($,{get when(){return n.ownership==="private"},get children(){return We()}}),null),t(b,l($,{get when(){return!o()},get children(){return Ae()}}),null),t(g,l($,{get when(){return n.tags.length>0},get children(){var y=va();return t(y,l(A,{get each(){return n.tags},children:v=>(()=>{var c=be();return t(c,v),c})()})),y}}),null),t(S,()=>n.blurb),t(a,l($,{get when(){return o()},get fallback(){return l(Fe,{variant:"card"})},get children(){return l(qe,{item:n,variant:"card",get catalog(){return e.catalog}})}}),null),D(y=>{var v=n.ownership==="private",c=!o(),p=o()?void 0:!0,w=o()?void 0:"暂无 OneScience 源码或魔搭映射,暂不可用";return v!==y.e&&a.classList.toggle("is-private",y.e=v),c!==y.t&&a.classList.toggle("is-unavailable",y.t=c),p!==y.a&&M(a,"aria-disabled",y.a=p),w!==y.o&&M(a,"title",y.o=w),y},{e:void 0,t:void 0,a:void 0,o:void 0}),a})()}})),i})()}function Fe(e){return(()=>{var i=ya();return D(()=>i.classList.toggle("os-client-capability-unavailable-hint-card",e.variant==="card")),i})()}function Pa(e){return(()=>{var i=$a(),n=i.firstChild,o=n.firstChild,a=n.nextSibling;return t(o,()=>e.item.name),t(n,l($,{get when(){return e.item.ownership==="private"},get children(){return We()}}),null),t(n,l($,{get when(){return!pe(e.item)},get children(){return Ae()}}),null),t(a,()=>e.item.blurb),t(i,l($,{get when(){return e.item.tags.length>0},get children(){var s=ma();return t(s,l(A,{get each(){return e.item.tags},children:g=>(()=>{var b=be();return t(b,g),b})()})),s}}),null),i})()}function qe(e){const i=()=>e.catalog?{category:e.catalog.category,domain:e.catalog.domain}:void 0;return(()=>{var n=fa();return t(n,l(_e,{get href(){return st(e.item.id,i())},children:"详情"}),null),t(n,l(Oa,{get item(){return e.item}}),null),t(n,l(_e,{get href(){return ot(e.item.id,void 0,i())},"data-primary":"true",children:"使用"}),null),D(o=>{var a=e.variant!=="card",s=e.variant==="card";return a!==o.e&&n.classList.toggle("os-client-capability-catalog-actions",o.e=a),s!==o.t&&n.classList.toggle("os-client-capability-actions",o.t=s),o},{e:void 0,t:void 0}),n})()}function Oa(e){const i=oe(),n=de(),o=ue(),a=ce(),s=()=>se(e.item);return(()=>{var g=_a();return g.$$click=()=>{s()&&Me({resourceId:e.item.id,navigate:i,isLoggedIn:!!V(),path:n.data.path,recent:ge(n.data.project),lastCodeWorkspace:a.projects.lastCode(),openProject:b=>o.projects.open(b),touchCode:b=>a.projects.touchCode(b)})},D(b=>{var f=!s(),S=s()?void 0:"暂无魔搭安装包";return f!==b.e&&(g.disabled=b.e=f),S!==b.t&&M(g,"title",b.t=S),b},{e:void 0,t:void 0}),g})()}function Ea(){if(typeof localStorage>"u")return"cards";const e=localStorage.getItem(Qe);return e==="cards"||e==="list"?e:"cards"}function Ta(e){typeof localStorage>"u"||localStorage.setItem(Qe,e)}re(["input","click"]);export{Wa as CapabilityCenterPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609041106/assets/nope-12-BJR1Ka3c.aac";export{e as default};
|