@onescience/onecode-web 1.14.50-202609101413 → 1.14.50-202609101646

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 (71) hide show
  1. package/assets/{3Dmol-zJlIxigb.js → 3Dmol-BwUAfJ9S.js} +1 -1
  2. package/assets/account-system-Bixt2wkW.js +1 -0
  3. package/assets/{alert-04-Cp8Jzdn0.js → alert-01-jRaj8g5g.js} +1 -1
  4. package/assets/{alert-05-BYORi2oX.js → alert-02-BUny2E8L.js} +1 -1
  5. package/assets/{alert-01-DbaABqZT.js → alert-04-BO_3whC8.js} +1 -1
  6. package/assets/{alert-02-eqeAgNGg.js → alert-05-E6mt-DDA.js} +1 -1
  7. package/assets/alert-06-D4xVKvt3.js +1 -0
  8. package/assets/alert-07-SATnNV3s.js +1 -0
  9. package/assets/alert-08-BZOkQMWt.js +1 -0
  10. package/assets/alert-10-CwIsuibB.js +1 -0
  11. package/assets/{bip-bop-03-Ds3vHxbp.js → bip-bop-03-DXwmuva7.js} +1 -1
  12. package/assets/{bip-bop-04-D99hrVJe.js → bip-bop-04-CPaWV-GN.js} +1 -1
  13. package/assets/{bip-bop-06-DlpeuHaw.js → bip-bop-06-rLczdPfL.js} +1 -1
  14. package/assets/{bip-bop-08-CjWzcmzu.js → bip-bop-08-BoszHGTp.js} +1 -1
  15. package/assets/bip-bop-09-Dmn-Zia_.js +1 -0
  16. package/assets/{center-DsgKhadM.js → center-CXnW6efM.js} +4 -4
  17. package/assets/dialog-edit-project-Cohs1a-E.js +1 -0
  18. package/assets/dialog-fork-CTohTbEY.js +1 -0
  19. package/assets/dialog-project-upload-vX1xOJn3.js +2 -0
  20. package/assets/{dialog-select-file-DLA9ErDC.js → dialog-select-file-1kwhziFH.js} +1 -1
  21. package/assets/dialog-select-model-DYef5Kd7.js +2 -0
  22. package/assets/dialog-terminal-unavailable-DR8ugCvy.js +3 -0
  23. package/assets/{docs-Cifj5x1f.js → docs-DbrcFw1_.js} +1 -1
  24. package/assets/ghostty-web-DY7xj-fL.js +13 -0
  25. package/assets/home-D7j2pC1k.js +1 -0
  26. package/assets/{index-DAMGhM04.js → index-CDgkkcJS.js} +355 -351
  27. package/assets/index-Dv4yLSDf.css +1 -0
  28. package/assets/{intro-xfetq0Ge.js → intro-D1N6jcgB.js} +1 -1
  29. package/assets/{nope-02-CS3zLx1E.js → nope-02-BZai3zMU.js} +1 -1
  30. package/assets/{nope-05-N-44ZznA.js → nope-05-xCKAI-GD.js} +1 -1
  31. package/assets/{nope-08-DUvkdjgJ.js → nope-08-B9xsyWV7.js} +1 -1
  32. package/assets/{nope-11-_EA8CZRx.js → nope-11-BRYmC6WI.js} +1 -1
  33. package/assets/nope-12-Caq-RMDD.js +1 -0
  34. package/assets/{onescience-DW8h4YYj.js → onescience-dYCbd2FC.js} +1 -1
  35. package/assets/{resources-Bl-zSce9.js → resources-h77Xtx4W.js} +1 -1
  36. package/assets/{selection-nvVPsBCu.js → selection-QPBUNekB.js} +1 -1
  37. package/assets/shell-BHWcVn6H.js +2 -0
  38. package/assets/skills-DBXwtiuD.js +1 -0
  39. package/assets/{staplebops-03-_xJyIJJ9.js → staplebops-03-B33jNym9.js} +1 -1
  40. package/assets/{staplebops-04-CrIbX8pr.js → staplebops-04-ByKBT8VW.js} +1 -1
  41. package/assets/{staplebops-06-dlB6b1hl.js → staplebops-06-kjCa6Ujj.js} +1 -1
  42. package/assets/{staplebops-07-C7F2ZZAN.js → staplebops-07-CnM6znEI.js} +1 -1
  43. package/assets/status-popover-body-B_LzuDCL.js +2 -0
  44. package/assets/wizard-DNUPns5W.js +1 -0
  45. package/assets/{yup-01-VPcNQT02.js → yup-01-Cd5uCv1_.js} +1 -1
  46. package/assets/{yup-03-DLmWjz7J.js → yup-03-TNs5cy3u.js} +1 -1
  47. package/assets/{yup-04-D-3taxv0.js → yup-04-CrJOUC_g.js} +1 -1
  48. package/assets/{yup-05-Bw62VCi-.js → yup-05-CLqrsVG_.js} +1 -1
  49. package/assets/{zh-DZqW_6rA.js → zh-M_rL6vl6.js} +1 -1
  50. package/assets/{zht-D5OqTOhl.js → zht-5kvKl4Oi.js} +1 -1
  51. package/index.html +11 -11
  52. package/package.json +2 -2
  53. package/assets/account-system-Je0BaqzS.js +0 -1
  54. package/assets/alert-06-B_4asjWo.js +0 -1
  55. package/assets/alert-07-Ge19oXLk.js +0 -1
  56. package/assets/alert-08-MWp7nDRp.js +0 -1
  57. package/assets/alert-10-B6OkVYJX.js +0 -1
  58. package/assets/bip-bop-09-DnNBRsGS.js +0 -1
  59. package/assets/dialog-edit-project-BKAq5m-l.js +0 -1
  60. package/assets/dialog-fork-D-mzsM6m.js +0 -1
  61. package/assets/dialog-project-upload-BtvMY5nK.js +0 -2
  62. package/assets/dialog-select-model-MQ1sAuiV.js +0 -2
  63. package/assets/dialog-terminal-unavailable-CExY762o.js +0 -3
  64. package/assets/ghostty-web-B_HTry8X.js +0 -13
  65. package/assets/home-DCRzZvKt.js +0 -1
  66. package/assets/index-HqBqMM3b.css +0 -1
  67. package/assets/nope-12-B_QLtLqS.js +0 -1
  68. package/assets/shell-C8tK_G1X.js +0 -2
  69. package/assets/skills-BtiyBPum.js +0 -1
  70. package/assets/status-popover-body-Cq-V73L7.js +0 -2
  71. package/assets/wizard-Bq1war3C.js +0 -1
@@ -1 +0,0 @@
1
- const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50-202609101413/assets/nope-12-BJR1Ka3c.aac";export{e as default};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dialog-project-upload-BtvMY5nK.js","assets/index-DAMGhM04.js","assets/index-HqBqMM3b.css","assets/dialog-terminal-unavailable-CExY762o.js"])))=>i.map(i=>d[i]);
2
- import{u as Ie,c as e,I as le,D as k,i as r,S,F as fe,d as Be,t as o,p as me,a as _e,s as Y,b as ye,e as it,f as Yt,g as ot,h as en,j as tn,k as nn,l as rn,m as at,n as W,o as y,q as sn,r as pt,v as on,w as lt,x as Q,y as ft,z as Ve,A as an,B as vt,C as ln,E as ge,G as cn,H as dn,M as un,J as hn,K as gn,L as ce,N as mn,O as pn,P as fn,Q as B,R as pe,T as A,U as vn,V as $n,W as zt,X as Xe,Y as $t,Z as bt,_ as ae,$ as nt,a0 as bn,a1 as At,a2 as wn,a3 as _n,a4 as We,a5 as wt,a6 as Ge,a7 as yn,a8 as kn,a9 as Sn,aa as xn,ab as Cn,ac as Pn,ad as Ln,ae as Dn,af as En,ag as Ke,ah as _t,ai as Nt,aj as In,ak as rt,al as Mn,am as Ft,an as de,ao as Rn,ap as yt,aq as jn,ar as Tn,as as zn,at as An,au as Nn,av as qe,aw as Ht,ax as st,ay as kt,az as Fn,aA as Hn,aB as Wn,aC as Qe,aD as St,aE as xt,aF as On,aG as Wt,aH as Ot,aI as Ee,aJ as Bt,aK as Bn,aL as qn,aM as Kn,aN as Un,aO as Vn,aP as Xn,aQ as Gn,aR as Ct,aS as Pt,aT as Lt,aU as Dt,aV as Qn,aW as Le}from"./index-DAMGhM04.js";import{DialogEditProject as Jn}from"./dialog-edit-project-BKAq5m-l.js";import{c as Zn}from"./selection-nvVPsBCu.js";var Yn=o("<span class=os-client-session-menu-label>"),er=o("<div class=os-client-session-menu-empty>");const Je="os-client-session-menu",tr="os-client-session-menu os-client-session-menu-sub";function nr(i){const l=Ie(),n=()=>Y(),x=()=>_e(n(),i.currentDirectory),h=()=>i.projects().filter(w=>me(w.worktree)!==me(i.currentDirectory)).filter(w=>!_e(n(),w.worktree));return e(S,{get when(){return x()},get children(){return e(k.Sub,{get children(){return[e(k.SubTrigger,{"data-action":"session-move",class:"os-client-session-menu-item",get children(){return[e(le,{name:"folder",size:"small",class:"os-client-session-menu-icon"}),(()=>{var w=Yn();return r(w,()=>l.t("session.move.toProject")),w})(),e(le,{name:"chevron-right",size:"small",class:"os-client-session-menu-chevron"})]}}),e(k.Portal,{get children(){return e(k.SubContent,{class:tr,get children(){return[e(k.Item,{"data-action":"session-move-new-project",class:"os-client-session-menu-item",onSelect:()=>i.onNewProject(),get children(){return[e(le,{name:"plus",size:"small",class:"os-client-session-menu-icon"}),e(k.ItemLabel,{class:"os-client-session-menu-label",get children(){return l.t("session.move.newProject")}})]}}),e(k.Separator,{class:"os-client-session-menu-separator"}),e(S,{get when(){return h().length>0},get fallback(){return(()=>{var w=er();return r(w,()=>l.t("session.move.emptyProjects")),w})()},get children(){return e(fe,{get each(){return h()},children:w=>e(k.Item,{"data-action":"session-move-target",class:"os-client-session-menu-item",onSelect:()=>i.onMove(w.worktree),get children(){return[e(le,{name:"folder",size:"small",class:"os-client-session-menu-icon"}),e(k.ItemLabel,{class:"os-client-session-menu-label",get children(){return Be(w)}})]}})})}})]}})}})]}})}})}function Et(i){const l=Ie();return[e(k.Item,{"data-action":"session-archive",class:"os-client-session-menu-item",onSelect:()=>i.onArchive(),get children(){return[e(le,{name:"archive",size:"small",class:"os-client-session-menu-icon"}),e(k.ItemLabel,{class:"os-client-session-menu-label",get children(){return l.t("common.archive")}})]}}),e(nr,{get currentDirectory(){return i.currentDirectory},get projects(){return i.projects},get onMove(){return i.onMove},get onNewProject(){return i.onNewProject}}),e(k.Separator,{class:"os-client-session-menu-separator"}),e(k.Item,{"data-action":"session-delete",class:"os-client-session-menu-item is-danger",onSelect:()=>i.onDelete(),get children(){return[e(le,{name:"trash",size:"small",class:"os-client-session-menu-icon"}),e(k.ItemLabel,{class:"os-client-session-menu-label",get children(){return l.t("common.delete")}})]}})]}var It=o('<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">'),rr=o("<span class=os-sidebar-label>"),sr=o('<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">'),ir=o("<span class=os-sidebar-label>新建会话"),or=o('<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">'),ar=o("<span class=os-sidebar-label>能力中心"),lr=o('<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">'),cr=o("<span class=os-sidebar-label>skills设置"),dr=o('<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">'),ur=o("<span class=os-sidebar-label>资源配置"),hr=o("<p class=os-client-empty-hint>登录后同步个人空间"),gr=o("<div class=os-client-task-list-scroll>"),mr=o("<button type=button class=os-client-task-more data-action=recent-expand>展开更多"),pr=o("<button type=button class=os-client-task-more data-action=recent-collapse>收起"),fr=o("<p class=os-client-empty-hint>登录后查看未分类会话"),vr=o("<button type=button class=os-client-shared-cases-more data-action=shared-cases-expand>展开更多"),$r=o("<button type=button class=os-client-shared-cases-more data-action=shared-cases-collapse>收起"),br=o("<div class=os-client-shared-cases-list>"),wr=o('<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>'),_r=o('<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=o("<span class=os-sidebar-label>帮助"),kr=o('<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>设置'),Sr=o("<p class=os-client-empty-hint>暂无项目,点击 + 打开目录"),xr=o("<div class=os-client-project-sessions>"),Cr=o("<div class=os-client-project-block><div class=os-client-project-row>"),Ze=o("<span class=os-client-task-main><span>"),Mt=o("<div class=os-client-session-row>"),Pr=o("<p class=os-client-empty-hint>暂无未分类会话,点击 + 新建"),Lr=o("<p class=os-client-empty-hint>暂无默认案例");const Oe=4,Rt=200,Ye=4;function Dr(){const i=it(),l=Yt(),n=Ie(),x=ot(),h=en(),w=tn(),$=nn(),C=rn(),_=at(),m=()=>!!Y(),V=()=>zt(i.pathname),j=()=>(i.pathname,i.search,Zn()),c=()=>i.pathname.startsWith("/workspace/capabilities"),g=()=>i.pathname.startsWith("/workspace/skills"),J=()=>i.pathname.startsWith("/workspace/resources"),E=()=>i.pathname.startsWith("/workspace/docs"),[L,D]=W(!0),[I,R]=W(!1),[H,X]=W(!1),q=y(()=>sn(x.projects.list(),Y())),G=y(()=>q().filter(t=>!_e(Y(),t.worktree))),ve=y(()=>pt(Y())?.trim()||""),ie=y(()=>on(Y())?.trim()||""),ue=y(()=>{const t=/^\/workspace\/([^/]+)\/session/.exec(i.pathname)?.[1];return t?lt(t)??"":""}),ee=()=>/\/session\/([^/?#]+)/.exec(i.pathname)?.[1],he=t=>{const a=ue();if(!a)return!1;const p=me(a);return me(t.worktree)===p?!0:t.sandboxes?.some(F=>me(F)===p)??!1};Q(()=>{if(!m())return;const t=[...G().flatMap(a=>[a.worktree,...a.sandboxes??[]]),ve()].filter(a=>a.length>0);for(const a of t)ft(()=>{h.project.loadSessions(a)})}),Q(()=>{const t=ie();if(!t)return;const[a,p]=h.child(t,{bootstrap:!1});(a.limit??0)<Rt&&p("limit",Rt),ft(()=>{h.project.loadSessions(t)})});const re=y(()=>{const t=ve();if(!t)return[];const[a]=h.child(t,{bootstrap:!1});return Ve(a,Date.now(),t).map(p=>({session:p,directory:t}))}),d=y(()=>H()?re():re().slice(0,Ye)),T=y(()=>!H()&&re().length>Ye),u=y(()=>H()&&re().length>Ye),b=y(()=>{const t=ie();if(!t)return[];const[a]=h.child(t,{bootstrap:!1});return an(Ve(a,Date.now(),t).filter(p=>vt(p.id)))}),f=y(()=>L()?I()?b():b().slice(0,Oe):[]),v=y(()=>L()&&!I()&&b().length>Oe),s=y(()=>L()&&I()&&b().length>Oe);Q(()=>{const t=ln(i.search),a=ee(),p=t&&t!=="open"?t:vt(a)?a:void 0;if((t||p)&&D(!0),p&&b().findIndex(Z=>Z.id===p)>=Oe&&R(!0),!t||t==="open")return;const F=ie();F&&a!==t&&l(ge(F,t),{replace:!0})});function M(t,a=!0){x.projects.open(t),C.projects.touchCode(t),a&&l(ge(t))}function U(){_.show(()=>e(Pn,{onCreated:t=>M(t)}))}function Me(t){_.show(()=>e(Jn,{project:t}))}function Re(t){const a=t.worktree;if(_e(Y(),a))return;const p=G(),F=me(a),N=p.findIndex(oe=>me(oe.worktree)===F);if(N===-1)return;if(he(t)){const oe=p[N+1]??p[N-1];l(oe?ge(oe.worktree):"/workspace")}x.projects.close(a)}async function je(){const t=$.openDirectoryPickerDialog;function a(p){if(Array.isArray(p)){p.forEach((F,N)=>M(F,N===0));return}p&&M(p)}if(t&&kn({hasNativePicker:!!t,isLocalServer:!!C.isLocal(),hasPlatformSession:!!Y()})){const p=await t({title:n.t("command.project.open"),multiple:!0});a(p);return}_.show(()=>e(Sn,{multiple:!0,onSelect:a,onCreateFolder:U}),()=>a(null))}function $e(){Xe({navigate:l,action:{type:"install",resourceId:"__project__"},isLoggedIn:m()})&&je()}function Te(){if(!Xe({navigate:l,action:{type:"install",resourceId:"__task__"},isLoggedIn:m()}))return;const t=pt(Y());t&&($t(bt(t)),M(t))}function ze(t){Xe({navigate:l,action:{type:"install",resourceId:"__task__"},isLoggedIn:m()})&&($t(bt(t)),M(t))}function ke(t){const a=Y();return bn(a,t)?!1:At(a,t)}function Ae(t){if(!ke(t)){ae({title:n.t("dialog.project.upload.failed"),description:n.t("dialog.project.upload.destinationHint"),variant:"error"});return}nt(()=>import("./dialog-project-upload-BtvMY5nK.js"),__vite__mapDeps([0,1,2])).then(a=>{_.show(()=>e(a.DialogProjectUpload,{directory:t}))})}function Ne(t){nt(()=>import("./index-DAMGhM04.js").then(a=>a.eH),__vite__mapDeps([1,2])).then(a=>{_.show(()=>e(a.DialogProjectEnvironment,{directory:t}))})}function Se(t){if(ee()!==t.id)return;const a=ue();if(!a){l("/workspace");return}l(ge(a))}function be(t,a){const[,p]=h.child(t,{bootstrap:!1});p(xn(F=>{const N=Cn.search(F.session,a,oe=>oe.id);if(!N.found)return;const Z=F.session[N.index];F.session.splice(N.index,1),Z&&!Z.parentID&&(F.sessionTotal=Math.max(0,F.sessionTotal-1))}))}async function xe(t){be(t.directory,t.id),Se(t),await w.client.session.update({directory:t.directory,sessionID:t.id,time:{archived:Date.now()}}).then(()=>!0).catch(p=>(ae({title:n.t("common.archive"),description:Ge(p,n.t("common.requestFailed"))}),!1))||h.project.loadSessions(t.directory)}async function Fe(t){return await w.client.session.delete({sessionID:t.id,directory:t.directory}).then(p=>p.data).catch(p=>(ae({title:n.t("session.delete.failed.title"),description:Ge(p,n.t("common.requestFailed"))}),!1))?(be(t.directory,t.id),Se(t),!0):!1}function Ce(t){const a=we(t);_.show(()=>e(wt,{get title(){return n.t("session.delete.title")},fit:!0,get children(){var p=It(),F=p.firstChild,N=F.nextSibling;return r(F,()=>n.t("session.delete.confirm",{name:a})),r(N,e(We,{variant:"ghost",size:"large",onClick:()=>_.close(),get children(){return n.t("common.cancel")}}),null),r(N,e(We,{variant:"primary",size:"large",onClick:()=>{Fe(t).then(Z=>{Z&&_.close()})},get children(){return n.t("session.delete.button")}}),null),p}}))}function He(t){const[a]=h.child(t,{bootstrap:!1});return Ve(a,Date.now(),t).map(p=>({session:p,directory:t}))}function we(t){const[a]=h.child(t.directory,{bootstrap:!1});return wn({title:t.title,fallbackText:_n(t.id,a.message,a.part),emptyLabel:n.t("command.session.new")})}function Pe(t,a){if(me(t.directory)===me(a))return;if(!_e(Y(),t.directory)){ae({title:n.t("session.move.failed.title"),description:n.t("session.move.failed.onlyDefault")});return}if(_e(Y(),a)){ae({title:n.t("session.move.failed.title"),description:n.t("session.move.failed.onlyDefault")});return}const p=Be({worktree:a});_.show(()=>e(wt,{get title(){return n.t("session.move.confirm.title")},fit:!0,get children(){var F=It(),N=F.firstChild,Z=N.nextSibling;return r(N,()=>n.t("session.move.confirm.description",{project:p})),r(Z,e(We,{variant:"ghost",size:"large",onClick:()=>_.close(),get children(){return n.t("common.cancel")}}),null),r(Z,e(We,{variant:"primary",size:"large",onClick:()=>{qt(t,a).then(oe=>{oe&&_.close()})},get children(){return n.t("session.move.confirm.action")}}),null),F}}))}async function qt(t,a){const p=t.directory;return await w.client.session.update({directory:t.directory,sessionID:t.id,moveTo:a}).then(()=>!0).catch(N=>(ae({title:n.t("session.move.failed.title"),description:Ge(N,n.t("common.requestFailed"))}),!1))?(be(p,t.id),x.projects.open(a),C.projects.touchCode(a),h.project.loadSessions(p),h.project.loadSessions(a),ee()===t.id?(l(ge(a,t.id)),!0):(ae({title:n.t("session.move.success.title"),description:n.t("session.move.success.description",{project:Be({worktree:a})})}),!0)):!1}function Kt(){_.show(()=>e(yn,{tab:"account"}))}return(()=>{var t=kr(),a=t.firstChild,p=a.nextSibling,F=p.firstChild,N=F.firstChild,Z=N.nextSibling,oe=Z.firstChild,Ut=oe.firstChild,Vt=Ut.nextSibling,ct=Vt.firstChild,Xt=oe.nextSibling,dt=Z.nextSibling,ut=dt.firstChild,Gt=ut.firstChild,Qt=Gt.nextSibling,ht=Qt.firstChild,Jt=ut.nextSibling,Zt=p.nextSibling,gt=Zt.firstChild,mt=gt.firstChild;return cn(a,dn(()=>$.platform==="desktop"?{"data-tauri-drag-region":!0}:{}),!1,!0),r(a,e(ce,{get href(){return gn($.platform)},class:"os-sidebar-brand-link",get children(){return[e(un,{class:"os-sidebar-brand-mark"}),(()=>{var P=rr();return r(P,()=>hn($.platform)),P})()]}})),r(N,e(ce,{get href(){return mn()},class:"os-sidebar-link",get classList(){return{"is-active":V()}},get children(){return[sr(),ir()]}}),null),r(N,e(ce,{get href(){return j()},class:"os-sidebar-link",get classList(){return{"is-active":c()}},get children(){return[or(),ar()]}}),null),r(N,e(ce,{get href(){return pn()},class:"os-sidebar-link",get classList(){return{"is-active":g()}},get children(){return[lr(),cr()]}}),null),r(N,e(ce,{get href(){return fn()},class:"os-sidebar-link",get classList(){return{"is-active":J()}},get children(){return[dr(),ur()]}}),null),ct.$$click=$e,r(Xt,e(S,{get when(){return pe(()=>!!m())()&&G().length>0},get fallback(){return e(S,{get when(){return m()},get children(){return Sr()}})},get children(){return e(fe,{get each(){return G()},children:P=>(()=>{var O=Cr(),te=O.firstChild;return r(te,e(ce,{get href(){return ge(P.worktree)},class:"os-client-project-item",get children(){return Be(P)}}),null),r(te,e(k,{get children(){return[e(k.Trigger,{type:"button",class:"os-client-project-more",get"aria-label"(){return n.t("common.moreOptions")},onClick:ne=>ne.stopPropagation(),children:"..."}),e(k.Portal,{get children(){return e(k.Content,{class:Je,get children(){return[e(k.Item,{"data-action":"project-new-session",class:"os-client-session-menu-item",onSelect:()=>ze(P.worktree),get children(){return[e(le,{name:"new-session",size:"small",class:"os-client-session-menu-icon"}),e(k.ItemLabel,{class:"os-client-session-menu-label",get children(){return n.t("command.session.new")}})]}}),e(S,{get when(){return ke(P.worktree)},get children(){return e(k.Item,{"data-action":"project-upload",class:"os-client-session-menu-item",onSelect:()=>Ae(P.worktree),get children(){return[e(le,{name:"cloud-upload",size:"small",class:"os-client-session-menu-icon"}),e(k.ItemLabel,{class:"os-client-session-menu-label",get children(){return n.t("command.project.upload")}})]}})}}),e(k.Item,{"data-action":"project-environment",class:"os-client-session-menu-item",onSelect:()=>Ne(P.worktree),get children(){return[e(le,{name:"console",size:"small",class:"os-client-session-menu-icon"}),e(k.ItemLabel,{class:"os-client-session-menu-label",get children(){return n.t("sidebar.project.environment")}})]}}),e(k.Item,{"data-action":"project-rename",class:"os-client-session-menu-item",onSelect:()=>Me(P),get children(){return[e(le,{name:"edit",size:"small",class:"os-client-session-menu-icon"}),e(k.ItemLabel,{class:"os-client-session-menu-label",get children(){return n.t("common.rename")}})]}}),e(k.Separator,{class:"os-client-session-menu-separator"}),e(k.Item,{"data-action":"project-remove-from-view",class:"os-client-session-menu-item",onSelect:()=>Re(P),get children(){return[e(le,{name:"close-small",size:"small",class:"os-client-session-menu-icon"}),e(k.ItemLabel,{class:"os-client-session-menu-label",get children(){return n.t("sidebar.project.removeFromView")}})]}})]}})}})]}}),null),r(O,e(S,{get when(){return he(P)},get children(){var ne=xr();return r(ne,e(fe,{get each(){return He(P.worktree)},children:z=>(()=>{var K=Mt();return r(K,e(ce,{get href(){return ge(z.directory,z.session.id)},class:"os-client-task-item",get classList(){return{"is-active":ee()===z.session.id}},get"data-session-id"(){return z.session.id},get children(){var se=Ze(),Ue=se.firstChild;return r(Ue,()=>we(z.session)),se}}),null),r(K,e(k,{get children(){return[e(k.Trigger,{type:"button",class:"os-client-session-more",get"aria-label"(){return n.t("common.moreOptions")},onClick:se=>se.stopPropagation(),children:"..."}),e(k.Portal,{get children(){return e(k.Content,{class:Je,get children(){return e(Et,{get currentDirectory(){return z.directory},projects:G,onArchive:()=>void xe(z.session),onDelete:()=>Ce(z.session),onMove:se=>Pe(z.session,se),onNewProject:$e})}})}})]}}),null),B(()=>K.classList.toggle("is-active",ee()===z.session.id)),K})()})),ne}}),null),O})()})}})),r(Z,e(S,{get when(){return!m()},get children(){return hr()}}),null),ht.$$click=Te,r(Jt,e(S,{get when(){return pe(()=>!!m())()&&re().length>0},get fallback(){return e(S,{get when(){return m()},get children(){return Pr()}})},get children(){return[(()=>{var P=gr();return r(P,e(fe,{get each(){return d()},children:O=>(()=>{var te=Mt();return r(te,e(ce,{get href(){return ge(O.directory,O.session.id)},class:"os-client-task-item",get classList(){return{"is-active":ee()===O.session.id}},get"data-session-id"(){return O.session.id},get children(){var ne=Ze(),z=ne.firstChild;return r(z,()=>we(O.session)),ne}}),null),r(te,e(k,{get children(){return[e(k.Trigger,{type:"button",class:"os-client-session-more",get"aria-label"(){return n.t("common.moreOptions")},onClick:ne=>ne.stopPropagation(),children:"..."}),e(k.Portal,{get children(){return e(k.Content,{class:Je,get children(){return e(Et,{get currentDirectory(){return O.directory},projects:G,onArchive:()=>void xe(O.session),onDelete:()=>Ce(O.session),onMove:ne=>Pe(O.session,ne),onNewProject:$e})}})}})]}}),null),B(()=>te.classList.toggle("is-active",ee()===O.session.id)),te})()})),B(()=>A(P,"data-expanded",H()?"true":"false")),P})(),e(S,{get when(){return T()},get children(){var P=mr();return P.$$click=()=>X(!0),P}}),e(S,{get when(){return u()},get children(){var P=pr();return P.$$click=()=>X(!1),P}})]}})),r(dt,e(S,{get when(){return!m()},get children(){return fr()}}),null),r(p,e(S,{get when(){return ie()},get children(){var P=wr(),O=P.firstChild,te=O.firstChild,ne=te.nextSibling;return O.$$click=()=>D(z=>!z),r(ne,()=>n.t("sidebar.section.sharedCases")),r(P,e(S,{get when(){return L()},get children(){var z=br();return r(z,e(S,{get when(){return f().length>0},get fallback(){return Lr()},get children(){return e(fe,{get each(){return f()},children:K=>e(ce,{get href(){return ge(ie(),K.id)},class:"os-client-task-item",get classList(){return{"is-active":ee()===K.id}},get"data-session-id"(){return K.id},get children(){var se=Ze(),Ue=se.firstChild;return r(Ue,()=>vn(K.title)??K.id),se}})})}}),null),r(z,e(S,{get when(){return v()},get children(){var K=vr();return K.$$click=()=>R(!0),K}}),null),r(z,e(S,{get when(){return s()},get children(){var K=$r();return K.$$click=()=>R(!1),K}}),null),z}}),null),B(z=>{var K=L(),se=L()?"true":"false";return K!==z.e&&A(O,"aria-expanded",z.e=K),se!==z.t&&A(te,"data-open",z.t=se),z},{e:void 0,t:void 0}),P}}),null),r(gt,e(ce,{get href(){return $n()},class:"os-sidebar-footer-action",get classList(){return{"is-active":E()}},get children(){return[_r(),yr()]}}),mt),mt.$$click=Kt,B(P=>{var O=!m(),te=!m();return O!==P.e&&ct.classList.toggle("is-muted",P.e=O),te!==P.t&&ht.classList.toggle("is-muted",P.t=te),P},{e:void 0,t:void 0}),t})()}ye(["click"]);var Er=o('<pre class="os-client-right-files-preview whitespace-pre-wrap break-all p-3 text-12-regular m-0">'),Ir=o("<button type=button class=os-client-right-files-back>← 返回目录"),Mr=o("<span class=os-client-right-files-title>"),Rr=o("<button type=button>"),jr=o("<div class=os-client-right-files-actions><button type=button>关闭"),Tr=o("<p class=os-client-right-files-hint>正在加载目录…"),zr=o("<p class=os-client-right-files-hint>该目录为空"),Ar=o("<div class=os-client-right-files-tree><p class=os-client-right-files-root></p><div class=os-client-right-files-tree-scroll>"),Nr=o("<div class=os-client-right-files-unsaved>"),Fr=o("<p class=os-client-right-files-hint>…"),Hr=o("<textarea class=os-client-right-files-textarea autocapitalize=off autocomplete=off autocorrect=off>"),Wr=o("<pre class=os-client-right-files-preview>"),Or=o("<div class=os-client-right-files-editor>"),Br=o("<section class=os-client-right-files><header class=os-client-right-files-header>"),qr=o("<strong>目录"),Kr=o("<div class=os-client-right-files-actions><button type=button aria-label=刷新>刷新</button><button type=button>关闭"),Ur=o("<p class=os-client-right-files-hint>加载失败:"),Vr=o("<p class=os-client-right-files-hint>");function Xr(i){const l=i.replace(/\\/g,"/").split("/");return l[l.length-1]||i}function Gr(i){const l=Ln(),n=Dn(),x=Ie(),[h,w]=W("tree"),[$,C]=W(),[_,m]=W(""),[V,j]=W(!1),[c,g]=W(!1),[J,E]=W(0);let L;const D=y(()=>l.tree.state("")),I=y(()=>l.tree.children("")),R=y(()=>En($())),H=(u=!1)=>{n.directory&&(u?l.tree.refresh(""):l.tree.list(""))};Ke(()=>{queueMicrotask(()=>H(!0))}),Q(()=>{if(!n.directory||h()!=="tree")return;const b=D();b?.loading||b?.loaded||b?.error||l.tree.list("")});const X=y(()=>{const u=$();if(u)return l.get(u)}),q=y(()=>X()?.content?.content??""),G=y(()=>!!X()?.loaded),ve=y(()=>!!X()?.loading),ie=y(()=>X()?.error),ue=y(()=>{const u=X();return!(!u?.loaded||u.content?.type!=="text"||u.content.encoding==="base64"||_t($()))}),ee=y(()=>ue()&&R()==="text"),he=y(()=>{if(!(!ue()||ee()))return{draft:_,setDraft:u=>{m(u),j(!0)},textareaRef:u=>{L=u},class:"os-client-right-files-textarea"}}),re=u=>(()=>{var b=Er();return r(b,u),b})();Q(()=>{const u=$();u&&l.load(u)}),Q(Nt($,()=>{j(!1),m(G()?q():""),E(0)},{defer:!1})),Q(()=>{!G()||V()||m(q())});const d=async()=>{const u=$();if(!(!u||c()||!V()||!ue())){g(!0);try{await l.write(u,_()),j(!1),yt(u)&&E(b=>b+1)}finally{g(!1)}}};Q(()=>{if(typeof window>"u")return;In(window,"keydown",b=>{!(b.metaKey||b.ctrlKey)||b.key.toLowerCase()!=="s"||!L?.contains(document.activeElement)&&document.activeElement!==L||(b.preventDefault(),d())})});const T=u=>{C(u),w("editor")};return(()=>{var u=Br(),b=u.firstChild;return r(b,e(S,{get when(){return h()==="editor"},get fallback(){return[qr(),(()=>{var f=Kr(),v=f.firstChild,s=v.nextSibling;return v.$$click=()=>{H(!0),l.tree.refreshAll()},rt(s,"click",i.onClose,!0),f})()]},get children(){return[(()=>{var f=Ir();return f.$$click=()=>w("tree"),f})(),(()=>{var f=Mr();return r(f,(()=>{var v=pe(()=>!!$());return()=>v()?Xr($()):""})()),B(()=>A(f,"title",$())),f})(),(()=>{var f=jr(),v=f.firstChild;return r(f,e(S,{get when(){return ue()},get children(){var s=Rr();return s.$$click=()=>void d(),r(s,(()=>{var M=pe(()=>!!c());return()=>M()?x.t("common.saving"):x.t("common.save")})()),B(()=>s.disabled=!V()||c()),s}}),v),rt(v,"click",i.onClose,!0),f})()]}})),r(u,e(S,{get when(){return h()==="tree"},get children(){var f=Ar(),v=f.firstChild,s=v.nextSibling;return r(v,()=>n.directory),r(f,e(S,{get when(){return pe(()=>!!D()?.loading)()&&I().length===0},get children(){return Tr()}}),s),r(f,e(S,{get when(){return D()?.error},children:M=>(()=>{var U=Ur();return U.firstChild,r(U,M,null),U})()}),s),r(f,e(S,{get when(){return pe(()=>!!(D()?.loaded&&I().length===0))()&&!D()?.error},get children(){return zr()}}),s),r(s,e(Mn,{path:"",class:"os-client-right-file-tree",nodeClass:"os-client-right-file-node",get active(){return $()},draggable:!1,onFileClick:M=>T(M.path)})),B(()=>A(v,"title",n.directory)),f}}),null),r(u,e(S,{get when(){return h()==="editor"},get children(){var f=Or();return r(f,e(S,{get when(){return V()},get children(){var v=Nr();return r(v,()=>x.t("session.file.unsaved")),v}}),null),r(f,e(S,{get when(){return pe(()=>!!ve())()&&!G()},get children(){var v=Fr(),s=v.firstChild;return r(v,()=>x.t("common.loading"),s),v}}),null),r(f,e(S,{get when(){return ie()},children:v=>(()=>{var s=Vr();return r(s,v),s})()}),null),r(f,e(S,{get when(){return G()},get children(){return e(Ft,{get children(){return[e(de,{get when(){return yt($())},get children(){return e(Rn,{path:$,contents:q,renderSource:re,get editSource(){return he()},previewRevision:J,chrome:"workbench"})}}),e(de,{get when(){return R()==="markdown"},get children(){return e(jn,{path:$,contents:q,renderSource:re,get editSource(){return he()},chrome:"workbench"})}}),e(de,{get when(){return R()==="csv"},get children(){return e(Tn,{path:$,contents:q,renderSource:re,get editSource(){return he()},chrome:"workbench"})}}),e(de,{get when(){return _t($())},get children(){return e(zn,{path:$,chrome:"workbench"})}}),e(de,{get when(){return Nn($())},get children(){return e(An,{path:$,contents:q,renderSource:re,get editSource(){return he()},chrome:"workbench"})}}),e(de,{get when(){return ee()},get children(){var v=Hr();v.$$input=M=>{m(M.currentTarget.value),j(!0)};var s=L;return typeof s=="function"?qe(s,v):L=v,A(v,"spellcheck",!1),B(()=>v.value=_()),v}}),e(de,{when:!0,get children(){var v=Wr();return r(v,()=>q()||"(二进制或不支持预览的文件)"),v}})]}})}}),null),f}}),null),B(()=>A(u,"data-view",h())),u})()}ye(["click","input"]);var Qr=o('<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>'),Jr=o("<ul class=os-client-right-todo-list>"),Zr=o("<span class=os-client-right-todo-text>"),Yr=o('<li class="os-client-right-todo-item is-clickable"role=button tabindex=0>'),es=o("<p class=os-client-right-todo-progress>已完成 <!> / "),ts=o("<section class=os-client-right-todo><header class=os-client-right-todo-header><strong></strong><button type=button>关闭"),ns=o("<p class=os-client-right-todo-empty>暂无场景工作流。从能力中心场景创建任务后,步骤会显示在这里。"),rs=o("<span class=os-client-right-todo-stop> · ");function ss(i){return i==="completed"?"completed":i==="in_progress"?"in_progress":i==="failed"?"cancelled":"pending"}function is(i){if(i==="in_progress")return Qr()}function os(i,l){return l?"confirm":i==="pending"?"edit":i==="completed"||i==="failed"||i==="in_progress"?"rerun":"view"}function as(i){return(()=>{var l=Jr();return r(l,e(fe,{get each(){return i.items},children:n=>(()=>{var x=Yr();return x.$$keydown=h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),i.onOpen(n.index))},x.$$click=()=>i.onOpen(n.index),r(x,e(Fn,{readOnly:!0,get checked(){return n.status==="completed"},get indeterminate(){return n.status==="in_progress"},get icon(){return is(n.status)},get children(){var h=Zr();return r(h,()=>n.content),B(w=>{var $=n.status==="completed"||n.status==="cancelled",C=n.status==="pending";return $!==w.e&&h.classList.toggle("is-done",w.e=$),C!==w.t&&h.classList.toggle("is-pending",w.t=C),w},{e:void 0,t:void 0}),h}})),B(()=>A(x,"data-state",n.status)),x})()})),l})()}function ls(i){const l=at();Ht();const n=y(()=>st(i.directoryKey,i.sessionID)??kt(i.directoryKey)),x=y(()=>{const C=n();return C?.steps.length?C.steps.map((_,m)=>({content:_.name,status:ss(_.status),index:m})):[]}),h=y(()=>x().filter(C=>C.status==="completed").length),w=y(()=>n()?.title||"待办"),$=C=>{const _=st(i.directoryKey,i.sessionID)??kt(i.directoryKey);if(!_)return;const m=_.steps[C];if(!m)return;const V=Hn(_,C),j=m.status==="pending"&&_.phase==="awaiting_confirm"&&_.currentIndex===C,c=os(m.status,j),g=m.status==="in_progress",J=c==="confirm"?"确认下一步参数":c==="edit"?"编辑步骤参数":g?"终止并重新执行":c==="rerun"?"从此步重新执行":"查看步骤参数",E=i.directoryKey;l.show(()=>e(On,{title:J,get stepName(){return m.name},fields:V,get values(){return _.values},mode:c,get firstDecision(){return j&&_.confirmMode==="unset"},aborting:g,rerunActionLabel:g?"终止并重新执行":"从此步重新执行",get reason(){return c==="confirm"?`下一步「${m.name}」可按需调整参数,确认后将自动发送并执行。`:c==="edit"?`可修改「${m.name}」的预填参数,保存后在执行该步时生效。`:g?`将停止自动续跑并从「${m.name}」重发。已提交的外部作业需自行取消;可先修改参数再确认。`:c==="rerun"?`可修改「${m.name}」参数。确认后将从该步重新执行,并重置后续步骤状态。`:`「${m.name}」当前为只读,展示该步相关参数。`},canContinue:j,onSave:L=>{St(E,L),ae({title:"已保存步骤参数"})},onConfirm:L=>{const D=xt(E,L);D&&(Qe(E,D),ae({title:L.mode==="auto"?`连续执行:${D.stepName}`:`继续执行:${D.stepName}`}))},onSaveAndContinue:L=>{St(E,L.values);const D=xt(E,L);D&&(Qe(E,D),ae({title:L.mode==="auto"?`连续执行:${D.stepName}`:`继续执行:${D.stepName}`}))},onRerun:L=>{const D=Wn(E,{stepIndex:C,values:L});D&&(Qe(E,D),ae({title:g?`已终止并从该步重跑:${D.stepName}`:`已从该步重新执行:${D.stepName}`}))}}))};return(()=>{var C=ts(),_=C.firstChild,m=_.firstChild,V=m.nextSibling;return r(m,w),rt(V,"click",i.onClose,!0),r(C,e(S,{get when(){return x().length>0},get fallback(){return ns()},get children(){return[(()=>{var j=es(),c=j.firstChild,g=c.nextSibling;return g.nextSibling,r(j,h,g),r(j,()=>x().length,null),r(j,e(S,{get when(){return n()?.stopReason},children:J=>(()=>{var E=rs();return E.firstChild,r(E,J,null),E})()}),null),j})(),e(as,{get items(){return x()},onOpen:$})]}}),null),B(()=>A(m,"title",w())),C})()}ye(["click","keydown"]);var cs=o("<div class=os-client-right-add-dropdown role=menu>"),ds=o('<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>'),us=o("<button type=button role=menuitem>"),hs=o("<section class=os-client-right-empty><strong>尚未打开页面</strong><p>点击 + 打开目录、可视化组件或待办;在会话中可从目录点文件到右侧编辑。"),gs=o("<section class=os-client-right-pane-stub><header><strong>可视化组件</strong><button type=button>关闭</button></header><p>请从「目录」中打开 `.html` / `.md` / `.csv` / `.pdf` / `.xyz` 文件查看可视化预览;后续版本将提供独立可视化入口。"),ms=o("<section class=os-client-right-pane-stub><header><strong>目录</strong><button type=button>关闭</button></header><p>请先打开项目或任务后再查看目录。"),ps=o("<section class=os-client-right-pane-stub><header><strong>待办</strong><button type=button>关闭</button></header><p>请先打开项目或任务后再查看待办。");const fs=[{id:"directory",label:"目录"},{id:"viz",label:"可视化组件"},{id:"todo",label:"待办"}];function vs(){const i=it(),[l,n]=W(!1),[x,h]=W();let w;const $=y(()=>Wt(i.pathname)),C=y(()=>{const c=$()?.dir;return c?lt(c)??"":""}),_=y(()=>Ot(i.pathname)&&!!C()),m=y(()=>{Ht();const c=$()?.dir;if(!c)return!1;const g=st(c,$()?.id);return g?g.phase!=="done"&&g.phase!=="stopped":!1});Ke(()=>{const c=g=>{l()&&(w?.contains(g.target)||n(!1))};document.addEventListener("pointerdown",c),Ee(()=>document.removeEventListener("pointerdown",c))}),Q(()=>{if(!Bt())return;const g=Bn();g&&(h(g),n(!1))});const V=c=>{h(c),n(!1)},j=()=>{if(m()&&x()!=="todo"){h("todo");return}h(void 0)};return(()=>{var c=ds(),g=c.firstChild,J=g.firstChild,E=J.firstChild,L=g.nextSibling,D=w;return typeof D=="function"?qe(D,g):w=g,E.$$click=()=>n(I=>!I),r(J,e(S,{get when(){return l()},get children(){var I=cs();return r(I,e(fe,{get each(){return[...fs]},children:R=>(()=>{var H=us();return H.$$click=()=>V(R.id),r(H,()=>R.label),H})()})),I}}),null),r(L,e(S,{get when(){return x()},get fallback(){return hs()},children:I=>e(Ft,{get children(){return[e(de,{get when(){return I()==="directory"},get children(){return e(S,{get when(){return _()},get fallback(){return(()=>{var R=ms(),H=R.firstChild,X=H.firstChild,q=X.nextSibling;return q.$$click=j,R})()},get children(){return e(qn,{params:()=>({dir:$().dir,id:$()?.id}),get children(){return e(Kn,{directory:()=>C(),get children(){return e(Un,{get children(){return e(Vn,{get children(){return e(Gr,{onClose:j})}})}})}})}})}})}}),e(de,{get when(){return I()==="todo"},get children(){return e(S,{get when(){return $()?.dir},get fallback(){return(()=>{var R=ps(),H=R.firstChild,X=H.firstChild,q=X.nextSibling;return q.$$click=()=>h(void 0),R})()},children:R=>e(ls,{get directoryKey(){return R()},get sessionID(){return $()?.id},onClose:()=>h(void 0)})})}}),e(de,{get when(){return I()==="viz"},get children(){var R=gs(),H=R.firstChild,X=H.firstChild,q=X.nextSibling;return q.$$click=j,R}})]}})})),B(I=>{var R=!!l(),H=l();return R!==I.e&&E.classList.toggle("is-open",I.e=R),H!==I.t&&A(E,"aria-expanded",I.t=H),I},{e:void 0,t:void 0}),c})()}ye(["click"]);var $s=o('<button type=button class="os-client-panel-toggle os-client-terminal-toggle"aria-controls=terminal-panel>'),bs=o('<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 ws(){const i=it(),l=ot(),n=Ie(),x=Xn(),h=at(),[w,$]=W(Y()),C=y(()=>zt(i.pathname)||Ot(i.pathname)),_=y(()=>!C()||Gn()&&!w()?!1:l.terminal.enabled()?!0:Ct(w())),m=y(()=>l.view("workbench").terminal.opened()),V=y(()=>{const c=Wt(i.pathname);return c?.dir?lt(c.dir)??"":""});Ke(()=>{const c=()=>$(Y());window.addEventListener(Pt,c),window.addEventListener(Lt,c),window.addEventListener("storage",c),Ee(()=>{window.removeEventListener(Pt,c),window.removeEventListener(Lt,c),window.removeEventListener("storage",c)})}),Q(()=>{_()&&Dt()}),Q(Nt(C,(c,g)=>{g===void 0||c||!g||m()&&(l.view("workbench").terminal.close(),l.terminal.closeFullscreen())}));const j=()=>{if(Ct(w())||!l.terminal.enabled()){nt(()=>import("./dialog-terminal-unavailable-CExY762o.js"),__vite__mapDeps([3,1,2])).then(c=>{h.show(()=>e(c.DialogTerminalUnavailable,{}))});return}if(!m()){const c=V();if(c&&!At(w(),c))return;Dt()}l.view("workbench").terminal.toggle()};return e(S,{get when(){return _()},get children(){var c=$s();return c.$$click=g=>g.preventDefault(),c.$$pointerdown=g=>{g.button===0&&(g.preventDefault(),j())},r(c,e(_s,{get active(){return m()}})),B(g=>{var J=!!m(),E=n.t("command.terminal.toggle"),L=n.t("command.terminal.toggle"),D=m(),I=`${n.t("command.terminal.toggle")} (${x.keybind("terminal.toggle")})`;return J!==g.e&&c.classList.toggle("is-active",g.e=J),E!==g.t&&A(c,"data-tooltip",g.t=E),L!==g.a&&A(c,"aria-label",g.a=L),D!==g.o&&A(c,"aria-expanded",g.o=D),I!==g.i&&A(c,"title",g.i=I),g},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),c}})}function _s(i){return(()=>{var l=bs(),n=l.firstChild,x=n.nextSibling;return B(()=>A(x,"opacity",i.active?1:.85)),l})()}ye(["pointerdown","click"]);var ys=o('<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>'),ks=o('<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>'),Ss=o('<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>'),xs=o("<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 De=320,Cs=230,Ps=430,Ls=200,jt=1280;function Tt(i){return(()=>{var l=ys();return B(n=>{var x=i.side,h=i.open?"true":"false";return x!==n.e&&A(l,"data-side",n.e=x),h!==n.t&&A(l,"data-open",n.t=h),n},{e:void 0,t:void 0}),l})()}function et(i){return Math.min(Ps,Math.max(Cs,Math.round(i)))}function tt(i){const l=typeof window>"u"?jt:Math.min(jt,Math.floor(window.innerWidth*.85));return Math.min(l,Math.max(Ls,Math.round(i)))}function Ms(i){const l=ot(),[n,x]=W(!0),[h,w]=W(!1),[$,C]=W(De),[_,m]=W(De),[V,j]=W(!1),[c,g]=W(!1),[J,E]=W(0),[L,D]=W({left:0,right:0}),[I,R]=W(),[H,X]=W(),q=y(()=>l.view("workbench").terminal.opened()),G=()=>q(),ve=y(()=>{if(!q())return 0;const d=J();return d>0?d:l.terminal.height()}),ie=()=>{const d=I();if(!d)return;const T=d.querySelector(":scope > .os-workspace-main");if(!T)return;const u=d.getBoundingClientRect(),b=getComputedStyle(d),f=u.left+(parseFloat(b.borderLeftWidth)||0),v=u.right-(parseFloat(b.borderRightWidth)||0),s=T.getBoundingClientRect(),U=d.querySelector(":scope > .os-client-right-sidebar")?.getBoundingClientRect()??s;D({left:Math.max(0,Math.round(s.left-f)),right:Math.max(0,Math.round(v-U.right))})},ue=()=>{x(d=>(d||C(De),!d))},ee=()=>{w(d=>(d||m(De),!d))};Q(()=>{Bt()&&(w(!0),m(T=>T>0?T:De))});const he=d=>{if(d.button!==0)return;d.preventDefault();const T=d.clientX,u=$();j(!0);const b=v=>{C(et(u+(v.clientX-T)))},f=()=>{j(!1),window.removeEventListener("pointermove",b),window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f)};window.addEventListener("pointermove",b),window.addEventListener("pointerup",f),window.addEventListener("pointercancel",f)},re=d=>{if(d.button!==0)return;d.preventDefault();const T=d.clientX,u=_();g(!0);const b=v=>{m(tt(u+(T-v.clientX)))},f=()=>{g(!1),window.removeEventListener("pointermove",b),window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f)};window.addEventListener("pointermove",b),window.addEventListener("pointerup",f),window.addEventListener("pointercancel",f)};return Q(()=>{const d=H();if(!d||typeof ResizeObserver>"u")return;const T=()=>{const b=d.querySelector("#terminal-panel");E(b?Math.round(b.getBoundingClientRect().height):0)};T();const u=new ResizeObserver(T);u.observe(d),Ee(()=>u.disconnect())}),Q(()=>{q()||E(0)}),Ke(()=>{l.view("workbench").terminal.close(),l.terminal.closeFullscreen(),E(0)}),Q(()=>{n(),h(),$(),_(),V(),c(),G(),I(),ie();const d=requestAnimationFrame(ie);Ee(()=>cancelAnimationFrame(d))}),Q(()=>{const d=I();if(!d||typeof ResizeObserver>"u")return;const T=new ResizeObserver(()=>ie());T.observe(d);const u=d.querySelector(":scope > .os-workspace-main");u&&T.observe(u);const b=d.querySelector(":scope > .os-client-right-sidebar");b&&T.observe(b),Ee(()=>T.disconnect())}),(()=>{var d=xs(),T=d.firstChild,u=T.firstChild,b=u.nextSibling,f=T.nextSibling,v=f.nextSibling;return qe(R,d),u.$$click=ue,r(u,e(Tt,{side:"left",get open(){return n()}})),r(T,e(ws,{}),b),b.$$click=ee,r(b,e(Tt,{side:"right",get open(){return h()}})),r(d,e(S,{get when(){return n()},get children(){return[e(Dr,{}),(()=>{var s=ks();return s.$$keydown=M=>{if(M.key==="ArrowLeft"){M.preventDefault(),C(U=>et(U-16));return}M.key==="ArrowRight"&&(M.preventDefault(),C(U=>et(U+16)))},s.$$pointerdown=he,B(()=>A(s,"aria-valuenow",$())),s})()]}}),f),r(f,()=>i.children),r(d,e(S,{get when(){return h()},get children(){return[(()=>{var s=Ss();return s.$$keydown=M=>{if(M.key==="ArrowLeft"){M.preventDefault(),m(U=>tt(U+16));return}M.key==="ArrowRight"&&(M.preventDefault(),m(U=>tt(U-16)))},s.$$pointerdown=re,B(()=>A(s,"aria-valuenow",_())),s})(),e(vs,{})]}}),v),qe(X,v),A(v,"id",Qn),B(s=>{var M=!!n(),U=!!h(),Me=!!V(),Re=!!c(),je=!!G(),$e=!!(l.terminal.fullscreen()&&l.view("workbench").terminal.opened()),Te=`${$()}px`,ze=`${_()}px`,ke=`${ve()}px`,Ae=`${L().left}px`,Ne=`${L().right}px`,Se=!!n(),be=n()?"关闭左侧栏":"打开左侧栏",xe=n()?"关闭左侧栏":"打开左侧栏",Fe=!!h(),Ce=h()?"关闭右侧栏":"打开右侧栏",He=h()?"关闭右侧栏":"打开右侧栏",we=!!G(),Pe=!G();return M!==s.e&&d.classList.toggle("has-left-sidebar",s.e=M),U!==s.t&&d.classList.toggle("has-right-sidebar",s.t=U),Me!==s.a&&d.classList.toggle("is-resizing-left",s.a=Me),Re!==s.o&&d.classList.toggle("is-resizing-right",s.o=Re),je!==s.i&&d.classList.toggle("has-terminal-open",s.i=je),$e!==s.n&&d.classList.toggle("has-terminal-fullscreen",s.n=$e),Te!==s.s&&Le(d,"--os-client-sidebar-w",s.s=Te),ze!==s.h&&Le(d,"--os-client-tool-w",s.h=ze),ke!==s.r&&Le(d,"--os-client-terminal-h",s.r=ke),Ae!==s.d&&Le(d,"--os-client-terminal-left",s.d=Ae),Ne!==s.l&&Le(d,"--os-client-terminal-right",s.l=Ne),Se!==s.u&&u.classList.toggle("is-active",s.u=Se),be!==s.c&&A(u,"data-tooltip",s.c=be),xe!==s.w&&A(u,"aria-label",s.w=xe),Fe!==s.m&&b.classList.toggle("is-active",s.m=Fe),Ce!==s.f&&A(b,"data-tooltip",s.f=Ce),He!==s.y&&A(b,"aria-label",s.y=He),we!==s.g&&v.classList.toggle("is-open",s.g=we),Pe!==s.p&&A(v,"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}),d})()}ye(["click","pointerdown","keydown"]);export{Ms as WorkbenchShell};
@@ -1 +0,0 @@
1
- import{e as j,f as q,l as D,n as k,o as g,ag as O,i as a,c as o,t as v,dP as u,b as Q,s as E,bd as H,r as N,a_ as y,aT as C,aS as L,aI as z,L as B,O as P,S as G,Q as J,T as K,F as V,R as X,dQ as Y}from"./index-DAMGhM04.js";var Z=v("<p class=os-client-skills-login-hint>登录后可同步个人空间技能。 "),ee=v('<div class="os-client-capability-page os-client-skills-page"><section class=os-client-capability-selector aria-label=技能设置><div class=os-client-capability-current-domain><span>技能设置:</span><strong></strong><small></small></div><div class="os-client-capability-tabs os-client-skills-tabs"role=tablist aria-label=技能管理视图></div></section><div class=os-client-capability-page-body>'),te=v("<button type=button><strong></strong><small>");function ae(c){const s=new URLSearchParams(c).get("tab");if(s==="list"||s==="repo"||s==="upload")return s}function ne(){const c=j(),s=q(),T=D(),[b,A]=k(0),R=g(()=>(b(),!!E())),d=g(()=>!R()),[n,x]=k(ae(c.search)??"list"),M=g(()=>{b();const e=E();return e&&(H(e,T.projects.lastCode())||N(e))||""}),p=e=>{x(e),s(P(e),{replace:!0})};O(()=>{const e=()=>A(i=>i+1);window.addEventListener(y,e),window.addEventListener(C,e),window.addEventListener(L,e),z(()=>{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,F=f.firstChild,m=F.nextSibling,I=m.nextSibling,S=f.nextSibling,U=i.nextSibling;return a(m,()=>h().label),a(I,()=>h().hint),a(i,o(G,{get when(){return d()},get children(){var t=Z();return t.firstChild,a(t,o(B,{get href(){return`/login?redirect=${encodeURIComponent(P(n()))}`},children:"去登录"}),null),t}}),S),a(S,o(V,{each:u,children:t=>(()=>{var r=te(),w=r.firstChild,W=w.nextSibling;return r.$$click=()=>p(t.id),a(w,()=>t.label),a(W,()=>t.hint),J(l=>{var $=n()===t.id,_=n()===t.id;return $!==l.e&&r.classList.toggle("is-active",l.e=$),_!==l.t&&K(r,"aria-pressed",l.t=_),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})()}Q(["click"]);export{ne as WorkbenchSkillsPage};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DAMGhM04.js","assets/index-HqBqMM3b.css"])))=>i.map(i=>d[i]);
2
- import{es as G,h as U,j as H,ct as I,m as J,u as z,aI as R,n as W,x as X,ev as Y,ew as q,ex as Z,ey as ee,o as P,ez as te,i as a,c as s,eA as v,S as $,F as A,eB as ae,R as F,Q as B,ca as se,eC as ne,T as re,a4 as K,ae as le,eD as oe,e2 as ce,_ as ie,p as ue,t as c,$ as de,b as ge}from"./index-DAMGhM04.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)]">'),Q=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=G(),m=le(),f=z(),S=I(),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=G(),f=U(),S=H(),w=I(),i=J(),l=z();let C=0,O=!1;R(()=>{O=!0,C+=1});const[T,E]=W();X(()=>{if(!k.shown()){E(void 0);return}let r=!1;const e=q();(async()=>{const t=await Y(S.url);r||e!==q()||t===void 0||(E(t),Z(t),await ee({serverUrl:S.url,queryClient:w}).catch(()=>{}))})(),R(()=>{r=!0})});const p=$e(),L=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))}),N=r=>m.data.mcp?.[r]?.status,j=P(()=>{const r=T()??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))}),V=P(()=>T()??f.data.config.ssh),D=te({ssh:V}),M=r=>{const e=++C;de(()=>import("./index-DAMGhM04.js").then(t=>t.eF),__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 L().length>0},get fallback(){return(()=>{var n=Q();return a(n,()=>l.t("dialog.mcp.empty")),n})()},get children(){return s(A,{get each(){return L()},children:n=>{const o=()=>N(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 F(()=>!!p.isPending)()&&p.variables===n},onChange:()=>{p.isPending||p.mutate(n)}})),B(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=Q();return a(o,()=>l.t("dialog.ssh.empty")),o})()},get children(){return s(A,{get each(){return j()},children:o=>{const h=()=>D.byName()[o.name];return(()=>{var u=ye(),b=u.firstChild,x=b.firstChild,y=x.nextSibling,d=y.nextSibling;return u.$$click=()=>M(),a(y,()=>o.name),a(d,(()=>{var g=F(()=>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 F(()=>!!D.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),B(()=>re(x,"data-state",D.loading()&&!h()?"testing":h()?.connectivity??"idle")),u})()}})}}),n),a(n,s(K,{variant:"secondary",class:"h-8 px-3 py-1.5",onClick:()=>M(),get children(){return l.t("status.popover.action.manageSsh")}}),null),a(n,s(K,{variant:"secondary",icon:"plus-small",class:"h-8 px-3 py-1.5",onClick:()=>M("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 Ve,m as tt,bI as Qe,dv as Oe,x as it,o as L,dw as at,dx as ke,dy as Ie,dz as ye,dA as Ae,dB as le,dC as lt,ak as Se,i as t,bQ as Xe,c as a,Q as w,F as Y,T as U,S as g,R as Pe,dD as rt,dE as nt,dF as Ue,dG as st,dH as ct,t as n,dI as ot,ds as dt,e as ut,dJ as pt,f as gt,h as ht,g as bt,l as vt,n as $t,ag as mt,X as Fe,aX as Te,r as Le,s as xe,aZ as Re,Z as je,ba as We,Y as qe,_ as De,E as Ee,dK as _t,dL as ft,bP as pe,dM as yt,dN as St,b8 as Ye,bR as Ze,dO as wt,bN as xt,L as X,cc as Be,dt as Ct,bS as zt,du as kt,aY as It}from"./index-DAMGhM04.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>本步有 <!> 个参数类型不正确,请按标注类型修改。"),jt=n("<p class=os-client-capability-wizard-missing>其他步骤还有 <!> 个必填参数未填写,可点击左侧步骤继续补全。"),Wt=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">'),At=n("<p>"),Ut=n("<div class=os-client-capability-wizard-step-banner><strong>"),Bt=n("<p class=os-client-capability-wizard-note>本步无需额外用户参数。"),Kt=n("<em>*"),Gt=n("<small class=os-client-capability-wizard-field-type>"),Nt=n("<textarea rows=3>"),Ke=n("<em class=os-client-capability-wizard-field-error>"),Vt=n("<label class=os-client-capability-wizard-field><span>"),Qt=n("<input type=text>"),Xt=n("<p class=os-client-capability-wizard-outputs-empty>本步暂无结构化产出清单。"),Yt=n("<li>");function Zt(e){const d=tt(),[l,v]=Qe({values:Oe(e.scenario),attempted:!1,activeStepIndex:0});it(()=>{v({values:Oe(e.scenario),attempted:!1,activeStepIndex:0})});const S=L(()=>at(e.scenario)),k=L(()=>S()[l.activeStepIndex]??S()[0]),B=L(()=>{const $=k();return $?ke(e.scenario,$):e.scenario.user_input}),R=L(()=>Ie(e.scenario,l.values)),ge=L(()=>ye(e.scenario.user_input,l.values)),K=L(()=>B().filter($=>Ae($)?!String(l.values[le($)]??"").trim():!1)),oe=L(()=>ye(B(),l.values)),I=L(()=>B().filter($=>String(l.values[le($)]??"").trim()).length),Z=L(()=>{const P=k()?.prompt||e.scenario.ai_prompt?.template||"";return lt(P,l.values)}),N=L(()=>k()?.outputs??[]),re=L(()=>(e.scenario.related_papers??[]).filter($=>!!String($.url??"").trim())),V=($,P)=>{v("values",$,P)},J=$=>{v("activeStepIndex",$)},Ce=()=>{v("attempted",!0);const $=ye(e.scenario.user_input,l.values);if($.length>0){const j=le($[0]),C=S().findIndex(te=>ke(e.scenario,te).some(r=>le(r)===j));C>=0&&v("activeStepIndex",C);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(j=>ke(e.scenario,j).some(C=>le(C)===de));ee>=0&&v("activeStepIndex",ee),d.show(()=>a(ot,{title:"请补充必填参数",get reason(){return`还有 ${P.length} 个必填参数未填写,补充后即可创建任务并自动逐步执行。`},fields:P,get values(){return l.values},onConfirm:j=>{const C={...l.values,...j};v("values",C),!(ye(e.scenario.user_input,C).length>0||Ie(e.scenario,C).length>0)&&e.onSubmit({values:C})}}))};return(()=>{var $=Ht(),P=$.firstChild,de=P.nextSibling,ee=de.firstChild,j=ee.firstChild,C=j.nextSibling,te=C.firstChild,r=te.nextSibling,h=C.nextSibling,m=ee.nextSibling,b=m.firstChild,W=b.firstChild,Q=W.nextSibling,he=Q.nextSibling,q=b.nextSibling,be=q.firstChild,ve=be.firstChild,G=ve.nextSibling,ue=G.firstChild,ne=ue.nextSibling,ze=ne.nextSibling,$e=ze.nextSibling;$e.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(j,"click",e.onClose,!0),t(te,()=>e.scenario.name),t(r,()=>Xe(e.scenario.problem_and_applicability)),Se(h,"click",e.onClose,!0),t(he,a(Y,{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=()=>J(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(Y,{get each(){return re()},children:z=>(()=>{var O=Ot(),f=O.firstChild;return t(f,()=>z.title),w(y=>{var A=z.url,o=z.title;return A!==y.e&&U(f,"href",y.e=A),o!==y.t&&U(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(G,()=>l.activeStepIndex+1,ue),t(G,()=>S().length,ne),t(G,I,$e),t(G,()=>B().length,null),t(q,a(g,{get when(){return k()},children:i=>(()=>{var s=Ut(),c=s.firstChild;return t(c,()=>i().name),t(s,a(g,{get when(){return i().purpose?.trim()},get children(){var z=At();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=jt(),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=Wt(),s=i.firstChild,c=s.nextSibling;return c.nextSibling,t(i,()=>ge().length,c),i}}),D),t(D,a(g,{get when(){return B().length>0},get fallback(){return Bt()},get children(){return a(Y,{get each(){return B()},children:i=>{const s=le(i),c=Ae(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=Vt(),A=y.firstChild;return y.classList.toggle("is-required",!!c),y.classList.toggle("is-invalid",!!(z||f)),t(A,()=>nt(i),null),t(A,a(g,{when:c,get children(){return Kt()}}),null),t(A,a(g,{get when(){return i.input_type},get children(){var o=Gt();return t(o,()=>i.input_type),o}}),null),t(y,a(g,{get when(){return st(i)},get fallback(){return(()=>{var o=Qt();return o.$$input=x=>V(s,x.currentTarget.value),w(x=>{var He=i.input_type==="int"||i.input_type==="float"?"decimal":void 0,Me=Ue(i);return He!==x.e&&U(o,"inputmode",x.e=He),Me!==x.t&&U(o,"placeholder",x.t=Me),x},{e:void 0,t:void 0}),w(()=>o.value=l.values[s]??""),o})()},get children(){var o=Nt();return o.$$input=x=>V(s,x.currentTarget.value),w(()=>U(o,"placeholder",Ue(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=()=>J(Math.max(0,l.activeStepIndex-1)),u.$$click=()=>J(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(()=>U(i,"title",k()?.result_subfolder)),i}}),null),t(_,a(g,{get when(){return N().length>0},get fallback(){return Xt()},get children(){var i=Dt();return t(i,a(Y,{get each(){return N()},children:s=>(()=>{var c=Yt();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=Ce,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=Z()),$})()}Ve(["click","input"]);function Jt(e,d){return e.replace(/\{\{(\w+)\}\}/g,(l,v)=>d[v]??"")}var ei=n("<div class=os-client-capability-wizard-overlay role=dialog aria-modal=true aria-label=能力向导>"),ti=n("<section class=os-client-capability-wizard-dialog><p>未找到该能力。"),ii=n("<div class=os-client-capability-wizard-scenario-group><span>完整工作流场景"),ai=n("<section class=os-client-capability-wizard-dialog><header class=os-client-capability-wizard-head><div class=os-client-capability-wizard-head-title><h2></h2></div></header><div class=os-client-capability-wizard-columns><aside class=os-client-capability-wizard-column aria-label=你想做什么?><h3>你想做什么?</h3><div class=os-client-capability-wizard-scenarios></div></aside><section class=os-client-capability-wizard-column aria-label=补充信息><h3>补充信息</h3></section><section class=os-client-capability-wizard-column aria-label=起始任务><div class=os-client-capability-wizard-column-head><h3>起始任务</h3><button type=button>重新生成</button></div><textarea class=os-client-capability-wizard-prompt rows=14></textarea></section></div><footer class=os-client-capability-wizard-footer><button type=button data-primary=true>创建任务"),li=n("<section class=os-client-capability-wizard-dialog><p>「<!>」暂无 OneScience 源码或魔搭映射,当前不可使用。"),ri=n("<button type=button><strong></strong><p>"),ni=n("<button type=button><strong></strong><p></p><small> · <!> 步"),Ge=n("<p class=os-client-capability-wizard-empty>请先选择任务场景。"),si=n("<div class=os-client-capability-wizard-required aria-label=该能力需要什么数据><h4>该能力需要什么数据</h4><ul>"),ci=n("<div class=os-client-capability-wizard-middle><div class=os-client-capability-wizard-fields></div><div class=os-client-capability-wizard-summary aria-label=当前能力配置><h4>当前能力配置</h4><dl><div><dt>当前能力</dt><dd></dd></div><div><dt>关键配置</dt><dd></dd></div><div><dt>运行资源</dt><dd></dd></div><div><dt>交付结果</dt><dd>"),oi=n("<textarea rows=3>"),di=n("<label class=os-client-capability-wizard-field><span>"),ui=n("<input type=text>"),pi=n("<li>"),gi=n("<div class=os-client-capability-wizard-right-head><strong></strong><p>"),hi=n("<div class=os-client-capability-wizard-outputs aria-label=预计产出><span>预计产出</span><p>");function bi(e){return e==="hpc"?"软件介绍":"模型介绍"}function vi(e){return`使用 ${e} 开始科研任务`}function $i(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(xe())||Re(document,e.path);if(!d)return!1;const l=je(d);return We(l,e.prompt),qe(l),e.openProject?.(d),e.touchCode?.(d),De({variant:"success",title:`已为你创建「${e.title}」任务`}),e.navigate(Ee(d)),!0}function Je(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 v=Te({path:e.path,recent:e.recent,lastCodeWorkspace:e.lastCodeWorkspace})||Le(xe())||Re(document,e.path);if(!v)return!1;const S=je(v);return ft(S,{title:e.scenario.name,scenarioId:pe(e.scenario),values:e.values,steps:d}),yt("todo"),We(S,St(l,e.values)),qe(S),e.openProject?.(v),e.touchCode?.(v),De({variant:"success",title:`已创建「${e.scenario.name}」`,description:`将按 ${d.length} 步自动依次执行,缺参或失败时暂停`}),e.navigate(Ee(v)),!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=Ye(e.resourceId),l=d?.scenarios.find(k=>k.id===e.scenarioId);if(!d||!l||!Ze(d))return!1;const v=Te({path:e.path,recent:e.recent,lastCodeWorkspace:e.lastCodeWorkspace})||Le(xe())||Re(document,e.path);if(!v)return!1;const S=je(v);return We(S,e.prompt),qe(S),e.openProject?.(v),e.touchCode?.(v),De({variant:"success",title:`已为你创建 ${d.name}「${l.title}」任务`}),e.navigate(Ee(v)),!0}function we(e,d){return Jt(e.promptTemplate,d)}function Ne(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(),v=gt(),S=ht(),k=bt(),B=vt(),R=()=>Ye(e.id??""),ge=()=>kt(d.search),K=()=>Ct(d.search,{category:R()?.category??"onemodel",domain:R()?.domain??"materials"}),oe=()=>zt(e.id??"",ge()),[I,Z]=Qe({scenarioId:"",values:{},prompt:""}),[N,re]=$t(""),V=()=>R()?.scenarios.find(r=>r.id===I.scenarioId),J=L(()=>{const r=R();return r?wt({domain:r.domain,name:r.name,id:r.id,category:r.category}):[]}),Ce=L(()=>{const r=N();if(r)return xt(r)??J().find(h=>pe(h)===r)}),$=()=>({navigate:v,isLoggedIn:!!xe(),path:S.data.path,recent:It(S.data.project),lastCodeWorkspace:B.projects.lastCode(),openProject:r=>k.projects.open(r),touchCode:r=>B.projects.touchCode(r)}),P=()=>{const r=V();r&&Z("prompt",we(r,I.values))};mt(()=>{const r=R();if(!r?.scenarios.length)return;const h=l.scenario,b=(h?r.scenarios.find(Q=>Q.id===h):void 0)??r.scenarios[0],W=Ne(b);Z({scenarioId:b.id,values:W,prompt:we(b,W)})});const de=r=>{const m=R()?.scenarios.find(W=>W.id===r);if(!m)return;re("");const b=Ne(m);Z({scenarioId:m.id,values:b,prompt:we(m,b)})},ee=r=>{re(r)},j=(r,h)=>{const m=V();if(!m)return;const b={...I.values,[r]:h};Z({values:b,prompt:we(m,b)})},C=()=>{const r=R(),h=V();!r||!h||et({resourceId:r.id,scenarioId:h.id,values:{...I.values},prompt:I.prompt,...$()})},te=(r,h)=>{Je({scenario:r,values:h.values,...$()})};return(()=>{var r=ei();return t(r,a(g,{get when(){return R()},get fallback(){return[a(X,{class:"os-client-capability-wizard-backdrop",get href(){return Be()},"aria-label":"关闭向导"}),(()=>{var h=ti();return h.firstChild,t(h,a(X,{get href(){return Be()},children:"返回能力中心"}),null),h})()]},children:h=>a(g,{get when(){return Ze(h())},get fallback(){return[a(X,{class:"os-client-capability-wizard-backdrop",get href(){return K()},"aria-label":"关闭向导"}),(()=>{var m=li(),b=m.firstChild,W=b.firstChild,Q=W.nextSibling;return Q.nextSibling,t(b,()=>h().name,Q),t(m,a(X,{get href(){return K()},children:"返回模型库"}),null),m})()]},get children(){return[a(X,{class:"os-client-capability-wizard-backdrop",get href(){return K()},"aria-label":"关闭向导"}),(()=>{var m=ai(),b=m.firstChild,W=b.firstChild,Q=W.firstChild,he=b.nextSibling,q=he.firstChild,be=q.firstChild,ve=be.nextSibling,G=q.nextSibling;G.firstChild;var ue=G.nextSibling,ne=ue.firstChild,ze=ne.firstChild,$e=ze.nextSibling,D=ne.nextSibling,me=he.nextSibling,ie=me.firstChild;return t(b,a(X,{class:"os-client-capability-wizard-intro-back",get href(){return oe()},get children(){return bi(h().category)}}),W),t(Q,()=>vi(h().name)),t(b,a(X,{class:"os-client-capability-wizard-close",get href(){return K()},"aria-label":"关闭",children:"×"}),null),t(ve,a(Y,{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=!N()&&I.scenarioId===u.id,E=!N()&&I.scenarioId===u.id;return H!==T.e&&p.classList.toggle("is-active",T.e=H),E!==T.t&&U(p,"aria-pressed",T.t=E),T},{e:void 0,t:void 0}),p})()}),null),t(ve,a(g,{get when(){return J().length>0},get children(){var u=ii();return u.firstChild,t(u,a(Y,{get each(){return J()},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,()=>Xe(p.problem_and_applicability)),t(H,()=>p.scenario_id,E),t(H,()=>p.workflow_steps?.length||p.workflow.length,se),w(M=>{var ae=N()===pe(p),ce=N()===pe(p);return ae!==M.e&&_.classList.toggle("is-active",M.e=ae),ce!==M.t&&U(_,"aria-pressed",M.t=ce),M},{e:void 0,t:void 0}),_})()}),null),u}}),null),t(G,a(g,{get when(){return V()},keyed:!0,get fallback(){return Ge()},children:u=>(()=>{var p=ci(),_=p.firstChild,F=_.nextSibling,T=F.firstChild,H=T.nextSibling,E=H.firstChild,se=E.firstChild,M=se.nextSibling,ae=E.nextSibling,ce=ae.firstChild,_e=ce.nextSibling,fe=ae.nextSibling,i=fe.firstChild,s=i.nextSibling,c=fe.nextSibling,z=c.firstChild,O=z.nextSibling;return t(_,a(Y,{get each(){return u.fields},children:f=>(()=>{var y=di(),A=y.firstChild;return t(A,()=>f.label),t(y,a(g,{get when(){return f.multiline},get fallback(){return(()=>{var o=ui();return o.$$input=x=>j(f.id,x.currentTarget.value),w(()=>U(o,"placeholder",f.placeholder)),w(()=>o.value=I.values[f.id]??""),o})()},get children(){var o=oi();return o.$$input=x=>j(f.id,x.currentTarget.value),w(()=>U(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,A=y.nextSibling;return t(A,a(Y,{get each(){return u.requiredData},children:o=>(()=>{var x=pi();return t(x,o),x})()})),f}}),null),p})()}),null),t(ue,a(g,{get when(){return V()},keyed:!0,get fallback(){return Ge()},children:u=>[(()=>{var p=gi(),_=p.firstChild,F=_.nextSibling;return t(_,()=>u.title),t(F,()=>u.summary),p})(),(()=>{var p=hi(),_=p.firstChild,F=_.nextSibling;return t(F,()=>u.expectedOutputs),p})()]}),ne),$e.$$click=P,D.$$input=u=>Z("prompt",u.currentTarget.value),t(me,a(X,{get href(){return K()},children:"返回能力中心"}),ie),ie.$$click=C,w(()=>ie.disabled=!I.prompt.trim()),w(()=>D.value=I.prompt),m})(),a(g,{get when(){return Ce()},children:m=>a(Zt,{get scenario(){return m()},onClose:()=>re(""),onSubmit:b=>te(m(),b)})})]}})})),r})()}Ve(["click","input"]);const yi=Object.freeze(Object.defineProperty({__proto__:null,CapabilityWizardPage:_i,startCapabilityPromptTask:$i,startCapabilityScenarioRunTask:Je,startCapabilityWizardTask:et},Symbol.toStringTag,{value:"Module"}));export{Zt as S,Je as a,et as b,$i as s,yi as w};