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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/assets/{3Dmol-B1rQmimB.js → 3Dmol-RKDiXaRg.js} +1 -1
  2. package/assets/{account-system-Djs3bQsY.js → account-system-DFYTCeNL.js} +1 -1
  3. package/assets/{alert-04-DQgxnbZj.js → alert-01-B6SjnkXH.js} +1 -1
  4. package/assets/{alert-05-DieKTu9h.js → alert-02-Bn6728rM.js} +1 -1
  5. package/assets/{alert-01-BzJJ-zh_.js → alert-04-jmqtByAD.js} +1 -1
  6. package/assets/{alert-02-DuklsSJE.js → alert-05-CE6tI9A0.js} +1 -1
  7. package/assets/alert-06-BAi_L4zP.js +1 -0
  8. package/assets/alert-07-Cn7ZOenp.js +1 -0
  9. package/assets/alert-08-D6LHIgAM.js +1 -0
  10. package/assets/alert-10-be3tLNNN.js +1 -0
  11. package/assets/{bip-bop-03-8uYDh5fD.js → bip-bop-03-hI-vWCWS.js} +1 -1
  12. package/assets/{bip-bop-04-D7J2V_pQ.js → bip-bop-04-Cgr5t3Zo.js} +1 -1
  13. package/assets/{bip-bop-06-DVe4G3q4.js → bip-bop-06-eb5ijA50.js} +1 -1
  14. package/assets/{bip-bop-08-BR47Ixqy.js → bip-bop-08-khYj4LJQ.js} +1 -1
  15. package/assets/bip-bop-09-DFPW_zRQ.js +1 -0
  16. package/assets/center-BVBFp6ru.js +5 -0
  17. package/assets/{dialog-edit-project-Dsv8HvjS.js → dialog-edit-project-tcU9hl39.js} +1 -1
  18. package/assets/{dialog-fork-CA3inOLr.js → dialog-fork-uQ5csZRc.js} +1 -1
  19. package/assets/dialog-project-upload-CsReduwu.js +2 -0
  20. package/assets/{dialog-select-file-BrLiSa0e.js → dialog-select-file-BfPPNy9k.js} +1 -1
  21. package/assets/{dialog-select-model-CMF-xmbD.js → dialog-select-model-C52crykE.js} +2 -2
  22. package/assets/{dialog-terminal-unavailable-BOUZ3KsI.js → dialog-terminal-unavailable-BkHYaj5Y.js} +2 -2
  23. package/assets/{docs-BzOnK23f.js → docs-CNwLKp7S.js} +1 -1
  24. package/assets/{ghostty-web-l4q7-PU1.js → ghostty-web-BjYePGZA.js} +1 -1
  25. package/assets/home-ChQHvRIz.js +1 -0
  26. package/assets/{index-BfLPI17v.js → index-BwlDF8Yo.js} +249 -249
  27. package/assets/{index-BwtL4rk2.css → index-C08Qpyxg.css} +1 -1
  28. package/assets/{intro-BJgVhMkF.js → intro-ClyaOLOp.js} +1 -1
  29. package/assets/{nope-02-CruCGsk0.js → nope-02-eTwBuVFA.js} +1 -1
  30. package/assets/{nope-05-Dxj-phOs.js → nope-05-nRSq_Cvk.js} +1 -1
  31. package/assets/{nope-08-DcEjC0yF.js → nope-08-CT0ZPkUQ.js} +1 -1
  32. package/assets/{nope-11-Dkkp3vCv.js → nope-11-Dee-nhac.js} +1 -1
  33. package/assets/nope-12-BcNQ0hvD.js +1 -0
  34. package/assets/{onescience-DMXJ1nYb.js → onescience-BoAw7Siq.js} +1 -1
  35. package/assets/{resources-BtRvjjW6.js → resources-DGV7mmBh.js} +2 -2
  36. package/assets/{selection-BDKVpung.js → selection-rjfgbO6y.js} +1 -1
  37. package/assets/shell-Bdw4x3qZ.js +2 -0
  38. package/assets/{skills-Cr1Txx6V.js → skills-CReL5hzR.js} +1 -1
  39. package/assets/{staplebops-03-C9ZA5vYl.js → staplebops-03-Bnug52UI.js} +1 -1
  40. package/assets/{staplebops-04-C8RBLMc9.js → staplebops-04-tlRw4aZh.js} +1 -1
  41. package/assets/{staplebops-06-hRBlO_Jx.js → staplebops-06-BQHHghSz.js} +1 -1
  42. package/assets/{staplebops-07-C4Pmn4wy.js → staplebops-07-CBHBHWCe.js} +1 -1
  43. package/assets/status-popover-body-BSpw3lkO.js +2 -0
  44. package/assets/wizard-vRbib2EA.js +1 -0
  45. package/assets/{yup-01-CCyquaXC.js → yup-01-CTfekeWH.js} +1 -1
  46. package/assets/{yup-03-DUKtblGi.js → yup-03-DZ9dhDcC.js} +1 -1
  47. package/assets/{yup-04-Djw3oL2g.js → yup-04-EIrCkyiu.js} +1 -1
  48. package/assets/{yup-05-BPnDQKpc.js → yup-05-C5sTiBKc.js} +1 -1
  49. package/index.html +11 -11
  50. package/package.json +2 -2
  51. package/assets/alert-06-CdNX1MFF.js +0 -1
  52. package/assets/alert-07-D8bcb829.js +0 -1
  53. package/assets/alert-08-DwxXD9Jv.js +0 -1
  54. package/assets/alert-10-O1JGraHb.js +0 -1
  55. package/assets/bip-bop-09-Ba1Kwga0.js +0 -1
  56. package/assets/center-BHSp0APF.js +0 -5
  57. package/assets/dialog-project-upload-Bs1_9kHj.js +0 -2
  58. package/assets/home-C3y_A1-6.js +0 -1
  59. package/assets/nope-12-DAx93zTR.js +0 -1
  60. package/assets/shell-M6Hcceef.js +0 -2
  61. package/assets/status-popover-body-CwhO-ly1.js +0 -2
  62. package/assets/wizard-DfNLXs5i.js +0 -1
@@ -1,5 +0,0 @@
1
- import{b as Ee,n as P,c as l,i as t,S as p,Q as k,a$ as Pt,t as i,b0 as Tt,X as Me,b1 as pt,b2 as Ne,aQ as Be,r as Ve,s as pe,aS as Ge,Z as gt,b3 as bt,Y as ht,_ as we,E as yt,b4 as Et,b5 as vt,b6 as $t,l as Re,h as Oe,e as Je,f as Ue,o as ne,aR as je,b7 as mt,b8 as Rt,x as ft,T as B,F as V,R as ce,g as Ye,ag as Qe,b9 as _t,ba as Ot,bb as Ut,bc as Ke,ak as wt,bd as jt,be as At,bf as qt,bg as Fe,bh as Kt,bi as rt,bj as Wt,bk as lt,aU as Ht,bl as xe,bm as Xe,bn as Mt,L as nt,bo as Qt}from"./index-BfLPI17v.js";import{m as Ft,O as zt,S as Nt,s as Bt}from"./onescience-DMXJ1nYb.js";import{d as Vt,r as Gt,s as it,w as Jt}from"./selection-BDKVpung.js";import{s as Yt,a as st,b as Xt,S as Zt}from"./wizard-DfNLXs5i.js";import"./onescience-docs-CH5KBTI9.js";var ea=i("<p class=os-client-capability-upload-error role=alert>"),ta=i('<div class=os-client-capability-wizard-overlay role=dialog aria-modal=true aria-label=上传私有模型><button type=button class=os-client-capability-wizard-backdrop aria-label=关闭上传></button><form class=os-client-capability-upload-dialog><header class=os-client-capability-upload-head><div class=os-client-capability-upload-head-copy><div class=os-client-capability-upload-eyebrow>私有资产 · 模型</div><h2>上传私有模型</h2><p>填写与模型卡片一致的基础信息。保存后会出现在当前领域的 onemodel 列表,并标注为私有资产。</p></div><button type=button class=os-client-capability-upload-close aria-label=关闭>×</button></header><div class=os-client-capability-upload-notice role=note><strong>后台登记为 AI 原语</strong><p>AI 原语是后台知识资产体系,不对用户单独展示。上传后会自动登记,供 Agent 检索与编排时利用该模型知识。</p></div><div class=os-client-capability-upload-body><label class=os-client-capability-upload-field><span>名称<span class=os-client-capability-upload-required> *</span></span><small>显示在模型卡片标题</small><input maxlength=64 required placeholder="例如:团队内部微调 MACE"></label><label class=os-client-capability-upload-field><span>简介<span class=os-client-capability-upload-required> *</span></span><small>对应卡片正文,建议 1–2 句说明用途与适用场景</small><textarea maxlength=160 required rows=3 placeholder="例如:面向界面体系的内部势函数,可用于弛豫与短时程 MD 冒烟"></textarea></label><div class=os-client-capability-upload-grid data-cols=2><label class=os-client-capability-upload-field><span>标签<span class=os-client-capability-upload-required> *</span></span><small>逗号分隔,将显示为卡片标签;系统会自动加上「私有」</small><input required placeholder="例如:mlff, 界面, 内部模型"></label><label class=os-client-capability-upload-field><span>领域</span><small>跟随当前能力中心领域,卡片会出现在该领域下</small><input class=is-readonly readonly></label></div></div><footer class=os-client-capability-upload-actions><button type=button>取消</button><button type=submit data-primary=true>保存并发布');function aa(e){return e.split(/[,,、]/).map(a=>a.trim()).filter(Boolean)}function ra(e){const[a,n]=P(""),[s,r]=P(""),[c,b]=P(""),[g,C]=P(""),D=()=>{n(""),r(""),b(""),C("")},_=()=>{D(),e.onClose()},f=u=>{u.preventDefault();const d=a().trim(),O=s().trim(),v=aa(c());if(!d||!O||v.length===0){C("请填写名称、简介和至少一个标签,以便生成与现有模型卡片一致的展示信息。");return}const M=Tt({name:d,blurb:O,tags:v,domain:e.domain});e.onSaved({id:M.id,name:M.name}),_()};return l(p,{get when(){return e.open},get children(){var u=ta(),d=u.firstChild,O=d.nextSibling,v=O.firstChild,M=v.firstChild,q=M.nextSibling,X=v.nextSibling,o=X.nextSibling,j=o.firstChild,ie=j.firstChild,Q=ie.nextSibling,G=Q.nextSibling,x=j.nextSibling,K=x.firstChild,F=K.nextSibling,h=F.nextSibling,I=x.nextSibling,w=I.firstChild,W=w.firstChild,Z=W.nextSibling,J=Z.nextSibling,S=w.nextSibling,z=S.firstChild,se=z.nextSibling,ge=se.nextSibling,$e=o.nextSibling,be=$e.firstChild;return d.$$click=_,O.addEventListener("submit",f),q.$$click=_,G.$$input=ae=>n(ae.currentTarget.value),h.$$input=ae=>r(ae.currentTarget.value),J.$$input=ae=>b(ae.currentTarget.value),t(O,l(p,{get when(){return g()},get children(){var ae=ea();return t(ae,g),ae}}),$e),be.$$click=_,k(()=>G.value=a()),k(()=>h.value=s()),k(()=>J.value=c()),k(()=>ge.value=Pt(e.domain)),u}})}Ee(["click","input"]);function la(e,a){return e.includes("modelscope download --model ")?e:`${e}
2
-
3
- 【从魔搭下载模型】
4
- ${Ft(a,{kind:"local"})}`}function na(e){const a=pt(e);if(!a)throw new Error(`Unknown capability resource: ${e}`);if(!Ne(a))throw new Error(`Capability resource is not installable: ${e}`);const n=Et(a);return{banner:a.install.banner,prompt:n?la(a.install.prompt,n):a.install.prompt}}function St(e){if(!Me({navigate:e.navigate,action:{type:"install",resourceId:e.resourceId},isLoggedIn:e.isLoggedIn}))return!1;const a=pt(e.resourceId);if(!a||!Ne(a))return!1;const{banner:n,prompt:s}=na(e.resourceId),r=Be({path:e.path,recent:e.recent,lastCodeWorkspace:e.lastCodeWorkspace})||Ve(pe())||Ge(document,e.path);if(!r)return!1;const c=gt(r);return bt(c,s),ht(c),e.openProject?.(r),e.touchCode?.(r),we({variant:"success",title:n}),e.navigate(yt(r)),!0}async function te(e,a,n){const s=await vt(`${$t(e)}${a}`,{...n,headers:{"content-type":"application/json",...n?.headers??{}}});if(!s.ok){const r=await s.text().catch(()=>"");throw new Error(r||`Request failed (${s.status})`)}return await s.json()}function ia(e,a){const n=new URLSearchParams;return a?.domain&&a.domain!=="all"&&n.set("domain",a.domain),te(e,`/experimental/onescience/raw-source?${n}`)}function sa(e,a){const n=new URLSearchParams({scope:a.scope});return a.domain&&a.domain!=="all"&&n.set("domain",a.domain),te(e,`/experimental/onescience/already?${n}`)}function oa(e,a){return te(e,"/experimental/onescience/raw-source",{method:"POST",body:JSON.stringify(a)})}function ca(e,a){return te(e,`/experimental/onescience/raw-source/${encodeURIComponent(a)}/convert`,{method:"POST"})}function da(e,a,n){const s=new URLSearchParams;n&&s.set("viewer_workspace_id",n);const r=s.size?`?${s}`:"";return te(e,`/experimental/onescience/raw-source/${encodeURIComponent(a)}/preview${r}`)}function ua(e,a,n){const s=new URLSearchParams;n&&s.set("viewer_workspace_id",n);const r=s.size?`?${s}`:"";return te(e,`/experimental/onescience/already/${encodeURIComponent(a)}/preview${r}`)}function pa(e,a,n){return te(e,`/experimental/onescience/session/${encodeURIComponent(a)}/chips`,{method:"PUT",body:JSON.stringify({raw_ids:n})})}function ga(e,a){return te(e,`/experimental/onescience/already/${encodeURIComponent(a)}/publish`,{method:"POST"})}function ba(e,a){return te(e,`/experimental/onescience/already/${encodeURIComponent(a)}/unpublish`,{method:"POST"})}function ha(e,a){return te(e,`/experimental/onescience/already/${encodeURIComponent(a)}/reingest`,{method:"POST"})}function ya(e,a,n){return te(e,`/experimental/onescience/already/${encodeURIComponent(a)}/training`,{method:"POST",body:JSON.stringify(n)})}function va(e){return te(e,"/experimental/workspace")}function $a(e){return te(e,"/experimental/onescience/object-store-key")}function ma(e,a){return te(e,"/experimental/onescience/object-store-key",{method:"PUT",body:JSON.stringify(a)})}function fa(e,a){return te(e,`/experimental/onescience/object-store-key/${encodeURIComponent(a)}`,{method:"DELETE"})}const _a={all:"全部",weather:"地球科学",materials:"材料化学",bio:"生命科学",fluid:"流体仿真"};var wa=i('<div class=os-onedata-subtabs role=tablist aria-label="Already 范围"><button type=button>我的</button><button type=button>公共'),Sa=i("<p class=os-client-capability-empty>登录后才能查看和接入登记库。"),ka=i("<p class=os-onedata-error>"),We=i("<ul class=os-onedata-list>"),Ca=i('<form class=os-onedata-register><strong>个人对象存储 Key</strong><select><option value=s3>s3</option><option value=oss>oss</option><option value=cos>cos</option></select><input required placeholder="Access Key ID"><input required type=password placeholder=Secret><input><input placeholder=region(可选)><button type=submit>保存 Key'),Ia=i("<select required><option value>选择远端执行环境"),xa=i('<form class=os-onedata-register><strong>+ 接入原始数据</strong><input placeholder=名称><input required placeholder="本机路径、s3://bucket/key、远端路径或 http(s) 地址"><select><option value=local_fs>本机路径</option><option value=http_dataset>无认证 HTTP</option><option value=object_store>对象存储(平台桶路径或 s3/oss/cos URI)</option><option value=remote_workspace>已连接的远端 wrk_*</option></select><button type=submit>接入'),La=i("<p class=os-client-capability-empty>还没有原始数据。接入本机路径、公开 HTTP,或已连接的远端路径。"),Da=i("<button type=button class=os-onedata-chip-btn>把选中的原始数据挂到当前会话芯片"),ot=i("<pre class=os-onedata-preview>"),Pa=i("<ul>"),Ta=i("<section class=os-onedata-selector aria-label=模型选择数据(只读)><h3>选择数据(只读)</h3><p>训练只接受 ready 的 Already(alr_)。种子 id / raw_ 不能写入 datasetRefs。"),Ea=i("<select><option value>选择作业目标"),Ra=i("<div class=os-onedata-actions><select><option value=local>作业目标:本机</option><option value=workspace>作业目标:远端 wrk_*</option><option value=shared_root>作业目标:平台共享根"),Oa=i("<p class=os-client-capability-empty>"),Ua=i('<section class="os-client-capability-resource-panel os-onedata-catalog"><header class="os-client-capability-page-section-head os-client-capability-page-section-head-active"><p>。先登记为原始数据,转为 Already 后才能给模型用。</p></header><div class=os-onedata-subtabs role=tablist aria-label="OneData 登记库"><button type=button>原始数据</button><button type=button>Already</button></div><section class=os-onedata-platform><header class=os-client-capability-page-section-head><div><strong>平台目录</strong><p>种子与魔搭卡,只读。下载后请回到上方「原始数据」按实际路径接入;不能把种子 id 当成训练数据。'),ja=i("<li><span> · …</span><button type=button>删除"),ct=i("<option>"),Aa=i("<li><label><input type=checkbox><strong></strong><span> · </span><small></small></label><div class=os-onedata-actions><button type=button>预览</button><button type=button>转为 Already"),qa=i("<p class=os-client-capability-empty>还没有 ready 的 Already。"),Ka=i("<li><code></code> "),Wa=i("<button type=button>发布"),Ha=i("<button type=button>取消发布"),Ma=i("<button type=button>作为原始数据接入"),Qa=i("<button type=button>开训"),Fa=i("<li><strong></strong><span></span><small></small><div class=os-onedata-actions><button type=button>预览");function za(e){const a=Re(),n=Oe(),s=Je(),r=Ue(),c=ne(()=>new URLSearchParams(s.search)),b=ne(()=>c().get("onedata")==="already"?"already":"raw"),g=ne(()=>c().get("already")==="public"?"public":"mine"),[C,D]=P([]),[_,f]=P([]),[u,d]=P(""),[O,v]=P(!1),[M,q]=P(""),[X,o]=P(""),[j,ie]=P("local_fs"),[Q,G]=P(""),[x,K]=P([]),[F,h]=P(""),[I,w]=P([]),[W,Z]=P("local"),[J,S]=P([]),[z,se]=P("s3"),[ge,$e]=P(""),[be,ae]=P(""),[Se,Le]=P(""),[he,Ae]=P(""),ee=()=>a.current?.http.url,ke=()=>!!pe(),De=ne(()=>Be({path:n.data.path,recent:je(n.data.project??[]),lastCodeWorkspace:a.projects.lastCode()})||mt(pe(),a.projects.lastCode())||Ve(pe())||Ge(document,n.data.path)),et=ne(()=>{const T=De();if(!T)return;const Y=Rt(T);if(Y)return Y;const[re]=n.child(T,{bootstrap:!1});return(re.session??[]).find(ye=>!ye.parentID&&!ye.time?.archived)?.id}),Ce=T=>{const Y=new URLSearchParams(s.search);for(const[re,ye]of Object.entries(T))Y.set(re,ye);Y.set("category","onedata"),r(`${s.pathname}?${Y}`)},tt=T=>Ce({onedata:T}),de=async()=>{const T=ee();if(!T||!ke()){D([]),f([]);return}d("");try{const Y=e.domain==="all"?void 0:e.domain,[re,ye,Pe,Ie]=await Promise.all([ia(T,{domain:Y}),sa(T,{scope:g(),domain:Y}),va(T).catch(()=>[]),$a(T).catch(()=>({items:[]}))]);D(re.items),f(ye.items),K(Pe.filter(ve=>ve.id.startsWith("wrk_")).map(ve=>({id:ve.id,name:ve.name||ve.id}))),S(Ie.items)}catch(Y){d(Y instanceof Error?Y.message:"无法加载登记库")}};ft(()=>{e.domain,b(),g(),de()});const qe=ne(()=>_().filter(T=>T.status==="ready")),at=(T,Y)=>T.zarr_summary?.arrays?.length?T.zarr_summary.arrays.map(re=>`${re.path||"."} shape=${re.shape.join("×")} dtype=${re.dtype} chunks=${re.chunks.join("×")}`).join(`
5
- `):T.sample?T.sample:`规模 ${T.probe?.logical_bytes??0} bytes · ${T.probe?.format_hint??Y}`;return(()=>{var T=Ua(),Y=T.firstChild,re=Y.firstChild,ye=re.firstChild,Pe=Y.nextSibling,Ie=Pe.firstChild,ve=Ie.nextSibling,me=Pe.nextSibling;return me.firstChild,t(re,()=>e.copy.replace(/[。.]$/,""),ye),Ie.$$click=()=>tt("raw"),ve.$$click=()=>tt("already"),t(T,l(p,{get when(){return b()==="already"},get children(){var y=wa(),$=y.firstChild,L=$.nextSibling;return $.$$click=()=>Ce({already:"mine"}),L.$$click=()=>Ce({already:"public"}),k(E=>{var A=g()==="mine",N=g()==="public";return A!==E.e&&B($,"aria-pressed",E.e=A),N!==E.t&&B(L,"aria-pressed",E.t=N),E},{e:void 0,t:void 0}),y}}),me),t(T,l(p,{get when(){return!ke()},get children(){return Sa()}}),me),t(T,l(p,{get when(){return u()},get children(){var y=ka();return t(y,u),y}}),me),t(T,l(p,{get when(){return ce(()=>b()==="raw")()&&ke()},get children(){return[(()=>{var y=Ca(),$=y.firstChild,L=$.nextSibling,E=L.nextSibling,A=E.nextSibling,N=A.nextSibling,U=N.nextSibling,le=U.nextSibling;return y.addEventListener("submit",async m=>{m.preventDefault();const R=ee();if(R){v(!0),d("");try{await ma(R,{provider:z(),access_key_id:ge().trim(),secret:be().trim(),...Se().trim()?{endpoint:Se().trim()}:{},...he().trim()?{region:he().trim()}:{}}),$e(""),ae(""),await de()}catch(H){d(H instanceof Error?H.message:"保存对象存储 Key 失败")}finally{v(!1)}}}),L.addEventListener("change",m=>se(m.currentTarget.value)),E.$$input=m=>$e(m.currentTarget.value),A.$$input=m=>ae(m.currentTarget.value),N.$$input=m=>Le(m.currentTarget.value),U.$$input=m=>Ae(m.currentTarget.value),t(y,l(p,{get when(){return J().length>0},get children(){var m=We();return t(m,l(V,{get each(){return J()},children:R=>(()=>{var H=ja(),fe=H.firstChild,ue=fe.firstChild,oe=fe.nextSibling;return t(fe,()=>R.provider,ue),t(fe,()=>R.access_key_id_suffix,null),t(fe,(()=>{var _e=ce(()=>!!R.endpoint);return()=>_e()?` · ${R.endpoint}`:""})(),null),oe.$$click=async()=>{const _e=ee();if(_e)try{await fa(_e,R.provider),await de()}catch(Te){d(Te instanceof Error?Te.message:"删除 Key 失败")}},H})()})),m}}),null),k(m=>{var R=z()==="s3"?"endpoint(可选)":"endpoint(必填)",H=O()||!ge().trim()||!be().trim();return R!==m.e&&B(N,"placeholder",m.e=R),H!==m.t&&(le.disabled=m.t=H),m},{e:void 0,t:void 0}),k(()=>L.value=z()),k(()=>E.value=ge()),k(()=>A.value=be()),k(()=>N.value=Se()),k(()=>U.value=he()),y})(),(()=>{var y=xa(),$=y.firstChild,L=$.nextSibling,E=L.nextSibling,A=E.nextSibling,N=A.nextSibling;return y.addEventListener("submit",async U=>{U.preventDefault();const le=ee();if(le){v(!0),d("");try{await oa(le,{title:M().trim()||X().trim(),domain:e.domain==="all"?"unspecified":e.domain,uri:X().trim(),connector:j(),...j()==="remote_workspace"?{workspace_id:Q()}:{}}),q(""),o(""),await de()}catch(m){d(m instanceof Error?m.message:"接入失败")}finally{v(!1)}}}),L.$$input=U=>q(U.currentTarget.value),E.$$input=U=>o(U.currentTarget.value),A.addEventListener("change",U=>ie(U.currentTarget.value)),t(y,l(p,{get when(){return j()==="remote_workspace"},get children(){var U=Ia();return U.firstChild,U.addEventListener("change",le=>G(le.currentTarget.value)),t(U,l(V,{get each(){return x()},children:le=>(()=>{var m=ct();return t(m,()=>le.name),k(()=>m.value=le.id),m})()}),null),k(()=>U.value=Q()),U}}),N),k(()=>N.disabled=O()||!X().trim()||j()==="remote_workspace"&&!Q()),k(()=>L.value=M()),k(()=>E.value=X()),k(()=>A.value=j()),y})(),l(p,{get when(){return C().length===0},get fallback(){return(()=>{var y=We();return t(y,l(V,{get each(){return C()},children:$=>(()=>{var L=Aa(),E=L.firstChild,A=E.firstChild,N=A.nextSibling,U=N.nextSibling,le=U.firstChild,m=U.nextSibling,R=E.nextSibling,H=R.firstChild,fe=H.nextSibling;return A.addEventListener("change",ue=>{const oe=ue.currentTarget.checked;w(_e=>oe?[..._e,$.id]:_e.filter(Te=>Te!==$.id))}),t(N,()=>$.title),t(U,()=>$.format,le),t(U,()=>$.connector,null),t(m,()=>$.uri),H.$$click=async()=>{const ue=ee();if(ue)try{const oe=await da(ue,$.id,Q()||void 0);h(at(oe,$.format))}catch(oe){d(oe instanceof Error?oe.message:"预览失败")}},fe.$$click=async()=>{const ue=ee();if(ue){v(!0);try{await ca(ue,$.id),Ce({onedata:"already",already:"mine"}),await de()}catch(oe){d(oe instanceof Error?oe.message:"转化失败")}finally{v(!1)}}},k(()=>A.checked=I().includes($.id)),L})()})),y})()},get children(){return La()}}),l(p,{get when(){return ce(()=>!!et())()&&I().length>0},get children(){var y=Da();return y.$$click=async()=>{const $=ee(),L=et();if(!(!$||!L))try{await pa($,L,I())}catch(E){d(E instanceof Error?E.message:"挂载芯片失败")}},y}}),l(p,{get when(){return F()},get children(){var y=ot();return t(y,F),y}})]}}),me),t(T,l(p,{get when(){return ce(()=>b()==="already")()&&ke()},get children(){return[l(p,{get when(){return g()==="mine"},get children(){var y=Ta(),$=y.firstChild;return $.nextSibling,t(y,l(p,{get when(){return qe().length>0},get fallback(){return qa()},get children(){var L=Pa();return t(L,l(V,{get each(){return qe()},children:E=>(()=>{var A=Ka(),N=A.firstChild;return N.nextSibling,t(N,()=>E.id),t(A,()=>E.title,null),A})()})),L}}),null),y}}),l(p,{get when(){return qe().length>0},get children(){var y=Ra(),$=y.firstChild;return $.addEventListener("change",L=>Z(L.currentTarget.value)),t(y,l(p,{get when(){return W()==="workspace"},get children(){var L=Ea();return L.firstChild,L.addEventListener("change",E=>G(E.currentTarget.value)),t(L,l(V,{get each(){return x()},children:E=>(()=>{var A=ct();return t(A,()=>E.name),k(()=>A.value=E.id),A})()}),null),k(()=>L.value=Q()),L}}),null),k(()=>$.value=W()),y}}),l(p,{get when(){return _().length===0},get fallback(){return(()=>{var y=We();return t(y,l(V,{get each(){return _()},children:$=>(()=>{var L=Fa(),E=L.firstChild,A=E.nextSibling,N=A.nextSibling,U=N.nextSibling,le=U.firstChild;return t(E,()=>$.title),t(A,()=>$.status,null),t(A,()=>$.visibility==="public"?" · 已发布":"",null),t(N,()=>$.uri),le.$$click=async()=>{const m=ee();if(m)try{const R=await ua(m,$.id,g()==="public"&&Q()||void 0);h(at(R,$.format))}catch(R){d(R instanceof Error?R.message:"预览失败")}},t(U,l(p,{get when(){return ce(()=>g()==="mine"&&$.status==="ready")()&&$.visibility!=="public"},get children(){var m=Wa();return m.$$click=async()=>{const R=ee();if(R){v(!0);try{await ga(R,$.id),await de()}catch(H){d(H instanceof Error?H.message:"发布失败")}finally{v(!1)}}},m}}),null),t(U,l(p,{get when(){return ce(()=>g()==="mine")()&&$.visibility==="public"},get children(){var m=Ha();return m.$$click=async()=>{const R=ee();if(R){v(!0);try{await ba(R,$.id),await de()}catch(H){d(H instanceof Error?H.message:"取消发布失败")}finally{v(!1)}}},m}}),null),t(U,l(p,{get when(){return g()==="public"},get children(){var m=Ma();return m.$$click=async()=>{const R=ee();if(R){v(!0);try{await ha(R,$.id),Ce({onedata:"raw"}),await de()}catch(H){d(H instanceof Error?H.message:"再次接入失败")}finally{v(!1)}}},m}}),null),t(U,l(p,{get when(){return $.status==="ready"},get children(){var m=Qa();return m.$$click=async()=>{const R=ee();if(R){if(W()==="workspace"&&!Q()){d("请选择作业目标 wrk_*");return}v(!0);try{await ya(R,$.id,{target:W(),...W()==="workspace"?{workspace_id:Q()}:{}}),await de()}catch(H){d(H instanceof Error?H.message:"开训失败")}finally{v(!1)}}},m}}),null),L})()})),y})()},get children(){var y=Oa();return t(y,()=>g()==="public"?"还没有公共 Already。":"还没有 Already。从原始数据转化,或等对话加工回写。"),y}}),l(p,{get when(){return F()},get children(){var y=ot();return t(y,F),y}})]}}),me),t(me,l(zt,{get filter(){return _a[e.domain]},get domainLabel(){return e.domainLabel}}),null),k(y=>{var $=b()==="raw",L=b()==="already";return $!==y.e&&B(Ie,"aria-pressed",y.e=$),L!==y.t&&B(ve,"aria-pressed",y.t=L),y},{e:void 0,t:void 0}),T})()}Ee(["click","input"]);var Na=i('<article class="os-client-capability-card os-client-capability-skill-card"><div class=os-client-capability-skill-card-head><h4></h4></div><p></p><div class=os-client-capability-meta><span class=os-client-capability-skill-provider></span></div><div class=os-client-capability-actions><button type=button>详情</button><button type=button data-primary=true>开发'),kt=i("<span>"),Ba=i("<div>"),Va=i("<button type=button class=os-client-capability-oneskills-expand>"),Ga=i("<section class=os-client-capability-oneskills-section><header class=os-client-capability-oneskills-section-head><div class=os-client-capability-oneskills-section-title><h3></h3></div><p>"),Ja=i("<p class=os-client-capability-empty>当前分类暂无技能卡片。"),Ya=i("<span class=os-client-capability-oneskills-count> 个技能"),Xa=i("<p class=os-client-capability-oneskills-error>"),Za=i("<div class=os-client-capability-oneskills-top-row>"),er=i("<div class=os-client-capability-oneskills-overview>"),tr=i('<section class="os-client-capability-resource-panel os-client-capability-oneskills-panel"><header class=os-client-capability-oneskills-toolbar><div class=os-client-capability-oneskills-toolbar-copy><p>按 OneSkills 分层浏览官方技能,查看详情或进入开发。</p></div><div class=os-client-capability-oneskills-actions><span class=inline-flex><button type=button class=os-client-capability-oneskills-upgrade>'),ar=i("<p class=os-client-capability-empty>正在加载 OneSkills 技能..."),rr=i("<p class=os-client-capability-empty>暂无可展示的 OneSkills 技能,请先安装或更新技能。");const dt=4,ze=new Set(["orchestrator","resource"]);function lr(e,a){return e.layer===a.title||e.tags.includes(a.title)||e.tags.includes(a.id)}function nr(e){return Be(e)||mt(pe(),e.lastCodeWorkspace)||Ve(pe())||Ge(document,e.path)}function ir(e){const a=()=>e.item.tags.filter(n=>n!==e.item.layer&&n!==e.item.provider).slice(0,3);return(()=>{var n=Na(),s=n.firstChild,r=s.firstChild,c=s.nextSibling,b=c.nextSibling,g=b.firstChild,C=b.nextSibling,D=C.firstChild,_=D.nextSibling;return wt(n,"click",e.onOpen,!0),t(r,()=>e.item.title),t(c,()=>e.item.copy),t(g,()=>e.item.provider),t(b,l(V,{get each(){return a()},children:f=>(()=>{var u=kt();return t(u,f),u})()}),null),D.$$click=f=>{f.stopPropagation(),e.onOpen()},_.$$click=f=>{f.stopPropagation(),e.onDevelop()},k(f=>{var u=e.layerId,d=e.canDevelop?void 0:"登录后使用";return u!==f.e&&B(n,"data-layer",f.e=u),d!==f.t&&B(_,"title",f.t=d),f},{e:void 0,t:void 0}),n})()}function ut(e){const[a,n]=P(!1),s=()=>e.items.length,r=()=>Math.max(0,s()-dt),c=()=>a()||r()===0?e.items:e.items.slice(0,dt),b=()=>ze.has(e.group.id);return(()=>{var g=Ga(),C=g.firstChild,D=C.firstChild,_=D.firstChild,f=D.nextSibling;return t(_,()=>e.group.title),t(D,l(p,{get when(){return s()>0},get children(){var u=kt();return t(u,s),u}}),null),t(f,()=>e.group.copy),t(g,l(p,{get when(){return s()>0},get fallback(){return Ja()},get children(){return[(()=>{var u=Ba();return t(u,l(V,{get each(){return c()},children:d=>l(ir,{item:d,get layerId(){return e.group.id},get canDevelop(){return e.canDevelop},onOpen:()=>e.onOpen(d),onDevelop:()=>e.onDevelop(d)})})),k(d=>{var O=!b(),v=!!b();return O!==d.e&&u.classList.toggle("os-client-capability-page-grid",d.e=O),v!==d.t&&u.classList.toggle("os-client-capability-oneskills-compact-grid",d.t=v),d},{e:void 0,t:void 0}),u})(),l(p,{get when(){return ce(()=>!b())()&&r()>0},get children(){var u=Va();return u.$$click=()=>n(d=>!d),t(u,(()=>{var d=ce(()=>!!a());return()=>d()?"收起":`展开其余 ${r()} 个`})()),k(()=>B(u,"aria-expanded",a())),u}})]}}),null),k(u=>{var d=e.group.id,O=!!e.compact,v=e.group.id;return d!==u.e&&B(g,"id",u.e=d),O!==u.t&&g.classList.toggle("is-compact",u.t=O),v!==u.a&&B(g,"data-layer",u.a=v),u},{e:void 0,t:void 0,a:void 0}),g})()}function sr(){const e=Je(),a=Ue(),n=Re(),s=Oe(),r=Ye(),[c,b]=P([]),[g,C]=P(!1),[D,_]=P(!1),[f,u]=P(),[d,O]=P(!1),[v,M]=P(),q=ne(()=>!!pe()?.account.id),X=ne(()=>nr({path:s.data.path,recent:je(s.data.project),lastCodeWorkspace:n.projects.lastCode()})),o=async()=>{const h=n.current;if(!h){b([]),C(!0);return}const I=await Ot(h.http.url,{limit:100});b(I.loaded?I.items:[]),C(!0)};Qe(()=>{const h=Vt(e.search)??Gt()?.domainId??"all";a(_t("oneskills",h),{replace:!0}),o()});const j=h=>c().filter(I=>lr(I,h)),ie=()=>jt.filter(h=>j(h).length>0),Q=()=>{const h=ie();return{pair:h.filter(I=>ze.has(I.id)),rest:h.filter(I=>!ze.has(I.id))}},G=h=>{M(h),O(!0)},x=()=>{O(!1),M(void 0)},K=h=>{if(!Me({navigate:a,action:{type:"prompt",prompt:""},isLoggedIn:q()}))return;const I=X();if(!I){we({variant:"error",title:"无法开发",description:"未检测到工作目录"});return}const w=Bt({id:h.id,title:h.title,copy:h.copy,layer:h.layer,tags:h.tags,provider:h.provider}),W=gt(I);bt(W,w.prompt,{skill:w.skill}),ht(W),r.projects.open(I),n.projects.touchCode(I),O(!1),M(void 0),we({variant:"success",title:`已为你创建「${h.title}」开发任务`}),a(yt(I))},F=async()=>{if(!Me({navigate:a,action:{type:"install",resourceId:"oneskills"},isLoggedIn:q()}))return;const h=n.current,I=X();if(!h){const w=Ke();u(w),we({variant:"error",title:"更新失败",description:w});return}if(!I){const w=Ke();u(w),we({variant:"error",title:"更新失败",description:w});return}_(!0),u(void 0);try{const w=await Ut(h.http.url,I);await o();const W=w.version?`版本 ${w.version} · ${w.skillCount} 个技能`:`${w.skillCount} 个技能`,Z=w.seedSource==="bundled"&&w.seedFallbackReason?"原语已回退内置 seed":w.seedSource==="disk"?"原语已同步磁盘 oneskills":void 0;we({variant:"success",title:"OneSkills 已更新",description:Z?`${W} · ${Z}`:W})}catch(w){const W=Ke(w instanceof Error?w.message:"更新 OneSkills 失败");u(W),we({variant:"error",title:"更新失败",description:W})}finally{_(!1)}};return(()=>{var h=tr(),I=h.firstChild,w=I.firstChild;w.firstChild;var W=w.nextSibling,Z=W.firstChild,J=Z.firstChild;return t(w,l(p,{get when(){return ce(()=>!!g())()&&c().length>0},get children(){var S=Ya(),z=S.firstChild;return t(S,()=>c().length,z),S}}),null),t(W,l(p,{get when(){return f()},get children(){var S=Xa();return t(S,f),S}}),Z),J.$$click=()=>void F(),t(J,()=>D()?"更新中...":"更新 OneSkills"),t(h,l(p,{get when(){return g()},get fallback(){return ar()},get children(){return l(p,{get when(){return c().length>0},get fallback(){return rr()},get children(){var S=er();return t(S,l(p,{get when(){return Q().pair.length>0},get children(){var z=Za();return t(z,l(V,{get each(){return Q().pair},children:se=>l(ut,{group:se,get items(){return j(se)},compact:!0,get canDevelop(){return q()},onOpen:G,onDevelop:K})})),z}}),null),t(S,l(V,{get each(){return Q().rest},children:z=>l(ut,{group:z,get items(){return j(z)},get canDevelop(){return q()},onOpen:G,onDevelop:K})}),null),S}})}}),null),t(h,l(Nt,{variant:"workbench",get item(){return v()},get open(){return d()},get serverUrl(){return n.current?.http.url},onClose:x,onDevelop:()=>{const S=v();S&&(x(),K(S))}}),null),k(S=>{var z=q()?void 0:"登录后使用",se=D();return z!==S.e&&B(Z,"title",S.e=z),se!==S.t&&(J.disabled=S.t=se),S},{e:void 0,t:void 0}),h})()}Ee(["click"]);async function or(e,a){const n=new URLSearchParams;n.set("limit","200");const s=await vt(`${$t(e)}/experimental/onescience/scenario?${n}`);if(!s.ok)throw new Error(`scenario catalog failed: ${s.status}`);const c=((await s.json()).items??[]).map(b=>({...b,model_ids:b.model_ids?.length?b.model_ids:[b.model.trim().toLowerCase()]}));return At(c),c}var cr=i("<span>当前范围:"),dr=i("<strong>全领域"),ur=i("<small>OneSkills 原语跨领域通用,不区分材料 / 气象 / 流体 / 生信"),pr=i("<div class=os-client-capability-domain-row role=tablist aria-label=能力中心领域>"),gr=i("<div class=os-client-capability-scenario-grid>"),br=i("<section class=os-client-capability-scenario-panel><div class=os-client-capability-scenario-toolbar><span>场景卡片</span><strong></strong><small> · 点击卡片打开场景弹窗</small><label class=os-client-capability-scenario-search><input type=search placeholder=搜索场景名称、ID、模型、HPC… aria-label=搜索场景>"),hr=i("<div class=os-client-capability-page><section class=os-client-capability-selector aria-label=能力中心筛选><div class=os-client-capability-current-domain></div><div class=os-client-capability-filter-tabs aria-label=能力类型></div></section><div class=os-client-capability-page-body>"),yr=i("<span>当前领域:"),vr=i("<strong>"),$r=i("<small>"),mr=i("<button type=button>"),fr=i("<button type=button class=os-client-capability-filter-tab role=tab><div class=os-client-capability-filter-tab-text><strong></strong><small>"),_r=i("<p class=os-client-capability-hint>"),Ze=i("<span>"),wr=i("<button type=button class=os-client-capability-scenario-card><div class=os-client-capability-scenario-card-head><h4></h4><span></span></div><p></p><div class=os-client-capability-scenario-card-meta><span></span><span></span><span> 步工作流</span><span> 个字段</span></div><div class=os-client-capability-scenario-card-action><span>使用"),Sr=i("<button type=button class=os-client-capability-upload-trigger><span aria-hidden=true>+</span>上传私有模型"),kr=i("<label class=os-client-capability-catalog-search><span>搜索</span><input type=search placeholder=按名称、简介或标签筛选>"),Cr=i("<div class=os-client-capability-catalog-toolbar><div class=os-client-capability-catalog-toolbar-side><span class=os-client-capability-catalog-count></span><div class=os-client-capability-view-switch role=tablist aria-label=展示方式>"),Ir=i('<section class=os-client-capability-resource-panel><header class="os-client-capability-page-section-head os-client-capability-page-section-head-active"><p>'),xr=i("<p class=os-client-capability-empty>当前「<!>」领域暂无<!>卡片。"),Lr=i("<button type=button role=tab>"),Dr=i("<p class=os-client-capability-empty>没有匹配的结果,试试换个关键词。"),Pr=i("<div class=os-client-capability-catalog role=list>"),Tr=i("<article class=os-client-capability-catalog-row role=listitem>"),Er=i("<div class=os-client-capability-page-grid>"),Ct=i("<span class=os-client-capability-private-badge>私有资产"),It=i("<span class=os-client-capability-unavailable-badge>暂不可用"),Rr=i("<div class=os-client-capability-meta>"),Or=i("<article class=os-client-capability-card><div class=os-client-capability-card-body><div class=os-client-capability-card-head><div class=os-client-capability-card-title><h4></h4></div></div><p>"),Ur=i("<p class=os-client-capability-unavailable-hint>暂无 OneScience 源码或魔搭映射"),jr=i("<div class=os-client-capability-catalog-tags>"),Ar=i("<div class=os-client-capability-catalog-copy><div class=os-client-capability-card-title><h4></h4></div><p>"),qr=i("<div>"),Kr=i("<button type=button>安装");const Wr=[{id:"all",label:"全部"},{id:"materials",label:"材料"},{id:"weather",label:"气象"},{id:"fluid",label:"流体"},{id:"bio",label:"生信"}],Hr=[{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:"列表"}],xt="os-capability-view-mode";function He(e){return e==="all"||e==="materials"||e==="weather"||e==="fluid"||e==="bio"?e:"all"}function Qr(e){return e==="materials"||e==="weather"||e==="fluid"||e==="bio"?e:"materials"}function Fr(e,a){const n=e.split("?")[0]??e;return new RegExp(`^${Fe.capabilities}/[^/]+`).test(n)?!new URLSearchParams(a).has("domain"):!1}function rl(e){const a=Je(),n=Ue(),s=it(a.pathname,a.search),[r,c]=qt({domainId:He(s.domainId),categoryId:s.categoryId,scenarioQuery:"",activeScenarioId:"",uploadPage:null,scenarioCatalogTick:0}),b=Oe(),g=Ye(),C=Re();Qe(()=>{const o=C.current?.http.url;o&&or(o).then(()=>c("scenarioCatalogTick",j=>j+1)).catch(()=>{})});const D=o=>{Jt({categoryId:o.categoryId,domainId:He(o.domainId)})},_=o=>{D(o),n(_t(o.categoryId,o.domainId),{replace:!0})};ft(()=>{const o=a.pathname,j=a.search,ie=it(o,j);if(Fr(o,j)){c("categoryId",ie.categoryId);return}const Q=He(ie.domainId),G=ie.categoryId;c({domainId:Q,categoryId:G}),D({domainId:Q,categoryId:G});const x=o.split("?")[0]??o,K=x===Fe.capabilities||x===`${Fe.capabilities}/`,F=new URLSearchParams(j);K&&!F.get("category")&&!F.get("domain")&&_({domainId:Q,categoryId:G})});const f=ne(()=>(Kt(),r.domainId==="all"?rt():rt(r.domainId))),u=ne(()=>f().find(o=>o.id===r.categoryId)??f()[0]),d=ne(()=>(r.scenarioCatalogTick,Wt(r.domainId,r.scenarioQuery))),O=ne(()=>{if(r.scenarioCatalogTick,!!r.activeScenarioId)return lt(r.activeScenarioId)}),v=o=>{c({categoryId:o,activeScenarioId:"",scenarioQuery:o==="scenario"?r.scenarioQuery:""}),_({domainId:r.domainId,categoryId:o})},M=()=>c("activeScenarioId",""),q=()=>({navigate:n,isLoggedIn:!!pe(),path:b.data.path,recent:je(b.data.project),lastCodeWorkspace:C.projects.lastCode(),openProject:o=>g.projects.open(o),touchCode:o=>C.projects.touchCode(o)});Qe(()=>{const o=Ht();if(o)try{if(o.type==="install"){if(o.resourceId==="oneskills"){c("categoryId","oneskills"),_({domainId:r.domainId,categoryId:"oneskills"});return}if(o.resourceId.startsWith("__"))return;St({resourceId:o.resourceId,...q()});return}if(o.type==="prompt"&&o.prompt.trim()){Yt({prompt:o.prompt,title:o.title||"能力中心任务",workflow:o.workflow,...q()});return}if(o.type==="scenario-run"){const j=lt(o.scenarioId);if(!j)return;st({scenario:j,values:o.values,...q()});return}o.type==="wizard"&&Xt({resourceId:o.resourceId,scenarioId:o.scenarioId,values:o.values,prompt:o.prompt,...q()})}catch{}});const X=(o,j)=>{st({scenario:o,values:j.values,...q()})};return(()=>{var o=hr(),j=o.firstChild,ie=j.firstChild,Q=ie.nextSibling,G=j.nextSibling;return t(ie,l(p,{get when(){return r.categoryId==="oneskills"},get fallback(){return[yr(),(()=>{var x=vr();return t(x,()=>xe(r.domainId)),x})(),(()=>{var x=$r();return t(x,()=>r.categoryId==="scenario"?"切换领域后,下方场景同步刷新":"切换领域后,下方模型、HPC 软件与数据集内容同步刷新"),x})()]},get children(){return[cr(),dr(),ur()]}})),t(j,l(p,{get when(){return r.categoryId!=="oneskills"},get children(){var x=pr();return t(x,l(V,{each:Wr,children:K=>(()=>{var F=mr();return F.$$click=()=>{c({domainId:K.id,activeScenarioId:"",scenarioQuery:""}),_({domainId:K.id,categoryId:r.categoryId})},t(F,()=>K.label),k(h=>{var I=K.id===r.domainId,w=K.id===r.domainId;return I!==h.e&&F.classList.toggle("is-active",h.e=I),w!==h.t&&B(F,"aria-pressed",h.t=w),h},{e:void 0,t:void 0}),F})()})),x}}),Q),t(Q,l(V,{each:Hr,children:x=>(()=>{var K=fr(),F=K.firstChild,h=F.firstChild,I=h.nextSibling;return K.$$click=()=>v(x.id),t(h,()=>x.label),t(I,()=>x.title),k(w=>{var W=r.categoryId===x.id,Z=r.categoryId===x.id;return W!==w.e&&K.classList.toggle("is-active",w.e=W),Z!==w.t&&B(K,"aria-selected",w.t=Z),w},{e:void 0,t:void 0}),K})()})),t(G,l(p,{get when(){return r.categoryId==="oneskills"},get children(){return l(sr,{})}}),null),t(G,l(p,{get when(){return r.categoryId==="scenario"},get children(){var x=br(),K=x.firstChild,F=K.firstChild,h=F.nextSibling,I=h.nextSibling,w=I.firstChild,W=I.nextSibling,Z=W.firstChild;return t(h,()=>d().length),t(I,()=>xe(r.domainId),w),Z.$$input=J=>c("scenarioQuery",J.currentTarget.value),t(x,l(p,{get when(){return d().length>0},get fallback(){return(()=>{var J=_r();return t(J,(()=>{var S=ce(()=>!!r.scenarioQuery.trim());return()=>S()?`未找到匹配「${r.scenarioQuery.trim()}」的场景。`:`当前「${xe(r.domainId)}」领域暂无场景卡片。`})()),J})()},get children(){var J=gr();return t(J,l(V,{get each(){return d()},children:S=>(()=>{var z=wr(),se=z.firstChild,ge=se.firstChild,$e=ge.nextSibling,be=se.nextSibling,ae=be.nextSibling,Se=ae.firstChild,Le=Se.nextSibling,he=Le.nextSibling,Ae=he.firstChild,ee=he.nextSibling,ke=ee.firstChild;return z.$$click=()=>c("activeScenarioId",S.scenario_id),t(ge,()=>S.name),t($e,()=>S.scenario_id),t(be,()=>S.problem_and_applicability),t(Se,()=>S.type),t(Le,()=>S.model),t(ae,l(p,{get when(){return S.HPC},get children(){var De=Ze();return t(De,()=>S.HPC),De}}),he),t(he,()=>S.workflow_steps?.length||S.workflow.length,Ae),t(ee,()=>S.user_input.length,ke),z})()})),J}}),null),k(()=>Z.value=r.scenarioQuery),x}}),null),t(G,l(p,{get when(){return r.categoryId==="onemodel"||r.categoryId==="hpc"},get children(){return l(zr,{get category(){return u()},get domainId(){return r.domainId},get domainLabel(){return xe(r.domainId)},get onUpload(){return r.categoryId==="onemodel"?()=>c("uploadPage","models"):void 0}})}}),null),t(G,l(p,{get when(){return r.categoryId==="onedata"},get children(){return l(za,{get domain(){return r.domainId},get domainLabel(){return xe(r.domainId)},get copy(){return u().copy}})}}),null),t(o,l(p,{get when(){return O()},children:x=>l(Zt,{get scenario(){return x()},onClose:M,onSubmit:K=>X(x(),K)})}),null),t(o,l(ra,{get open(){return r.uploadPage!==null},page:"models",get domain(){return Qr(r.domainId)},onClose:()=>c("uploadPage",null),onSaved:()=>{c({categoryId:"onemodel",uploadPage:null,activeScenarioId:""}),_({domainId:r.domainId,categoryId:"onemodel"})}}),null),t(o,()=>e.children,null),o})()}function zr(e){const[a,n]=P(""),[s,r]=P(Jr()),c=()=>({category:e.category.id,domain:e.domainId}),b=ne(()=>{const C=a().trim().toLowerCase();return C?e.category.items.filter(D=>[D.name,D.blurb,...D.tags].some(_=>_.toLowerCase().includes(C))):e.category.items}),g=C=>{r(C),Yr(C)};return(()=>{var C=Ir(),D=C.firstChild,_=D.firstChild;return t(_,()=>e.category.copy.replace(/[。.]$/,"")),t(D,l(p,{get when(){return e.onUpload},get children(){var f=Sr();return wt(f,"click",e.onUpload,!0),f}}),null),t(C,l(p,{get when(){return e.category.items.length>0},get fallback(){return(()=>{var f=xr(),u=f.firstChild,d=u.nextSibling,O=d.nextSibling,v=O.nextSibling;return v.nextSibling,t(f,()=>e.domainLabel,d),t(f,()=>e.category.id==="hpc"?" HPC 软件":"模型",v),f})()},get children(){return[(()=>{var f=Cr(),u=f.firstChild,d=u.firstChild,O=d.nextSibling;return t(f,l(p,{get when(){return e.category.items.length>=6},get children(){var v=kr(),M=v.firstChild,q=M.nextSibling;return q.$$input=X=>n(X.currentTarget.value),k(()=>q.value=a()),v}}),u),t(d,(()=>{var v=ce(()=>b().length===e.category.items.length);return()=>v()?`共 ${e.category.items.length} 项`:`${b().length} / ${e.category.items.length} 项`})()),t(O,l(V,{each:Mr,children:v=>(()=>{var M=Lr();return M.$$click=()=>g(v.id),t(M,()=>v.label),k(q=>{var X=s()===v.id,o=s()===v.id;return X!==q.e&&B(M,"aria-selected",q.e=X),o!==q.t&&M.classList.toggle("is-active",q.t=o),q},{e:void 0,t:void 0}),M})()})),f})(),l(p,{get when(){return b().length>0},get fallback(){return Dr()},get children(){return[l(p,{get when(){return s()==="list"},get children(){return l(Nr,{get items(){return b()},get catalog(){return c()}})}}),l(p,{get when(){return s()==="cards"},get children(){return l(Br,{get items(){return b()},get catalog(){return c()}})}})]}})]}}),null),C})()}function Nr(e){return(()=>{var a=Pr();return t(a,l(V,{get each(){return e.items},children:n=>{const s=()=>Xe(n);return(()=>{var r=Tr();return t(r,l(Vr,{item:n}),null),t(r,l(p,{get when(){return s()},get fallback(){return l(Lt,{})},get children(){return l(Dt,{item:n,get catalog(){return e.catalog}})}}),null),k(c=>{var b=n.ownership==="private",g=!s(),C=s()?void 0:!0,D=s()?void 0:"暂无 OneScience 源码或魔搭映射,暂不可用";return b!==c.e&&r.classList.toggle("is-private",c.e=b),g!==c.t&&r.classList.toggle("is-unavailable",c.t=g),C!==c.a&&B(r,"aria-disabled",c.a=C),D!==c.o&&B(r,"title",c.o=D),c},{e:void 0,t:void 0,a:void 0,o:void 0}),r})()}})),a})()}function Br(e){return(()=>{var a=Er();return t(a,l(V,{get each(){return e.items},children:n=>{const s=()=>Xe(n);return(()=>{var r=Or(),c=r.firstChild,b=c.firstChild,g=b.firstChild,C=g.firstChild,D=b.nextSibling;return t(C,()=>n.name),t(g,l(p,{get when(){return n.ownership==="private"},get children(){return Ct()}}),null),t(g,l(p,{get when(){return!s()},get children(){return It()}}),null),t(b,l(p,{get when(){return n.tags.length>0},get children(){var _=Rr();return t(_,l(V,{get each(){return n.tags},children:f=>(()=>{var u=Ze();return t(u,f),u})()})),_}}),null),t(D,()=>n.blurb),t(r,l(p,{get when(){return s()},get fallback(){return l(Lt,{variant:"card"})},get children(){return l(Dt,{item:n,variant:"card",get catalog(){return e.catalog}})}}),null),k(_=>{var f=n.ownership==="private",u=!s(),d=s()?void 0:!0,O=s()?void 0:"暂无 OneScience 源码或魔搭映射,暂不可用";return f!==_.e&&r.classList.toggle("is-private",_.e=f),u!==_.t&&r.classList.toggle("is-unavailable",_.t=u),d!==_.a&&B(r,"aria-disabled",_.a=d),O!==_.o&&B(r,"title",_.o=O),_},{e:void 0,t:void 0,a:void 0,o:void 0}),r})()}})),a})()}function Lt(e){return(()=>{var a=Ur();return k(()=>a.classList.toggle("os-client-capability-unavailable-hint-card",e.variant==="card")),a})()}function Vr(e){return(()=>{var a=Ar(),n=a.firstChild,s=n.firstChild,r=n.nextSibling;return t(s,()=>e.item.name),t(n,l(p,{get when(){return e.item.ownership==="private"},get children(){return Ct()}}),null),t(n,l(p,{get when(){return!Xe(e.item)},get children(){return It()}}),null),t(r,()=>e.item.blurb),t(a,l(p,{get when(){return e.item.tags.length>0},get children(){var c=jr();return t(c,l(V,{get each(){return e.item.tags},children:b=>(()=>{var g=Ze();return t(g,b),g})()})),c}}),null),a})()}function Dt(e){const a=()=>e.catalog?{category:e.catalog.category,domain:e.catalog.domain}:void 0;return(()=>{var n=qr();return t(n,l(nt,{get href(){return Mt(e.item.id,a())},children:"详情"}),null),t(n,l(Gr,{get item(){return e.item}}),null),t(n,l(nt,{get href(){return Qt(e.item.id,void 0,a())},"data-primary":"true",children:"使用"}),null),k(s=>{var r=e.variant!=="card",c=e.variant==="card";return r!==s.e&&n.classList.toggle("os-client-capability-catalog-actions",s.e=r),c!==s.t&&n.classList.toggle("os-client-capability-actions",s.t=c),s},{e:void 0,t:void 0}),n})()}function Gr(e){const a=Ue(),n=Oe(),s=Ye(),r=Re(),c=()=>Ne(e.item);return(()=>{var b=Kr();return b.$$click=()=>{c()&&St({resourceId:e.item.id,navigate:a,isLoggedIn:!!pe(),path:n.data.path,recent:je(n.data.project),lastCodeWorkspace:r.projects.lastCode(),openProject:g=>s.projects.open(g),touchCode:g=>r.projects.touchCode(g)})},k(g=>{var C=!c(),D=c()?void 0:"暂无魔搭安装包";return C!==g.e&&(b.disabled=g.e=C),D!==g.t&&B(b,"title",g.t=D),g},{e:void 0,t:void 0}),b})()}function Jr(){if(typeof localStorage>"u")return"cards";const e=localStorage.getItem(xt);return e==="cards"||e==="list"?e:"cards"}function Yr(e){typeof localStorage>"u"||localStorage.setItem(xt,e)}Ee(["input","click"]);export{rl as CapabilityCenterPage};
@@ -1,2 +0,0 @@
1
- import{m as oe,u as se,l as ce,h as de,n as g,o as x,dI as ue,dJ as ge,dK as pe,x as fe,dL as he,c as n,i as t,a4 as k,av as J,S as p,R as K,dM as L,dN as V,F as xe,ay as me,a5 as ve,t as f,dO as we,dP as be,_ as ye}from"./index-BfLPI17v.js";var _e=f('<p class="text-12-regular text-icon-warning-base">'),U=f('<p class="text-12-regular text-text-weak">'),$e=f('<ul class="max-h-36 overflow-auto text-12-regular text-text-weak font-mono">'),Se=f('<div class="flex flex-col gap-2 rounded-md border border-border-weak-base bg-background-weak px-3 py-3"><p class="text-13-medium text-text-strong">'),ke=f("<p class=text-text-critical-base>"),je=f('<p class="text-12-regular text-text-critical-base whitespace-pre-wrap">'),Ee=f('<div class="flex flex-col gap-5 p-6 pt-0"><div class="flex flex-col gap-2"><p class="text-12-regular text-text-weak"></p><p class="text-13-medium text-text-strong break-all font-mono">/</p><p class="text-12-regular text-text-weak"></p></div><div class="flex flex-wrap gap-2"><input type=file class=hidden multiple><input type=file class=hidden multiple></div><div class="flex flex-col gap-1 text-12-regular text-text-weak"><p></p></div><div class="flex justify-end gap-2">'),Ce=f("<li class=truncate>");function Ue(b){const F=oe(),l=se(),T=ce(),X=de(),[s,q]=g([]),[Q,Y]=g(!1),[D,Z]=g(!1),[I,P]=g(),[ee,j]=g(!0),[h,B]=g(!1),[z,R]=g({done:0,total:0,written:0,skipped:0,failed:0}),[A,$]=g("");let M,O;const te=x(()=>{const r=X.data.path.home,a=b.directory;return r&&a.startsWith(r)?`~${a.slice(r.length)}`:a}),E=x(()=>ue(s())),S=x(()=>ge(s())),H=x(()=>{const r=I();return r===void 0||r<=0?!1:E()>r}),N=x(()=>s().length>0&&!h()&&!H()),C=x(()=>s().slice(0,pe)),re=x(()=>s().length>0&&!S());fe(()=>{const r=b.directory,a=T.current?.http;if(!r||!a){j(!1);return}let i=!1;return j(!0),he(a.url,r).then(c=>{i||P(c.availableBytes)}).catch(()=>{i||P(void 0)}).finally(()=>{i||j(!1)}),()=>{i=!0}});const W=r=>{if(!r?.length)return;$("");const a=we(r);q(a.entries),Y(a.truncated),a.truncated&&$(l.t("dialog.project.upload.tooManyFiles",{max:String(V),selected:String(a.totalSelected)}))},le=async()=>{const r=T.current?.http;if(!r||!N())return;const a=s();B(!0),$(""),R({done:0,total:a.length,written:0,skipped:0,failed:0});let i=0,c=0,m=0;const y=[];for(let d=0;d<a.length;d+=1){const u=a[d];try{(await be(r.url,b.directory,{path:u.path,file:u.file,overwrite:D()})).status==="written"?i+=1:c+=1}catch(v){m+=1;const w=v instanceof Error?v.message:l.t("dialog.project.upload.failed");y.length<3&&y.push(`${u.path}: ${w}`)}R({done:d+1,total:a.length,written:i,skipped:c,failed:m})}if(B(!1),m===0){ye({title:l.t("toast.project.upload.success",{written:String(i),skipped:String(c)})}),b.onUploaded?.(),F.close();return}$([l.t("dialog.project.upload.partialFailed",{written:String(i),skipped:String(c),failed:String(m)}),...y].join(`
2
- `)),(i>0||c>0)&&b.onUploaded?.()};return n(ve,{get title(){return l.t("command.project.upload")},class:"w-full max-w-[520px] mx-auto",get children(){var r=Ee(),a=r.firstChild,i=a.firstChild,c=i.nextSibling,m=c.firstChild,y=c.nextSibling,d=a.nextSibling,u=d.firstChild,v=u.nextSibling,w=d.nextSibling,ae=w.firstChild,_=w.nextSibling;return t(i,()=>l.t("dialog.project.upload.destinationLabel")),t(c,te,m),t(y,()=>l.t("dialog.project.upload.destinationHint")),t(d,n(k,{type:"button",variant:"secondary",size:"large",get disabled(){return h()},onClick:()=>M?.click(),get children(){return l.t("dialog.project.upload.pickFiles")}}),u),t(d,n(k,{type:"button",variant:"secondary",size:"large",get disabled(){return h()},onClick:()=>O?.click(),get children(){return l.t("dialog.project.upload.pickFolder")}}),u),u.addEventListener("change",e=>{W(e.currentTarget.files),e.currentTarget.value=""}),J(e=>{M=e},u),v.addEventListener("change",e=>{W(e.currentTarget.files),e.currentTarget.value=""}),J(e=>{O=e,e&&e.setAttribute("webkitdirectory","")},v),t(r,n(p,{get when(){return s().length>0},get children(){var e=Se(),ne=e.firstChild;return t(ne,(()=>{var o=K(()=>!!S());return()=>o()?l.t("dialog.project.upload.folderSummary",{folder:S(),count:String(s().length),size:L(E())}):l.t("dialog.project.upload.summary",{count:String(s().length),size:L(E())})})()),t(e,n(p,{get when(){return Q()},get children(){var o=_e();return t(o,()=>l.t("dialog.project.upload.truncatedHint",{max:String(V)})),o}}),null),t(e,n(p,{get when(){return S()},get children(){var o=U();return t(o,()=>l.t("dialog.project.upload.folderHint")),o}}),null),t(e,n(p,{get when(){return re()},get children(){return[(()=>{var o=$e();return t(o,n(xe,{get each(){return C()},children:ie=>(()=>{var G=Ce();return t(G,()=>ie.path),G})()})),o})(),n(p,{get when(){return s().length>C().length},get children(){var o=U();return t(o,()=>l.t("dialog.project.upload.moreFiles",{count:String(s().length-C().length)})),o}})]}}),null),e}}),w),t(ae,()=>l.t("dialog.project.upload.diskSpace",{space:ee()?l.t("common.loading"):L(I())})),t(w,n(p,{get when(){return H()},get children(){var e=ke();return t(e,()=>l.t("dialog.project.upload.diskInsufficient")),e}}),null),t(r,n(me,{get checked(){return D()},onChange:Z,get disabled(){return h()},get children(){return l.t("dialog.project.upload.overwrite")}}),_),t(r,n(p,{get when(){return h()},get children(){var e=U();return t(e,()=>l.t("dialog.project.upload.progress",{done:String(z().done),total:String(z().total)})),e}}),_),t(r,n(p,{get when(){return A()},get children(){var e=je();return t(e,A),e}}),_),t(_,n(k,{type:"button",variant:"ghost",size:"large",get disabled(){return h()},onClick:()=>F.close(),get children(){return l.t("common.cancel")}}),null),t(_,n(k,{type:"button",variant:"primary",size:"large",get disabled(){return!N()},onClick:()=>void le(),get children(){return K(()=>!!h())()?l.t("dialog.project.upload.uploading"):l.t("dialog.project.upload.confirm")}}),null),r}})}export{Ue as DialogProjectUpload};
@@ -1 +0,0 @@
1
- import{h as w,l as y,n as P,o as p,ag as k,i,c as e,t as l,b as E,s as u,aQ as S,aR as b,r as C,aS as L,aT as m,aM as g,aL as h,aB as $,aU as W,S as v,L as _,Z as A,aF as D,aG as H,aH as R,aV as j,aW as I,aX as M,aE as q,f as U,aY as B,aZ as F,a_ as G,X as O}from"./index-BfLPI17v.js";var T=l('<div class="os-client-chat-page os-client-welcome-chat"><section class="os-client-chat-stage is-empty"><div class=os-client-chat-hero><img class=os-client-logo src=/assets/onescience/onescience-logo.png alt=OneScience><h1>全流程科研模型生成平台</h1><p>从需求、数据、模型、skills 到运行环境,把科研工作组织成可执行的客户端任务。'),X=l("<div class=os-client-welcome-prompt-empty role=region aria-label=登录提示><div class=os-client-welcome-login-card><div class=os-client-welcome-login-copy><strong>登录后开始对话</strong><p>使用个人工作区与 Agent 协作,管理项目、会话与科研任务。"),Z=l("<div class=os-client-welcome-prompt-empty><p>正在准备工作区…"),x=l('<div class="os-client-welcome-prompt os-code-embed"data-component=session-prompt-dock>');function V(){const o=w(),n=y(),[d,t]=P(0),a=p(()=>(d(),!!u())),f=p(()=>a()&&(S({path:o.data.path,recent:b(o.data.project),lastCodeWorkspace:n.projects.lastCode()})||C(u())||L(document,o.data.path))||"");return k(()=>{const r=()=>t(c=>c+1);window.addEventListener(m,r),window.addEventListener(g,r),window.addEventListener(h,r),$(()=>{window.removeEventListener(m,r),window.removeEventListener(g,r),window.removeEventListener(h,r)}),W()?.type==="prompt"&&queueMicrotask(()=>document.querySelector('[data-component="prompt-input"]')?.focus())}),(()=>{var r=T();return r.firstChild,i(r,e(v,{get when(){return a()},get fallback(){return(()=>{var s=X(),c=s.firstChild;return c.firstChild,i(c,e(_,{get href(){return`/login?redirect=${encodeURIComponent("/workspace")}`},class:"os-client-welcome-login-cta",children:"去登录"}),null),s})()},get children(){return e(v,{get when(){return f()},get fallback(){return Z()},children:s=>e(K,{get directory(){return s()}})})}}),null),r})()}function K(o){const n=p(()=>({dir:A(o.directory),id:void 0}));return e(q,{params:n,get children(){return e(D,{directory:()=>o.directory,get children(){return e(H,{get children(){return e(R,{get children(){return e(j,{get children(){return e(I,{get children(){return e(M,{get children(){return e(N,{directory:()=>o.directory})}})}})}})}})}})}})}})}function N(o){const n=U(),d=t=>{const a=t.target;a instanceof Element&&a.closest('[data-action="prompt-attach"], [data-action="prompt-submit"]')&&(u()||(t.preventDefault(),t.stopPropagation(),O({navigate:n,action:{type:"prompt",prompt:""},isLoggedIn:!1})))};return[e(B,{}),(()=>{var t=x();return t.$$click=d,i(t,e(F,{get directory(){return o.directory}}),null),i(t,e(G,{}),null),t})()]}E(["click"]);export{V as WorkbenchHomePage};
@@ -1 +0,0 @@
1
- const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609071715/assets/nope-12-BJR1Ka3c.aac";export{e as default};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dialog-project-upload-Bs1_9kHj.js","assets/index-BfLPI17v.js","assets/index-BwtL4rk2.css","assets/dialog-terminal-unavailable-BOUZ3KsI.js"])))=>i.map(i=>d[i]);
2
- import{u as Ie,c as e,I as ie,D as $,i as r,S as _,F as pe,d as Be,t as i,p as ge,a as _e,s as J,b as ye,e as rt,f as Vt,g as st,h as Xt,j as Gt,k as Jt,l as Qt,m as Dt,n as W,o as y,q as Zt,r as ht,v as Yt,w as it,x as K,y as gt,z as Ve,A as en,B as mt,C as tn,E as he,G as nn,H as rn,M as sn,J as on,K as an,L as le,N as ln,O as cn,P as dn,Q as N,R as ve,T as j,U as un,V as hn,W as It,X as Xe,Y as vt,Z as pt,_ as me,$ as tt,a0 as gn,a1 as Mt,a2 as mn,a3 as vn,a4 as Ne,a5 as ft,a6 as Ge,a7 as pn,a8 as fn,a9 as bn,aa as wn,ab as $n,ac as _n,ad as yn,ae as kn,af as Sn,ag as Ke,ah as bt,ai as Rt,aj as xn,ak as nt,al as Cn,am as jt,an as ce,ao as Pn,ap as wt,aq as Ln,ar as En,as as Dn,at as In,au as Mn,av as qe,aw as Rn,ax as jn,ay as Tn,az as Tt,aA as zt,aB as De,aC as At,aD as zn,aE as An,aF as Hn,aG as Wn,aH as Fn,aI as Nn,aJ as On,aK as $t,aL as _t,aM as yt,aN as kt,aO as Bn,aP as Le}from"./index-BfLPI17v.js";import{DialogEditProject as qn}from"./dialog-edit-project-Dsv8HvjS.js";import{c as Kn}from"./selection-BDKVpung.js";var Un=i("<span class=os-client-session-menu-label>"),Vn=i("<div class=os-client-session-menu-empty>");const Je="os-client-session-menu",Xn="os-client-session-menu os-client-session-menu-sub";function Gn(l){const a=Ie(),n=()=>J(),P=()=>_e(n(),l.currentDirectory),u=()=>l.projects().filter(h=>ge(h.worktree)!==ge(l.currentDirectory)).filter(h=>!_e(n(),h.worktree));return e(_,{get when(){return P()},get children(){return e($.Sub,{get children(){return[e($.SubTrigger,{"data-action":"session-move",class:"os-client-session-menu-item",get children(){return[e(ie,{name:"folder",size:"small",class:"os-client-session-menu-icon"}),(()=>{var h=Un();return r(h,()=>a.t("session.move.toProject")),h})(),e(ie,{name:"chevron-right",size:"small",class:"os-client-session-menu-chevron"})]}}),e($.Portal,{get children(){return e($.SubContent,{class:Xn,get children(){return[e($.Item,{"data-action":"session-move-new-project",class:"os-client-session-menu-item",onSelect:()=>l.onNewProject(),get children(){return[e(ie,{name:"plus",size:"small",class:"os-client-session-menu-icon"}),e($.ItemLabel,{class:"os-client-session-menu-label",get children(){return a.t("session.move.newProject")}})]}}),e($.Separator,{class:"os-client-session-menu-separator"}),e(_,{get when(){return u().length>0},get fallback(){return(()=>{var h=Vn();return r(h,()=>a.t("session.move.emptyProjects")),h})()},get children(){return e(pe,{get each(){return u()},children:h=>e($.Item,{"data-action":"session-move-target",class:"os-client-session-menu-item",onSelect:()=>l.onMove(h.worktree),get children(){return[e(ie,{name:"folder",size:"small",class:"os-client-session-menu-icon"}),e($.ItemLabel,{class:"os-client-session-menu-label",get children(){return Be(h)}})]}})})}})]}})}})]}})}})}function St(l){const a=Ie();return[e($.Item,{"data-action":"session-archive",class:"os-client-session-menu-item",onSelect:()=>l.onArchive(),get children(){return[e(ie,{name:"archive",size:"small",class:"os-client-session-menu-icon"}),e($.ItemLabel,{class:"os-client-session-menu-label",get children(){return a.t("common.archive")}})]}}),e(Gn,{get currentDirectory(){return l.currentDirectory},get projects(){return l.projects},get onMove(){return l.onMove},get onNewProject(){return l.onNewProject}}),e($.Separator,{class:"os-client-session-menu-separator"}),e($.Item,{"data-action":"session-delete",class:"os-client-session-menu-item is-danger",onSelect:()=>l.onDelete(),get children(){return[e(ie,{name:"trash",size:"small",class:"os-client-session-menu-icon"}),e($.ItemLabel,{class:"os-client-session-menu-label",get children(){return a.t("common.delete")}})]}})]}var xt=i('<div class="flex flex-col gap-4 pl-6 pr-2.5 pb-3"><span class="text-14-regular text-text-strong"></span><div class="flex justify-end gap-2">'),Jn=i("<span class=os-sidebar-label>"),Qn=i('<svg class=os-sidebar-icon viewBox="0 0 24 24"aria-hidden=true><path d="M21 15a2 2 0 0 1-2 2H8l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z">'),Zn=i("<span class=os-sidebar-label>新建会话"),Yn=i('<svg class=os-sidebar-icon viewBox="0 0 24 24"aria-hidden=true><path d="M5 5h5v5H5z"></path><path d="M14 5h5v5h-5z"></path><path d="M5 14h5v5H5z"></path><path d="M14 14h5v5h-5z">'),er=i("<span class=os-sidebar-label>能力中心"),tr=i('<svg class=os-sidebar-icon viewBox="0 0 24 24"aria-hidden=true><path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.5-3.5a5.8 5.8 0 0 1-7.6 7.6l-6.8 6.8a2.1 2.1 0 0 1-3-3l6.8-6.8a5.8 5.8 0 0 1 7.6-7.6z">'),nr=i("<span class=os-sidebar-label>skills设置"),rr=i('<svg class=os-sidebar-icon viewBox="0 0 24 24"aria-hidden=true><rect x=3 y=4 width=18 height=6 rx=1.5></rect><rect x=3 y=14 width=18 height=6 rx=1.5></rect><path d="M7 7h.01"></path><path d="M7 17h.01">'),sr=i("<span class=os-sidebar-label>资源配置"),ir=i("<p class=os-client-empty-hint>登录后同步个人空间"),or=i("<div class=os-client-task-list-scroll>"),ar=i("<button type=button class=os-client-task-more data-action=recent-expand>展开更多"),lr=i("<button type=button class=os-client-task-more data-action=recent-collapse>收起"),cr=i("<p class=os-client-empty-hint>登录后查看未分类会话"),dr=i("<button type=button class=os-client-shared-cases-more data-action=shared-cases-expand>展开更多"),ur=i("<button type=button class=os-client-shared-cases-more data-action=shared-cases-collapse>收起"),hr=i("<div class=os-client-shared-cases-list>"),gr=i('<section class="os-sidebar-group os-client-shared-cases"data-section=shared-cases><button type=button class=os-client-shared-cases-toggle data-action=shared-cases-toggle><span class=os-client-shared-cases-chevron aria-hidden=true></span><span>'),mr=i('<svg class=os-sidebar-icon viewBox="0 0 24 24"aria-hidden=true><path d="M7 4h7l3 3v13H7z"></path><path d="M14 4v4h4"></path><path d="M10 12h5"></path><path d="M10 16h5">'),vr=i("<span class=os-sidebar-label>帮助"),pr=i('<aside class=os-sidebar><div class=os-sidebar-brand></div><nav class=os-sidebar-nav><div class=os-sidebar-nav-scroll><div class="os-sidebar-group os-client-capability-group"></div><div class="os-sidebar-group os-client-list-section"><div class=os-client-section-title><span>项目</span><span class=os-client-section-actions><button type=button aria-label=新建项目>+</button></span></div><div class=os-client-project-list></div></div><div class="os-sidebar-group os-client-list-section"><div class=os-client-section-title><span>未分类</span><span class=os-client-section-actions><button type=button aria-label=新建会话>+</button></span></div><div class=os-client-task-list></div></div></div></nav><div class=os-sidebar-footer><div class=os-sidebar-footer-actions><button type=button class=os-sidebar-footer-action><svg class=os-sidebar-icon viewBox="0 0 24 24"aria-hidden=true><path d="M12 8.5a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7Z"></path><path d="M12 3.5v2"></path><path d="M12 18.5v2"></path><path d="m5.6 5.6 1.4 1.4"></path><path d="m17 17 1.4 1.4"></path><path d="M3.5 12h2"></path><path d="M18.5 12h2"></path><path d="m5.6 18.4 1.4-1.4"></path><path d="m17 7 1.4-1.4"></path></svg><span class=os-sidebar-label>设置'),fr=i("<p class=os-client-empty-hint>暂无项目,点击 + 打开目录"),br=i("<div class=os-client-project-sessions>"),wr=i("<div class=os-client-project-block><div class=os-client-project-row>"),Qe=i("<span class=os-client-task-main><span>"),Ct=i("<div class=os-client-session-row>"),$r=i("<p class=os-client-empty-hint>暂无未分类会话,点击 + 新建"),_r=i("<p class=os-client-empty-hint>暂无默认案例");const Oe=4,Pt=200,Ze=4;function yr(){const l=rt(),a=Vt(),n=Ie(),P=st(),u=Xt(),h=Gt(),m=Jt(),A=Qt(),L=Dt(),w=()=>!!J(),I=()=>It(l.pathname),T=()=>(l.pathname,l.search,Kn()),b=()=>l.pathname.startsWith("/workspace/capabilities"),k=()=>l.pathname.startsWith("/workspace/skills"),oe=()=>l.pathname.startsWith("/workspace/resources"),X=()=>l.pathname.startsWith("/workspace/docs"),[S,C]=W(!0),[D,U]=W(!1),[V,ae]=W(!1),Q=y(()=>Zt(P.projects.list(),J())),q=y(()=>Q().filter(t=>!_e(J(),t.worktree))),fe=y(()=>ht(J())?.trim()||""),re=y(()=>Yt(J())?.trim()||""),de=y(()=>{const t=/^\/workspace\/([^/]+)\/session/.exec(l.pathname)?.[1];return t?it(t)??"":""}),Z=()=>/\/session\/([^/?#]+)/.exec(l.pathname)?.[1],ue=t=>{const o=de();if(!o)return!1;const g=ge(o);return ge(t.worktree)===g?!0:t.sandboxes?.some(H=>ge(H)===g)??!1};K(()=>{if(!w())return;const t=[...q().flatMap(o=>[o.worktree,...o.sandboxes??[]]),fe()].filter(o=>o.length>0);for(const o of t)gt(()=>{u.project.loadSessions(o)})}),K(()=>{const t=re();if(!t)return;const[o,g]=u.child(t,{bootstrap:!1});(o.limit??0)<Pt&&g("limit",Pt),gt(()=>{u.project.loadSessions(t)})});const te=y(()=>{const t=fe();if(!t)return[];const[o]=u.child(t,{bootstrap:!1});return Ve(o,Date.now(),t).map(g=>({session:g,directory:t}))}),c=y(()=>V()?te():te().slice(0,Ze)),M=y(()=>!V()&&te().length>Ze),d=y(()=>V()&&te().length>Ze),f=y(()=>{const t=re();if(!t)return[];const[o]=u.child(t,{bootstrap:!1});return en(Ve(o,Date.now(),t).filter(g=>mt(g.id)))}),v=y(()=>S()?D()?f():f().slice(0,Oe):[]),p=y(()=>S()&&!D()&&f().length>Oe),s=y(()=>S()&&D()&&f().length>Oe);K(()=>{const t=tn(l.search),o=Z(),g=t&&t!=="open"?t:mt(o)?o:void 0;if((t||g)&&C(!0),g&&f().findIndex(G=>G.id===g)>=Oe&&U(!0),!t||t==="open")return;const H=re();H&&o!==t&&a(he(H,t),{replace:!0})});function E(t,o=!0){P.projects.open(t),A.projects.touchCode(t),o&&a(he(t))}function B(){L.show(()=>e(_n,{onCreated:t=>E(t)}))}function Me(t){L.show(()=>e(qn,{project:t}))}function Re(t){const o=t.worktree;if(_e(J(),o))return;const g=q(),H=ge(o),z=g.findIndex(se=>ge(se.worktree)===H);if(z===-1)return;if(ue(t)){const se=g[z+1]??g[z-1];a(se?he(se.worktree):"/workspace")}P.projects.close(o)}async function je(){const t=m.openDirectoryPickerDialog;function o(g){if(Array.isArray(g)){g.forEach((H,z)=>E(H,z===0));return}g&&E(g)}if(t&&fn({hasNativePicker:!!t,isLocalServer:!!A.isLocal(),hasPlatformSession:!!J()})){const g=await t({title:n.t("command.project.open"),multiple:!0});o(g);return}L.show(()=>e(bn,{multiple:!0,onSelect:o,onCreateFolder:B}),()=>o(null))}function be(){Xe({navigate:a,action:{type:"install",resourceId:"__project__"},isLoggedIn:w()})&&je()}function Te(){if(!Xe({navigate:a,action:{type:"install",resourceId:"__task__"},isLoggedIn:w()}))return;const t=ht(J());t&&(vt(pt(t)),E(t))}function ze(t){Xe({navigate:a,action:{type:"install",resourceId:"__task__"},isLoggedIn:w()})&&(vt(pt(t)),E(t))}function ke(t){const o=J();return gn(o,t)?!1:Mt(o,t)}function Ae(t){if(!ke(t)){me({title:n.t("dialog.project.upload.failed"),description:n.t("dialog.project.upload.destinationHint"),variant:"error"});return}tt(()=>import("./dialog-project-upload-Bs1_9kHj.js"),__vite__mapDeps([0,1,2])).then(o=>{L.show(()=>e(o.DialogProjectUpload,{directory:t}))})}function He(t){tt(()=>import("./index-BfLPI17v.js").then(o=>o.ee),__vite__mapDeps([1,2])).then(o=>{L.show(()=>e(o.DialogProjectEnvironment,{directory:t}))})}function Se(t){if(Z()!==t.id)return;const o=de();if(!o){a("/workspace");return}a(he(o))}function we(t,o){const[,g]=u.child(t,{bootstrap:!1});g(wn(H=>{const z=$n.search(H.session,o,se=>se.id);if(!z.found)return;const G=H.session[z.index];H.session.splice(z.index,1),G&&!G.parentID&&(H.sessionTotal=Math.max(0,H.sessionTotal-1))}))}async function xe(t){we(t.directory,t.id),Se(t),await h.client.session.update({directory:t.directory,sessionID:t.id,time:{archived:Date.now()}}).then(()=>!0).catch(g=>(me({title:n.t("common.archive"),description:Ge(g,n.t("common.requestFailed"))}),!1))||u.project.loadSessions(t.directory)}async function We(t){return await h.client.session.delete({sessionID:t.id,directory:t.directory}).then(g=>g.data).catch(g=>(me({title:n.t("session.delete.failed.title"),description:Ge(g,n.t("common.requestFailed"))}),!1))?(we(t.directory,t.id),Se(t),!0):!1}function Ce(t){const o=$e(t);L.show(()=>e(ft,{get title(){return n.t("session.delete.title")},fit:!0,get children(){var g=xt(),H=g.firstChild,z=H.nextSibling;return r(H,()=>n.t("session.delete.confirm",{name:o})),r(z,e(Ne,{variant:"ghost",size:"large",onClick:()=>L.close(),get children(){return n.t("common.cancel")}}),null),r(z,e(Ne,{variant:"primary",size:"large",onClick:()=>{We(t).then(G=>{G&&L.close()})},get children(){return n.t("session.delete.button")}}),null),g}}))}function Fe(t){const[o]=u.child(t,{bootstrap:!1});return Ve(o,Date.now(),t).map(g=>({session:g,directory:t}))}function $e(t){const[o]=u.child(t.directory,{bootstrap:!1});return mn({title:t.title,fallbackText:vn(t.id,o.message,o.part),emptyLabel:n.t("command.session.new")})}function Pe(t,o){if(ge(t.directory)===ge(o))return;if(!_e(J(),t.directory)){me({title:n.t("session.move.failed.title"),description:n.t("session.move.failed.onlyDefault")});return}if(_e(J(),o)){me({title:n.t("session.move.failed.title"),description:n.t("session.move.failed.onlyDefault")});return}const g=Be({worktree:o});L.show(()=>e(ft,{get title(){return n.t("session.move.confirm.title")},fit:!0,get children(){var H=xt(),z=H.firstChild,G=z.nextSibling;return r(z,()=>n.t("session.move.confirm.description",{project:g})),r(G,e(Ne,{variant:"ghost",size:"large",onClick:()=>L.close(),get children(){return n.t("common.cancel")}}),null),r(G,e(Ne,{variant:"primary",size:"large",onClick:()=>{Ht(t,o).then(se=>{se&&L.close()})},get children(){return n.t("session.move.confirm.action")}}),null),H}}))}async function Ht(t,o){const g=t.directory;return await h.client.session.update({directory:t.directory,sessionID:t.id,moveTo:o}).then(()=>!0).catch(z=>(me({title:n.t("session.move.failed.title"),description:Ge(z,n.t("common.requestFailed"))}),!1))?(we(g,t.id),P.projects.open(o),A.projects.touchCode(o),u.project.loadSessions(g),u.project.loadSessions(o),Z()===t.id?(a(he(o,t.id)),!0):(me({title:n.t("session.move.success.title"),description:n.t("session.move.success.description",{project:Be({worktree:o})})}),!0)):!1}function Wt(){L.show(()=>e(pn,{tab:"account"}))}return(()=>{var t=pr(),o=t.firstChild,g=o.nextSibling,H=g.firstChild,z=H.firstChild,G=z.nextSibling,se=G.firstChild,Ft=se.firstChild,Nt=Ft.nextSibling,ot=Nt.firstChild,Ot=se.nextSibling,at=G.nextSibling,lt=at.firstChild,Bt=lt.firstChild,qt=Bt.nextSibling,ct=qt.firstChild,Kt=lt.nextSibling,Ut=g.nextSibling,dt=Ut.firstChild,ut=dt.firstChild;return nn(o,rn(()=>m.platform==="desktop"?{"data-tauri-drag-region":!0}:{}),!1,!0),r(o,e(le,{get href(){return an(m.platform)},class:"os-sidebar-brand-link",get children(){return[e(sn,{class:"os-sidebar-brand-mark"}),(()=>{var x=Jn();return r(x,()=>on(m.platform)),x})()]}})),r(z,e(le,{get href(){return ln()},class:"os-sidebar-link",get classList(){return{"is-active":I()}},get children(){return[Qn(),Zn()]}}),null),r(z,e(le,{get href(){return T()},class:"os-sidebar-link",get classList(){return{"is-active":b()}},get children(){return[Yn(),er()]}}),null),r(z,e(le,{get href(){return cn()},class:"os-sidebar-link",get classList(){return{"is-active":k()}},get children(){return[tr(),nr()]}}),null),r(z,e(le,{get href(){return dn()},class:"os-sidebar-link",get classList(){return{"is-active":oe()}},get children(){return[rr(),sr()]}}),null),ot.$$click=be,r(Ot,e(_,{get when(){return ve(()=>!!w())()&&q().length>0},get fallback(){return e(_,{get when(){return w()},get children(){return fr()}})},get children(){return e(pe,{get each(){return q()},children:x=>(()=>{var F=wr(),Y=F.firstChild;return r(Y,e(le,{get href(){return he(x.worktree)},class:"os-client-project-item",get children(){return Be(x)}}),null),r(Y,e($,{get children(){return[e($.Trigger,{type:"button",class:"os-client-project-more",get"aria-label"(){return n.t("common.moreOptions")},onClick:ee=>ee.stopPropagation(),children:"..."}),e($.Portal,{get children(){return e($.Content,{class:Je,get children(){return[e($.Item,{"data-action":"project-new-session",class:"os-client-session-menu-item",onSelect:()=>ze(x.worktree),get children(){return[e(ie,{name:"new-session",size:"small",class:"os-client-session-menu-icon"}),e($.ItemLabel,{class:"os-client-session-menu-label",get children(){return n.t("command.session.new")}})]}}),e(_,{get when(){return ke(x.worktree)},get children(){return e($.Item,{"data-action":"project-upload",class:"os-client-session-menu-item",onSelect:()=>Ae(x.worktree),get children(){return[e(ie,{name:"cloud-upload",size:"small",class:"os-client-session-menu-icon"}),e($.ItemLabel,{class:"os-client-session-menu-label",get children(){return n.t("command.project.upload")}})]}})}}),e($.Item,{"data-action":"project-environment",class:"os-client-session-menu-item",onSelect:()=>He(x.worktree),get children(){return[e(ie,{name:"console",size:"small",class:"os-client-session-menu-icon"}),e($.ItemLabel,{class:"os-client-session-menu-label",get children(){return n.t("sidebar.project.environment")}})]}}),e($.Item,{"data-action":"project-rename",class:"os-client-session-menu-item",onSelect:()=>Me(x),get children(){return[e(ie,{name:"edit",size:"small",class:"os-client-session-menu-icon"}),e($.ItemLabel,{class:"os-client-session-menu-label",get children(){return n.t("common.rename")}})]}}),e($.Separator,{class:"os-client-session-menu-separator"}),e($.Item,{"data-action":"project-remove-from-view",class:"os-client-session-menu-item",onSelect:()=>Re(x),get children(){return[e(ie,{name:"close-small",size:"small",class:"os-client-session-menu-icon"}),e($.ItemLabel,{class:"os-client-session-menu-label",get children(){return n.t("sidebar.project.removeFromView")}})]}})]}})}})]}}),null),r(F,e(_,{get when(){return ue(x)},get children(){var ee=br();return r(ee,e(pe,{get each(){return Fe(x.worktree)},children:R=>(()=>{var O=Ct();return r(O,e(le,{get href(){return he(R.directory,R.session.id)},class:"os-client-task-item",get classList(){return{"is-active":Z()===R.session.id}},get"data-session-id"(){return R.session.id},get children(){var ne=Qe(),Ue=ne.firstChild;return r(Ue,()=>$e(R.session)),ne}}),null),r(O,e($,{get children(){return[e($.Trigger,{type:"button",class:"os-client-session-more",get"aria-label"(){return n.t("common.moreOptions")},onClick:ne=>ne.stopPropagation(),children:"..."}),e($.Portal,{get children(){return e($.Content,{class:Je,get children(){return e(St,{get currentDirectory(){return R.directory},projects:q,onArchive:()=>void xe(R.session),onDelete:()=>Ce(R.session),onMove:ne=>Pe(R.session,ne),onNewProject:be})}})}})]}}),null),N(()=>O.classList.toggle("is-active",Z()===R.session.id)),O})()})),ee}}),null),F})()})}})),r(G,e(_,{get when(){return!w()},get children(){return ir()}}),null),ct.$$click=Te,r(Kt,e(_,{get when(){return ve(()=>!!w())()&&te().length>0},get fallback(){return e(_,{get when(){return w()},get children(){return $r()}})},get children(){return[(()=>{var x=or();return r(x,e(pe,{get each(){return c()},children:F=>(()=>{var Y=Ct();return r(Y,e(le,{get href(){return he(F.directory,F.session.id)},class:"os-client-task-item",get classList(){return{"is-active":Z()===F.session.id}},get"data-session-id"(){return F.session.id},get children(){var ee=Qe(),R=ee.firstChild;return r(R,()=>$e(F.session)),ee}}),null),r(Y,e($,{get children(){return[e($.Trigger,{type:"button",class:"os-client-session-more",get"aria-label"(){return n.t("common.moreOptions")},onClick:ee=>ee.stopPropagation(),children:"..."}),e($.Portal,{get children(){return e($.Content,{class:Je,get children(){return e(St,{get currentDirectory(){return F.directory},projects:q,onArchive:()=>void xe(F.session),onDelete:()=>Ce(F.session),onMove:ee=>Pe(F.session,ee),onNewProject:be})}})}})]}}),null),N(()=>Y.classList.toggle("is-active",Z()===F.session.id)),Y})()})),N(()=>j(x,"data-expanded",V()?"true":"false")),x})(),e(_,{get when(){return M()},get children(){var x=ar();return x.$$click=()=>ae(!0),x}}),e(_,{get when(){return d()},get children(){var x=lr();return x.$$click=()=>ae(!1),x}})]}})),r(at,e(_,{get when(){return!w()},get children(){return cr()}}),null),r(g,e(_,{get when(){return re()},get children(){var x=gr(),F=x.firstChild,Y=F.firstChild,ee=Y.nextSibling;return F.$$click=()=>C(R=>!R),r(ee,()=>n.t("sidebar.section.sharedCases")),r(x,e(_,{get when(){return S()},get children(){var R=hr();return r(R,e(_,{get when(){return v().length>0},get fallback(){return _r()},get children(){return e(pe,{get each(){return v()},children:O=>e(le,{get href(){return he(re(),O.id)},class:"os-client-task-item",get classList(){return{"is-active":Z()===O.id}},get"data-session-id"(){return O.id},get children(){var ne=Qe(),Ue=ne.firstChild;return r(Ue,()=>un(O.title)??O.id),ne}})})}}),null),r(R,e(_,{get when(){return p()},get children(){var O=dr();return O.$$click=()=>U(!0),O}}),null),r(R,e(_,{get when(){return s()},get children(){var O=ur();return O.$$click=()=>U(!1),O}}),null),R}}),null),N(R=>{var O=S(),ne=S()?"true":"false";return O!==R.e&&j(F,"aria-expanded",R.e=O),ne!==R.t&&j(Y,"data-open",R.t=ne),R},{e:void 0,t:void 0}),x}}),null),r(dt,e(le,{get href(){return hn()},class:"os-sidebar-footer-action",get classList(){return{"is-active":X()}},get children(){return[mr(),vr()]}}),ut),ut.$$click=Wt,N(x=>{var F=!w(),Y=!w();return F!==x.e&&ot.classList.toggle("is-muted",x.e=F),Y!==x.t&&ct.classList.toggle("is-muted",x.t=Y),x},{e:void 0,t:void 0}),t})()}ye(["click"]);var kr=i('<pre class="os-client-right-files-preview whitespace-pre-wrap break-all p-3 text-12-regular m-0">'),Sr=i("<button type=button class=os-client-right-files-back>← 返回目录"),xr=i("<span class=os-client-right-files-title>"),Cr=i("<button type=button>"),Pr=i("<div class=os-client-right-files-actions><button type=button>关闭"),Lr=i("<p class=os-client-right-files-hint>正在加载目录…"),Er=i("<p class=os-client-right-files-hint>该目录为空"),Dr=i("<div class=os-client-right-files-tree><p class=os-client-right-files-root></p><div class=os-client-right-files-tree-scroll>"),Ir=i("<div class=os-client-right-files-unsaved>"),Mr=i("<p class=os-client-right-files-hint>…"),Rr=i("<textarea class=os-client-right-files-textarea autocapitalize=off autocomplete=off autocorrect=off>"),jr=i("<pre class=os-client-right-files-preview>"),Tr=i("<div class=os-client-right-files-editor>"),zr=i("<section class=os-client-right-files><header class=os-client-right-files-header>"),Ar=i("<strong>目录"),Hr=i("<div class=os-client-right-files-actions><button type=button aria-label=刷新>刷新</button><button type=button>关闭"),Wr=i("<p class=os-client-right-files-hint>加载失败:"),Fr=i("<p class=os-client-right-files-hint>");function Nr(l){const a=l.replace(/\\/g,"/").split("/");return a[a.length-1]||l}function Or(l){const a=yn(),n=kn(),P=Ie(),[u,h]=W("tree"),[m,A]=W(),[L,w]=W(""),[I,T]=W(!1),[b,k]=W(!1),[oe,X]=W(0);let S;const C=y(()=>a.tree.state("")),D=y(()=>a.tree.children("")),U=y(()=>Sn(m())),V=(d=!1)=>{n.directory&&(d?a.tree.refresh(""):a.tree.list(""))};Ke(()=>{queueMicrotask(()=>V(!0))}),K(()=>{if(!n.directory||u()!=="tree")return;const f=C();f?.loading||f?.loaded||f?.error||a.tree.list("")});const ae=y(()=>{const d=m();if(d)return a.get(d)}),Q=y(()=>ae()?.content?.content??""),q=y(()=>!!ae()?.loaded),fe=y(()=>!!ae()?.loading),re=y(()=>ae()?.error),de=y(()=>{const d=ae();return!(!d?.loaded||d.content?.type!=="text"||d.content.encoding==="base64"||bt(m()))}),Z=y(()=>de()&&U()==="text"),ue=y(()=>{if(!(!de()||Z()))return{draft:L,setDraft:d=>{w(d),T(!0)},textareaRef:d=>{S=d},class:"os-client-right-files-textarea"}}),te=d=>(()=>{var f=kr();return r(f,d),f})();K(()=>{const d=m();d&&a.load(d)}),K(Rt(m,()=>{T(!1),w(q()?Q():""),X(0)},{defer:!1})),K(()=>{!q()||I()||w(Q())});const c=async()=>{const d=m();if(!(!d||b()||!I()||!de())){k(!0);try{await a.write(d,L()),T(!1),wt(d)&&X(f=>f+1)}finally{k(!1)}}};K(()=>{if(typeof window>"u")return;xn(window,"keydown",f=>{!(f.metaKey||f.ctrlKey)||f.key.toLowerCase()!=="s"||!S?.contains(document.activeElement)&&document.activeElement!==S||(f.preventDefault(),c())})});const M=d=>{A(d),h("editor")};return(()=>{var d=zr(),f=d.firstChild;return r(f,e(_,{get when(){return u()==="editor"},get fallback(){return[Ar(),(()=>{var v=Hr(),p=v.firstChild,s=p.nextSibling;return p.$$click=()=>{V(!0),a.tree.refreshAll()},nt(s,"click",l.onClose,!0),v})()]},get children(){return[(()=>{var v=Sr();return v.$$click=()=>h("tree"),v})(),(()=>{var v=xr();return r(v,(()=>{var p=ve(()=>!!m());return()=>p()?Nr(m()):""})()),N(()=>j(v,"title",m())),v})(),(()=>{var v=Pr(),p=v.firstChild;return r(v,e(_,{get when(){return de()},get children(){var s=Cr();return s.$$click=()=>void c(),r(s,(()=>{var E=ve(()=>!!b());return()=>E()?P.t("common.saving"):P.t("common.save")})()),N(()=>s.disabled=!I()||b()),s}}),p),nt(p,"click",l.onClose,!0),v})()]}})),r(d,e(_,{get when(){return u()==="tree"},get children(){var v=Dr(),p=v.firstChild,s=p.nextSibling;return r(p,()=>n.directory),r(v,e(_,{get when(){return ve(()=>!!C()?.loading)()&&D().length===0},get children(){return Lr()}}),s),r(v,e(_,{get when(){return C()?.error},children:E=>(()=>{var B=Wr();return B.firstChild,r(B,E,null),B})()}),s),r(v,e(_,{get when(){return ve(()=>!!(C()?.loaded&&D().length===0))()&&!C()?.error},get children(){return Er()}}),s),r(s,e(Cn,{path:"",class:"os-client-right-file-tree",nodeClass:"os-client-right-file-node",get active(){return m()},draggable:!1,onFileClick:E=>M(E.path)})),N(()=>j(p,"title",n.directory)),v}}),null),r(d,e(_,{get when(){return u()==="editor"},get children(){var v=Tr();return r(v,e(_,{get when(){return I()},get children(){var p=Ir();return r(p,()=>P.t("session.file.unsaved")),p}}),null),r(v,e(_,{get when(){return ve(()=>!!fe())()&&!q()},get children(){var p=Mr(),s=p.firstChild;return r(p,()=>P.t("common.loading"),s),p}}),null),r(v,e(_,{get when(){return re()},children:p=>(()=>{var s=Fr();return r(s,p),s})()}),null),r(v,e(_,{get when(){return q()},get children(){return e(jt,{get children(){return[e(ce,{get when(){return wt(m())},get children(){return e(Pn,{path:m,contents:Q,renderSource:te,get editSource(){return ue()},previewRevision:oe,chrome:"workbench"})}}),e(ce,{get when(){return U()==="markdown"},get children(){return e(Ln,{path:m,contents:Q,renderSource:te,get editSource(){return ue()},chrome:"workbench"})}}),e(ce,{get when(){return U()==="csv"},get children(){return e(En,{path:m,contents:Q,renderSource:te,get editSource(){return ue()},chrome:"workbench"})}}),e(ce,{get when(){return bt(m())},get children(){return e(Dn,{path:m,chrome:"workbench"})}}),e(ce,{get when(){return Mn(m())},get children(){return e(In,{path:m,contents:Q,renderSource:te,get editSource(){return ue()},chrome:"workbench"})}}),e(ce,{get when(){return Z()},get children(){var p=Rr();p.$$input=E=>{w(E.currentTarget.value),T(!0)};var s=S;return typeof s=="function"?qe(s,p):S=p,j(p,"spellcheck",!1),N(()=>p.value=L()),p}}),e(ce,{when:!0,get children(){var p=jr();return r(p,()=>Q()||"(二进制或不支持预览的文件)"),p}})]}})}}),null),v}}),null),N(()=>j(d,"data-view",u())),d})()}ye(["click","input"]);var Br=i('<svg viewBox="0 0 12 12"width=12 height=12 fill=currentColor aria-hidden=true><circle cx=6 cy=6 r=3 class=os-client-right-todo-pulse>'),qr=i("<ul class=os-client-right-todo-list>"),Kr=i("<span class=os-client-right-todo-text>"),Ur=i("<li class=os-client-right-todo-item>"),Vr=i("<p class=os-client-right-todo-progress>已完成 <!> / "),Xr=i("<section class=os-client-right-todo><header class=os-client-right-todo-header><strong></strong><button type=button>关闭"),Gr=i("<p class=os-client-right-todo-empty>暂无场景工作流。从能力中心场景创建任务后,步骤会显示在这里。"),Jr=i("<span class=os-client-right-todo-stop> · ");function Qr(l){return l==="completed"?"completed":l==="in_progress"?"in_progress":l==="failed"?"cancelled":"pending"}function Zr(l){if(l==="in_progress")return Br()}function Yr(l){return(()=>{var a=qr();return r(a,e(pe,{get each(){return l.items},children:n=>(()=>{var P=Ur();return r(P,e(Tn,{readOnly:!0,get checked(){return n.status==="completed"},get indeterminate(){return n.status==="in_progress"},get icon(){return Zr(n.status)},get children(){var u=Kr();return r(u,()=>n.content),N(h=>{var m=n.status==="completed"||n.status==="cancelled",A=n.status==="pending";return m!==h.e&&u.classList.toggle("is-done",h.e=m),A!==h.t&&u.classList.toggle("is-pending",h.t=A),h},{e:void 0,t:void 0}),u}})),N(()=>j(P,"data-state",n.status)),P})()})),a})()}function es(l){Rn();const a=y(()=>jn(l.directoryKey)),n=y(()=>{const h=a();return h?.steps.length?h.steps.map(m=>({content:m.name,status:Qr(m.status)})):[]}),P=y(()=>n().filter(h=>h.status==="completed").length),u=y(()=>a()?.title||"待办");return(()=>{var h=Xr(),m=h.firstChild,A=m.firstChild,L=A.nextSibling;return r(A,u),nt(L,"click",l.onClose,!0),r(h,e(_,{get when(){return n().length>0},get fallback(){return Gr()},get children(){return[(()=>{var w=Vr(),I=w.firstChild,T=I.nextSibling;return T.nextSibling,r(w,P,T),r(w,()=>n().length,null),r(w,e(_,{get when(){return a()?.stopReason},children:b=>(()=>{var k=Jr();return k.firstChild,r(k,b,null),k})()}),null),w})(),e(Yr,{get items(){return n()}})]}}),null),N(()=>j(A,"title",u())),h})()}ye(["click"]);var ts=i("<div class=os-client-right-add-dropdown role=menu>"),ns=i('<aside class="os-client-right-sidebar os-client-right-dock"><div class=os-client-right-toolbar><div class=os-client-right-add-menu><button type=button class=os-client-right-add-button aria-label=打开页面><span class=os-client-right-add-icon aria-hidden=true></span></button></div></div><div class=os-client-right-dock-body>'),rs=i("<button type=button role=menuitem>"),ss=i("<section class=os-client-right-empty><strong>尚未打开页面</strong><p>点击 + 打开目录、可视化组件或待办;在会话中可从目录点文件到右侧编辑。"),is=i("<section class=os-client-right-pane-stub><header><strong>可视化组件</strong><button type=button>关闭</button></header><p>请从「目录」中打开 `.html` / `.md` / `.csv` / `.pdf` / `.xyz` 文件查看可视化预览;后续版本将提供独立可视化入口。"),os=i("<section class=os-client-right-pane-stub><header><strong>目录</strong><button type=button>关闭</button></header><p>请先打开项目或任务后再查看目录。"),as=i("<section class=os-client-right-pane-stub><header><strong>待办</strong><button type=button>关闭</button></header><p>请先打开项目或任务后再查看待办。");const ls=[{id:"directory",label:"目录"},{id:"viz",label:"可视化组件"},{id:"todo",label:"待办"}];function cs(){const l=rt(),[a,n]=W(!1),[P,u]=W();let h;const m=y(()=>Tt(l.pathname)),A=y(()=>{const I=m()?.dir;return I?it(I)??"":""}),L=y(()=>zt(l.pathname)&&!!A());Ke(()=>{const I=T=>{a()&&(h?.contains(T.target)||n(!1))};document.addEventListener("pointerdown",I),De(()=>document.removeEventListener("pointerdown",I))}),K(()=>{if(!At())return;const T=zn();T&&(u(T),n(!1))});const w=I=>{u(I),n(!1)};return(()=>{var I=ns(),T=I.firstChild,b=T.firstChild,k=b.firstChild,oe=T.nextSibling,X=h;return typeof X=="function"?qe(X,T):h=T,k.$$click=()=>n(S=>!S),r(b,e(_,{get when(){return a()},get children(){var S=ts();return r(S,e(pe,{get each(){return[...ls]},children:C=>(()=>{var D=rs();return D.$$click=()=>w(C.id),r(D,()=>C.label),D})()})),S}}),null),r(oe,e(_,{get when(){return P()},get fallback(){return ss()},children:S=>e(jt,{get children(){return[e(ce,{get when(){return S()==="directory"},get children(){return e(_,{get when(){return L()},get fallback(){return(()=>{var C=os(),D=C.firstChild,U=D.firstChild,V=U.nextSibling;return V.$$click=()=>u(void 0),C})()},get children(){return e(An,{params:()=>({dir:m().dir,id:m()?.id}),get children(){return e(Hn,{directory:()=>A(),get children(){return e(Wn,{get children(){return e(Fn,{get children(){return e(Or,{onClose:()=>u(void 0)})}})}})}})}})}})}}),e(ce,{get when(){return S()==="todo"},get children(){return e(_,{get when(){return m()?.dir},get fallback(){return(()=>{var C=as(),D=C.firstChild,U=D.firstChild,V=U.nextSibling;return V.$$click=()=>u(void 0),C})()},children:C=>e(es,{get directoryKey(){return C()},get sessionID(){return m()?.id},onClose:()=>u(void 0)})})}}),e(ce,{get when(){return S()==="viz"},get children(){var C=is(),D=C.firstChild,U=D.firstChild,V=U.nextSibling;return V.$$click=()=>u(void 0),C}})]}})})),N(S=>{var C=!!a(),D=a();return C!==S.e&&k.classList.toggle("is-open",S.e=C),D!==S.t&&j(k,"aria-expanded",S.t=D),S},{e:void 0,t:void 0}),I})()}ye(["click"]);var ds=i('<button type=button class="os-client-panel-toggle os-client-terminal-toggle"aria-controls=terminal-panel>'),us=i('<svg class=os-client-pane-toggle-icon viewBox="0 0 24 24"aria-hidden=true><rect x=4.5 y=5.5 width=15 height=13 rx=1.35 fill=none stroke=currentColor stroke-width=1.4></rect><path d="M8 10.25l2.4 2.25L8 14.75M12.25 14.75H16"fill=none stroke=currentColor stroke-width=1.4 stroke-linecap=round stroke-linejoin=round>');function hs(){const l=rt(),a=st(),n=Ie(),P=Nn(),u=Dt(),[h,m]=W(J()),A=y(()=>It(l.pathname)||zt(l.pathname)),L=y(()=>!A()||On()&&!h()?!1:a.terminal.enabled()?!0:$t(h())),w=y(()=>a.view("workbench").terminal.opened()),I=y(()=>{const b=Tt(l.pathname);return b?.dir?it(b.dir)??"":""});Ke(()=>{const b=()=>m(J());window.addEventListener(_t,b),window.addEventListener(yt,b),window.addEventListener("storage",b),De(()=>{window.removeEventListener(_t,b),window.removeEventListener(yt,b),window.removeEventListener("storage",b)})}),K(()=>{L()&&kt()}),K(Rt(A,(b,k)=>{k===void 0||b||!k||w()&&(a.view("workbench").terminal.close(),a.terminal.closeFullscreen())}));const T=()=>{if($t(h())||!a.terminal.enabled()){tt(()=>import("./dialog-terminal-unavailable-BOUZ3KsI.js"),__vite__mapDeps([3,1,2])).then(b=>{u.show(()=>e(b.DialogTerminalUnavailable,{}))});return}if(!w()){const b=I();if(b&&!Mt(h(),b))return;kt()}a.view("workbench").terminal.toggle()};return e(_,{get when(){return L()},get children(){var b=ds();return b.$$click=k=>k.preventDefault(),b.$$pointerdown=k=>{k.button===0&&(k.preventDefault(),T())},r(b,e(gs,{get active(){return w()}})),N(k=>{var oe=!!w(),X=n.t("command.terminal.toggle"),S=n.t("command.terminal.toggle"),C=w(),D=`${n.t("command.terminal.toggle")} (${P.keybind("terminal.toggle")})`;return oe!==k.e&&b.classList.toggle("is-active",k.e=oe),X!==k.t&&j(b,"data-tooltip",k.t=X),S!==k.a&&j(b,"aria-label",k.a=S),C!==k.o&&j(b,"aria-expanded",k.o=C),D!==k.i&&j(b,"title",k.i=D),k},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),b}})}function gs(l){return(()=>{var a=us(),n=a.firstChild,P=n.nextSibling;return N(()=>j(P,"opacity",l.active?1:.85)),a})()}ye(["pointerdown","click"]);var ms=i('<svg class=os-client-pane-toggle-icon viewBox="0 0 24 24"aria-hidden=true><rect class=os-client-pane-toggle-icon-main x=4.5 y=5.5 width=7.7 height=13 rx=1.35></rect><rect class=os-client-pane-toggle-icon-divider x=12.15 y=5.5 width=1.15 height=13 rx=0.55></rect><rect class=os-client-pane-toggle-icon-side x=14.05 y=5.5 width=5.45 height=13 rx=1.35>'),vs=i('<div class="os-client-pane-resizer os-client-pane-resizer-sidebar"role=separator aria-orientation=vertical aria-label=调整左边栏宽度 aria-valuemin=230 aria-valuemax=430 tabindex=0>'),ps=i('<div class="os-client-pane-resizer os-client-pane-resizer-tool"role=separator aria-orientation=vertical aria-label=调整右边栏宽度 aria-valuemin=200 aria-valuemax=1280 tabindex=0>'),fs=i("<main class=os-client-workbench><div class=os-client-workbench-chrome><button type=button class=os-client-panel-toggle></button><button type=button class=os-client-panel-toggle></button></div><section class=os-workspace-main></section><div class=os-client-terminal-dock>");const Ee=320,bs=230,ws=430,$s=200,Lt=1280;function Et(l){return(()=>{var a=ms();return N(n=>{var P=l.side,u=l.open?"true":"false";return P!==n.e&&j(a,"data-side",n.e=P),u!==n.t&&j(a,"data-open",n.t=u),n},{e:void 0,t:void 0}),a})()}function Ye(l){return Math.min(ws,Math.max(bs,Math.round(l)))}function et(l){const a=typeof window>"u"?Lt:Math.min(Lt,Math.floor(window.innerWidth*.85));return Math.min(a,Math.max($s,Math.round(l)))}function Ss(l){const a=st(),[n,P]=W(!0),[u,h]=W(!1),[m,A]=W(Ee),[L,w]=W(Ee),[I,T]=W(!1),[b,k]=W(!1),[oe,X]=W(0),[S,C]=W({left:0,right:0}),[D,U]=W(),[V,ae]=W(),Q=y(()=>a.view("workbench").terminal.opened()),q=()=>Q(),fe=y(()=>{if(!Q())return 0;const c=oe();return c>0?c:a.terminal.height()}),re=()=>{const c=D();if(!c)return;const M=c.querySelector(":scope > .os-workspace-main");if(!M)return;const d=c.getBoundingClientRect(),f=getComputedStyle(c),v=d.left+(parseFloat(f.borderLeftWidth)||0),p=d.right-(parseFloat(f.borderRightWidth)||0),s=M.getBoundingClientRect(),B=c.querySelector(":scope > .os-client-right-sidebar")?.getBoundingClientRect()??s;C({left:Math.max(0,Math.round(s.left-v)),right:Math.max(0,Math.round(p-B.right))})},de=()=>{P(c=>(c||A(Ee),!c))},Z=()=>{h(c=>(c||w(Ee),!c))};K(()=>{At()&&(h(!0),w(M=>M>0?M:Ee))});const ue=c=>{if(c.button!==0)return;c.preventDefault();const M=c.clientX,d=m();T(!0);const f=p=>{A(Ye(d+(p.clientX-M)))},v=()=>{T(!1),window.removeEventListener("pointermove",f),window.removeEventListener("pointerup",v),window.removeEventListener("pointercancel",v)};window.addEventListener("pointermove",f),window.addEventListener("pointerup",v),window.addEventListener("pointercancel",v)},te=c=>{if(c.button!==0)return;c.preventDefault();const M=c.clientX,d=L();k(!0);const f=p=>{w(et(d+(M-p.clientX)))},v=()=>{k(!1),window.removeEventListener("pointermove",f),window.removeEventListener("pointerup",v),window.removeEventListener("pointercancel",v)};window.addEventListener("pointermove",f),window.addEventListener("pointerup",v),window.addEventListener("pointercancel",v)};return K(()=>{const c=V();if(!c||typeof ResizeObserver>"u")return;const M=()=>{const f=c.querySelector("#terminal-panel");X(f?Math.round(f.getBoundingClientRect().height):0)};M();const d=new ResizeObserver(M);d.observe(c),De(()=>d.disconnect())}),K(()=>{Q()||X(0)}),Ke(()=>{a.view("workbench").terminal.close(),a.terminal.closeFullscreen(),X(0)}),K(()=>{n(),u(),m(),L(),I(),b(),q(),D(),re();const c=requestAnimationFrame(re);De(()=>cancelAnimationFrame(c))}),K(()=>{const c=D();if(!c||typeof ResizeObserver>"u")return;const M=new ResizeObserver(()=>re());M.observe(c);const d=c.querySelector(":scope > .os-workspace-main");d&&M.observe(d);const f=c.querySelector(":scope > .os-client-right-sidebar");f&&M.observe(f),De(()=>M.disconnect())}),(()=>{var c=fs(),M=c.firstChild,d=M.firstChild,f=d.nextSibling,v=M.nextSibling,p=v.nextSibling;return qe(U,c),d.$$click=de,r(d,e(Et,{side:"left",get open(){return n()}})),r(M,e(hs,{}),f),f.$$click=Z,r(f,e(Et,{side:"right",get open(){return u()}})),r(c,e(_,{get when(){return n()},get children(){return[e(yr,{}),(()=>{var s=vs();return s.$$keydown=E=>{if(E.key==="ArrowLeft"){E.preventDefault(),A(B=>Ye(B-16));return}E.key==="ArrowRight"&&(E.preventDefault(),A(B=>Ye(B+16)))},s.$$pointerdown=ue,N(()=>j(s,"aria-valuenow",m())),s})()]}}),v),r(v,()=>l.children),r(c,e(_,{get when(){return u()},get children(){return[(()=>{var s=ps();return s.$$keydown=E=>{if(E.key==="ArrowLeft"){E.preventDefault(),w(B=>et(B+16));return}E.key==="ArrowRight"&&(E.preventDefault(),w(B=>et(B-16)))},s.$$pointerdown=te,N(()=>j(s,"aria-valuenow",L())),s})(),e(cs,{})]}}),p),qe(ae,p),j(p,"id",Bn),N(s=>{var E=!!n(),B=!!u(),Me=!!I(),Re=!!b(),je=!!q(),be=!!(a.terminal.fullscreen()&&a.view("workbench").terminal.opened()),Te=`${m()}px`,ze=`${L()}px`,ke=`${fe()}px`,Ae=`${S().left}px`,He=`${S().right}px`,Se=!!n(),we=n()?"关闭左侧栏":"打开左侧栏",xe=n()?"关闭左侧栏":"打开左侧栏",We=!!u(),Ce=u()?"关闭右侧栏":"打开右侧栏",Fe=u()?"关闭右侧栏":"打开右侧栏",$e=!!q(),Pe=!q();return E!==s.e&&c.classList.toggle("has-left-sidebar",s.e=E),B!==s.t&&c.classList.toggle("has-right-sidebar",s.t=B),Me!==s.a&&c.classList.toggle("is-resizing-left",s.a=Me),Re!==s.o&&c.classList.toggle("is-resizing-right",s.o=Re),je!==s.i&&c.classList.toggle("has-terminal-open",s.i=je),be!==s.n&&c.classList.toggle("has-terminal-fullscreen",s.n=be),Te!==s.s&&Le(c,"--os-client-sidebar-w",s.s=Te),ze!==s.h&&Le(c,"--os-client-tool-w",s.h=ze),ke!==s.r&&Le(c,"--os-client-terminal-h",s.r=ke),Ae!==s.d&&Le(c,"--os-client-terminal-left",s.d=Ae),He!==s.l&&Le(c,"--os-client-terminal-right",s.l=He),Se!==s.u&&d.classList.toggle("is-active",s.u=Se),we!==s.c&&j(d,"data-tooltip",s.c=we),xe!==s.w&&j(d,"aria-label",s.w=xe),We!==s.m&&f.classList.toggle("is-active",s.m=We),Ce!==s.f&&j(f,"data-tooltip",s.f=Ce),Fe!==s.y&&j(f,"aria-label",s.y=Fe),$e!==s.g&&p.classList.toggle("is-open",s.g=$e),Pe!==s.p&&j(p,"aria-hidden",s.p=Pe),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,u:void 0,c:void 0,w:void 0,m:void 0,f:void 0,y:void 0,g:void 0,p:void 0}),c})()}ye(["click","pointerdown","keydown"]);export{Ss as WorkbenchShell};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BfLPI17v.js","assets/index-BwtL4rk2.css"])))=>i.map(i=>d[i]);
2
- import{e1 as V,h as X,j as Y,c0 as z,m as Z,f as ee,u as H,aB as K,n as te,x as ae,e4 as se,e5 as Q,e6 as ne,e7 as re,o as O,e8 as le,i as a,c as s,e9 as b,S as _,F as A,dr as ce,R as T,Q as G,bJ as oe,a4 as w,ea as ie,T as ue,ae as de,dl as ge,dp as pe,_ as he,p as ve,t as u,P as be,$ as me,b as fe}from"./index-BfLPI17v.js";var xe=u("<div class=os-ssh-dialog-stack>"),N=u('<div class="flex flex-col px-2 pb-2"><div class="flex flex-col p-3 bg-background-base rounded-sm min-h-14 gap-2"><div class="flex flex-wrap gap-2 pt-1">'),ye=u('<div class="flex items-center gap-1 w-[360px] rounded-xl shadow-[var(--shadow-lg-border-base)]">'),I=u('<div class="text-14-regular text-text-base text-center my-auto py-2">'),_e=u('<button type=button class="flex items-center gap-2 w-full h-8 pl-3 pr-2 py-1 rounded-md hover:bg-surface-raised-base-hover transition-colors text-left"><div></div><span class="text-14-regular text-text-base truncate flex-1"></span><div>'),$e=u('<span class="text-11-regular text-text-weaker shrink-0">· 检测中...'),ke=u('<span class="text-12-regular text-text-weak truncate pl-3.5">'),Se=u('<button type=button class="flex flex-col gap-0.5 w-full px-3 py-1.5 rounded-md hover:bg-surface-raised-base-hover transition-colors text-left"><div class="flex items-center gap-2 min-w-0"><span class="os-ssh-connectivity-dot shrink-0"aria-hidden=true></span><span class="text-14-regular text-text-base truncate"></span><span class="text-11-regular text-text-weaker shrink-0">'),we=u('<span class="text-11-regular text-text-weaker shrink-0">· ');const Ce=()=>{const $=V(),m=de(),f=H(),k=z(),C=ge();return pe(()=>({mutationFn:async i=>{await($.data.mcp[i]?.status==="connected"?m.client.mcp.disconnect({name:i}):m.client.mcp.connect({name:i}))},onSuccess:()=>k.refetchQueries(C.mcp(ve($.directory))),onError:i=>{he({variant:"error",title:f.t("common.requestFailed"),description:i instanceof Error?i.message:String(i)})}}))};function De($){const m=V(),f=X(),k=Y(),C=z(),i=Z(),E=ee(),c=H();let M=0,F=!1;K(()=>{F=!0,M+=1});const[R,L]=te();ae(()=>{if(!$.shown()){L(void 0);return}let r=!1;const e=Q();(async()=>{const t=await se(k.url);r||e!==Q()||t===void 0||(L(t),ne(t),await re({serverUrl:k.url,queryClient:C}).catch(()=>{}))})(),K(()=>{r=!0})});const d=Ce(),j=O(()=>{const r=new Set([...Object.keys(f.data.config.mcp??{}),...Object.keys(m.data.mcp??{})]);return Array.from(r).sort((e,t)=>e.localeCompare(t))}),J=r=>m.data.mcp?.[r]?.status,B=O(()=>{const r=R()??f.data.config.ssh??{};return Object.entries(r).map(([e,t])=>({name:e,config:t})).filter(e=>!!e.config&&typeof e.config=="object"&&"host"in e.config).sort((e,t)=>e.name.localeCompare(t.name))}),U=O(()=>R()??f.data.config.ssh),D=le({ssh:U}),P=r=>{const e=++M;me(()=>import("./index-BfLPI17v.js").then(t=>t.ec),__vite__mapDeps([0,1])).then(t=>{F||M!==e||i.show(()=>(()=>{var o=xe();return a(o,s(t.DialogSelectSsh,{initialMode:r})),o})())})},q=r=>{E(be("mcp",r))};return(()=>{var r=ye();return a(r,s(b,{get"aria-label"(){return c.t("status.popover.ariaLabel")},class:"tabs bg-background-strong rounded-xl overflow-hidden","data-component":"tabs","data-active":"mcp",defaultValue:"mcp",variant:"alt",get children(){return[s(b.List,{"data-slot":"tablist",class:"bg-transparent border-b-0 px-4 pt-2 pb-0 gap-3 h-10",get children(){return[s(b.Trigger,{value:"mcp","data-slot":"tab",class:"text-12-regular",get children(){return c.t("status.popover.tab.mcp")}}),s(b.Trigger,{value:"ssh","data-slot":"tab",class:"text-12-regular",get children(){return c.t("status.popover.tab.ssh")}})]}}),s(b.Content,{value:"mcp",get children(){var e=N(),t=e.firstChild,o=t.firstChild;return a(t,s(_,{get when(){return j().length>0},get fallback(){return(()=>{var n=I();return a(n,()=>c.t("dialog.mcp.empty")),n})()},get children(){return s(A,{get each(){return j()},children:n=>{const h=()=>J(n),g=()=>h()==="connected";return(()=>{var p=_e(),x=p.firstChild,y=x.nextSibling,S=y.nextSibling;return p.$$click=()=>{d.isPending||d.mutate(n)},a(y,n),S.$$click=l=>l.stopPropagation(),a(S,s(ce,{get checked(){return g()},get disabled(){return T(()=>!!d.isPending)()&&d.variables===n},onChange:()=>{d.isPending||d.mutate(n)}})),G(l=>{var v=d.isPending&&d.variables===n,W={"size-2 rounded-full shrink-0":!0,"bg-icon-success-base":g(),"bg-border-weak-base":!g()};return v!==l.e&&(p.disabled=l.e=v),l.t=oe(x,W,l.t),l},{e:void 0,t:void 0}),p})()}})}}),o),a(o,s(w,{variant:"secondary",class:"h-8 px-3 py-1.5",onClick:()=>q(),get children(){return c.t("status.popover.action.manageMcp")}}),null),a(o,s(w,{variant:"secondary",icon:"plus-small",class:"h-8 px-3 py-1.5",onClick:()=>q("add"),get children(){return c.t("dialog.mcp.addButton")}}),null),e}}),s(b.Content,{value:"ssh",get children(){var e=N(),t=e.firstChild,o=t.firstChild;return a(t,s(_,{get when(){return B().length>0},get fallback(){return(()=>{var n=I();return a(n,()=>c.t("dialog.ssh.empty")),n})()},get children(){return s(A,{get each(){return B()},children:n=>{const h=()=>D.byName()[n.name];return(()=>{var g=Se(),p=g.firstChild,x=p.firstChild,y=x.nextSibling,S=y.nextSibling;return g.$$click=()=>P(),a(y,()=>n.name),a(S,(()=>{var l=T(()=>n.config.enabled===!1);return()=>l()?c.t("dialog.ssh.status.disabled"):c.t("dialog.ssh.status.enabled")})()),a(p,s(_,{get when(){return h()},children:l=>(()=>{var v=we();return v.firstChild,a(v,()=>ie(l().connectivity),null),v})()}),null),a(p,s(_,{get when(){return T(()=>!!D.loading())()&&!h()},get children(){return $e()}}),null),a(g,s(_,{get when(){return n.config.remotePath},get children(){var l=ke();return a(l,()=>n.config.remotePath),l}}),null),G(()=>ue(x,"data-state",D.loading()&&!h()?"testing":h()?.connectivity??"idle")),g})()}})}}),o),a(o,s(w,{variant:"secondary",class:"h-8 px-3 py-1.5",onClick:()=>P(),get children(){return c.t("status.popover.action.manageSsh")}}),null),a(o,s(w,{variant:"secondary",icon:"plus-small",class:"h-8 px-3 py-1.5",onClick:()=>P("add"),get children(){return c.t("dialog.ssh.addButton")}}),null),e}})]}})),r})()}fe(["click"]);export{De as StatusPopoverBody};
@@ -1 +0,0 @@
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};