@onescience/onecode-web 1.14.50-202609071521 → 1.14.50-202609071715
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/{3Dmol-BBe_mNlJ.js → 3Dmol-B1rQmimB.js} +1 -1
- package/assets/{account-system-Dwi2xgXX.js → account-system-Djs3bQsY.js} +1 -1
- package/assets/{alert-04-BMC8BgKu.js → alert-01-BzJJ-zh_.js} +1 -1
- package/assets/{alert-05-BdPKihXd.js → alert-02-DuklsSJE.js} +1 -1
- package/assets/{alert-01-BwT8PyA2.js → alert-04-DQgxnbZj.js} +1 -1
- package/assets/{alert-02-DL_Hozvd.js → alert-05-DieKTu9h.js} +1 -1
- package/assets/alert-06-CdNX1MFF.js +1 -0
- package/assets/alert-07-D8bcb829.js +1 -0
- package/assets/alert-08-DwxXD9Jv.js +1 -0
- package/assets/alert-10-O1JGraHb.js +1 -0
- package/assets/{bip-bop-03-DHsaXfIM.js → bip-bop-03-8uYDh5fD.js} +1 -1
- package/assets/{bip-bop-04-BtdF6fK1.js → bip-bop-04-D7J2V_pQ.js} +1 -1
- package/assets/{bip-bop-06-CY_ZWHaR.js → bip-bop-06-DVe4G3q4.js} +1 -1
- package/assets/{bip-bop-08-Fc6621fg.js → bip-bop-08-BR47Ixqy.js} +1 -1
- package/assets/bip-bop-09-Ba1Kwga0.js +1 -0
- package/assets/{center-Du8raWkz.js → center-BHSp0APF.js} +1 -1
- package/assets/{dialog-edit-project-BWSljV71.js → dialog-edit-project-Dsv8HvjS.js} +1 -1
- package/assets/{dialog-fork-De_7mQ6k.js → dialog-fork-CA3inOLr.js} +1 -1
- package/assets/{dialog-project-upload-BGS1HdpV.js → dialog-project-upload-Bs1_9kHj.js} +1 -1
- package/assets/{dialog-select-file-CwKZwwPL.js → dialog-select-file-BrLiSa0e.js} +1 -1
- package/assets/{dialog-select-model-CbOVwO1s.js → dialog-select-model-CMF-xmbD.js} +2 -2
- package/assets/{dialog-terminal-unavailable-DxSPTWtf.js → dialog-terminal-unavailable-BOUZ3KsI.js} +1 -1
- package/assets/{docs-D2uWkeFz.js → docs-BzOnK23f.js} +1 -1
- package/assets/{ghostty-web-0LLJoc4B.js → ghostty-web-l4q7-PU1.js} +1 -1
- package/assets/{home-C6hwg1cL.js → home-C3y_A1-6.js} +1 -1
- package/assets/{index-Cxg7oCCB.js → index-BfLPI17v.js} +324 -324
- package/assets/{index-D8rxV13k.css → index-BwtL4rk2.css} +1 -1
- package/assets/{intro-oB7XqOIB.js → intro-BJgVhMkF.js} +1 -1
- package/assets/{nope-02-CrCpUOWA.js → nope-02-CruCGsk0.js} +1 -1
- package/assets/{nope-05-DOwpRanZ.js → nope-05-Dxj-phOs.js} +1 -1
- package/assets/{nope-08-dWMZrEu4.js → nope-08-DcEjC0yF.js} +1 -1
- package/assets/{nope-11-D1b3syFM.js → nope-11-Dkkp3vCv.js} +1 -1
- package/assets/nope-12-DAx93zTR.js +1 -0
- package/assets/{onescience-0qW5Uv7c.js → onescience-DMXJ1nYb.js} +1 -1
- package/assets/{resources-B0ZUUluy.js → resources-BtRvjjW6.js} +1 -1
- package/assets/{selection-D7DGmYLZ.js → selection-BDKVpung.js} +1 -1
- package/assets/{shell-V-2mXIBe.js → shell-M6Hcceef.js} +2 -2
- package/assets/{skills-CaLvQClr.js → skills-Cr1Txx6V.js} +1 -1
- package/assets/{staplebops-03-DZoq47RX.js → staplebops-03-C9ZA5vYl.js} +1 -1
- package/assets/{staplebops-04-vyKRj5Hr.js → staplebops-04-C8RBLMc9.js} +1 -1
- package/assets/{staplebops-06-CH-pJHfc.js → staplebops-06-hRBlO_Jx.js} +1 -1
- package/assets/{staplebops-07-BzUCUDbK.js → staplebops-07-C4Pmn4wy.js} +1 -1
- package/assets/{status-popover-body--BJDT6mD.js → status-popover-body-CwhO-ly1.js} +2 -2
- package/assets/{wizard-C7wldoTg.js → wizard-DfNLXs5i.js} +1 -1
- package/assets/{yup-01-CtjovY3S.js → yup-01-CCyquaXC.js} +1 -1
- package/assets/{yup-03-qrYctadK.js → yup-03-DUKtblGi.js} +1 -1
- package/assets/{yup-04-BMoYNjee.js → yup-04-Djw3oL2g.js} +1 -1
- package/assets/{yup-05-CO9CIwVo.js → yup-05-BPnDQKpc.js} +1 -1
- package/index.html +11 -11
- package/package.json +2 -2
- package/assets/alert-06-CXOdx709.js +0 -1
- package/assets/alert-07-DHYkPTfg.js +0 -1
- package/assets/alert-08-Bj-NpjH1.js +0 -1
- package/assets/alert-10-0Z2UEjuX.js +0 -1
- package/assets/bip-bop-09-B8A7Fzat.js +0 -1
- package/assets/nope-12-Cifc2OtG.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c$ as K,e as M,i,c as e,t as r,L as n,S as p,F as o,bo as P,Q as N,T as U,bL as E,bm as V,d0 as X,d1 as Y,b1 as Z}from"./index-
|
|
1
|
+
import{c$ as K,e as M,i,c as e,t as r,L as n,S as p,F as o,bo as P,Q as N,T as U,bL as E,bm as V,d0 as X,d1 as Y,b1 as Z}from"./index-BfLPI17v.js";var ii=r("<div class=os-client-capability-intro-overlay role=dialog aria-modal=true aria-label=能力介绍>"),ti=r("<section class=os-client-capability-intro-dialog><p>未找到该能力。"),ei=r("<p class=os-client-capability-unavailable-hint>暂无 OneScience 源码或魔搭映射,当前不可使用。"),li=r("<section class=os-client-capability-intro-scenarios aria-label=快捷场景><div class=os-client-capability-intro-scenarios-copy><h3></h3><p></p></div><div class=os-client-capability-intro-scenario-grid>"),ai=r("<section class=os-client-capability-intro-dialog><header class=os-client-capability-intro-head><div><span></span><h2></h2><p></p></div></header><div class=os-client-capability-intro-matrix><article class=os-client-capability-intro-block data-tone=suited><h3>适合解决</h3><div class=os-client-capability-intro-chips></div></article><article class=os-client-capability-intro-block data-tone=not-for><h3>不建议直接用在</h3><div class=os-client-capability-intro-chips></div></article><article class=os-client-capability-intro-block data-tone=prepare><h3>需要准备什么</h3><div class=os-client-capability-intro-chips></div></article></div><section class=os-client-capability-intro-flow aria-label=使用流程><h3>怎么用</h3><ol></ol></section><footer class=os-client-capability-intro-footer><a class=os-client-capability-intro-docs-link target=_blank rel=noreferrer>深入资料"),m=r("<span>"),ri=r("<li><span></span><strong>"),ni=r("<strong>"),si=r("<p>");function ci(b){return b==="hpc"?{title:"不用手写复杂作业脚本",body:"选择一个常见软件任务,系统会把输入文件、HPC 资源、运行脚本和审批步骤整理成可执行任务。"}:{title:"不用理解复杂模型细节",body:"选择一个常见能力,系统会把研究对象、输入数据、目标和运行偏好整理成可执行任务。"}}function di(){const b=K(),C=M(),h=()=>Z(b.id??""),S=()=>Y(C.search),g=()=>X(C.search,{category:h()?.category??"onemodel",domain:h()?.domain??"materials"});return(()=>{var x=ii();return i(x,e(p,{get when(){return h()},get fallback(){return[e(n,{class:"os-client-capability-intro-backdrop",get href(){return E()},"aria-label":"关闭介绍"}),(()=>{var t=ti();return t.firstChild,i(t,e(n,{get href(){return E()},children:"返回能力中心"}),null),t})()]},children:t=>{const k=()=>ci(t().category),_=()=>V(t());return[e(n,{class:"os-client-capability-intro-backdrop",get href(){return g()},"aria-label":"关闭介绍"}),(()=>{var $=ai(),u=$.firstChild,w=u.firstChild,H=w.firstChild,F=H.nextSibling,I=F.nextSibling,R=u.nextSibling,z=R.firstChild,O=z.firstChild,Q=O.nextSibling,A=z.nextSibling,T=A.firstChild,W=T.nextSibling,j=A.nextSibling,q=j.firstChild,B=q.nextSibling,L=R.nextSibling,D=L.firstChild,G=D.nextSibling,y=L.nextSibling,J=y.firstChild;return i(H,()=>t().intro.title||"30 秒看懂模型"),i(F,()=>t().name),i(I,()=>t().intro.subtitle),i(w,e(p,{get when(){return!_()},get children(){return ei()}}),null),i(u,e(n,{class:"os-client-capability-intro-close",get href(){return g()},"aria-label":"关闭",children:"×"}),null),i(Q,e(o,{get each(){return t().intro.suited},children:a=>(()=>{var l=m();return i(l,a),l})()})),i(W,e(o,{get each(){return t().intro.notFor},children:a=>(()=>{var l=m();return i(l,a),l})()})),i(B,e(o,{get each(){return t().intro.prepare},children:a=>(()=>{var l=m();return i(l,a),l})()})),i(G,e(o,{get each(){return t().intro.steps},children:(a,l)=>(()=>{var s=ri(),d=s.firstChild,f=d.nextSibling;return i(d,()=>l()+1),i(f,a),s})()})),i($,e(p,{get when(){return _()},get children(){var a=li(),l=a.firstChild,s=l.firstChild,d=s.nextSibling,f=l.nextSibling;return i(s,()=>k().title),i(d,()=>k().body),i(f,e(o,{get each(){return t().scenarios},children:v=>e(n,{class:"os-client-capability-intro-scenario-card",get href(){return P(t().id,v.id,S())},get children(){return[(()=>{var c=ni();return i(c,()=>v.title),c})(),(()=>{var c=si();return i(c,()=>v.summary),c})()]}})})),a}}),y),i(y,e(p,{get when(){return _()},get fallback(){return e(n,{class:"os-client-capability-intro-wizard-link",get href(){return g()},children:"返回模型库"})},get children(){return e(n,{class:"os-client-capability-intro-wizard-link",get href(){return P(t().id,void 0,S())},"data-primary":"true",children:"进入能力向导"})}}),null),N(()=>U(J,"href",t().docsHref)),$})()]}})),x})()}export{di as CapabilityIntroPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-
|
|
1
|
+
const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609071715/assets/nope-02-EygnDbCM.aac";export{e as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-
|
|
1
|
+
const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609071715/assets/nope-05-DZsXzrQW.aac";export{e as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-
|
|
1
|
+
const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609071715/assets/nope-08-COPo0uNf.aac";export{e as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-
|
|
1
|
+
const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609071715/assets/nope-11-CVdXg8G-.aac";export{e as default};
|
|
@@ -0,0 +1 @@
|
|
|
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,4 +1,4 @@
|
|
|
1
|
-
import{b as Lt,n as y,x as _e,c as r,bp as $t,i as a,ak as Le,S as $,R as le,F as ce,Q as F,T as B,t as o,bq as Ss,br as vt,bs as _s,bt as nn,bu as Ma,bv as Kt,bw as ei,Z as Ps,b3 as ks,Y as Ds,bx as As,by as rn,bz as xs,aB as Xe,I as Nt,L as rt,ag as Ot,bA as Ms,o as K,av as fa,bB as ba,bC as Ha,b5 as st,bD as jn,bE as zn,bF as Pi,bG as ki,bH as Is,bI as Fs,bJ as la,k as Di,bK as Wn,l as ft,f as Ct,e as Zt,h as Ut,g as va,j as Ts,m as Vn,y as Es,G as Ns,H as Os,b9 as nt,bL as sn,bM as Rs,bN as Jn,bO as Kn,bP as Xn,ba as Qn,bQ as ci,bR as Ls,bS as Us,bT as Gs,aQ as Zn,bU as Bs,s as St,bV as Hs,bW as on,bd as ua,N as qs,bX as Ia,V as Oa,bY as js,ai as yt,aP as Tt,aR as Ai,q as xi,bZ as zs,aS as Yn,a7 as Ws,b_ as Vs,b$ as Js,c0 as Ks,c1 as Xs,c2 as Ra,c3 as da,c4 as Qs,c5 as ti,p as ai,c6 as Zs,c7 as Ys,c8 as sa,c9 as eo,ca as to,cb as ao,cc as io,cd as Mi,ce as no,cf as ln,cg as ro,ch as so,ci as Ii,cj as Fi,ck as er,cl as tr,cm as di,cn as oo,co as ui,cp as lo,cq as co,cr as uo,cs as Vt,ct as mo,cu as ho,cv as ar,cw as ir,cx as nr,cy as rr,cz as sr,cA as po,bf as go,cB as fo,cC as bo,cD as vo,cE as yo,D as Mt,cF as wo,cG as $o,cH as Co,cI as So,cJ as cn,cK as _o,cL as mi,cM as Po,cN as or,cO as lr,cP as ko,cQ as cr,_ as Jt,cR as Ti,r as Do,cS as Ao,cT as xo,X as Mo,bb as Io,bc as ii,cU as dr,v as Fo,cV as To,E as Eo,cW as No,cX as dn,cY as Oo,cZ as Ro,c_ as Lo}from"./index-Cxg7oCCB.js";import{d as Uo}from"./onescience-docs-CH5KBTI9.js";var Go=o("<div><div class=os-download-path-hint-title></div><ul class=os-download-path-hint-list>"),Bo=o("<li class=break-all>"),Ho=o('<div class=os-download-conda-list role=listbox aria-label="conda 环境"><button type=button class=os-download-conda-item data-manual><span class=os-download-conda-item-name></span><span class=os-download-conda-item-path>可继续在上方输入框修改'),qo=o("<p class=os-download-conda-hint>"),jo=o("<p class=os-download-conda-hint data-tone=muted>"),zo=o('<div class=os-download-env-field><span class=os-field-label-row><span class=os-field-label>conda 环境</span><button type=button class=os-download-conda-query></button></span><div class=os-download-conda-combobox><input placeholder="可选,留空用默认 modelscope">'),Wo=o("<div class=os-download-env-row><div class=os-download-env-field><span class=os-field-label-row><span class=os-field-label>下载到环境</span></span><div>"),Vo=o("<p class=os-section-copy>确认将 <strong></strong> <!>以下路径吗?"),Jo=o("<p class=os-section-copy>SCNet 侧无法直接访问 ModelScope。确认后将打开科研开发会话,由 Agent 使用 scnet MCP 工具完成下载与传输。"),Ko=o("<div class=os-dataset-download-info-row><span></span><strong>"),Xo=o("<div class=os-upload-error>可用空间不足,无法下载该数据集"),un=o("<div class=os-upload-error>"),Qo=o("<div class=os-upload-error>无法从魔搭获取数据集大小,暂不可下载"),Zo=o('<div class=os-modal-backdrop role=presentation><div class="os-upload-dialog os-download-dialog"><div class=os-upload-head><div><div class=os-eyebrow>数据集</div><h2></h2></div><button type=button class="os-button os-button-secondary os-button-square">×</button></div><div class=os-dataset-download-info><div class=os-dataset-download-info-row><span>数据集大小(预估)</span><strong></strong></div></div><div class=os-upload-actions><button type=button class="os-button os-button-secondary">取消</button><button type=button class="os-button os-button-primary">'),Yo=o("<span class=os-download-conda-item-active> 当前"),el=o("<button type=button class=os-download-conda-item><span class=os-download-conda-item-name></span><span class=os-download-conda-item-path>"),tl=o("<label><span class=os-field-label-row><span class=os-field-label><span class=os-field-required aria-hidden=true> *</span></span></span><input>"),al=o('<div class=os-modal-backdrop role=presentation><div class="os-upload-dialog os-download-dialog"><div class=os-upload-head><div><div class=os-eyebrow>取消下载</div><h2></h2></div><button type=button class="os-button os-button-secondary os-button-square">×</button></div><p class=os-section-copy>确认取消 <strong></strong> 的下载吗?已下载的部分文件将被保留,你可以稍后重新下载。</p><div class=os-upload-actions><button type=button class="os-button os-button-secondary">继续下载</button><button type=button class="os-button os-button-primary">'),il=o("<p class=os-section-copy>正在删除所选副本…"),nl=o("<p class=os-section-copy>"),rl=o("<button type=button class=os-download-copy-all>"),sl=o("<div class=os-download-copy-list role=group aria-label=选择要删除的环境>"),ol=o('<div class=os-modal-backdrop role=presentation><div class="os-upload-dialog os-download-dialog"><div class=os-upload-head><div><div class=os-eyebrow></div><h2></h2></div><button type=button class="os-button os-button-secondary os-button-square">×</button></div><div class=os-upload-actions><button type=button class="os-button os-button-secondary">取消</button><button type=button class="os-button os-button-primary">'),mn=o("<strong>"),ll=o("<span class=os-download-copy-partial> 未完成"),cl=o("<button type=button class=os-download-copy-item><span class=os-download-copy-item-title></span><span class=os-download-copy-item-path>"),dl=o('<span class="os-download-copy-path break-all">');function hn(e){const t=()=>e.paths.filter(i=>i.trim());return r($,{get when(){return t().length>0},get children(){var i=Go(),n=i.firstChild,s=n.nextSibling;return a(n,()=>e.confirmed?"数据集位置":"数据集实际位置(随 ModelScope 版本可能不同)"),a(s,r(ce,{get each(){return t()},children:d=>(()=>{var l=Bo();return a(l,d),l})()})),F(()=>vt(i,`os-download-path-hint ${e.class??""}`.trim())),i}})}function ul(e){const t=()=>e.actionLabel??"下载",i=()=>e.environment??{kind:"local"},n=()=>e.diskLoading?"加载中...":nn(e.availableBytes),s=()=>e.sizeLoading?"加载中...":e.datasetBytes===void 0?"无法从魔搭获取数据集大小":nn(e.datasetBytes),d=()=>{if(i().kind==="ssh")return e.remotePath??"";if(i().kind==="scnet")return e.remotePath?.trim()||"(SCNet 默认缓存目录)";const D=`/${e.datasetId}`;return e.targetPath.endsWith(D)?e.targetPath.slice(0,-D.length):e.targetPath},l=()=>{const D=(e.actualPaths??[]).map(L=>L.trim()).filter(Boolean);return D.length>0?{paths:[...new Set(D)],confirmed:!0}:{paths:_s(d(),e.datasetId),confirmed:!1}},c=()=>e.busy?i().kind==="ssh"?"正在提交到远端...":"正在提交下载...":i().kind==="scnet"?"创建下载任务":t()==="更新"?"确认更新":"确认下载",g=()=>!!e.sizeLoading||e.datasetBytes===void 0,_=()=>{if(i().kind==="scnet")return!1;const D=e.datasetBytes,L=e.availableBytes;return D===void 0||L===void 0||L<=0?!1:D>L},v=()=>i().kind==="scnet"||e.diskLoading?!1:e.availableBytes===void 0,u=()=>!!e.busy||!!e.confirmDisabled||i().kind==="ssh"&&!(e.remotePath??"").trim()||g()||!!e.diskLoading||v()||_(),[h,p]=y([]),[w,P]=y(!1),[f,M]=y(),[U,G]=y(),[Z,b]=y(!1);_e(D=>{const L=e.condaQueryKey??"";return D!==void 0&&D!==L&&(p([]),M(void 0),G(void 0),P(!1),b(!1)),L});const N=async()=>{if(!(!e.onQueryCondaEnvs||w()||e.busy)){P(!0),M(void 0),G(void 0);try{const D=await e.onQueryCondaEnvs();p(D.items),G(D.available),b(D.items.length>0)}catch(D){const L=D instanceof Error&&D.message.trim()?D.message:"查询 conda 环境失败";p([]),b(!1),Ss(L)?(G(!1),M(void 0)):(G(void 0),M(L))}finally{P(!1)}}},C=D=>{e.onCondaEnvChange?.(D),b(!1)};return r($,{get when(){return e.open},get children(){return r($t,{get children(){var D=Zo(),L=D.firstChild,H=L.firstChild,E=H.firstChild,O=E.firstChild,J=O.firstChild,me=O.nextSibling,ge=E.nextSibling,X=H.nextSibling,$e=X.firstChild,ee=$e.firstChild,we=ee.nextSibling,ye=X.nextSibling,ne=ye.firstChild,Y=ne.nextSibling;return L.$$click=q=>q.stopPropagation(),a(O,t,J),a(me,()=>e.title),Le(ge,"click",e.onClose,!0),a(L,r($,{get when(){return e.environmentSelector},get children(){var q=Wo(),V=q.firstChild,j=V.firstChild,W=j.nextSibling;return a(W,()=>e.environmentSelector),a(q,r($,{get when(){return i().kind!=="scnet"},get children(){var ie=zo(),Se=ie.firstChild,Ne=Se.firstChild,Ue=Ne.nextSibling,Fe=Se.nextSibling,Je=Fe.firstChild;return Ue.$$click=()=>void N(),a(Ue,()=>w()?"查询中...":"查询"),Je.addEventListener("focus",()=>{h().length>0&&b(!0)}),Je.$$input=Ce=>e.onCondaEnvChange?.(Ce.currentTarget.value),a(Fe,r($,{get when(){return le(()=>!!(!e.busy&&Z()))()&&h().length>0},get children(){var Ce=Ho(),Ye=Ce.firstChild,We=Ye.firstChild;return Ye.$$click=()=>C((e.condaEnv??"").trim()),a(We,(()=>{var et=le(()=>!!(e.condaEnv??"").trim());return()=>et()?`使用当前输入:${(e.condaEnv??"").trim()}`:"手动填写 / 留空用默认"})()),a(Ce,r(ce,{get each(){return h()},children:et=>(()=>{var re=el(),fe=re.firstChild,A=fe.nextSibling;return re.$$click=()=>C(et.name),a(fe,()=>et.name,null),a(fe,r($,{get when(){return et.active},get children(){return Yo()}}),null),a(A,()=>et.path),F(te=>{var oe=et.name===(e.condaEnv??"").trim()?"":void 0,z=et.path;return oe!==te.e&&B(re,"data-selected",te.e=oe),z!==te.t&&B(re,"title",te.t=z),te},{e:void 0,t:void 0}),re})()}),null),Ce}}),null),a(ie,r($,{get when(){return le(()=>!e.busy)()&&f()},get children(){var Ce=qo();return a(Ce,f),Ce}}),null),a(ie,r($,{get when(){return le(()=>!e.busy)()&&U()===!1},get children(){var Ce=jo();return a(Ce,()=>i().kind==="ssh"?"远端未检测到 conda。可留空,将使用远端默认环境中的 modelscope。":"本机未检测到 conda。可留空,将使用当前环境中的 modelscope。"),Ce}}),null),F(Ce=>{var Ye=!!e.busy||w()||!e.onQueryCondaEnvs,We=i().kind==="ssh"?"可选。填写远端 conda 环境名;留空则使用远端默认环境中的 modelscope。":"可选。填写本机 conda 环境名;留空则使用当前环境中的 modelscope。";return Ye!==Ce.e&&(Ue.disabled=Ce.e=Ye),We!==Ce.t&&B(Je,"title",Ce.t=We),Ce},{e:void 0,t:void 0}),F(()=>Je.value=e.condaEnv??""),ie}}),null),F(()=>B(q,"data-conda",i().kind!=="scnet"?"":void 0)),q}}),X),a(L,r($,{get when(){return i().kind==="local"},get fallback(){return[(()=>{var q=tl(),V=q.firstChild,j=V.firstChild,W=j.firstChild,ie=V.nextSibling;return a(j,()=>i().kind==="ssh"?"远端存储目录":"SCNet 目标目录",W),ie.$$input=Se=>e.onRemotePathChange?.(Se.currentTarget.value),F(()=>B(ie,"placeholder",i().kind==="ssh"?"/work/you/modelscope/hub/datasets":"modelscope/hub/datasets")),F(()=>ie.value=e.remotePath??""),q})(),r(hn,{get paths(){return l().paths},get confirmed(){return l().confirmed}})]},get children(){return[(()=>{var q=Vo(),V=q.firstChild,j=V.nextSibling,W=j.nextSibling,ie=W.nextSibling;return ie.nextSibling,a(j,()=>e.datasetId),a(q,()=>t()==="更新"?"更新到":"下载到",ie),q})(),r(hn,{get paths(){return l().paths},get confirmed(){return l().confirmed}})]}}),X),a(L,r($,{get when(){return i().kind==="scnet"},get children(){return Jo()}}),X),a(we,s),a(X,r($,{get when(){return i().kind!=="scnet"},get children(){var q=Ko(),V=q.firstChild,j=V.nextSibling;return a(V,()=>i().kind==="ssh"?"远端可用空间":"项目路径可用空间"),a(j,n),q}}),null),a(L,r($,{get when(){return _()},get children(){return Xo()}}),ye),a(L,r($,{get when(){return v()},get children(){var q=un();return a(q,()=>i().kind==="ssh"?"无法获取远端可用空间,暂不可下载":"无法获取项目路径可用空间,暂不可下载"),q}}),ye),a(L,r($,{get when(){return le(()=>!e.sizeLoading)()&&e.datasetBytes===void 0},get children(){return Qo()}}),ye),a(L,r($,{get when(){return e.error},get children(){var q=un();return a(q,()=>e.error),q}}),ye),Le(ne,"click",e.onClose,!0),Le(Y,"click",e.onConfirm,!0),a(Y,c),F(q=>{var V=_()?"":void 0,j=v()?"":void 0,W=e.busy,ie=u();return V!==q.e&&B(X,"data-insufficient",q.e=V),j!==q.t&&B(X,"data-unknown",q.t=j),W!==q.a&&(ne.disabled=q.a=W),ie!==q.o&&(Y.disabled=q.o=ie),q},{e:void 0,t:void 0,a:void 0,o:void 0}),D}})}})}function ml(e){return r($,{get when(){return e.open},get children(){return r($t,{get children(){var t=al(),i=t.firstChild,n=i.firstChild,s=n.firstChild,d=s.firstChild,l=d.nextSibling,c=s.nextSibling,g=n.nextSibling,_=g.firstChild,v=_.nextSibling,u=g.nextSibling,h=u.firstChild,p=h.nextSibling;return i.$$click=w=>w.stopPropagation(),a(l,()=>e.title),Le(c,"click",e.onClose,!0),a(v,()=>e.datasetId),Le(h,"click",e.onClose,!0),Le(p,"click",e.onConfirm,!0),a(p,()=>e.busy?"正在取消...":"确认取消"),F(w=>{var P=e.busy,f=e.busy;return P!==w.e&&(h.disabled=w.e=P),f!==w.t&&(p.disabled=w.t=f),w},{e:void 0,t:void 0}),t}})}})}function hl(e){const[t,i]=y();_e(()=>{if(!e.open){i(void 0);return}e.busy||i(e.copies)});const n=()=>e.busy?t()??e.copies:e.copies,s=()=>new Set(e.selectedKeys),d=()=>n().filter(u=>s().has(u.key)),l=()=>n().length>0&&d().length===n().length,c=()=>{const u=d();return u.length>0&&u.every(h=>h.partial)},g=()=>!!e.busy||d().length===0,_=u=>{if(e.busy)return;const h=new Set(s());h.has(u)?h.delete(u):h.add(u),e.onSelectedKeysChange([...h])},v=()=>{e.busy||e.onSelectedKeysChange(l()?[]:n().map(u=>u.key))};return r($,{get when(){return e.open},get children(){return r($t,{get children(){var u=ol(),h=u.firstChild,p=h.firstChild,w=p.firstChild,P=w.firstChild,f=P.nextSibling,M=w.nextSibling,U=p.nextSibling,G=U.firstChild,Z=G.nextSibling;return h.$$click=b=>b.stopPropagation(),a(P,()=>c()?"清理残留文件":"删除数据集"),a(f,()=>e.title),Le(M,"click",e.onClose,!0),a(h,r($,{get when(){return e.busy},get children(){return il()}}),U),a(h,r($,{get when(){return!e.busy},get children(){return[(()=>{var b=nl();return a(b,(()=>{var N=le(()=>n().length>1);return()=>N()?"该数据集已下载到多个环境。请选择要删除的副本,此操作不可恢复。":le(()=>!!c())()?["确认清理 ",(()=>{var C=mn();return a(C,()=>e.datasetId),C})()," 未完成的下载残留吗?请选择环境后继续。"]:["请选择要删除 ",(()=>{var C=mn();return a(C,()=>e.datasetId),C})()," 的环境。此操作不可恢复。"]})()),b})(),r($,{get when(){return n().length>1},get children(){var b=rl();return b.$$click=v,a(b,()=>l()?"取消全选":"全选"),F(()=>b.disabled=e.busy),b}}),(()=>{var b=sl();return a(b,r(ce,{get each(){return n()},children:N=>(()=>{var C=cl(),D=C.firstChild,L=D.nextSibling;return C.$$click=()=>_(N.key),a(D,()=>N.label,null),a(D,r($,{get when(){return N.partial},get children(){return ll()}}),null),a(L,r(ce,{get each(){return N.paths},children:H=>(()=>{var E=dl();return a(E,H),E})()})),F(H=>{var E=s().has(N.key)?"":void 0,O=s().has(N.key),J=e.busy;return E!==H.e&&B(C,"data-selected",H.e=E),O!==H.t&&B(C,"aria-pressed",H.t=O),J!==H.a&&(C.disabled=H.a=J),H},{e:void 0,t:void 0,a:void 0}),C})()})),b})()]}}),U),Le(G,"click",e.onClose,!0),Le(Z,"click",e.onConfirm,!0),a(Z,(()=>{var b=le(()=>!!e.busy);return()=>b()?"正在删除...":c()?"确认清理":"确认删除"})()),F(b=>{var N=e.busy,C=e.busy,D=g();return N!==b.e&&(M.disabled=b.e=N),C!==b.t&&(G.disabled=b.t=C),D!==b.a&&(Z.disabled=b.a=D),b},{e:void 0,t:void 0,a:void 0}),u}})}})}Lt(["click","input"]);const kt=`请按照下面的内容,使用OneScience,进行后续工作。
|
|
1
|
+
import{b as Lt,n as y,x as _e,c as r,bp as $t,i as a,ak as Le,S as $,R as le,F as ce,Q as F,T as B,t as o,bq as Ss,br as vt,bs as _s,bt as nn,bu as Ma,bv as Kt,bw as ei,Z as Ps,b3 as ks,Y as Ds,bx as As,by as rn,bz as xs,aB as Xe,I as Nt,L as rt,ag as Ot,bA as Ms,o as K,av as fa,bB as ba,bC as Ha,b5 as st,bD as jn,bE as zn,bF as Pi,bG as ki,bH as Is,bI as Fs,bJ as la,k as Di,bK as Wn,l as ft,f as Ct,e as Zt,h as Ut,g as va,j as Ts,m as Vn,y as Es,G as Ns,H as Os,b9 as nt,bL as sn,bM as Rs,bN as Jn,bO as Kn,bP as Xn,ba as Qn,bQ as ci,bR as Ls,bS as Us,bT as Gs,aQ as Zn,bU as Bs,s as St,bV as Hs,bW as on,bd as ua,N as qs,bX as Ia,V as Oa,bY as js,ai as yt,aP as Tt,aR as Ai,q as xi,bZ as zs,aS as Yn,a7 as Ws,b_ as Vs,b$ as Js,c0 as Ks,c1 as Xs,c2 as Ra,c3 as da,c4 as Qs,c5 as ti,p as ai,c6 as Zs,c7 as Ys,c8 as sa,c9 as eo,ca as to,cb as ao,cc as io,cd as Mi,ce as no,cf as ln,cg as ro,ch as so,ci as Ii,cj as Fi,ck as er,cl as tr,cm as di,cn as oo,co as ui,cp as lo,cq as co,cr as uo,cs as Vt,ct as mo,cu as ho,cv as ar,cw as ir,cx as nr,cy as rr,cz as sr,cA as po,bf as go,cB as fo,cC as bo,cD as vo,cE as yo,D as Mt,cF as wo,cG as $o,cH as Co,cI as So,cJ as cn,cK as _o,cL as mi,cM as Po,cN as or,cO as lr,cP as ko,cQ as cr,_ as Jt,cR as Ti,r as Do,cS as Ao,cT as xo,X as Mo,bb as Io,bc as ii,cU as dr,v as Fo,cV as To,E as Eo,cW as No,cX as dn,cY as Oo,cZ as Ro,c_ as Lo}from"./index-BfLPI17v.js";import{d as Uo}from"./onescience-docs-CH5KBTI9.js";var Go=o("<div><div class=os-download-path-hint-title></div><ul class=os-download-path-hint-list>"),Bo=o("<li class=break-all>"),Ho=o('<div class=os-download-conda-list role=listbox aria-label="conda 环境"><button type=button class=os-download-conda-item data-manual><span class=os-download-conda-item-name></span><span class=os-download-conda-item-path>可继续在上方输入框修改'),qo=o("<p class=os-download-conda-hint>"),jo=o("<p class=os-download-conda-hint data-tone=muted>"),zo=o('<div class=os-download-env-field><span class=os-field-label-row><span class=os-field-label>conda 环境</span><button type=button class=os-download-conda-query></button></span><div class=os-download-conda-combobox><input placeholder="可选,留空用默认 modelscope">'),Wo=o("<div class=os-download-env-row><div class=os-download-env-field><span class=os-field-label-row><span class=os-field-label>下载到环境</span></span><div>"),Vo=o("<p class=os-section-copy>确认将 <strong></strong> <!>以下路径吗?"),Jo=o("<p class=os-section-copy>SCNet 侧无法直接访问 ModelScope。确认后将打开科研开发会话,由 Agent 使用 scnet MCP 工具完成下载与传输。"),Ko=o("<div class=os-dataset-download-info-row><span></span><strong>"),Xo=o("<div class=os-upload-error>可用空间不足,无法下载该数据集"),un=o("<div class=os-upload-error>"),Qo=o("<div class=os-upload-error>无法从魔搭获取数据集大小,暂不可下载"),Zo=o('<div class=os-modal-backdrop role=presentation><div class="os-upload-dialog os-download-dialog"><div class=os-upload-head><div><div class=os-eyebrow>数据集</div><h2></h2></div><button type=button class="os-button os-button-secondary os-button-square">×</button></div><div class=os-dataset-download-info><div class=os-dataset-download-info-row><span>数据集大小(预估)</span><strong></strong></div></div><div class=os-upload-actions><button type=button class="os-button os-button-secondary">取消</button><button type=button class="os-button os-button-primary">'),Yo=o("<span class=os-download-conda-item-active> 当前"),el=o("<button type=button class=os-download-conda-item><span class=os-download-conda-item-name></span><span class=os-download-conda-item-path>"),tl=o("<label><span class=os-field-label-row><span class=os-field-label><span class=os-field-required aria-hidden=true> *</span></span></span><input>"),al=o('<div class=os-modal-backdrop role=presentation><div class="os-upload-dialog os-download-dialog"><div class=os-upload-head><div><div class=os-eyebrow>取消下载</div><h2></h2></div><button type=button class="os-button os-button-secondary os-button-square">×</button></div><p class=os-section-copy>确认取消 <strong></strong> 的下载吗?已下载的部分文件将被保留,你可以稍后重新下载。</p><div class=os-upload-actions><button type=button class="os-button os-button-secondary">继续下载</button><button type=button class="os-button os-button-primary">'),il=o("<p class=os-section-copy>正在删除所选副本…"),nl=o("<p class=os-section-copy>"),rl=o("<button type=button class=os-download-copy-all>"),sl=o("<div class=os-download-copy-list role=group aria-label=选择要删除的环境>"),ol=o('<div class=os-modal-backdrop role=presentation><div class="os-upload-dialog os-download-dialog"><div class=os-upload-head><div><div class=os-eyebrow></div><h2></h2></div><button type=button class="os-button os-button-secondary os-button-square">×</button></div><div class=os-upload-actions><button type=button class="os-button os-button-secondary">取消</button><button type=button class="os-button os-button-primary">'),mn=o("<strong>"),ll=o("<span class=os-download-copy-partial> 未完成"),cl=o("<button type=button class=os-download-copy-item><span class=os-download-copy-item-title></span><span class=os-download-copy-item-path>"),dl=o('<span class="os-download-copy-path break-all">');function hn(e){const t=()=>e.paths.filter(i=>i.trim());return r($,{get when(){return t().length>0},get children(){var i=Go(),n=i.firstChild,s=n.nextSibling;return a(n,()=>e.confirmed?"数据集位置":"数据集实际位置(随 ModelScope 版本可能不同)"),a(s,r(ce,{get each(){return t()},children:d=>(()=>{var l=Bo();return a(l,d),l})()})),F(()=>vt(i,`os-download-path-hint ${e.class??""}`.trim())),i}})}function ul(e){const t=()=>e.actionLabel??"下载",i=()=>e.environment??{kind:"local"},n=()=>e.diskLoading?"加载中...":nn(e.availableBytes),s=()=>e.sizeLoading?"加载中...":e.datasetBytes===void 0?"无法从魔搭获取数据集大小":nn(e.datasetBytes),d=()=>{if(i().kind==="ssh")return e.remotePath??"";if(i().kind==="scnet")return e.remotePath?.trim()||"(SCNet 默认缓存目录)";const D=`/${e.datasetId}`;return e.targetPath.endsWith(D)?e.targetPath.slice(0,-D.length):e.targetPath},l=()=>{const D=(e.actualPaths??[]).map(L=>L.trim()).filter(Boolean);return D.length>0?{paths:[...new Set(D)],confirmed:!0}:{paths:_s(d(),e.datasetId),confirmed:!1}},c=()=>e.busy?i().kind==="ssh"?"正在提交到远端...":"正在提交下载...":i().kind==="scnet"?"创建下载任务":t()==="更新"?"确认更新":"确认下载",g=()=>!!e.sizeLoading||e.datasetBytes===void 0,_=()=>{if(i().kind==="scnet")return!1;const D=e.datasetBytes,L=e.availableBytes;return D===void 0||L===void 0||L<=0?!1:D>L},v=()=>i().kind==="scnet"||e.diskLoading?!1:e.availableBytes===void 0,u=()=>!!e.busy||!!e.confirmDisabled||i().kind==="ssh"&&!(e.remotePath??"").trim()||g()||!!e.diskLoading||v()||_(),[h,p]=y([]),[w,P]=y(!1),[f,M]=y(),[U,G]=y(),[Z,b]=y(!1);_e(D=>{const L=e.condaQueryKey??"";return D!==void 0&&D!==L&&(p([]),M(void 0),G(void 0),P(!1),b(!1)),L});const N=async()=>{if(!(!e.onQueryCondaEnvs||w()||e.busy)){P(!0),M(void 0),G(void 0);try{const D=await e.onQueryCondaEnvs();p(D.items),G(D.available),b(D.items.length>0)}catch(D){const L=D instanceof Error&&D.message.trim()?D.message:"查询 conda 环境失败";p([]),b(!1),Ss(L)?(G(!1),M(void 0)):(G(void 0),M(L))}finally{P(!1)}}},C=D=>{e.onCondaEnvChange?.(D),b(!1)};return r($,{get when(){return e.open},get children(){return r($t,{get children(){var D=Zo(),L=D.firstChild,H=L.firstChild,E=H.firstChild,O=E.firstChild,J=O.firstChild,me=O.nextSibling,ge=E.nextSibling,X=H.nextSibling,$e=X.firstChild,ee=$e.firstChild,we=ee.nextSibling,ye=X.nextSibling,ne=ye.firstChild,Y=ne.nextSibling;return L.$$click=q=>q.stopPropagation(),a(O,t,J),a(me,()=>e.title),Le(ge,"click",e.onClose,!0),a(L,r($,{get when(){return e.environmentSelector},get children(){var q=Wo(),V=q.firstChild,j=V.firstChild,W=j.nextSibling;return a(W,()=>e.environmentSelector),a(q,r($,{get when(){return i().kind!=="scnet"},get children(){var ie=zo(),Se=ie.firstChild,Ne=Se.firstChild,Ue=Ne.nextSibling,Fe=Se.nextSibling,Je=Fe.firstChild;return Ue.$$click=()=>void N(),a(Ue,()=>w()?"查询中...":"查询"),Je.addEventListener("focus",()=>{h().length>0&&b(!0)}),Je.$$input=Ce=>e.onCondaEnvChange?.(Ce.currentTarget.value),a(Fe,r($,{get when(){return le(()=>!!(!e.busy&&Z()))()&&h().length>0},get children(){var Ce=Ho(),Ye=Ce.firstChild,We=Ye.firstChild;return Ye.$$click=()=>C((e.condaEnv??"").trim()),a(We,(()=>{var et=le(()=>!!(e.condaEnv??"").trim());return()=>et()?`使用当前输入:${(e.condaEnv??"").trim()}`:"手动填写 / 留空用默认"})()),a(Ce,r(ce,{get each(){return h()},children:et=>(()=>{var re=el(),fe=re.firstChild,A=fe.nextSibling;return re.$$click=()=>C(et.name),a(fe,()=>et.name,null),a(fe,r($,{get when(){return et.active},get children(){return Yo()}}),null),a(A,()=>et.path),F(te=>{var oe=et.name===(e.condaEnv??"").trim()?"":void 0,z=et.path;return oe!==te.e&&B(re,"data-selected",te.e=oe),z!==te.t&&B(re,"title",te.t=z),te},{e:void 0,t:void 0}),re})()}),null),Ce}}),null),a(ie,r($,{get when(){return le(()=>!e.busy)()&&f()},get children(){var Ce=qo();return a(Ce,f),Ce}}),null),a(ie,r($,{get when(){return le(()=>!e.busy)()&&U()===!1},get children(){var Ce=jo();return a(Ce,()=>i().kind==="ssh"?"远端未检测到 conda。可留空,将使用远端默认环境中的 modelscope。":"本机未检测到 conda。可留空,将使用当前环境中的 modelscope。"),Ce}}),null),F(Ce=>{var Ye=!!e.busy||w()||!e.onQueryCondaEnvs,We=i().kind==="ssh"?"可选。填写远端 conda 环境名;留空则使用远端默认环境中的 modelscope。":"可选。填写本机 conda 环境名;留空则使用当前环境中的 modelscope。";return Ye!==Ce.e&&(Ue.disabled=Ce.e=Ye),We!==Ce.t&&B(Je,"title",Ce.t=We),Ce},{e:void 0,t:void 0}),F(()=>Je.value=e.condaEnv??""),ie}}),null),F(()=>B(q,"data-conda",i().kind!=="scnet"?"":void 0)),q}}),X),a(L,r($,{get when(){return i().kind==="local"},get fallback(){return[(()=>{var q=tl(),V=q.firstChild,j=V.firstChild,W=j.firstChild,ie=V.nextSibling;return a(j,()=>i().kind==="ssh"?"远端存储目录":"SCNet 目标目录",W),ie.$$input=Se=>e.onRemotePathChange?.(Se.currentTarget.value),F(()=>B(ie,"placeholder",i().kind==="ssh"?"/work/you/modelscope/hub/datasets":"modelscope/hub/datasets")),F(()=>ie.value=e.remotePath??""),q})(),r(hn,{get paths(){return l().paths},get confirmed(){return l().confirmed}})]},get children(){return[(()=>{var q=Vo(),V=q.firstChild,j=V.nextSibling,W=j.nextSibling,ie=W.nextSibling;return ie.nextSibling,a(j,()=>e.datasetId),a(q,()=>t()==="更新"?"更新到":"下载到",ie),q})(),r(hn,{get paths(){return l().paths},get confirmed(){return l().confirmed}})]}}),X),a(L,r($,{get when(){return i().kind==="scnet"},get children(){return Jo()}}),X),a(we,s),a(X,r($,{get when(){return i().kind!=="scnet"},get children(){var q=Ko(),V=q.firstChild,j=V.nextSibling;return a(V,()=>i().kind==="ssh"?"远端可用空间":"项目路径可用空间"),a(j,n),q}}),null),a(L,r($,{get when(){return _()},get children(){return Xo()}}),ye),a(L,r($,{get when(){return v()},get children(){var q=un();return a(q,()=>i().kind==="ssh"?"无法获取远端可用空间,暂不可下载":"无法获取项目路径可用空间,暂不可下载"),q}}),ye),a(L,r($,{get when(){return le(()=>!e.sizeLoading)()&&e.datasetBytes===void 0},get children(){return Qo()}}),ye),a(L,r($,{get when(){return e.error},get children(){var q=un();return a(q,()=>e.error),q}}),ye),Le(ne,"click",e.onClose,!0),Le(Y,"click",e.onConfirm,!0),a(Y,c),F(q=>{var V=_()?"":void 0,j=v()?"":void 0,W=e.busy,ie=u();return V!==q.e&&B(X,"data-insufficient",q.e=V),j!==q.t&&B(X,"data-unknown",q.t=j),W!==q.a&&(ne.disabled=q.a=W),ie!==q.o&&(Y.disabled=q.o=ie),q},{e:void 0,t:void 0,a:void 0,o:void 0}),D}})}})}function ml(e){return r($,{get when(){return e.open},get children(){return r($t,{get children(){var t=al(),i=t.firstChild,n=i.firstChild,s=n.firstChild,d=s.firstChild,l=d.nextSibling,c=s.nextSibling,g=n.nextSibling,_=g.firstChild,v=_.nextSibling,u=g.nextSibling,h=u.firstChild,p=h.nextSibling;return i.$$click=w=>w.stopPropagation(),a(l,()=>e.title),Le(c,"click",e.onClose,!0),a(v,()=>e.datasetId),Le(h,"click",e.onClose,!0),Le(p,"click",e.onConfirm,!0),a(p,()=>e.busy?"正在取消...":"确认取消"),F(w=>{var P=e.busy,f=e.busy;return P!==w.e&&(h.disabled=w.e=P),f!==w.t&&(p.disabled=w.t=f),w},{e:void 0,t:void 0}),t}})}})}function hl(e){const[t,i]=y();_e(()=>{if(!e.open){i(void 0);return}e.busy||i(e.copies)});const n=()=>e.busy?t()??e.copies:e.copies,s=()=>new Set(e.selectedKeys),d=()=>n().filter(u=>s().has(u.key)),l=()=>n().length>0&&d().length===n().length,c=()=>{const u=d();return u.length>0&&u.every(h=>h.partial)},g=()=>!!e.busy||d().length===0,_=u=>{if(e.busy)return;const h=new Set(s());h.has(u)?h.delete(u):h.add(u),e.onSelectedKeysChange([...h])},v=()=>{e.busy||e.onSelectedKeysChange(l()?[]:n().map(u=>u.key))};return r($,{get when(){return e.open},get children(){return r($t,{get children(){var u=ol(),h=u.firstChild,p=h.firstChild,w=p.firstChild,P=w.firstChild,f=P.nextSibling,M=w.nextSibling,U=p.nextSibling,G=U.firstChild,Z=G.nextSibling;return h.$$click=b=>b.stopPropagation(),a(P,()=>c()?"清理残留文件":"删除数据集"),a(f,()=>e.title),Le(M,"click",e.onClose,!0),a(h,r($,{get when(){return e.busy},get children(){return il()}}),U),a(h,r($,{get when(){return!e.busy},get children(){return[(()=>{var b=nl();return a(b,(()=>{var N=le(()=>n().length>1);return()=>N()?"该数据集已下载到多个环境。请选择要删除的副本,此操作不可恢复。":le(()=>!!c())()?["确认清理 ",(()=>{var C=mn();return a(C,()=>e.datasetId),C})()," 未完成的下载残留吗?请选择环境后继续。"]:["请选择要删除 ",(()=>{var C=mn();return a(C,()=>e.datasetId),C})()," 的环境。此操作不可恢复。"]})()),b})(),r($,{get when(){return n().length>1},get children(){var b=rl();return b.$$click=v,a(b,()=>l()?"取消全选":"全选"),F(()=>b.disabled=e.busy),b}}),(()=>{var b=sl();return a(b,r(ce,{get each(){return n()},children:N=>(()=>{var C=cl(),D=C.firstChild,L=D.nextSibling;return C.$$click=()=>_(N.key),a(D,()=>N.label,null),a(D,r($,{get when(){return N.partial},get children(){return ll()}}),null),a(L,r(ce,{get each(){return N.paths},children:H=>(()=>{var E=dl();return a(E,H),E})()})),F(H=>{var E=s().has(N.key)?"":void 0,O=s().has(N.key),J=e.busy;return E!==H.e&&B(C,"data-selected",H.e=E),O!==H.t&&B(C,"aria-pressed",H.t=O),J!==H.a&&(C.disabled=H.a=J),H},{e:void 0,t:void 0,a:void 0}),C})()})),b})()]}}),U),Le(G,"click",e.onClose,!0),Le(Z,"click",e.onConfirm,!0),a(Z,(()=>{var b=le(()=>!!e.busy);return()=>b()?"正在删除...":c()?"确认清理":"确认删除"})()),F(b=>{var N=e.busy,C=e.busy,D=g();return N!==b.e&&(M.disabled=b.e=N),C!==b.t&&(G.disabled=b.t=C),D!==b.a&&(Z.disabled=b.a=D),b},{e:void 0,t:void 0,a:void 0}),u}})}})}Lt(["click","input"]);const kt=`请按照下面的内容,使用OneScience,进行后续工作。
|
|
2
2
|
————————
|
|
3
3
|
`,ur={training:{id:"training",label:"模型训练",description:"准备训练配置并做小规模验证"},inference:{id:"inference",label:"推理",description:"加载权重并完成推理验证"},"secondary-development":{id:"secondary-development",label:"二次开发",description:"改结构、做适配或扩展能力"},"parallel-expansion":{id:"parallel-expansion",label:"并行扩展",description:"改造为分布式或多卡训练"},"scientific-research":{id:"scientific-research",label:"科研开发",description:"选择论文或 GitHub 案例,复现并验证"}},pl=Object.values(ur),gl={training:`3)围绕 {title} 完成训练或微调准备与小规模验证:定位训练入口与配置方式,生成 training_config,优先 smoke training(小样本、少步数)。
|
|
4
4
|
能跑则跑通并汇报;不能跑则列出阻塞项与最小补齐方案。
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{h as oe,j as ce,u as se,c0 as de,dl as me,o as E,dm as ue,s as ge,dn as pe,p as U,bf as fe,dp as X,_ as G,i as r,c,dq as he,S as P,R as W,dr as Y,ds as Q,dt as be,Q as I,T as ae,t as b,b as ie,de as ve,n as Z,x as $e,N as ye,L as _e,F as we,du as xe}from"./index-
|
|
1
|
+
import{h as oe,j as ce,u as se,c0 as de,dl as me,o as E,dm as ue,s as ge,dn as pe,p as U,bf as fe,dp as X,_ as G,i as r,c,dq as he,S as P,R as W,dr as Y,ds as Q,dt as be,Q as I,T as ae,t as b,b as ie,de as ve,n as Z,x as $e,N as ye,L as _e,F as we,du as xe}from"./index-BfLPI17v.js";function q(i){return{name:"",transport:"local",command:"",environment:"",url:"",headers:"",enabled:!0,...i}}function le(i){const n=[],u=/"([^"]*)"|'([^']*)'|(\S+)/g;let e;for(;e=u.exec(i.trim());)n.push(e[1]??e[2]??e[3]??"");return n.filter(g=>g.length>0)}function Se(i){return i.map(n=>/[\s"']/.test(n)?`"${n.replaceAll('"','\\"')}"`:n).join(" ")}function ee(i){const n={};for(const u of i.split(/\r?\n/)){const e=u.trim();if(!e||e.startsWith("#"))continue;const g=e.indexOf("=");if(g<=0)continue;const k=e.slice(0,g).trim(),v=e.slice(g+1).trim();k&&(n[k]=v)}return Object.keys(n).length>0?n:void 0}function te(i){return i?Object.entries(i).map(([n,u])=>`${n}=${u}`).join(`
|
|
2
2
|
`):""}function Ce(i,n){return n.type==="remote"?q({name:i,transport:"remote",url:n.url??"",headers:te(n.headers),enabled:n.enabled!==!1}):q({name:i,transport:"local",command:Se(n.command??[]),environment:te(n.environment),enabled:n.enabled!==!1})}function Pe(i,n,u){const e=i.name.trim();if(!e)return"name";if(e!==u&&n.includes(e))return"duplicate";if(i.transport==="local")return le(i.command).length===0?"command":void 0;if(!i.url.trim())return"url"}function ke(i){const n=i.enabled;return i.transport==="remote"?{type:"remote",url:i.url.trim(),enabled:n,headers:ee(i.headers)}:{type:"local",command:le(i.command),enabled:n,environment:ee(i.environment)}}var Me=b('<div class=os-wb-ssh-list-shell><div class=os-wb-ssh-toolbar><button type=button class="os-wb-ssh-action os-wb-ssh-action-primary">'),Fe=b("<div class=os-wb-mcp-panel>"),re=b('<div class="flex flex-col gap-5">'),Ee=b('<p class="text-12-regular text-text-critical-base">'),Ke=b('<div class=os-wb-ssh-form-shell><button type=button class=os-wb-ssh-form-back>← 返回列表</button><div class="min-h-0 flex-1 overflow-y-auto pr-1"><div class="os-wb-ssh-form-card flex flex-col gap-5 p-5"><div class="flex flex-col gap-2"><span class="text-12-medium text-text-strong"></span></div><div class="flex items-center justify-between gap-3 rounded-xl border border-[#e8ebf0] px-3 py-3"><div class="flex flex-col gap-1"><span class="text-13-medium text-text-strong"></span><span class="text-12-regular text-text-weak"></span></div></div></div></div><div class=os-wb-ssh-form-actions><button type=button class=os-wb-ssh-action></button><button type=button class="os-wb-ssh-action os-wb-ssh-action-primary">'),Le=b("<span class=os-wb-ssh-row-badge>"),je=b("<span class=os-wb-ssh-row-meta>"),Oe=b("<span class=os-wb-ssh-row-path>"),Ae=b('<div class=os-wb-ssh-row><div class="flex flex-col gap-0.5 min-w-0 flex-1"><div class="flex items-center gap-2 min-w-0"><span class=os-wb-ssh-row-title></span></div></div><div class="flex items-center gap-2 shrink-0"><button type=button class=os-wb-ssh-action>');const Qe={connected:"mcp.status.connected",failed:"mcp.status.failed",needs_auth:"mcp.status.needs_auth",disabled:"mcp.status.disabled"},ne={name:"dialog.mcp.error.name",command:"dialog.mcp.error.command",url:"dialog.mcp.error.url",duplicate:"dialog.mcp.error.duplicate"};function qe(i={}){const n=oe(),u=ce(),e=se(),g=de(),k=me(),v=E(()=>ue(ge())?.trim()||n.data.path.directory?.trim()||""),K=E(()=>u.createClient({directory:v()||void 0,throwOnError:!0})),B=pe(()=>({...k.mcp(U(v()||"__mcp__")),enabled:!!v()})),[s,$]=fe({mode:i.initialMode==="add"?"form":"list",editing:void 0,form:q(),error:""}),S=E(()=>n.data.config.mcp??{}),C=E(()=>B.data??{}),N=E(()=>{const t=new Set([...Object.keys(S()),...Object.keys(C())]);return Array.from(t).map(l=>({name:l,status:C()[l]?.status??(S()[l]?"disabled":void 0)})).sort((l,f)=>l.name.localeCompare(f.name))}),T=E(()=>Object.keys(S())),_=t=>$("form",t),D=()=>{if(v())return g.refetchQueries(k.mcp(U(v())))},p=X(()=>({mutationFn:async t=>{C()[t]?.status==="connected"?await K().mcp.disconnect({name:t}):await K().mcp.connect({name:t})},onSuccess:()=>D(),onError:t=>{G({variant:"error",title:e.t("common.requestFailed"),description:t instanceof Error?t.message:String(t)})}})),m=X(()=>({mutationFn:async()=>{const t=Pe(s.form,T(),s.editing);if(t)throw $("error",e.t(ne[t])),new Error(t);$("error","");const l=s.form.name.trim(),f=ke(s.form),x={...S()};return s.editing&&s.editing!==l&&delete x[s.editing],x[l]=f,await n.updateConfig({mcp:x}),f.enabled!==!1&&await K().mcp.add({name:l,config:f}).catch(()=>{}),l},onSuccess:async()=>{G({title:e.t("dialog.mcp.toast.saved")});const t=async()=>{await Promise.all([D(),g.invalidateQueries({queryKey:["config"]})])};await t(),setTimeout(()=>void t(),500),setTimeout(()=>void t(),1500),w()},onError:t=>{t instanceof Error&&t.message in ne||G({variant:"error",title:e.t("common.requestFailed"),description:t instanceof Error?t.message:String(t)})}}));function w(){$({mode:"list",editing:void 0,form:q(),error:""})}function M(){$({mode:"form",editing:void 0,form:q(),error:""})}function H(t){const l=S()[t];if(!l||!("type"in l)){G({variant:"error",title:e.t("dialog.mcp.error.missingConfig")});return}$({mode:"form",editing:t,form:Ce(t,l),error:""})}return(()=>{var t=Fe();return r(t,c(P,{get when(){return s.mode==="list"},get fallback(){return(()=>{var l=Ke(),f=l.firstChild,x=f.nextSibling,d=x.firstChild,y=d.firstChild,R=y.firstChild,L=y.nextSibling,V=L.firstChild,h=V.firstChild,O=h.nextSibling,A=x.nextSibling,j=A.firstChild,F=j.nextSibling;return f.$$click=w,r(d,c(Q,{get label(){return e.t("dialog.mcp.form.name")},get placeholder(){return e.t("dialog.mcp.form.namePlaceholder")},get value(){return s.form.name},get disabled(){return m.isPending||!!s.editing},onChange:a=>_({name:a})}),y),r(R,()=>e.t("dialog.mcp.form.transport")),r(y,c(be,{options:["local","remote"],get current(){return s.form.transport},value:a=>a,label:a=>a==="local"?e.t("dialog.mcp.form.transport.local"):e.t("dialog.mcp.form.transport.remote"),onSelect:a=>{!a||m.isPending||_({transport:a})}}),null),r(d,c(P,{get when(){return s.form.transport==="local"},get fallback(){return(()=>{var a=re();return r(a,c(Q,{get label(){return e.t("dialog.mcp.form.url")},get placeholder(){return e.t("dialog.mcp.form.urlPlaceholder")},get value(){return s.form.url},get disabled(){return m.isPending},onChange:o=>_({url:o})}),null),r(a,c(Q,{multiline:!0,get label(){return e.t("dialog.mcp.form.headers")},get placeholder(){return e.t("dialog.mcp.form.headersPlaceholder")},get value(){return s.form.headers},get disabled(){return m.isPending},onChange:o=>_({headers:o}),class:"min-h-24"}),null),a})()},get children(){var a=re();return r(a,c(Q,{get label(){return e.t("dialog.mcp.form.command")},get placeholder(){return e.t("dialog.mcp.form.commandPlaceholder")},get value(){return s.form.command},get disabled(){return m.isPending},onChange:o=>_({command:o})}),null),r(a,c(Q,{multiline:!0,get label(){return e.t("dialog.mcp.form.environment")},get placeholder(){return e.t("dialog.mcp.form.environmentPlaceholder")},get value(){return s.form.environment},get disabled(){return m.isPending},onChange:o=>_({environment:o}),class:"min-h-24"}),null),a}}),L),r(h,()=>e.t("dialog.mcp.form.enabled")),r(O,()=>e.t("dialog.mcp.form.enabledDescription")),r(L,c(Y,{get checked(){return s.form.enabled},get disabled(){return m.isPending},onChange:a=>_({enabled:a})}),null),r(d,c(P,{get when(){return s.error},get children(){var a=Ee();return r(a,()=>s.error),a}}),null),j.$$click=w,r(j,()=>e.t("common.cancel")),F.$$click=()=>{m.isPending||m.mutate()},r(F,(()=>{var a=W(()=>!!m.isPending);return()=>a()?e.t("common.saving"):e.t("common.save")})()),I(a=>{var o=m.isPending,J=m.isPending;return o!==a.e&&(j.disabled=a.e=o),J!==a.t&&(F.disabled=a.t=J),a},{e:void 0,t:void 0}),l})()},get children(){var l=Me(),f=l.firstChild,x=f.firstChild;return r(l,c(he,{get search(){return{placeholder:e.t("common.search.placeholder"),autofocus:!0}},get emptyMessage(){return e.t("dialog.mcp.empty")},key:d=>d?.name??"",items:N,filterKeys:["name","status"],sortBy:(d,y)=>d.name.localeCompare(y.name),class:"os-wb-ssh-list flex-1 min-h-0",onSelect:d=>{!d||p.isPending||p.mutate(d.name)},children:d=>{const y=()=>C()[d.name]?.status??d.status,R=()=>{const h=y()?Qe[y()]:void 0;if(h)return e.t(h)},L=()=>{const h=C()[d.name];return h?.status==="failed"?h.error:void 0},V=()=>y()==="connected";return(()=>{var h=Ae(),O=h.firstChild,A=O.firstChild,j=A.firstChild,F=O.nextSibling,a=F.firstChild;return r(j,()=>d.name),r(A,c(P,{get when(){return R()},get children(){var o=Le();return r(o,R),o}}),null),r(A,c(P,{get when(){return W(()=>!!p.isPending)()&&p.variables===d.name},get children(){var o=je();return r(o,()=>e.t("common.loading.ellipsis")),o}}),null),r(O,c(P,{get when(){return L()},get children(){var o=Oe();return r(o,L),o}}),null),F.$$click=o=>o.stopPropagation(),a.$$click=()=>H(d.name),r(a,()=>e.t("common.edit")),r(F,c(Y,{get checked(){return V()},get disabled(){return W(()=>!!p.isPending)()&&p.variables===d.name},onChange:()=>{p.isPending||p.mutate(d.name)}}),null),h})()}}),f),x.$$click=M,r(x,()=>e.t("dialog.mcp.addButton")),l}})),I(()=>ae(t,"data-mode",s.mode)),t})()}ie(["click"]);var Te=b('<div class="os-client-capability-page os-client-resources-page"><header class=os-client-resources-head><div class=os-client-resources-head-copy><h2>资源配置</h2><p>SSH 连接与 MCP 工具链接</p></div></header><section class=os-client-capability-selector aria-label=资源配置><div class=os-client-capability-current-domain><span>当前配置:</span><strong></strong><small></small></div><div class=os-client-capability-domain-row role=tablist aria-label=资源配置类型></div></section><div class="os-client-capability-page-body os-client-resources-body">'),De=b("<button type=button>");const z=[{id:"ssh",label:"SSH 连接",descriptionKey:"dialog.ssh.description"},{id:"mcp",label:"MCP 链接",descriptionKey:"dialog.server.mcp.description"}];function Re(){const i=se(),[n,u]=ve(),[e,g]=Z("ssh"),[k,v]=Z(!1);$e(()=>{const s=n.section==="mcp"?"mcp":"ssh";g(s),v(s==="mcp"&&n.mode==="add")});const K=E(()=>z.find(s=>s.id===e())??z[0]),B=s=>{g(s),v(!1),u({section:s==="ssh"?void 0:s,mode:void 0},{replace:!0})};return(()=>{var s=Te(),$=s.firstChild;$.firstChild;var S=$.nextSibling,C=S.firstChild,N=C.firstChild,T=N.nextSibling,_=T.nextSibling,D=C.nextSibling,p=S.nextSibling;return r($,c(_e,{get href(){return ye()},class:"os-client-resources-close","aria-label":"关闭资源配置",children:"×"}),null),r(T,()=>K().label),r(_,()=>i.t(K().descriptionKey)),r(D,c(we,{each:z,children:m=>(()=>{var w=De();return w.$$click=()=>B(m.id),r(w,()=>m.label),I(M=>{var H=m.id===e(),t=m.id===e();return H!==M.e&&w.classList.toggle("is-active",M.e=H),t!==M.t&&ae(w,"aria-pressed",M.t=t),M},{e:void 0,t:void 0}),w})()})),r(p,c(P,{get when(){return e()==="ssh"},get children(){return c(xe,{variant:"page"})}}),null),r(p,c(P,{get when(){return W(()=>e()==="mcp")()?k()?"add":"list":!1},keyed:!0,children:m=>c(qe,{initialMode:m==="add"?"add":void 0})}),null),s})()}ie(["click"]);export{Re as WorkbenchResourcesPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bg as s,b1 as y}from"./index-
|
|
1
|
+
import{bg as s,b1 as y}from"./index-BfLPI17v.js";const m="os-capability-catalog-selection",l={categoryId:"scenario",domainId:"all"};function n(t){return t==="scenario"||t==="onemodel"||t==="hpc"||t==="onedata"||t==="oneskills"}function i(t){return t==="all"||t==="materials"||t==="weather"||t==="fluid"||t==="bio"}function f(t){const a=new URLSearchParams(t).get("category");return n(a)?a:void 0}function u(t){const a=new URLSearchParams(t).get("domain");return i(a)?a:void 0}function g(){try{if(typeof localStorage>"u")return;const t=localStorage.getItem(m);if(!t)return;const a=JSON.parse(t);return!n(a.categoryId)||!i(a.domainId)?void 0:{categoryId:a.categoryId,domainId:a.domainId}}catch{return}}function p(t){try{if(typeof localStorage>"u"||!n(t.categoryId)||!i(t.domainId))return;localStorage.setItem(m,JSON.stringify(t))}catch{}}function S(){const t=g()??l,a=new URLSearchParams({category:t.categoryId,domain:t.domainId});return`${s.capabilities}?${a}`}function b(t,a){const o=f(a),r=u(a),c=g();if(o)return r?{categoryId:o,domainId:r}:o==="oneskills"?{categoryId:o,domainId:c?.domainId??"all"}:{categoryId:o,domainId:"all"};const d=new RegExp(`^${s.capabilities}/([^/]+)`).exec(t),e=d?.[1]?y(d[1]):void 0;return e?{categoryId:e.category,domainId:r??e.domain}:c??l}export{S as c,u as d,g as r,b as s,p as w};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dialog-project-upload-
|
|
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-Cxg7oCCB.js";import{DialogEditProject as qn}from"./dialog-edit-project-BWSljV71.js";import{c as Kn}from"./selection-D7DGmYLZ.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-BGS1HdpV.js"),__vite__mapDeps([0,1,2])).then(o=>{L.show(()=>e(o.DialogProjectUpload,{directory:t}))})}function He(t){tt(()=>import("./index-Cxg7oCCB.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-DxSPTWtf.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
|
+
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 +1 @@
|
|
|
1
|
-
import{e as q,f as D,l as I,n as E,o as g,ag as O,i as a,c as o,t as v,dj as u,b as B,s as _,b7 as H,r as N,aT as y,aM as C,aL as L,aB as Q,L as z,O as T,S as G,Q as J,T as K,F as V,R as X,dk as Y}from"./index-
|
|
1
|
+
import{e as q,f as D,l as I,n as E,o as g,ag as O,i as a,c as o,t as v,dj as u,b as B,s as _,b7 as H,r as N,aT as y,aM as C,aL as L,aB as Q,L as z,O as T,S as G,Q as J,T as K,F as V,R as X,dk as Y}from"./index-BfLPI17v.js";var Z=v("<p class=os-client-skills-login-hint>登录后可同步个人空间技能。 "),ee=v('<div class="os-client-capability-page os-client-skills-page"><section class=os-client-capability-selector aria-label=技能设置><div class=os-client-capability-current-domain><span>技能设置:</span><strong></strong><small></small></div><div class="os-client-capability-tabs os-client-skills-tabs"role=tablist aria-label=技能管理视图></div></section><div class=os-client-capability-page-body>'),te=v("<button type=button><strong></strong><small>");function ae(c){const s=new URLSearchParams(c).get("tab");if(s==="list"||s==="repo"||s==="upload")return s}function ne(){const c=q(),s=D(),A=I(),[b,P]=E(0),R=g(()=>(b(),!!_())),d=g(()=>!R()),[n,x]=E(ae(c.search)??"list"),M=g(()=>{b();const e=_();return e&&(H(e,A.projects.lastCode())||N(e))||""}),p=e=>{x(e),s(T(e),{replace:!0})};O(()=>{const e=()=>P(i=>i+1);window.addEventListener(y,e),window.addEventListener(C,e),window.addEventListener(L,e),Q(()=>{window.removeEventListener(y,e),window.removeEventListener(C,e),window.removeEventListener(L,e)})});const h=()=>u.find(e=>e.id===n())??u[0];return(()=>{var e=ee(),i=e.firstChild,f=i.firstChild,j=f.firstChild,m=j.nextSibling,F=m.nextSibling,w=f.nextSibling,U=i.nextSibling;return a(m,()=>h().label),a(F,()=>h().hint),a(i,o(G,{get when(){return d()},get children(){var t=Z();return t.firstChild,a(t,o(z,{get href(){return`/login?redirect=${encodeURIComponent(T(n()))}`},children:"去登录"}),null),t}}),w),a(w,o(V,{each:u,children:t=>(()=>{var r=te(),S=r.firstChild,W=S.nextSibling;return r.$$click=()=>p(t.id),a(S,()=>t.label),a(W,()=>t.hint),J(l=>{var $=n()===t.id,k=n()===t.id;return $!==l.e&&r.classList.toggle("is-active",l.e=$),k!==l.t&&K(r,"aria-pressed",l.t=k),l},{e:void 0,t:void 0}),r})()})),a(U,o(Y,{get directory(){return X(()=>!!d())()?void 0:M()||void 0},get loginRequired(){return d()},get tab(){return n()},onTabChange:p,variant:"page-body"})),e})()}B(["click"]);export{ne as WorkbenchSkillsPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-
|
|
1
|
+
const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609071715/assets/staplebops-03-Aug82oH0.aac";export{e as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-
|
|
1
|
+
const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609071715/assets/staplebops-04-olyHi8qQ.aac";export{e as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-
|
|
1
|
+
const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609071715/assets/staplebops-06-Cj_2vOI4.aac";export{e as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-
|
|
1
|
+
const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609071715/assets/staplebops-07-cqQEvbIf.aac";export{e as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
|
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-
|
|
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};
|