@onescience/onecode-web 1.14.50-202609160919 → 1.14.50-202609161027

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/assets/{3Dmol-xleXy9GQ.js → 3Dmol-M-HCGXi-.js} +1 -1
  2. package/assets/account-system-DTmu6yza.js +1 -0
  3. package/assets/{alert-04-BuuL0AIT.js → alert-01--H8ZijJg.js} +1 -1
  4. package/assets/{alert-05-DcXrpRhd.js → alert-02-DMWQpxo9.js} +1 -1
  5. package/assets/{alert-01-CJCeF3ai.js → alert-04-DcYaZ-xm.js} +1 -1
  6. package/assets/{alert-02-CJi22mxO.js → alert-05-CM0QChx1.js} +1 -1
  7. package/assets/alert-06-CN5Z6JGX.js +1 -0
  8. package/assets/alert-07-DB70_vIB.js +1 -0
  9. package/assets/alert-08-DXosSLKo.js +1 -0
  10. package/assets/alert-10-BYDc6Z52.js +1 -0
  11. package/assets/{bip-bop-03-BfWYH28z.js → bip-bop-03-CgBZA_jJ.js} +1 -1
  12. package/assets/{bip-bop-04-BG-CNh_8.js → bip-bop-04-Cdg3sgXd.js} +1 -1
  13. package/assets/{bip-bop-06-j4-Pah17.js → bip-bop-06-C9sUctXo.js} +1 -1
  14. package/assets/{bip-bop-08--N0Z031u.js → bip-bop-08-B9NYDLda.js} +1 -1
  15. package/assets/bip-bop-09-CAme7tCm.js +1 -0
  16. package/assets/{center-B1n9y8EL.js → center-Du0Dj8jG.js} +6 -6
  17. package/assets/dialog-fork-BjcfXOqX.js +1 -0
  18. package/assets/dialog-project-upload-CYJ0BfeD.js +2 -0
  19. package/assets/{dialog-select-file-BeSTKWgn.js → dialog-select-file-zidb_eDW.js} +1 -1
  20. package/assets/dialog-select-model-DZ3mRBAc.js +2 -0
  21. package/assets/{dialog-terminal-unavailable-BJHx-DqW.js → dialog-terminal-unavailable-iZysceQY.js} +3 -3
  22. package/assets/docs-B0NyiRF4.js +1 -0
  23. package/assets/{ghostty-web-DOfPEAa3.js → ghostty-web-DGQcssMy.js} +1 -1
  24. package/assets/{index-D89_umhI.js → index-0c2NLcs4.js} +266 -265
  25. package/assets/index-B1w0cY3F.css +1 -0
  26. package/assets/intro-BK7wKdrB.js +1 -0
  27. package/assets/{nope-02-HEvVIfx-.js → nope-02-DPEXyJeg.js} +1 -1
  28. package/assets/{nope-05-RgyHBqFD.js → nope-05-C-bUd40n.js} +1 -1
  29. package/assets/{nope-08-BS9LU-iv.js → nope-08-CNk8cKW5.js} +1 -1
  30. package/assets/{nope-11-DDmUqlQl.js → nope-11-DsIQhsOX.js} +1 -1
  31. package/assets/nope-12-BhTRpZLh.js +1 -0
  32. package/assets/{onescience-Bh7elMIY.js → onescience-BcwQe_Jd.js} +1 -1
  33. package/assets/resources-Cc3laAYn.js +1 -0
  34. package/assets/skills-DSetuaMt.js +1 -0
  35. package/assets/{staplebops-03-Jk0L8SSt.js → staplebops-03-CxLT8eai.js} +1 -1
  36. package/assets/{staplebops-04-BpKJFMZ2.js → staplebops-04-DTP5i0WE.js} +1 -1
  37. package/assets/{staplebops-06-DXJvqdBM.js → staplebops-06-CpA-H7RJ.js} +1 -1
  38. package/assets/{staplebops-07-C2GlRGJk.js → staplebops-07-BmqD3QLG.js} +1 -1
  39. package/assets/status-popover-body-DUi9T_2Z.js +2 -0
  40. package/assets/wizard-gJnCj9nl.js +1 -0
  41. package/assets/{yup-01-Cr-oSr_6.js → yup-01-fa9Kdh5F.js} +1 -1
  42. package/assets/{yup-03-Cf1DFqxz.js → yup-03-MvWratCq.js} +1 -1
  43. package/assets/{yup-04-DzDXJxIT.js → yup-04-DtH9nOVu.js} +1 -1
  44. package/assets/{yup-05-C5d28SLh.js → yup-05-B237ku8q.js} +1 -1
  45. package/assets/{zh-B_0loE3I.js → zh-B9RFApjK.js} +1 -1
  46. package/assets/{zht-5kvKl4Oi.js → zht-CYl2vuaK.js} +1 -1
  47. package/index.html +11 -11
  48. package/package.json +2 -2
  49. package/assets/account-system-eYkc0SIK.js +0 -1
  50. package/assets/alert-06-C3By8s_s.js +0 -1
  51. package/assets/alert-07-C-ojhQuZ.js +0 -1
  52. package/assets/alert-08-B8D0_9P3.js +0 -1
  53. package/assets/alert-10-DieOLQIQ.js +0 -1
  54. package/assets/bip-bop-09-CrOhSPop.js +0 -1
  55. package/assets/current-project-D88n80Ca.js +0 -1
  56. package/assets/dialog-edit-project-DkwpgJNK.js +0 -1
  57. package/assets/dialog-fork-DWY7BL9L.js +0 -1
  58. package/assets/dialog-project-upload-CQETR8DT.js +0 -2
  59. package/assets/dialog-select-model-C285UQWZ.js +0 -2
  60. package/assets/docs-DUvUHosJ.js +0 -1
  61. package/assets/home-D0znvU1o.js +0 -1
  62. package/assets/index-B_MGkqLF.css +0 -1
  63. package/assets/intro-RRbGgi66.js +0 -1
  64. package/assets/nope-12-xFjEj3BZ.js +0 -1
  65. package/assets/resources-BWggkSux.js +0 -1
  66. package/assets/selection-BGUJK_pT.js +0 -1
  67. package/assets/shell-DC-zhUf2.js +0 -2
  68. package/assets/skills-KXwoMhyR.js +0 -1
  69. package/assets/status-popover-body-D6a05RuM.js +0 -2
  70. package/assets/wizard-DO-x_wJv.js +0 -1
@@ -1 +0,0 @@
1
- import{dC as M,e as N,i,c as e,t as r,R as n,S as p,F as o,c2 as E,W as Q,Y as T,cn as W,bo as U,dD as V,dE as X,bj as Z}from"./index-D89_umhI.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=M(),C=N(),h=()=>Z(b.id??""),S=()=>X(C.search),g=()=>V(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 W()},"aria-label":"关闭介绍"}),(()=>{var t=ti();return t.firstChild,i(t,e(n,{get href(){return W()},children:"返回能力中心"}),null),t})()]},children:t=>{const k=()=>ci(t().category),_=()=>U(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,R=H.nextSibling,j=R.nextSibling,F=u.nextSibling,z=F.firstChild,D=z.firstChild,I=D.nextSibling,A=z.nextSibling,L=A.firstChild,O=L.nextSibling,Y=A.nextSibling,q=Y.firstChild,B=q.nextSibling,P=F.nextSibling,G=P.firstChild,J=G.nextSibling,y=P.nextSibling,K=y.firstChild;return i(H,()=>t().intro.title||"30 秒看懂模型"),i(R,()=>t().name),i(j,()=>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(I,e(o,{get each(){return t().intro.suited},children:a=>(()=>{var l=m();return i(l,a),l})()})),i(O,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(J,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 E(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 E(t().id,void 0,S())},"data-primary":"true",children:"进入能力向导"})}}),null),Q(()=>T(K,"href",t().docsHref)),$})()]}})),x})()}export{di as CapabilityIntroPage};
@@ -1 +0,0 @@
1
- const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609160919/assets/nope-12-BJR1Ka3c.aac";export{e as default};
@@ -1 +0,0 @@
1
- import{u as p,i as s,c as l,T as g,R as u,d_ as h,t as b}from"./index-D89_umhI.js";var v=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 连接配置</p></div></header><section class=os-client-capability-selector aria-label=资源配置><div class=os-client-capability-current-domain><span>当前配置:</span><strong>SSH 连接</strong><small></small></div></section><div class="os-client-capability-page-body os-client-resources-body">');function f(){const r=p();return(()=>{var a=v(),e=a.firstChild;e.firstChild;var i=e.nextSibling,t=i.firstChild,n=t.firstChild,c=n.nextSibling,o=c.nextSibling,d=i.nextSibling;return s(e,l(u,{get href(){return g()},class:"os-client-resources-close","aria-label":"关闭资源配置",children:"×"}),null),s(o,()=>r.t("dialog.ssh.description")),s(d,l(h,{variant:"page"})),a})()}export{f as WorkbenchResourcesPage};
@@ -1 +0,0 @@
1
- import{bW as s,bj as y}from"./index-D89_umhI.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 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dialog-project-upload-CQETR8DT.js","assets/index-D89_umhI.js","assets/index-B_MGkqLF.css","assets/dialog-terminal-unavailable-BJHx-DqW.js"])))=>i.map(i=>d[i]);
2
- import{u as Te,c as e,I as he,D as O,i,S as _,F as Ce,d as Ne,t as a,p as le,a as ke,s as te,b as Me,e as it,f as kn,g as kt,h as Sn,j as xn,k as Cn,l as Ln,m as St,n as K,o as $,q as je,r as Ft,v as rt,w as st,x as Ee,y as Pn,z as Nt,A as Dn,B as xt,C as Z,E as Kt,G as lt,H as En,J as Tt,K as jn,L as fe,M as Mn,N as Rn,O as In,P as An,Q as On,R as pe,T as zn,U as Fn,V as Nn,W as X,X as be,Y as F,Z as Kn,_ as Tn,$ as sn,a0 as ct,a1 as Ke,a2 as Wn,a3 as Wt,a4 as wt,a5 as ce,a6 as on,a7 as Hn,a8 as an,a9 as Bn,aa as qn,ab as De,ac as dt,ad as tt,ae as Un,af as Vn,ag as Xn,ah as ut,ai as Gn,aj as Qn,ak as ln,al as Zn,am as Jn,an as Yn,ao as er,ap as tr,aq as nr,ar as Ht,as as Bt,at as rr,au as sr,av as $t,aw as cn,ax as qt,ay as ir,az as _t,aA as or,aB as dn,aC as ve,aD as ar,aE as Ut,aF as lr,aG as cr,aH as dr,aI as ur,aJ as hr,aK as un,aL as yt,aM as Vt,aN as gr,aO as mr,aP as fr,aQ as ht,aR as Xt,aS as Gt,aT as pr,aU as hn,aV as Ct,aW as gn,aX as vr,aY as br,aZ as wr,a_ as $r,a$ as _r,b0 as yr,b1 as kr,b2 as Qt,b3 as Zt,b4 as Sr,b5 as xr,b6 as ze}from"./index-D89_umhI.js";import{DialogEditProject as Cr}from"./dialog-edit-project-DkwpgJNK.js";import{c as Lr}from"./selection-BGUJK_pT.js";import{u as mn}from"./current-project-D88n80Ca.js";var Pr=a("<span class=os-client-session-menu-label>"),Dr=a("<div class=os-client-session-menu-empty>");const Er="os-client-session-menu",jr="os-client-session-menu os-client-session-menu-sub";function Mr(r){const u=Te(),n=()=>te(),p=()=>ke(n(),r.currentDirectory),l=()=>r.projects().filter(c=>le(c.worktree)!==le(r.currentDirectory)).filter(c=>!ke(n(),c.worktree));return e(_,{get when(){return p()},get children(){return e(O.Sub,{get children(){return[e(O.SubTrigger,{"data-action":"session-move",class:"os-client-session-menu-item",get children(){return[e(he,{name:"folder",size:"small",class:"os-client-session-menu-icon"}),(()=>{var c=Pr();return i(c,()=>u.t("session.move.toProject")),c})(),e(he,{name:"chevron-right",size:"small",class:"os-client-session-menu-chevron"})]}}),e(O.Portal,{get children(){return e(O.SubContent,{class:jr,get children(){return[e(O.Item,{"data-action":"session-move-new-project",class:"os-client-session-menu-item",onSelect:()=>r.onNewProject(),get children(){return[e(he,{name:"plus",size:"small",class:"os-client-session-menu-icon"}),e(O.ItemLabel,{class:"os-client-session-menu-label",get children(){return u.t("session.move.newProject")}})]}}),e(O.Separator,{class:"os-client-session-menu-separator"}),e(_,{get when(){return l().length>0},get fallback(){return(()=>{var c=Dr();return i(c,()=>u.t("session.move.emptyProjects")),c})()},get children(){return e(Ce,{get each(){return l()},children:c=>e(O.Item,{"data-action":"session-move-target",class:"os-client-session-menu-item",onSelect:()=>r.onMove(c.worktree),get children(){return[e(he,{name:"folder",size:"small",class:"os-client-session-menu-icon"}),e(O.ItemLabel,{class:"os-client-session-menu-label",get children(){return Ne(c)}})]}})})}})]}})}})]}})}})}function Jt(r){const u=Te();return[e(O.Item,{"data-action":"session-archive",class:"os-client-session-menu-item",onSelect:()=>r.onArchive(),get children(){return[e(he,{name:"archive",size:"small",class:"os-client-session-menu-icon"}),e(O.ItemLabel,{class:"os-client-session-menu-label",get children(){return u.t("common.archive")}})]}}),e(Mr,{get currentDirectory(){return r.currentDirectory},get projects(){return r.projects},get onMove(){return r.onMove},get onNewProject(){return r.onNewProject}}),e(O.Separator,{class:"os-client-session-menu-separator"}),e(O.Item,{"data-action":"session-delete",class:"os-client-session-menu-item is-danger",onSelect:()=>r.onDelete(),get children(){return[e(he,{name:"trash",size:"small",class:"os-client-session-menu-icon"}),e(O.ItemLabel,{class:"os-client-session-menu-label",get children(){return u.t("common.delete")}})]}})]}var Rr=a("<button type=button aria-haspopup=menu>..."),gt=a('<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">'),Ir=a("<span class=os-sidebar-label>"),Ar=a('<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">'),Or=a("<span class=os-sidebar-label>新建会话"),zr=a('<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">'),Fr=a("<span class=os-sidebar-label>能力中心"),Nr=a('<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">'),Kr=a("<span class=os-sidebar-label>skills设置"),Tr=a('<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">'),Wr=a("<span class=os-sidebar-label>资源配置"),Hr=a("<p class=os-client-empty-hint>登录后同步个人空间"),Br=a("<div class=os-client-task-list-scroll>"),qr=a("<button type=button class=os-client-task-more data-action=recent-expand>展开更多"),Ur=a("<button type=button class=os-client-task-more data-action=recent-collapse>收起"),Vr=a("<p class=os-client-empty-hint>登录后查看未分类会话"),Xr=a("<button type=button class=os-client-shared-cases-more data-action=shared-cases-expand>展开更多"),Gr=a("<button type=button class=os-client-shared-cases-more data-action=shared-cases-collapse>收起"),Qr=a("<div class=os-client-shared-cases-list>"),Zr=a('<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>'),Jr=a('<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">'),Yr=a("<span class=os-sidebar-label>帮助"),es=a('<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>设置'),ts=a("<p class=os-client-empty-hint>暂无项目,点击 + 打开目录"),ns=a("<div class=os-client-project-sessions>"),rs=a("<div class=os-client-project-block><div class=os-client-project-row>"),mt=a("<span class=os-client-task-main><span>"),Yt=a("<div class=os-client-session-row>"),ss=a("<p class=os-client-empty-hint>暂无未分类会话,点击 + 新建"),is=a("<p class=os-client-empty-hint>暂无默认案例");const nt=4,en=200,ft=4,tn=400;function pt(r){let u;const n=()=>r.openKey()===r.menuKey,p=l=>{l.preventDefault(),l.stopPropagation(),n()?r.setOpenKey(""):r.setOpenKey(r.menuKey)};return e(O,{modal:!1,preventScroll:!1,gutter:6,placement:"bottom-end",get open(){return n()},getAnchorRect:()=>u?.getBoundingClientRect(),onOpenChange:l=>{if(l){n()||r.setOpenKey(r.menuKey);return}Date.now()-r.openedAt()<tn||r.setOpenKey("")},get children(){return[(()=>{var l=Rr();return l.$$click=p,l.$$pointerup=c=>{c.preventDefault(),c.stopPropagation()},l.$$pointerdown=c=>{c.preventDefault(),c.stopPropagation()},Ke(c=>{u=c},l),X(c=>{var S=r.triggerClass,x=r.label,v=n();return S!==c.e&&Wn(l,c.e=S),x!==c.t&&F(l,"aria-label",c.t=x),v!==c.a&&F(l,"aria-expanded",c.a=v),c},{e:void 0,t:void 0,a:void 0}),l})(),e(O.Portal,{get children(){return e(O.Content,{class:Er,onOpenAutoFocus:l=>l.preventDefault(),onFocusOutside:l=>l.preventDefault(),onCloseAutoFocus:l=>l.preventDefault(),onInteractOutside:l=>{const c=l.target;if(c instanceof Node&&u?.contains(c)){l.preventDefault();return}Date.now()-r.openedAt()<tn&&l.preventDefault()},onPointerDown:l=>l.stopPropagation(),get children(){return r.children}})}})]}})}function os(){const r=it(),u=kn(),n=Te(),p=kt(),l=Sn(),c=xn(),S=Cn(),x=Ln(),v=St(),[E,z]=K(0),L=$(()=>(E(),!!te())),V=()=>sn(r.pathname),f=()=>(r.pathname,r.search,Lr()),j=()=>r.pathname.startsWith("/workspace/capabilities"),N=()=>r.pathname.startsWith("/workspace/skills"),y=()=>r.pathname.startsWith("/workspace/resources"),b=()=>r.pathname.startsWith("/workspace/docs"),[J,Y]=K(!0),[ne,de]=K(!1),[T,A]=K(!1),[M,se]=K("");let ie=0;const Se=t=>{t&&(ie=Date.now()),se(t)},ge=()=>ie;je(()=>{const t=()=>z(o=>o+1);window.addEventListener(Ft,t),window.addEventListener(rt,t),window.addEventListener(st,t),Ee(()=>{window.removeEventListener(Ft,t),window.removeEventListener(rt,t),window.removeEventListener(st,t)})});const Le=$(()=>Pn(p.projects.list(),te())),re=$(()=>Le().filter(t=>!ke(te(),t.worktree))),h=$(()=>Nt(te())?.trim()||""),I=$(()=>Dn(te())?.trim()||""),W=$(()=>{const t=/^\/workspace\/([^/]+)\/session/.exec(r.pathname)?.[1];return t?xt(t)??"":""}),d=()=>/\/session\/([^/?#]+)/.exec(r.pathname)?.[1],C=t=>{const o=W();if(!o)return!1;const g=le(o);return le(t.worktree)===g?!0:t.sandboxes?.some(R=>le(R)===g)??!1};Z(()=>{if(!L())return;const t=[...re().flatMap(o=>[o.worktree,...o.sandboxes??[]]),h()].filter(o=>o.length>0);for(const o of t)Kt(()=>{l.project.loadSessions(o)})}),Z(()=>{const t=I();if(!t)return;const[o,g]=l.child(t,{bootstrap:!1});(o.limit??0)<en&&g("limit",en),Kt(()=>{l.project.loadSessions(t)})});const w=$(()=>{const t=h();if(!t)return[];const[o]=l.child(t,{bootstrap:!1});return lt(o,Date.now(),t).map(g=>({session:g,directory:t}))}),s=$(()=>T()?w():w().slice(0,ft)),P=$(()=>!T()&&w().length>ft),H=$(()=>T()&&w().length>ft),_e=$(()=>{const t=I();if(!t)return[];const[o]=l.child(t,{bootstrap:!1});return En(lt(o,Date.now(),t).filter(g=>Tt(g.id)))}),Re=$(()=>J()?ne()?_e():_e().slice(0,nt):[]),We=$(()=>J()&&!ne()&&_e().length>nt),He=$(()=>J()&&ne()&&_e().length>nt);Z(()=>{const t=jn(r.search),o=d(),g=t&&t!=="open"?t:Tt(o)?o:void 0;if((t||g)&&Y(!0),g&&_e().findIndex(B=>B.id===g)>=nt&&de(!0),!t||t==="open")return;const R=I();R&&o!==t&&u(fe(R,t),{replace:!0})});function we(t,o=!0){p.projects.open(t),x.projects.touchCode(t),o&&u(fe(t))}function Be(){v.show(()=>e(Qn,{onCreated:t=>we(t)}))}function qe(t){v.show(()=>e(Cr,{project:t}))}function Ue(t){const o=t.worktree;if(ke(te(),o))return;const g=re(),R=le(o),k=g.findIndex(ee=>le(ee.worktree)===R);if(k===-1)return;const B=C(t);if(p.projects.close(o),B){const ee=g[k+1]??g[k-1];u(ee?fe(ee.worktree):"/workspace")}}function Ve(t){const[o,g]=l.child(t,{bootstrap:!1}),R=o.session.map(k=>k.id);Zn(t,R),l.session.setActive(t,void 0),g(ut(k=>{Jn(k,R),k.session=[]})),Yn(t,void 0),l.set("project",ut(k=>{const B=k.findIndex(ee=>le(ee.worktree)===le(t));B>=0&&k.splice(B,1)}))}async function Xe(t){if(ke(te(),t.worktree))return!1;const o=t.worktree,g=re(),R=le(o),k=g.findIndex(Q=>le(Q.worktree)===R),B=C(t);if(await c.client.experimental.session.list({directory:o,roots:!0,archived:!0,limit:1}).then(Q=>(Q.data??[]).some(Ae=>!!Ae.time?.archived)).catch(()=>!1))return ce({title:n.t("sidebar.project.delete.failed"),description:n.t("sidebar.project.delete.hasArchived")}),!1;const ue=ln(o)?.workspaceID?.trim();if(ue&&await c.client.experimental.workspace.remove({id:ue,directory:o}).catch(()=>{}),!await c.client.project.remove({directory:o}).then(Q=>Q.data).catch(Q=>(ce({title:n.t("sidebar.project.delete.failed"),description:tt(Q,n.t("common.requestFailed"))}),!1)))return!1;if(Ve(o),p.projects.close(o),B){const Q=k>=0?g[k+1]??g[k-1]:void 0;u(Q?fe(Q.worktree):"/workspace")}return!0}function Ge(t){const o=$(()=>Ne(t.project)),[g,R]=K(!1),[k,B]=K("checking");je(()=>{c.client.experimental.session.list({directory:t.project.worktree,roots:!0,archived:!0,limit:1}).then(ue=>{const xe=(ue.data??[]).some(Q=>!!Q.time?.archived);B(xe?"blocked":"ok")}).catch(()=>B("ok"))});const ee=async()=>{if(g()||k()!=="ok")return;R(!0);const ue=await Xe(t.project);R(!1),ue&&v.close()};return e(dt,{get title(){return n.t("sidebar.project.delete.title")},fit:!0,get children(){var ue=gt(),xe=ue.firstChild,Q=xe.nextSibling;return i(xe,(()=>{var Ae=be(()=>k()==="blocked");return()=>Ae()?n.t("sidebar.project.delete.hasArchived"):n.t("sidebar.project.delete.confirm",{name:o()})})()),i(Q,e(De,{variant:"ghost",size:"large",get disabled(){return g()},onClick:()=>v.close(),get children(){return n.t("common.cancel")}}),null),i(Q,e(_,{get when(){return k()!=="blocked"},get children(){return e(De,{variant:"primary",size:"large",get disabled(){return g()||k()==="checking"},onClick:()=>void ee(),get children(){return be(()=>!!g())()?n.t("sidebar.project.delete.busy"):n.t("sidebar.project.delete.button")}})}}),null),ue}})}function Qe(t){ke(te(),t.worktree)||v.show(()=>e(Ge,{project:t}))}async function Ze(){const t=S.openDirectoryPickerDialog;function o(g){if(Array.isArray(g)){g.forEach((R,k)=>we(R,k===0));return}g&&we(g)}if(t&&Vn({hasNativePicker:!!t,isLocalServer:!!x.isLocal(),hasPlatformSession:!!te()})){const g=await t({title:n.t("command.project.open"),multiple:!0});o(g);return}v.show(()=>e(Xn,{multiple:!0,onSelect:o,onCreateFolder:Be}),()=>o(null))}function Pe(){ct({navigate:u,action:{type:"install",resourceId:"__project__"},isLoggedIn:L()})&&Ze()}function Je(){if(!ct({navigate:u,action:{type:"install",resourceId:"__task__"},isLoggedIn:L()}))return;const t=Nt(te());t&&(Wt(wt(t)),we(t))}function Ye(t){ct({navigate:u,action:{type:"install",resourceId:"__task__"},isLoggedIn:L()})&&(Wt(wt(t)),we(t))}function Ie(t){const o=te();return Hn(o,t)?!1:an(o,t)}function fn(t){if(!Ie(t)){ce({title:n.t("dialog.project.upload.failed"),description:n.t("dialog.project.upload.destinationHint"),variant:"error"});return}on(()=>import("./dialog-project-upload-CQETR8DT.js"),__vite__mapDeps([0,1,2])).then(o=>{v.show(()=>e(o.DialogProjectUpload,{directory:t}))})}function Lt(t){if(d()!==t.id)return;const o=W();if(!o){u("/workspace");return}u(fe(o))}function ot(t,o){const[,g]=l.child(t,{bootstrap:!1});g(ut(R=>{const k=Gn.search(R.session,o,ee=>ee.id);if(!k.found)return;const B=R.session[k.index];R.session.splice(k.index,1),B&&!B.parentID&&(R.sessionTotal=Math.max(0,R.sessionTotal-1))}))}async function Pt(t){ot(t.directory,t.id),Lt(t),await c.client.session.update({directory:t.directory,sessionID:t.id,time:{archived:Date.now()}}).then(()=>!0).catch(g=>(ce({title:n.t("common.archive"),description:tt(g,n.t("common.requestFailed"))}),!1))||l.project.loadSessions(t.directory)}async function pn(t){return await c.client.session.delete({sessionID:t.id,directory:t.directory}).then(g=>g.data).catch(g=>(ce({title:n.t("session.delete.failed.title"),description:tt(g,n.t("common.requestFailed"))}),!1))?(ot(t.directory,t.id),Lt(t),!0):!1}function Dt(t){const o=at(t);v.show(()=>e(dt,{get title(){return n.t("session.delete.title")},fit:!0,get children(){var g=gt(),R=g.firstChild,k=R.nextSibling;return i(R,()=>n.t("session.delete.confirm",{name:o})),i(k,e(De,{variant:"ghost",size:"large",onClick:()=>v.close(),get children(){return n.t("common.cancel")}}),null),i(k,e(De,{variant:"primary",size:"large",onClick:()=>{pn(t).then(B=>{B&&v.close()})},get children(){return n.t("session.delete.button")}}),null),g}}))}function Et(t){const[o]=l.child(t,{bootstrap:!1});return lt(o,Date.now(),t).map(g=>({session:g,directory:t}))}function at(t){const[o]=l.child(t.directory,{bootstrap:!1});return Bn({title:t.title,fallbackText:qn(t.id,o.message,o.part),emptyLabel:n.t("command.session.new")})}function jt(t,o){if(le(t.directory)===le(o))return;if(!ke(te(),t.directory)){ce({title:n.t("session.move.failed.title"),description:n.t("session.move.failed.onlyDefault")});return}if(ke(te(),o)){ce({title:n.t("session.move.failed.title"),description:n.t("session.move.failed.onlyDefault")});return}const g=Ne({worktree:o});v.show(()=>e(dt,{get title(){return n.t("session.move.confirm.title")},fit:!0,get children(){var R=gt(),k=R.firstChild,B=k.nextSibling;return i(k,()=>n.t("session.move.confirm.description",{project:g})),i(B,e(De,{variant:"ghost",size:"large",onClick:()=>v.close(),get children(){return n.t("common.cancel")}}),null),i(B,e(De,{variant:"primary",size:"large",onClick:()=>{vn(t,o).then(ee=>{ee&&v.close()})},get children(){return n.t("session.move.confirm.action")}}),null),R}}))}async function vn(t,o){const g=t.directory;return await c.client.session.update({directory:t.directory,sessionID:t.id,moveTo:o}).then(()=>!0).catch(k=>(ce({title:n.t("session.move.failed.title"),description:tt(k,n.t("common.requestFailed"))}),!1))?(ot(g,t.id),p.projects.open(o),x.projects.touchCode(o),l.project.loadSessions(g),l.project.loadSessions(o),d()===t.id?(u(fe(o,t.id)),!0):(ce({title:n.t("session.move.success.title"),description:n.t("session.move.success.description",{project:Ne({worktree:o})})}),!0)):!1}function bn(){v.show(()=>e(Un,{tab:"account"}))}return(()=>{var t=es(),o=t.firstChild,g=o.nextSibling,R=g.firstChild,k=R.firstChild,B=k.nextSibling,ee=B.firstChild,ue=ee.firstChild,xe=ue.nextSibling,Q=xe.firstChild,Ae=ee.nextSibling,Mt=B.nextSibling,Rt=Mt.firstChild,wn=Rt.firstChild,$n=wn.nextSibling,It=$n.firstChild,_n=Rt.nextSibling,yn=g.nextSibling,At=yn.firstChild,Ot=At.firstChild;return Mn(o,Rn(()=>S.platform==="desktop"?{"data-tauri-drag-region":!0}:{}),!1,!0),i(o,e(pe,{get href(){return On(S.platform)},class:"os-sidebar-brand-link",get children(){return[e(In,{class:"os-sidebar-brand-mark"}),(()=>{var D=Ir();return i(D,()=>An(S.platform)),D})()]}})),i(k,e(pe,{get href(){return zn()},class:"os-sidebar-link",get classList(){return{"is-active":V()}},get children(){return[Ar(),Or()]}}),null),i(k,e(pe,{get href(){return f()},class:"os-sidebar-link",get classList(){return{"is-active":j()}},get children(){return[zr(),Fr()]}}),null),i(k,e(pe,{get href(){return Fn()},class:"os-sidebar-link",get classList(){return{"is-active":N()}},get children(){return[Nr(),Kr()]}}),null),i(k,e(pe,{get href(){return Nn()},class:"os-sidebar-link",get classList(){return{"is-active":y()}},get children(){return[Tr(),Wr()]}}),null),Q.$$click=Pe,i(Ae,e(_,{get when(){return be(()=>!!L())()&&re().length>0},get fallback(){return e(_,{get when(){return L()},get children(){return ts()}})},get children(){return e(Ce,{get each(){return re().map(D=>D.worktree)},children:D=>{const G=()=>re().find(oe=>oe.worktree===D);return e(_,{get when(){return G()},children:oe=>(()=>{var ae=rs(),q=ae.firstChild;return i(q,e(pe,{get href(){return fe(D)},class:"os-client-project-item",get classList(){return{"is-active":C(oe())}},onClick:m=>{m.metaKey||m.ctrlKey||m.shiftKey||m.altKey||(m.preventDefault(),we(D))},get children(){return Ne(oe())}}),null),i(q,e(pt,{menuKey:`project:${D}`,openKey:M,setOpenKey:Se,openedAt:ge,triggerClass:"os-client-project-more",get label(){return n.t("common.moreOptions")},get children(){return[e(O.Item,{"data-action":"project-new-session",class:"os-client-session-menu-item",onSelect:()=>Ye(D),get children(){return[e(he,{name:"new-session",size:"small",class:"os-client-session-menu-icon"}),e(O.ItemLabel,{class:"os-client-session-menu-label",get children(){return n.t("command.session.new")}})]}}),e(_,{get when(){return Ie(D)},get children(){return e(O.Item,{"data-action":"project-upload",class:"os-client-session-menu-item",onSelect:()=>fn(D),get children(){return[e(he,{name:"cloud-upload",size:"small",class:"os-client-session-menu-icon"}),e(O.ItemLabel,{class:"os-client-session-menu-label",get children(){return n.t("command.project.upload")}})]}})}}),e(O.Item,{"data-action":"project-rename",class:"os-client-session-menu-item",onSelect:()=>{const m=G();m&&qe(m)},get children(){return[e(he,{name:"edit",size:"small",class:"os-client-session-menu-icon"}),e(O.ItemLabel,{class:"os-client-session-menu-label",get children(){return n.t("common.rename")}})]}}),e(O.Separator,{class:"os-client-session-menu-separator"}),e(O.Item,{"data-action":"project-remove-from-view",class:"os-client-session-menu-item",onSelect:()=>{const m=G();m&&Ue(m)},get children(){return[e(he,{name:"close-small",size:"small",class:"os-client-session-menu-icon"}),e(O.ItemLabel,{class:"os-client-session-menu-label",get children(){return n.t("sidebar.project.removeFromView")}})]}}),e(O.Item,{"data-action":"project-delete",class:"os-client-session-menu-item is-danger",onSelect:()=>{const m=G();m&&Qe(m)},get children(){return[e(he,{name:"trash",size:"small",class:"os-client-session-menu-icon"}),e(O.ItemLabel,{class:"os-client-session-menu-label",get children(){return n.t("sidebar.project.delete")}})]}})]}}),null),i(ae,e(_,{get when(){return C(oe())},get children(){var m=ns();return i(m,e(Ce,{get each(){return Et(D).map(U=>U.session.id)},children:U=>{const $e=()=>Et(D).find(ye=>ye.session.id===U);return e(_,{get when(){return $e()},children:ye=>(()=>{var Oe=Yt();return i(Oe,e(pe,{get href(){return fe(ye().directory,U)},class:"os-client-task-item",get classList(){return{"is-active":d()===U}},"data-session-id":U,get children(){var me=mt(),et=me.firstChild;return i(et,()=>at(ye().session)),me}}),null),i(Oe,e(pt,{menuKey:`session:${U}`,openKey:M,setOpenKey:Se,openedAt:ge,triggerClass:"os-client-session-more",get label(){return n.t("common.moreOptions")},get children(){return e(Jt,{get currentDirectory(){return ye().directory},projects:re,onArchive:()=>void Pt(ye().session),onDelete:()=>Dt(ye().session),onMove:me=>jt(ye().session,me),onNewProject:Pe})}}),null),X(me=>{var et=d()===U,zt=M()===`session:${U}`;return et!==me.e&&Oe.classList.toggle("is-active",me.e=et),zt!==me.t&&Oe.classList.toggle("is-menu-open",me.t=zt),me},{e:void 0,t:void 0}),Oe})()})}})),m}}),null),X(m=>{var U=!!C(oe()),$e=M()===`project:${D}`;return U!==m.e&&q.classList.toggle("is-active",m.e=U),$e!==m.t&&q.classList.toggle("is-menu-open",m.t=$e),m},{e:void 0,t:void 0}),ae})()})}})}})),i(B,e(_,{get when(){return!L()},get children(){return Hr()}}),null),It.$$click=Je,i(_n,e(_,{get when(){return be(()=>!!L())()&&w().length>0},get fallback(){return e(_,{get when(){return L()},get children(){return ss()}})},get children(){return[(()=>{var D=Br();return i(D,e(Ce,{get each(){return s().map(G=>G.session.id)},children:G=>{const oe=()=>s().find(ae=>ae.session.id===G);return e(_,{get when(){return oe()},children:ae=>(()=>{var q=Yt();return i(q,e(pe,{get href(){return fe(ae().directory,G)},class:"os-client-task-item",get classList(){return{"is-active":d()===G}},"data-session-id":G,get children(){var m=mt(),U=m.firstChild;return i(U,()=>at(ae().session)),m}}),null),i(q,e(pt,{menuKey:`recent:${G}`,openKey:M,setOpenKey:Se,openedAt:ge,triggerClass:"os-client-session-more",get label(){return n.t("common.moreOptions")},get children(){return e(Jt,{get currentDirectory(){return ae().directory},projects:re,onArchive:()=>void Pt(ae().session),onDelete:()=>Dt(ae().session),onMove:m=>jt(ae().session,m),onNewProject:Pe})}}),null),X(m=>{var U=d()===G,$e=M()===`recent:${G}`;return U!==m.e&&q.classList.toggle("is-active",m.e=U),$e!==m.t&&q.classList.toggle("is-menu-open",m.t=$e),m},{e:void 0,t:void 0}),q})()})}})),X(()=>F(D,"data-expanded",T()?"true":"false")),D})(),e(_,{get when(){return P()},get children(){var D=qr();return D.$$click=()=>A(!0),D}}),e(_,{get when(){return H()},get children(){var D=Ur();return D.$$click=()=>A(!1),D}})]}})),i(Mt,e(_,{get when(){return!L()},get children(){return Vr()}}),null),i(g,e(_,{get when(){return I()},get children(){var D=Zr(),G=D.firstChild,oe=G.firstChild,ae=oe.nextSibling;return G.$$click=()=>Y(q=>!q),i(ae,()=>n.t("sidebar.section.sharedCases")),i(D,e(_,{get when(){return J()},get children(){var q=Qr();return i(q,e(_,{get when(){return Re().length>0},get fallback(){return is()},get children(){return e(Ce,{get each(){return Re()},children:m=>e(pe,{get href(){return fe(I(),m.id)},class:"os-client-task-item",get classList(){return{"is-active":d()===m.id}},get"data-session-id"(){return m.id},get children(){var U=mt(),$e=U.firstChild;return i($e,()=>Kn(m.title)??m.id),U}})})}}),null),i(q,e(_,{get when(){return We()},get children(){var m=Xr();return m.$$click=()=>de(!0),m}}),null),i(q,e(_,{get when(){return He()},get children(){var m=Gr();return m.$$click=()=>de(!1),m}}),null),q}}),null),X(q=>{var m=J(),U=J()?"true":"false";return m!==q.e&&F(G,"aria-expanded",q.e=m),U!==q.t&&F(oe,"data-open",q.t=U),q},{e:void 0,t:void 0}),D}}),null),i(At,e(pe,{get href(){return Tn()},class:"os-sidebar-footer-action",get classList(){return{"is-active":b()}},get children(){return[Jr(),Yr()]}}),Ot),Ot.$$click=bn,X(D=>{var G=!L(),oe=!L();return G!==D.e&&Q.classList.toggle("is-muted",D.e=G),oe!==D.t&&It.classList.toggle("is-muted",D.t=oe),D},{e:void 0,t:void 0}),t})()}Me(["pointerdown","pointerup","click"]);var as=a('<pre class="os-client-right-files-preview whitespace-pre-wrap break-all p-3 text-12-regular m-0">'),ls=a("<button type=button class=os-client-right-files-back>← 返回目录"),cs=a("<span class=os-client-right-files-title>"),ds=a("<button type=button>"),us=a("<div class=os-client-right-files-actions><button type=button>关闭"),hs=a("<p class=os-client-right-files-hint>SSH 未连接,目录显示远端路径。请先在项目栏连接远端。"),gs=a("<p class=os-client-right-files-hint>正在加载目录…"),ms=a("<p class=os-client-right-files-hint>该目录为空"),fs=a("<div class=os-client-right-files-tree-scroll>"),ps=a("<div class=os-client-right-files-tree><p class=os-client-right-files-root>"),vs=a("<div class=os-client-right-files-unsaved>"),bs=a("<p class=os-client-right-files-hint>…"),ws=a("<textarea class=os-client-right-files-textarea autocapitalize=off autocomplete=off autocorrect=off>"),$s=a("<pre class=os-client-right-files-preview>"),_s=a("<div class=os-client-right-files-editor>"),ys=a("<section class=os-client-right-files><header class=os-client-right-files-header>"),ks=a("<strong>目录"),Ss=a("<div class=os-client-right-files-actions><button type=button aria-label=刷新>刷新</button><button type=button>关闭"),xs=a("<p class=os-client-right-files-hint>加载失败:"),Cs=a("<p class=os-client-right-files-hint>");function Ls(r){const u=r.replace(/\\/g,"/").split("/");return u[u.length-1]||r}function Ps(r){const u=er(),n=tr(),p=Te(),[l,c]=K("tree"),[S,x]=K(),[v,E]=K(""),[z,L]=K(!1),[V,f]=K(!1),[j,N]=K(0);let y;const b=$(()=>u.tree.state("")),J=$(()=>u.tree.children("")),Y=$(()=>nr(S())),ne=$(()=>{Ht(),Bt();const d=n.directory;return d?rr(d):!1}),de=$(()=>{Ht(),Bt();const d=n.directory;return d&&sr(d).kind==="ssh"?ln(d)?.remotePath?.trim()||"未连接远端":d}),T=(d=!1)=>{!n.directory||ne()||(d?u.tree.refresh(""):u.tree.list(""))};je(()=>{queueMicrotask(()=>T(!0))}),Z(()=>{if(!n.directory||l()!=="tree"||ne())return;const C=b();C?.loading||C?.loaded||C?.error||u.tree.list("")}),Z($t(()=>cn(n.directory)??"",()=>{l()==="tree"&&T(!0)}));const A=$(()=>{const d=S();if(d)return u.get(d)}),M=$(()=>A()?.content?.content??""),se=$(()=>!!A()?.loaded),ie=$(()=>!!A()?.loading),Se=$(()=>A()?.error),ge=$(()=>{const d=A();return!(!d?.loaded||d.content?.type!=="text"||d.content.encoding==="base64"||qt(S()))}),Le=$(()=>ge()&&Y()==="text"),re=$(()=>{if(!(!ge()||Le()))return{draft:v,setDraft:d=>{E(d),L(!0)},textareaRef:d=>{y=d},class:"os-client-right-files-textarea"}}),h=d=>(()=>{var C=as();return i(C,d),C})();Z(()=>{const d=S();d&&u.load(d)}),Z($t(S,()=>{L(!1),E(se()?M():""),N(0)},{defer:!1})),Z(()=>{!se()||z()||E(M())});const I=async()=>{const d=S();if(!(!d||V()||!z()||!ge())){f(!0);try{await u.write(d,v()),L(!1),Ut(d)&&N(C=>C+1)}finally{f(!1)}}};Z(()=>{if(typeof window>"u")return;ir(window,"keydown",C=>{!(C.metaKey||C.ctrlKey)||C.key.toLowerCase()!=="s"||!y?.contains(document.activeElement)&&document.activeElement!==y||(C.preventDefault(),I())})});const W=d=>{x(d),c("editor")};return(()=>{var d=ys(),C=d.firstChild;return i(C,e(_,{get when(){return l()==="editor"},get fallback(){return[ks(),(()=>{var w=Ss(),s=w.firstChild,P=s.nextSibling;return s.$$click=()=>{T(!0),u.tree.refreshAll()},_t(P,"click",r.onClose,!0),w})()]},get children(){return[(()=>{var w=ls();return w.$$click=()=>c("tree"),w})(),(()=>{var w=cs();return i(w,(()=>{var s=be(()=>!!S());return()=>s()?Ls(S()):""})()),X(()=>F(w,"title",S())),w})(),(()=>{var w=us(),s=w.firstChild;return i(w,e(_,{get when(){return ge()},get children(){var P=ds();return P.$$click=()=>void I(),i(P,(()=>{var H=be(()=>!!V());return()=>H()?p.t("common.saving"):p.t("common.save")})()),X(()=>P.disabled=!z()||V()),P}}),s),_t(s,"click",r.onClose,!0),w})()]}})),i(d,e(_,{get when(){return l()==="tree"},get children(){var w=ps(),s=w.firstChild;return i(s,de),i(w,e(_,{get when(){return ne()},get children(){return hs()}}),null),i(w,e(_,{get when(){return be(()=>!!(!ne()&&b()?.loading))()&&J().length===0},get children(){return gs()}}),null),i(w,e(_,{get when(){return be(()=>!ne())()&&b()?.error},children:P=>(()=>{var H=xs();return H.firstChild,i(H,P,null),H})()}),null),i(w,e(_,{get when(){return be(()=>!!(!ne()&&b()?.loaded&&J().length===0))()&&!b()?.error},get children(){return ms()}}),null),i(w,e(_,{get when(){return!ne()},get children(){var P=fs();return i(P,e(or,{path:"",class:"os-client-right-file-tree",nodeClass:"os-client-right-file-node",get active(){return S()},draggable:!1,onFileClick:H=>W(H.path)})),P}}),null),X(()=>F(s,"title",de())),w}}),null),i(d,e(_,{get when(){return l()==="editor"},get children(){var w=_s();return i(w,e(_,{get when(){return z()},get children(){var s=vs();return i(s,()=>p.t("session.file.unsaved")),s}}),null),i(w,e(_,{get when(){return be(()=>!!ie())()&&!se()},get children(){var s=bs(),P=s.firstChild;return i(s,()=>p.t("common.loading"),P),s}}),null),i(w,e(_,{get when(){return Se()},children:s=>(()=>{var P=Cs();return i(P,s),P})()}),null),i(w,e(_,{get when(){return se()},get children(){return e(dn,{get children(){return[e(ve,{get when(){return Ut(S())},get children(){return e(ar,{path:S,contents:M,renderSource:h,get editSource(){return re()},previewRevision:j,chrome:"workbench"})}}),e(ve,{get when(){return Y()==="markdown"},get children(){return e(lr,{path:S,contents:M,renderSource:h,get editSource(){return re()},chrome:"workbench"})}}),e(ve,{get when(){return Y()==="csv"},get children(){return e(cr,{path:S,contents:M,renderSource:h,get editSource(){return re()},chrome:"workbench"})}}),e(ve,{get when(){return qt(S())},get children(){return e(dr,{path:S,chrome:"workbench"})}}),e(ve,{get when(){return hr(S())},get children(){return e(ur,{path:S,contents:M,renderSource:h,get editSource(){return re()},chrome:"workbench"})}}),e(ve,{get when(){return Le()},get children(){var s=ws();s.$$input=H=>{E(H.currentTarget.value),L(!0)};var P=y;return typeof P=="function"?Ke(P,s):y=s,F(s,"spellcheck",!1),X(()=>s.value=v()),s}}),e(ve,{when:!0,get children(){var s=$s();return i(s,()=>M()||"(二进制或不支持预览的文件)"),s}})]}})}}),null),w}}),null),X(()=>F(d,"data-view",l())),d})()}Me(["click","input"]);var Ds=a('<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>'),Es=a("<ul class=os-client-right-todo-list>"),js=a("<span class=os-client-right-todo-text>"),Ms=a('<li class="os-client-right-todo-item is-clickable"role=button tabindex=0>'),Rs=a("<p class=os-client-right-todo-progress>已完成 <!> / "),Is=a("<section class=os-client-right-todo><header class=os-client-right-todo-header><strong></strong><button type=button>关闭"),As=a("<p class=os-client-right-todo-empty>暂无场景工作流。从能力中心场景创建任务后,步骤会显示在这里。"),Os=a("<span class=os-client-right-todo-stop> · ");function zs(r){return r==="completed"?"completed":r==="in_progress"?"in_progress":r==="failed"?"cancelled":"pending"}function Fs(r){if(r==="in_progress")return Ds()}function Ns(r,u){return u?"confirm":r==="pending"?"edit":r==="completed"||r==="failed"||r==="in_progress"?"rerun":"view"}function Ks(r){return(()=>{var u=Es();return i(u,e(Ce,{get each(){return r.items},children:n=>(()=>{var p=Ms();return p.$$keydown=l=>{(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),r.onOpen(n.index))},p.$$click=()=>r.onOpen(n.index),i(p,e(gr,{readOnly:!0,get checked(){return n.status==="completed"},get indeterminate(){return n.status==="in_progress"},get icon(){return Fs(n.status)},get children(){var l=js();return i(l,()=>n.content),X(c=>{var S=n.status==="completed"||n.status==="cancelled",x=n.status==="pending";return S!==c.e&&l.classList.toggle("is-done",c.e=S),x!==c.t&&l.classList.toggle("is-pending",c.t=x),c},{e:void 0,t:void 0}),l}})),X(()=>F(p,"data-state",n.status)),p})()})),u})()}function Ts(r){const u=St();un();const n=$(()=>yt(r.directoryKey,r.sessionID)??Vt(r.directoryKey)),p=$(()=>{const x=n();return x?.steps.length?x.steps.map((v,E)=>({content:v.name,status:zs(v.status),index:E})):[]}),l=$(()=>p().filter(x=>x.status==="completed").length),c=$(()=>n()?.title||"待办"),S=x=>{const v=yt(r.directoryKey,r.sessionID)??Vt(r.directoryKey);if(!v)return;const E=v.steps[x];if(!E)return;const z=mr(v,x),L=E.status==="pending"&&v.phase==="awaiting_confirm"&&v.currentIndex===x,V=Ns(E.status,L),f=E.status==="in_progress",j=V==="confirm"?"确认下一步参数":V==="edit"?"编辑步骤参数":f?"终止并重新执行":V==="rerun"?"从此步重新执行":"查看步骤参数",N=r.directoryKey;u.show(()=>e(pr,{title:j,get stepName(){return E.name},fields:z,get values(){return v.values},mode:V,get firstDecision(){return L&&v.confirmMode==="unset"},aborting:f,rerunActionLabel:f?"终止并重新执行":"从此步重新执行",get reason(){return V==="confirm"?`下一步「${E.name}」可按需调整参数,确认后将自动发送并执行。`:V==="edit"?`可修改「${E.name}」的预填参数,保存后在执行该步时生效。`:f?`将停止自动续跑并从「${E.name}」重发。已提交的外部作业需自行取消;可先修改参数再确认。`:V==="rerun"?`可修改「${E.name}」参数。确认后将从该步重新执行,并重置后续步骤状态。`:`「${E.name}」当前为只读,展示该步相关参数。`},canContinue:L,onSave:y=>{Xt(N,y),ce({title:"已保存步骤参数"})},onConfirm:y=>{const b=Gt(N,y);b&&(ht(N,b),ce({title:y.mode==="auto"?`连续执行:${b.stepName}`:`继续执行:${b.stepName}`}))},onSaveAndContinue:y=>{Xt(N,y.values);const b=Gt(N,y);b&&(ht(N,b),ce({title:y.mode==="auto"?`连续执行:${b.stepName}`:`继续执行:${b.stepName}`}))},onRerun:y=>{const b=fr(N,{stepIndex:x,values:y});b&&(ht(N,b),ce({title:f?`已终止并从该步重跑:${b.stepName}`:`已从该步重新执行:${b.stepName}`}))}}))};return(()=>{var x=Is(),v=x.firstChild,E=v.firstChild,z=E.nextSibling;return i(E,c),_t(z,"click",r.onClose,!0),i(x,e(_,{get when(){return p().length>0},get fallback(){return As()},get children(){return[(()=>{var L=Rs(),V=L.firstChild,f=V.nextSibling;return f.nextSibling,i(L,l,f),i(L,()=>p().length,null),i(L,e(_,{get when(){return n()?.stopReason},children:j=>(()=>{var N=Os();return N.firstChild,i(N,j,null),N})()}),null),L})(),e(Ks,{get items(){return p()},onOpen:S})]}}),null),X(()=>F(E,"title",c())),x})()}Me(["click","keydown"]);var Ws=a("<div class=os-client-right-add-dropdown role=menu>"),Hs=a('<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>'),Bs=a("<button type=button role=menuitem>"),qs=a("<section class=os-client-right-empty><strong>尚未打开页面</strong><p>点击 + 打开目录、可视化组件或待办;在会话中可从目录点文件到右侧编辑。"),Us=a("<section class=os-client-right-pane-stub><header><strong>可视化组件</strong><button type=button>关闭</button></header><p>请从「目录」中打开 `.html` / `.md` / `.csv` / `.pdf` / `.xyz` 文件查看可视化预览;后续版本将提供独立可视化入口。"),Vs=a("<section class=os-client-right-pane-stub><header><strong>目录</strong><button type=button>关闭</button></header><p>请先打开项目或任务后再查看目录。"),Xs=a("<section class=os-client-right-pane-stub><header><strong>待办</strong><button type=button>关闭</button></header><p>请先打开项目或任务后再查看待办。");const Gs=[{id:"directory",label:"目录"},{id:"viz",label:"可视化组件"},{id:"todo",label:"待办"}];function Qs(){const r=it(),u=mn(),[n,p]=K(!1),[l,c]=K();let S;const x=$(()=>hn(r.pathname)),v=$(()=>{const y=x()?.dir;return y?xt(y)??"":""}),E=$(()=>Ct(r.pathname)&&!!v()),z=$(()=>v()||u()),L=$(()=>x()?.dir||(z()?wt(z()):"")),V=$(()=>!!z()&&!!L()),f=$(()=>{un();const y=x()?.dir;if(!y)return!1;const b=yt(y,x()?.id);return b?b.phase!=="done"&&b.phase!=="stopped":!1});je(()=>{const y=b=>{n()&&(S?.contains(b.target)||p(!1))};document.addEventListener("pointerdown",y),Ee(()=>document.removeEventListener("pointerdown",y))}),Z(y=>{const b=E();return b&&!y&&!l()&&c("directory"),b}),Z(()=>{if(!gn())return;const b=vr();b&&(c(b),p(!1))});const j=y=>{c(y),p(!1)},N=()=>{if(f()&&l()!=="todo"){c("todo");return}c(void 0)};return(()=>{var y=Hs(),b=y.firstChild,J=b.firstChild,Y=J.firstChild,ne=b.nextSibling,de=S;return typeof de=="function"?Ke(de,b):S=b,Y.$$click=()=>p(T=>!T),i(J,e(_,{get when(){return n()},get children(){var T=Ws();return i(T,e(Ce,{get each(){return[...Gs]},children:A=>(()=>{var M=Bs();return M.$$click=()=>j(A.id),i(M,()=>A.label),M})()})),T}}),null),i(ne,e(_,{get when(){return l()},get fallback(){return qs()},children:T=>e(dn,{get children(){return[e(ve,{get when(){return T()==="directory"},get children(){return e(_,{get when(){return V()},get fallback(){return(()=>{var A=Vs(),M=A.firstChild,se=M.firstChild,ie=se.nextSibling;return ie.$$click=N,A})()},get children(){return e(br,{params:()=>({dir:L(),id:x()?.id}),get children(){return e(wr,{directory:()=>z(),get children(){return e($r,{get children(){return e(_r,{get children(){return e(Ps,{onClose:N})}})}})}})}})}})}}),e(ve,{get when(){return T()==="todo"},get children(){return e(_,{get when(){return x()?.dir},get fallback(){return(()=>{var A=Xs(),M=A.firstChild,se=M.firstChild,ie=se.nextSibling;return ie.$$click=()=>c(void 0),A})()},children:A=>e(Ts,{get directoryKey(){return A()},get sessionID(){return x()?.id},onClose:()=>c(void 0)})})}}),e(ve,{get when(){return T()==="viz"},get children(){var A=Us(),M=A.firstChild,se=M.firstChild,ie=se.nextSibling;return ie.$$click=N,A}})]}})})),X(T=>{var A=!!n(),M=n();return A!==T.e&&Y.classList.toggle("is-open",T.e=A),M!==T.t&&F(Y,"aria-expanded",T.t=M),T},{e:void 0,t:void 0}),y})()}Me(["click"]);var Zs=a('<button type=button class="os-client-panel-toggle os-client-terminal-toggle"aria-controls=terminal-panel>'),Js=a('<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 Ys(){const r=it(),u=kt(),n=Te(),p=yr(),l=St(),[c,S]=K(te()),x=mn(),v=$(()=>sn(r.pathname)||Ct(r.pathname)),E=$(()=>!v()||kr()&&!c()?!1:u.terminal.enabled()?!0:Qt(c())),z=$(()=>u.view("workbench").terminal.opened()),L=$(()=>{const f=hn(r.pathname);return f?.dir?xt(f.dir)??"":x()});je(()=>{const f=()=>S(te());window.addEventListener(st,f),window.addEventListener(rt,f),window.addEventListener("storage",f),Ee(()=>{window.removeEventListener(st,f),window.removeEventListener(rt,f),window.removeEventListener("storage",f)})}),Z(()=>{E()&&Zt()}),Z($t(v,(f,j)=>{j===void 0||f||!j||z()&&(u.view("workbench").terminal.close(),u.terminal.closeFullscreen())}));const V=()=>{if(Qt(c())||!u.terminal.enabled()){on(()=>import("./dialog-terminal-unavailable-BJHx-DqW.js"),__vite__mapDeps([3,1,2])).then(f=>{l.show(()=>e(f.DialogTerminalUnavailable,{}))});return}if(!z()){const f=L();if(f&&!cn(f)&&!an(c(),f))return;Zt()}u.view("workbench").terminal.toggle()};return e(_,{get when(){return E()},get children(){var f=Zs();return f.$$click=j=>j.preventDefault(),f.$$pointerdown=j=>{j.button===0&&(j.preventDefault(),V())},i(f,e(ei,{get active(){return z()}})),X(j=>{var N=!!z(),y=n.t("command.terminal.toggle"),b=n.t("command.terminal.toggle"),J=z(),Y=`${n.t("command.terminal.toggle")} (${p.keybind("terminal.toggle")})`;return N!==j.e&&f.classList.toggle("is-active",j.e=N),y!==j.t&&F(f,"data-tooltip",j.t=y),b!==j.a&&F(f,"aria-label",j.a=b),J!==j.o&&F(f,"aria-expanded",j.o=J),Y!==j.i&&F(f,"title",j.i=Y),j},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),f}})}function ei(r){return(()=>{var u=Js(),n=u.firstChild,p=n.nextSibling;return X(()=>F(p,"opacity",r.active?1:.85)),u})()}Me(["pointerdown","click"]);var ti=a('<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>'),ni=a('<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>'),ri=a('<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>'),si=a("<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 Fe=320,ii=230,oi=430,ai=200,nn=1280;function rn(r){return(()=>{var u=ti();return X(n=>{var p=r.side,l=r.open?"true":"false";return p!==n.e&&F(u,"data-side",n.e=p),l!==n.t&&F(u,"data-open",n.t=l),n},{e:void 0,t:void 0}),u})()}function vt(r){return Math.min(oi,Math.max(ii,Math.round(r)))}function bt(r){const u=typeof window>"u"?nn:Math.min(nn,Math.floor(window.innerWidth*.85));return Math.min(u,Math.max(ai,Math.round(r)))}function hi(r){const u=kt(),n=it(),[p,l]=K(!0),[c,S]=K(!1),[x,v]=K(Fe),[E,z]=K(Fe),[L,V]=K(!1),[f,j]=K(!1),[N,y]=K(0),[b,J]=K({left:0,right:0}),[Y,ne]=K(),[de,T]=K(),A=$(()=>u.view("workbench").terminal.opened()),M=()=>A(),se=$(()=>{if(!A())return 0;const h=N();return h>0?h:u.terminal.height()}),ie=()=>{const h=Y();if(!h)return;const I=h.querySelector(":scope > .os-workspace-main");if(!I)return;const W=h.getBoundingClientRect(),d=getComputedStyle(h),C=W.left+(parseFloat(d.borderLeftWidth)||0),w=W.right-(parseFloat(d.borderRightWidth)||0),s=I.getBoundingClientRect(),H=h.querySelector(":scope > .os-client-right-sidebar")?.getBoundingClientRect()??s;J({left:Math.max(0,Math.round(s.left-C)),right:Math.max(0,Math.round(w-H.right))})},Se=()=>{l(h=>(h||v(Fe),!h))},ge=()=>{S(h=>(h||(z(Fe),Ct(n.pathname)&&Sr("directory")),!h))};Z(()=>{gn()&&(S(!0),z(I=>I>0?I:Fe))});const Le=h=>{if(h.button!==0)return;h.preventDefault();const I=h.clientX,W=x();V(!0);const d=w=>{v(vt(W+(w.clientX-I)))},C=()=>{V(!1),window.removeEventListener("pointermove",d),window.removeEventListener("pointerup",C),window.removeEventListener("pointercancel",C)};window.addEventListener("pointermove",d),window.addEventListener("pointerup",C),window.addEventListener("pointercancel",C)},re=h=>{if(h.button!==0)return;h.preventDefault();const I=h.clientX,W=E();j(!0);const d=w=>{z(bt(W+(I-w.clientX)))},C=()=>{j(!1),window.removeEventListener("pointermove",d),window.removeEventListener("pointerup",C),window.removeEventListener("pointercancel",C)};window.addEventListener("pointermove",d),window.addEventListener("pointerup",C),window.addEventListener("pointercancel",C)};return Z(()=>{const h=de();if(!h||typeof ResizeObserver>"u")return;const I=()=>{const d=h.querySelector("#terminal-panel");y(d?Math.round(d.getBoundingClientRect().height):0)};I();const W=new ResizeObserver(I);W.observe(h),Ee(()=>W.disconnect())}),Z(()=>{A()||y(0)}),je(()=>{u.view("workbench").terminal.close(),u.terminal.closeFullscreen(),y(0)}),Z(()=>{p(),c(),x(),E(),L(),f(),M(),Y(),ie();const h=requestAnimationFrame(ie);Ee(()=>cancelAnimationFrame(h))}),Z(()=>{const h=Y();if(!h||typeof ResizeObserver>"u")return;const I=new ResizeObserver(()=>ie());I.observe(h);const W=h.querySelector(":scope > .os-workspace-main");W&&I.observe(W);const d=h.querySelector(":scope > .os-client-right-sidebar");d&&I.observe(d),Ee(()=>I.disconnect())}),(()=>{var h=si(),I=h.firstChild,W=I.firstChild,d=W.nextSibling,C=I.nextSibling,w=C.nextSibling;return Ke(ne,h),W.$$click=Se,i(W,e(rn,{side:"left",get open(){return p()}})),i(I,e(Ys,{}),d),d.$$click=ge,i(d,e(rn,{side:"right",get open(){return c()}})),i(h,e(_,{get when(){return p()},get children(){return[e(os,{}),(()=>{var s=ni();return s.$$keydown=P=>{if(P.key==="ArrowLeft"){P.preventDefault(),v(H=>vt(H-16));return}P.key==="ArrowRight"&&(P.preventDefault(),v(H=>vt(H+16)))},s.$$pointerdown=Le,X(()=>F(s,"aria-valuenow",x())),s})()]}}),C),i(C,()=>r.children),i(h,e(_,{get when(){return c()},get children(){return[(()=>{var s=ri();return s.$$keydown=P=>{if(P.key==="ArrowLeft"){P.preventDefault(),z(H=>bt(H+16));return}P.key==="ArrowRight"&&(P.preventDefault(),z(H=>bt(H-16)))},s.$$pointerdown=re,X(()=>F(s,"aria-valuenow",E())),s})(),e(Qs,{})]}}),w),Ke(T,w),F(w,"id",xr),X(s=>{var P=!!p(),H=!!c(),_e=!!L(),Re=!!f(),We=!!M(),He=!!(u.terminal.fullscreen()&&u.view("workbench").terminal.opened()),we=`${x()}px`,Be=`${E()}px`,qe=`${se()}px`,Ue=`${b().left}px`,Ve=`${b().right}px`,Xe=!!p(),Ge=p()?"关闭左侧栏":"打开左侧栏",Qe=p()?"关闭左侧栏":"打开左侧栏",Ze=!!c(),Pe=c()?"关闭右侧栏":"打开右侧栏",Je=c()?"关闭右侧栏":"打开右侧栏",Ye=!!M(),Ie=!M();return P!==s.e&&h.classList.toggle("has-left-sidebar",s.e=P),H!==s.t&&h.classList.toggle("has-right-sidebar",s.t=H),_e!==s.a&&h.classList.toggle("is-resizing-left",s.a=_e),Re!==s.o&&h.classList.toggle("is-resizing-right",s.o=Re),We!==s.i&&h.classList.toggle("has-terminal-open",s.i=We),He!==s.n&&h.classList.toggle("has-terminal-fullscreen",s.n=He),we!==s.s&&ze(h,"--os-client-sidebar-w",s.s=we),Be!==s.h&&ze(h,"--os-client-tool-w",s.h=Be),qe!==s.r&&ze(h,"--os-client-terminal-h",s.r=qe),Ue!==s.d&&ze(h,"--os-client-terminal-left",s.d=Ue),Ve!==s.l&&ze(h,"--os-client-terminal-right",s.l=Ve),Xe!==s.u&&W.classList.toggle("is-active",s.u=Xe),Ge!==s.c&&F(W,"data-tooltip",s.c=Ge),Qe!==s.w&&F(W,"aria-label",s.w=Qe),Ze!==s.m&&d.classList.toggle("is-active",s.m=Ze),Pe!==s.f&&F(d,"data-tooltip",s.f=Pe),Je!==s.y&&F(d,"aria-label",s.y=Je),Ye!==s.g&&w.classList.toggle("is-open",s.g=Ye),Ie!==s.p&&F(w,"aria-hidden",s.p=Ie),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}),h})()}Me(["click","pointerdown","keydown"]);export{hi as WorkbenchShell};
@@ -1 +0,0 @@
1
- import{e as j,f as D,l as I,n as E,o as g,q as Y,i as a,c as o,t as v,dY as u,b as z,s as _,br as H,z as N,r as y,v as C,w as L,x as O,R as X,U as x,S as Z,W as B,Y as G,F as J,X as K,dZ as Q}from"./index-D89_umhI.js";var V=v("<p class=os-client-skills-login-hint>登录后可同步个人空间技能。 "),ee=v('<div class="os-client-capability-page os-client-skills-page"><section class=os-client-capability-selector aria-label=技能设置><div class=os-client-capability-current-domain><span>技能设置:</span><strong></strong><small></small></div><div class="os-client-capability-tabs os-client-skills-tabs"role=tablist aria-label=技能管理视图></div></section><div class=os-client-capability-page-body>'),te=v("<button type=button><strong></strong><small>");function ae(c){const s=new URLSearchParams(c).get("tab");if(s==="list"||s==="repo"||s==="upload")return s}function ne(){const c=j(),s=D(),A=I(),[b,P]=E(0),R=g(()=>(b(),!!_())),d=g(()=>!R()),[n,T]=E(ae(c.search)??"list"),M=g(()=>{b();const e=_();return e&&(H(e,A.projects.lastCode())||N(e))||""}),p=e=>{T(e),s(x(e),{replace:!0})};Y(()=>{const e=()=>P(i=>i+1);window.addEventListener(y,e),window.addEventListener(C,e),window.addEventListener(L,e),O(()=>{window.removeEventListener(y,e),window.removeEventListener(C,e),window.removeEventListener(L,e)})});const h=()=>u.find(e=>e.id===n())??u[0];return(()=>{var e=ee(),i=e.firstChild,f=i.firstChild,U=f.firstChild,m=U.nextSibling,W=m.nextSibling,w=f.nextSibling,q=i.nextSibling;return a(m,()=>h().label),a(W,()=>h().hint),a(i,o(Z,{get when(){return d()},get children(){var t=V();return t.firstChild,a(t,o(X,{get href(){return`/login?redirect=${encodeURIComponent(x(n()))}`},children:"去登录"}),null),t}}),w),a(w,o(J,{each:u,children:t=>(()=>{var r=te(),S=r.firstChild,F=S.nextSibling;return r.$$click=()=>p(t.id),a(S,()=>t.label),a(F,()=>t.hint),B(l=>{var $=n()===t.id,k=n()===t.id;return $!==l.e&&r.classList.toggle("is-active",l.e=$),k!==l.t&&G(r,"aria-pressed",l.t=k),l},{e:void 0,t:void 0}),r})()})),a(q,o(Q,{get directory(){return K(()=>!!d())()?void 0:M()||void 0},get loginRequired(){return d()},get tab(){return n()},onTabChange:p,variant:"page-body"})),e})()}z(["click"]);export{ne as WorkbenchSkillsPage};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-D89_umhI.js","assets/index-B_MGkqLF.css"])))=>i.map(i=>d[i]);
2
- import{eB as I,h as H,j as J,cE as Q,m as U,u as N,x as K,n as W,C as X,eE as Y,eF as q,eG as Z,eH as ee,o as P,eI as te,i as a,c as s,eJ as v,S as $,F as B,eK as ae,X as E,W as G,cl as se,eL as ne,Y as re,ab as R,ap as le,eM as oe,eb as ce,a5 as ie,p as ue,t as c,a6 as de,b as ge}from"./index-D89_umhI.js";var pe=c("<div class=os-ssh-dialog-stack>"),he=c('<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">'),be=c('<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">'),ve=c('<div class="flex items-center gap-1 w-[360px] rounded-xl shadow-[var(--shadow-lg-border-base)]">'),A=c('<div class="text-14-regular text-text-base text-center my-auto py-2">'),me=c('<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>'),fe=c('<span class="text-11-regular text-text-weaker shrink-0">· 检测中...'),xe=c('<span class="text-12-regular text-text-weak truncate pl-3.5">'),ye=c('<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">'),_e=c('<span class="text-11-regular text-text-weaker shrink-0">· ');const $e=()=>{const k=I(),m=le(),f=N(),S=Q(),w=oe();return ce(()=>({mutationFn:async i=>{await(k.data.mcp[i]?.status==="connected"?m.client.mcp.disconnect({name:i}):m.client.mcp.connect({name:i}))},onSuccess:()=>S.refetchQueries(w.mcp(ue(k.directory))),onError:i=>{ie({variant:"error",title:f.t("common.requestFailed"),description:i instanceof Error?i.message:String(i)})}}))};function Se(k){const m=I(),f=H(),S=J(),w=Q(),i=U(),l=N();let C=0,O=!1;K(()=>{O=!0,C+=1});const[F,L]=W();X(()=>{if(!k.shown()){L(void 0);return}let r=!1;const e=q();(async()=>{const t=await Y(S.url);r||e!==q()||t===void 0||(L(t),Z(t),await ee({serverUrl:S.url,queryClient:w}).catch(()=>{}))})(),K(()=>{r=!0})});const p=$e(),T=P(()=>{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))}),V=r=>m.data.mcp?.[r]?.status,j=P(()=>{const r=F()??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))}),z=P(()=>F()??f.data.config.ssh),M=te({ssh:z}),D=r=>{const e=++C;de(()=>import("./index-D89_umhI.js").then(t=>t.eO),__vite__mapDeps([0,1])).then(t=>{O||C!==e||i.show(()=>(()=>{var n=pe();return a(n,s(t.DialogSelectSsh,{initialMode:r})),n})())})};return(()=>{var r=ve();return a(r,s(v,{get"aria-label"(){return l.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(v.List,{"data-slot":"tablist",class:"bg-transparent border-b-0 px-4 pt-2 pb-0 gap-3 h-10",get children(){return[s(v.Trigger,{value:"mcp","data-slot":"tab",class:"text-12-regular",get children(){return l.t("status.popover.tab.mcp")}}),s(v.Trigger,{value:"ssh","data-slot":"tab",class:"text-12-regular",get children(){return l.t("status.popover.tab.ssh")}})]}}),s(v.Content,{value:"mcp",get children(){var e=he(),t=e.firstChild;return a(t,s($,{get when(){return T().length>0},get fallback(){return(()=>{var n=A();return a(n,()=>l.t("dialog.mcp.empty")),n})()},get children(){return s(B,{get each(){return T()},children:n=>{const o=()=>V(n),h=()=>o()==="connected";return(()=>{var u=me(),b=u.firstChild,x=b.nextSibling,y=x.nextSibling;return u.$$click=()=>{p.isPending||p.mutate(n)},a(x,n),y.$$click=d=>d.stopPropagation(),a(y,s(ae,{get checked(){return h()},get disabled(){return E(()=>!!p.isPending)()&&p.variables===n},onChange:()=>{p.isPending||p.mutate(n)}})),G(d=>{var g=p.isPending&&p.variables===n,_={"size-2 rounded-full shrink-0":!0,"bg-icon-success-base":h(),"bg-border-weak-base":!h()};return g!==d.e&&(u.disabled=d.e=g),d.t=se(b,_,d.t),d},{e:void 0,t:void 0}),u})()}})}})),e}}),s(v.Content,{value:"ssh",get children(){var e=be(),t=e.firstChild,n=t.firstChild;return a(t,s($,{get when(){return j().length>0},get fallback(){return(()=>{var o=A();return a(o,()=>l.t("dialog.ssh.empty")),o})()},get children(){return s(B,{get each(){return j()},children:o=>{const h=()=>M.byName()[o.name];return(()=>{var u=ye(),b=u.firstChild,x=b.firstChild,y=x.nextSibling,d=y.nextSibling;return u.$$click=()=>D(),a(y,()=>o.name),a(d,(()=>{var g=E(()=>o.config.enabled===!1);return()=>g()?l.t("dialog.ssh.status.disabled"):l.t("dialog.ssh.status.enabled")})()),a(b,s($,{get when(){return h()},children:g=>(()=>{var _=_e();return _.firstChild,a(_,()=>ne(g().connectivity),null),_})()}),null),a(b,s($,{get when(){return E(()=>!!M.loading())()&&!h()},get children(){return fe()}}),null),a(u,s($,{get when(){return o.config.remotePath},get children(){var g=xe();return a(g,()=>o.config.remotePath),g}}),null),G(()=>re(x,"data-state",M.loading()&&!h()?"testing":h()?.connectivity??"idle")),u})()}})}}),n),a(n,s(R,{variant:"secondary",class:"h-8 px-3 py-1.5",onClick:()=>D(),get children(){return l.t("status.popover.action.manageSsh")}}),null),a(n,s(R,{variant:"secondary",icon:"plus-small",class:"h-8 px-3 py-1.5",onClick:()=>D("add"),get children(){return l.t("dialog.ssh.addButton")}}),null),e}})]}})),r})()}ge(["click"]);export{Se as StatusPopoverBody};
@@ -1 +0,0 @@
1
- import{b as Ne,m as tt,bV as Xe,dF as Oe,C as it,o as L,dG as at,dH as ke,dI as Ie,dJ as ye,dK as Ue,dL as le,dM as lt,az as Se,i as t,c0 as Je,c as a,W as w,F as Q,Y as A,S as g,X as Pe,dN as rt,dO as nt,dP as Ae,dQ as st,dR as ct,t as n,dS as ot,dC as dt,e as ut,dT as pt,f as gt,h as ht,g as bt,l as $t,n as vt,q as mt,a0 as Fe,bf as Te,z as Le,s as Ce,bg as Re,a4 as We,bl as je,a3 as qe,a5 as De,L as Ee,dU as _t,dV as ft,b$ as pe,b4 as yt,dW as St,bj as Qe,bo as Ye,dX as wt,bZ as Ct,R as J,cn as Ve,dD as xt,c1 as zt,dE as kt,be as It}from"./index-D89_umhI.js";var Pt=n("<div class=os-client-capability-wizard-papers><h3>相关论文</h3><ul>"),Ft=n("<div class=os-client-capability-wizard-papers><h3>HPC 软件</h3><span>"),Tt=n("<p class=os-client-capability-wizard-note>工作目录与运行环境由系统自动识别,本步只需填写下列业务参数。"),Lt=n("<p class=os-client-capability-wizard-missing>本步还有 <!> 个必填参数未填写。"),Rt=n("<p class=os-client-capability-wizard-missing>本步有 <!> 个参数类型不正确,请按标注类型修改。"),Wt=n("<p class=os-client-capability-wizard-missing>其他步骤还有 <!> 个必填参数未填写,可点击左侧步骤继续补全。"),jt=n("<p class=os-client-capability-wizard-missing>其他步骤还有 <!> 个参数类型不正确,可点击左侧步骤修改。"),qt=n("<small>"),Dt=n("<ul class=os-client-capability-wizard-output-list>"),Et=n("<div class=os-client-capability-wizard-quality><strong>质量门禁</strong><p>"),Ht=n('<div class=os-client-capability-wizard-overlay role=dialog aria-modal=true aria-label=场景向导><button type=button class=os-client-capability-wizard-backdrop aria-label=关闭场景></button><section class=os-client-capability-wizard-dialog><header class=os-client-capability-wizard-head><button type=button class=os-client-capability-wizard-intro-back>返回场景列表</button><div class=os-client-capability-wizard-head-title><h2></h2><p></p></div><button type=button class=os-client-capability-wizard-close aria-label=关闭>×</button></header><div class=os-client-capability-wizard-columns><aside class=os-client-capability-wizard-column aria-label=工作流><h3>工作流</h3><p class=os-client-capability-wizard-note>点击步骤查看对应参数与产出;创建后将自动按序执行。</p><ol class=os-client-capability-wizard-workflow></ol></aside><section class=os-client-capability-wizard-column aria-label=补充信息><div class=os-client-capability-wizard-column-head><h3>本步参数</h3><small>/<!> · 已填 <!>/</small></div><div class=os-client-capability-wizard-fields></div><div class=os-client-capability-wizard-step-nav><button type=button>上一步</button><button type=button>下一步</button></div></section><section class=os-client-capability-wizard-column aria-label="本步产出与 Prompt"><div class=os-client-capability-wizard-outputs aria-label=本步产出><div class=os-client-capability-wizard-outputs-head><span>本步产出</span></div></div><div class=os-client-capability-wizard-column-head><h3>本步 Prompt</h3><small>第 <!> 步</small></div><textarea class=os-client-capability-wizard-prompt rows=12 readonly></textarea></section></div><footer class=os-client-capability-wizard-footer><button type=button>返回能力中心</button><button type=button data-primary=true>创建任务并自动逐步执行'),Mt=n("<li><button type=button class=os-client-capability-wizard-step><span></span><div><p>"),Ot=n('<li><a target=_blank rel="noopener noreferrer">'),Ut=n("<p>"),At=n("<div class=os-client-capability-wizard-step-banner><strong>"),Vt=n("<p class=os-client-capability-wizard-note>本步无需额外用户参数。"),Kt=n("<em>*"),Bt=n("<small class=os-client-capability-wizard-field-type>"),Gt=n("<textarea rows=3>"),Ke=n("<em class=os-client-capability-wizard-field-error>"),Nt=n("<label class=os-client-capability-wizard-field><span>"),Xt=n("<input type=text>"),Jt=n("<p class=os-client-capability-wizard-outputs-empty>本步暂无结构化产出清单。"),Qt=n("<li>");function Yt(e){const d=tt(),[l,$]=Xe({values:Oe(e.scenario),attempted:!1,activeStepIndex:0});it(()=>{$({values:Oe(e.scenario),attempted:!1,activeStepIndex:0})});const S=L(()=>at(e.scenario)),k=L(()=>S()[l.activeStepIndex]??S()[0]),V=L(()=>{const v=k();return v?ke(e.scenario,v):e.scenario.user_input}),R=L(()=>Ie(e.scenario,l.values)),ge=L(()=>ye(e.scenario.user_input,l.values)),K=L(()=>V().filter(v=>Ue(v)?!String(l.values[le(v)]??"").trim():!1)),oe=L(()=>ye(V(),l.values)),I=L(()=>V().filter(v=>String(l.values[le(v)]??"").trim()).length),Y=L(()=>{const P=k()?.prompt||e.scenario.ai_prompt?.template||"";return lt(P,l.values)}),G=L(()=>k()?.outputs??[]),re=L(()=>(e.scenario.related_papers??[]).filter(v=>!!String(v.url??"").trim())),N=(v,P)=>{$("values",v,P)},Z=v=>{$("activeStepIndex",v)},xe=()=>{$("attempted",!0);const v=ye(e.scenario.user_input,l.values);if(v.length>0){const W=le(v[0]),x=S().findIndex(te=>ke(e.scenario,te).some(r=>le(r)===W));x>=0&&$("activeStepIndex",x);return}const P=Ie(e.scenario,l.values);if(P.length===0){e.onSubmit({values:{...l.values}});return}const de=le(P[0]),ee=S().findIndex(W=>ke(e.scenario,W).some(x=>le(x)===de));ee>=0&&$("activeStepIndex",ee),d.show(()=>a(ot,{title:"请补充必填参数",get reason(){return`还有 ${P.length} 个必填参数未填写,补充后即可创建任务并自动逐步执行。`},fields:P,get values(){return l.values},onConfirm:W=>{const x={...l.values,...W};$("values",x),!(ye(e.scenario.user_input,x).length>0||Ie(e.scenario,x).length>0)&&e.onSubmit({values:x})}}))};return(()=>{var v=Ht(),P=v.firstChild,de=P.nextSibling,ee=de.firstChild,W=ee.firstChild,x=W.nextSibling,te=x.firstChild,r=te.nextSibling,h=x.nextSibling,m=ee.nextSibling,b=m.firstChild,j=b.firstChild,X=j.nextSibling,he=X.nextSibling,q=b.nextSibling,be=q.firstChild,$e=be.firstChild,B=$e.nextSibling,ue=B.firstChild,ne=ue.nextSibling,ze=ne.nextSibling,ve=ze.nextSibling;ve.nextSibling;var D=be.nextSibling,me=D.nextSibling,ie=me.firstChild,u=ie.nextSibling,p=q.nextSibling,_=p.firstChild,F=_.firstChild;F.firstChild;var T=_.nextSibling,H=T.firstChild,E=H.nextSibling,se=E.firstChild,M=se.nextSibling;M.nextSibling;var ae=T.nextSibling,ce=m.nextSibling,_e=ce.firstChild,fe=_e.nextSibling;return Se(P,"click",e.onClose,!0),Se(W,"click",e.onClose,!0),t(te,()=>e.scenario.name),t(r,()=>Je(e.scenario.problem_and_applicability)),Se(h,"click",e.onClose,!0),t(he,a(Q,{get each(){return S()},children:(i,s)=>(()=>{var c=Mt(),z=c.firstChild,O=z.firstChild,f=O.nextSibling,y=f.firstChild;return z.$$click=()=>Z(s()),t(O,()=>s()+1),t(y,()=>i.name),w(()=>c.classList.toggle("is-active",l.activeStepIndex===s())),c})()})),t(b,a(g,{get when(){return re().length>0},get children(){var i=Pt(),s=i.firstChild,c=s.nextSibling;return t(c,a(Q,{get each(){return re()},children:z=>(()=>{var O=Ot(),f=O.firstChild;return t(f,()=>z.title),w(y=>{var U=z.url,o=z.title;return U!==y.e&&A(f,"href",y.e=U),o!==y.t&&A(f,"title",y.t=o),y},{e:void 0,t:void 0}),O})()})),i}}),null),t(b,a(g,{get when(){return e.scenario.HPC},get children(){var i=Ft(),s=i.firstChild,c=s.nextSibling;return t(c,()=>e.scenario.HPC),i}}),null),t(B,()=>l.activeStepIndex+1,ue),t(B,()=>S().length,ne),t(B,I,ve),t(B,()=>V().length,null),t(q,a(g,{get when(){return k()},children:i=>(()=>{var s=At(),c=s.firstChild;return t(c,()=>i().name),t(s,a(g,{get when(){return i().purpose?.trim()},get children(){var z=Ut();return t(z,()=>i().purpose),z}}),null),s})()}),D),t(q,a(g,{get when(){return e.scenario.system_auto_detection?.fields?.length},get children(){return Tt()}}),D),t(q,a(g,{get when(){return Pe(()=>!!l.attempted)()&&K().length>0},get children(){var i=Lt(),s=i.firstChild,c=s.nextSibling;return c.nextSibling,t(i,()=>K().length,c),i}}),D),t(q,a(g,{get when(){return oe().length>0},get children(){var i=Rt(),s=i.firstChild,c=s.nextSibling;return c.nextSibling,t(i,()=>oe().length,c),i}}),D),t(q,a(g,{get when(){return Pe(()=>!!(l.attempted&&R().length>0))()&&K().length===0},get children(){var i=Wt(),s=i.firstChild,c=s.nextSibling;return c.nextSibling,t(i,()=>R().length,c),i}}),D),t(q,a(g,{get when(){return Pe(()=>!!(l.attempted&&ge().length>0))()&&oe().length===0},get children(){var i=jt(),s=i.firstChild,c=s.nextSibling;return c.nextSibling,t(i,()=>ge().length,c),i}}),D),t(D,a(g,{get when(){return V().length>0},get fallback(){return Vt()},get children(){return a(Q,{get each(){return V()},children:i=>{const s=le(i),c=Ue(i),z=l.attempted&&c&&!String(l.values[s]??"").trim(),O=rt(i,l.values[s]??""),f=!!O&&(l.attempted||!!String(l.values[s]??"").trim());return(()=>{var y=Nt(),U=y.firstChild;return y.classList.toggle("is-required",!!c),y.classList.toggle("is-invalid",!!(z||f)),t(U,()=>nt(i),null),t(U,a(g,{when:c,get children(){return Kt()}}),null),t(U,a(g,{get when(){return i.input_type},get children(){var o=Bt();return t(o,()=>i.input_type),o}}),null),t(y,a(g,{get when(){return st(i)},get fallback(){return(()=>{var o=Xt();return o.$$input=C=>N(s,C.currentTarget.value),w(C=>{var He=i.input_type==="int"||i.input_type==="float"?"decimal":void 0,Me=Ae(i);return He!==C.e&&A(o,"inputmode",C.e=He),Me!==C.t&&A(o,"placeholder",C.t=Me),C},{e:void 0,t:void 0}),w(()=>o.value=l.values[s]??""),o})()},get children(){var o=Gt();return o.$$input=C=>N(s,C.currentTarget.value),w(()=>A(o,"placeholder",Ae(i))),w(()=>o.value=l.values[s]??""),o}}),null),t(y,a(g,{when:f,get children(){var o=Ke();return t(o,O),o}}),null),t(y,a(g,{when:z&&!f,get children(){var o=Ke();return t(o,()=>ct(i,"")),o}}),null),y})()}})}})),ie.$$click=()=>Z(Math.max(0,l.activeStepIndex-1)),u.$$click=()=>Z(Math.min(S().length-1,l.activeStepIndex+1)),t(F,a(g,{get when(){return k()?.result_subfolder},get children(){var i=qt();return t(i,()=>k()?.result_subfolder),w(()=>A(i,"title",k()?.result_subfolder)),i}}),null),t(_,a(g,{get when(){return G().length>0},get fallback(){return Jt()},get children(){var i=Dt();return t(i,a(Q,{get each(){return G()},children:s=>(()=>{var c=Qt();return t(c,s),c})()})),i}}),null),t(_,a(g,{get when(){return k()?.quality_gate},get children(){var i=Et(),s=i.firstChild,c=s.nextSibling;return t(c,()=>k()?.quality_gate),i}}),null),t(E,()=>l.activeStepIndex+1,M),Se(_e,"click",e.onClose,!0),fe.$$click=xe,w(i=>{var s=l.activeStepIndex<=0,c=l.activeStepIndex>=S().length-1;return s!==i.e&&(ie.disabled=i.e=s),c!==i.t&&(u.disabled=i.t=c),i},{e:void 0,t:void 0}),w(()=>ae.value=Y()),v})()}Ne(["click","input"]);function Zt(e,d){return e.replace(/\{\{(\w+)\}\}/g,(l,$)=>d[$]??"")}var ei=n("<div class=os-client-capability-wizard-overlay role=dialog aria-modal=true aria-label=能力向导>"),ti=n("<section class=os-client-capability-wizard-dialog><p>未找到该能力。"),ii=n("<div class=os-client-capability-wizard-scenario-group><span>完整工作流场景"),ai=n("<section class=os-client-capability-wizard-dialog><header class=os-client-capability-wizard-head><div class=os-client-capability-wizard-head-title><h2></h2></div></header><div class=os-client-capability-wizard-columns><aside class=os-client-capability-wizard-column aria-label=你想做什么?><h3>你想做什么?</h3><div class=os-client-capability-wizard-scenarios></div></aside><section class=os-client-capability-wizard-column aria-label=补充信息><h3>补充信息</h3></section><section class=os-client-capability-wizard-column aria-label=起始任务><div class=os-client-capability-wizard-column-head><h3>起始任务</h3><button type=button>重新生成</button></div><textarea class=os-client-capability-wizard-prompt rows=14></textarea></section></div><footer class=os-client-capability-wizard-footer><button type=button data-primary=true>创建任务"),li=n("<section class=os-client-capability-wizard-dialog><p>「<!>」暂无 OneScience 源码或魔搭映射,当前不可使用。"),ri=n("<button type=button><strong></strong><p>"),ni=n("<button type=button><strong></strong><p></p><small> · <!> 步"),Be=n("<p class=os-client-capability-wizard-empty>请先选择任务场景。"),si=n("<div class=os-client-capability-wizard-required aria-label=该能力需要什么数据><h4>该能力需要什么数据</h4><ul>"),ci=n("<div class=os-client-capability-wizard-middle><div class=os-client-capability-wizard-fields></div><div class=os-client-capability-wizard-summary aria-label=当前能力配置><h4>当前能力配置</h4><dl><div><dt>当前能力</dt><dd></dd></div><div><dt>关键配置</dt><dd></dd></div><div><dt>运行资源</dt><dd></dd></div><div><dt>交付结果</dt><dd>"),oi=n("<textarea rows=3>"),di=n("<label class=os-client-capability-wizard-field><span>"),ui=n("<input type=text>"),pi=n("<li>"),gi=n("<div class=os-client-capability-wizard-right-head><strong></strong><p>"),hi=n("<div class=os-client-capability-wizard-outputs aria-label=预计产出><span>预计产出</span><p>");function bi(e){return e==="hpc"?"软件介绍":"模型介绍"}function $i(e){return`使用 ${e} 开始科研任务`}function vi(e){if(!Fe({navigate:e.navigate,action:{type:"prompt",prompt:e.prompt,title:e.title,workflow:e.workflow},isLoggedIn:e.isLoggedIn}))return!1;const d=Te({path:e.path,recent:e.recent,lastCodeWorkspace:e.lastCodeWorkspace})||Le(Ce())||Re(document,e.path);if(!d)return!1;const l=We(d);return je(l,e.prompt),qe(l),e.openProject?.(d),e.touchCode?.(d),De({variant:"success",title:`已为你创建「${e.title}」任务`}),e.navigate(Ee(d)),!0}function Ze(e){const d=_t(e.scenario),l=d[0];if(!l?.promptTemplate.trim()||!Fe({navigate:e.navigate,action:{type:"scenario-run",scenarioId:e.scenario.id||e.scenario.scenario_id,values:e.values},isLoggedIn:e.isLoggedIn}))return!1;const $=Te({path:e.path,recent:e.recent,lastCodeWorkspace:e.lastCodeWorkspace})||Le(Ce())||Re(document,e.path);if(!$)return!1;const S=We($);return ft(S,{title:e.scenario.name,scenarioId:pe(e.scenario),values:e.values,steps:d}),yt("todo"),je(S,St(l,e.values)),qe(S),e.openProject?.($),e.touchCode?.($),De({variant:"success",title:`已创建「${e.scenario.name}」`,description:`将按 ${d.length} 步自动依次执行,缺参或失败时暂停`}),e.navigate(Ee($)),!0}function et(e){if(!Fe({navigate:e.navigate,action:{type:"wizard",resourceId:e.resourceId,scenarioId:e.scenarioId,values:e.values,prompt:e.prompt},isLoggedIn:e.isLoggedIn}))return!1;const d=Qe(e.resourceId),l=d?.scenarios.find(k=>k.id===e.scenarioId);if(!d||!l||!Ye(d))return!1;const $=Te({path:e.path,recent:e.recent,lastCodeWorkspace:e.lastCodeWorkspace})||Le(Ce())||Re(document,e.path);if(!$)return!1;const S=We($);return je(S,e.prompt),qe(S),e.openProject?.($),e.touchCode?.($),De({variant:"success",title:`已为你创建 ${d.name}「${l.title}」任务`}),e.navigate(Ee($)),!0}function we(e,d){return Zt(e.promptTemplate,d)}function Ge(e){return Object.fromEntries(e.fields.map(d=>[d.id,mi(d)]))}function mi(e){return e.default?.trim()?e.default:e.placeholder?.replace(/^例如[::]\s*/,"").trim()??""}function _i(){const e=dt(),d=ut(),[l]=pt(),$=gt(),S=ht(),k=bt(),V=$t(),R=()=>Qe(e.id??""),ge=()=>kt(d.search),K=()=>xt(d.search,{category:R()?.category??"onemodel",domain:R()?.domain??"materials"}),oe=()=>zt(e.id??"",ge()),[I,Y]=Xe({scenarioId:"",values:{},prompt:""}),[G,re]=vt(""),N=()=>R()?.scenarios.find(r=>r.id===I.scenarioId),Z=L(()=>{const r=R();return r?wt({domain:r.domain,name:r.name,id:r.id,category:r.category}):[]}),xe=L(()=>{const r=G();if(r)return Ct(r)??Z().find(h=>pe(h)===r)}),v=()=>({navigate:$,isLoggedIn:!!Ce(),path:S.data.path,recent:It(S.data.project),lastCodeWorkspace:V.projects.lastCode(),openProject:r=>k.projects.open(r),touchCode:r=>V.projects.touchCode(r)}),P=()=>{const r=N();r&&Y("prompt",we(r,I.values))};mt(()=>{const r=R();if(!r?.scenarios.length)return;const h=l.scenario,b=(h?r.scenarios.find(X=>X.id===h):void 0)??r.scenarios[0],j=Ge(b);Y({scenarioId:b.id,values:j,prompt:we(b,j)})});const de=r=>{const m=R()?.scenarios.find(j=>j.id===r);if(!m)return;re("");const b=Ge(m);Y({scenarioId:m.id,values:b,prompt:we(m,b)})},ee=r=>{re(r)},W=(r,h)=>{const m=N();if(!m)return;const b={...I.values,[r]:h};Y({values:b,prompt:we(m,b)})},x=()=>{const r=R(),h=N();!r||!h||et({resourceId:r.id,scenarioId:h.id,values:{...I.values},prompt:I.prompt,...v()})},te=(r,h)=>{Ze({scenario:r,values:h.values,...v()})};return(()=>{var r=ei();return t(r,a(g,{get when(){return R()},get fallback(){return[a(J,{class:"os-client-capability-wizard-backdrop",get href(){return Ve()},"aria-label":"关闭向导"}),(()=>{var h=ti();return h.firstChild,t(h,a(J,{get href(){return Ve()},children:"返回能力中心"}),null),h})()]},children:h=>a(g,{get when(){return Ye(h())},get fallback(){return[a(J,{class:"os-client-capability-wizard-backdrop",get href(){return K()},"aria-label":"关闭向导"}),(()=>{var m=li(),b=m.firstChild,j=b.firstChild,X=j.nextSibling;return X.nextSibling,t(b,()=>h().name,X),t(m,a(J,{get href(){return K()},children:"返回模型库"}),null),m})()]},get children(){return[a(J,{class:"os-client-capability-wizard-backdrop",get href(){return K()},"aria-label":"关闭向导"}),(()=>{var m=ai(),b=m.firstChild,j=b.firstChild,X=j.firstChild,he=b.nextSibling,q=he.firstChild,be=q.firstChild,$e=be.nextSibling,B=q.nextSibling;B.firstChild;var ue=B.nextSibling,ne=ue.firstChild,ze=ne.firstChild,ve=ze.nextSibling,D=ne.nextSibling,me=he.nextSibling,ie=me.firstChild;return t(b,a(J,{class:"os-client-capability-wizard-intro-back",get href(){return oe()},get children(){return bi(h().category)}}),j),t(X,()=>$i(h().name)),t(b,a(J,{class:"os-client-capability-wizard-close",get href(){return K()},"aria-label":"关闭",children:"×"}),null),t($e,a(Q,{get each(){return h().scenarios},children:u=>(()=>{var p=ri(),_=p.firstChild,F=_.nextSibling;return p.$$click=()=>de(u.id),t(_,()=>u.title),t(F,()=>u.summary),w(T=>{var H=!G()&&I.scenarioId===u.id,E=!G()&&I.scenarioId===u.id;return H!==T.e&&p.classList.toggle("is-active",T.e=H),E!==T.t&&A(p,"aria-pressed",T.t=E),T},{e:void 0,t:void 0}),p})()}),null),t($e,a(g,{get when(){return Z().length>0},get children(){var u=ii();return u.firstChild,t(u,a(Q,{get each(){return Z()},children:p=>(()=>{var _=ni(),F=_.firstChild,T=F.nextSibling,H=T.nextSibling,E=H.firstChild,se=E.nextSibling;return se.nextSibling,_.$$click=()=>ee(pe(p)),t(F,()=>p.name),t(T,()=>Je(p.problem_and_applicability)),t(H,()=>p.scenario_id,E),t(H,()=>p.workflow_steps?.length||p.workflow.length,se),w(M=>{var ae=G()===pe(p),ce=G()===pe(p);return ae!==M.e&&_.classList.toggle("is-active",M.e=ae),ce!==M.t&&A(_,"aria-pressed",M.t=ce),M},{e:void 0,t:void 0}),_})()}),null),u}}),null),t(B,a(g,{get when(){return N()},keyed:!0,get fallback(){return Be()},children:u=>(()=>{var p=ci(),_=p.firstChild,F=_.nextSibling,T=F.firstChild,H=T.nextSibling,E=H.firstChild,se=E.firstChild,M=se.nextSibling,ae=E.nextSibling,ce=ae.firstChild,_e=ce.nextSibling,fe=ae.nextSibling,i=fe.firstChild,s=i.nextSibling,c=fe.nextSibling,z=c.firstChild,O=z.nextSibling;return t(_,a(Q,{get each(){return u.fields},children:f=>(()=>{var y=di(),U=y.firstChild;return t(U,()=>f.label),t(y,a(g,{get when(){return f.multiline},get fallback(){return(()=>{var o=ui();return o.$$input=C=>W(f.id,C.currentTarget.value),w(()=>A(o,"placeholder",f.placeholder)),w(()=>o.value=I.values[f.id]??""),o})()},get children(){var o=oi();return o.$$input=C=>W(f.id,C.currentTarget.value),w(()=>A(o,"placeholder",f.placeholder)),w(()=>o.value=I.values[f.id]??""),o}}),null),y})()})),t(M,()=>u.capabilitySummary.current),t(_e,()=>u.capabilitySummary.keyConfig),t(s,()=>u.capabilitySummary.resources),t(O,()=>u.capabilitySummary.deliverables),t(p,a(g,{get when(){return u.requiredData?.length},get children(){var f=si(),y=f.firstChild,U=y.nextSibling;return t(U,a(Q,{get each(){return u.requiredData},children:o=>(()=>{var C=pi();return t(C,o),C})()})),f}}),null),p})()}),null),t(ue,a(g,{get when(){return N()},keyed:!0,get fallback(){return Be()},children:u=>[(()=>{var p=gi(),_=p.firstChild,F=_.nextSibling;return t(_,()=>u.title),t(F,()=>u.summary),p})(),(()=>{var p=hi(),_=p.firstChild,F=_.nextSibling;return t(F,()=>u.expectedOutputs),p})()]}),ne),ve.$$click=P,D.$$input=u=>Y("prompt",u.currentTarget.value),t(me,a(J,{get href(){return K()},children:"返回能力中心"}),ie),ie.$$click=x,w(()=>ie.disabled=!I.prompt.trim()),w(()=>D.value=I.prompt),m})(),a(g,{get when(){return xe()},children:m=>a(Yt,{get scenario(){return m()},onClose:()=>re(""),onSubmit:b=>te(m(),b)})})]}})})),r})()}Ne(["click","input"]);const yi=Object.freeze(Object.defineProperty({__proto__:null,CapabilityWizardPage:_i,startCapabilityPromptTask:vi,startCapabilityScenarioRunTask:Ze,startCapabilityWizardTask:et},Symbol.toStringTag,{value:"Module"}));export{Yt as S,Ze as a,et as b,vi as s,yi as w};