@onescience/onecode-web 1.14.50-202609020932 → 1.14.50-202609041106
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/3Dmol-7YMNJqfC.js +1697 -0
- package/assets/account-system-Cw5e9KGB.js +1 -0
- package/assets/{alert-05-Bl8njajc.js → alert-01-CYAeyCMP.js} +1 -1
- package/assets/{alert-01-BOoRj25G.js → alert-02-a2ki0UoQ.js} +1 -1
- package/assets/{alert-02-Bkr1qirU.js → alert-04-CcZgG6bJ.js} +1 -1
- package/assets/{alert-04-Cntc_GD0.js → alert-05-D7-V4rRk.js} +1 -1
- package/assets/alert-06-cxwQaG-M.js +1 -0
- package/assets/alert-07-Co7x1ur1.js +1 -0
- package/assets/alert-08-CF8mI3pz.js +1 -0
- package/assets/alert-10-DELx7y93.js +1 -0
- package/assets/{bip-bop-03-uhYGDH17.js → bip-bop-03-CQtp5UBI.js} +1 -1
- package/assets/{bip-bop-04-Bh4cNFTB.js → bip-bop-04-B5JxsVo8.js} +1 -1
- package/assets/{bip-bop-06-Cw-vGoPK.js → bip-bop-06-CM-arrml.js} +1 -1
- package/assets/{bip-bop-08-CmxH5qOK.js → bip-bop-08-CZmdmAH8.js} +1 -1
- package/assets/bip-bop-09-DG1FB07M.js +1 -0
- package/assets/center-B41zMqFC.js +4 -0
- package/assets/dialog-edit-project-DHNm7Ey_.js +1 -0
- package/assets/dialog-fork-CI25AsCv.js +1 -0
- package/assets/dialog-project-upload-CkgODEoQ.js +2 -0
- package/assets/dialog-select-file-CExSniO7.js +1 -0
- package/assets/dialog-select-model-DA1fqH_v.js +2 -0
- package/assets/dialog-terminal-unavailable-BJfv1EHP.js +3 -0
- package/assets/docs-wIg32xY_.js +1 -0
- package/assets/ghostty-web-v5wxn2ZG.js +13 -0
- package/assets/home-8jUqij3D.js +1 -0
- package/assets/index-DSFO1zPs.js +2774 -0
- package/assets/index-DgFAbOBA.css +1 -0
- package/assets/intro-f3CyX3LG.js +1 -0
- package/assets/{nope-02-BejrPVJn.js → nope-02-Dud-xmOl.js} +1 -1
- package/assets/{nope-05-B6HACZcF.js → nope-05-CRb47w2t.js} +1 -1
- package/assets/{nope-08-CUZdkhuT.js → nope-08-C6-KHO6r.js} +1 -1
- package/assets/{nope-11-HqRoevb2.js → nope-11-CLbBShpj.js} +1 -1
- package/assets/nope-12-DKbH8IN1.js +1 -0
- package/assets/onescience-DnetzwjT.js +82 -0
- package/assets/{resources-CMhdiU1T.js → resources-vDDc_MJX.js} +2 -2
- package/assets/selection-BwmaAH41.js +1 -0
- package/assets/shell-Cbn2njzj.js +2 -0
- package/assets/skills-DYlf3B0U.js +1 -0
- package/assets/{staplebops-03-BFNSaaN1.js → staplebops-03-D24uBgZq.js} +1 -1
- package/assets/{staplebops-04-C1lCJhbW.js → staplebops-04-uT3rFS3Z.js} +1 -1
- package/assets/{staplebops-06-Cj3ptVIB.js → staplebops-06-CKdUVJT0.js} +1 -1
- package/assets/{staplebops-07-BbrHCuYa.js → staplebops-07-DLe3dmB5.js} +1 -1
- package/assets/status-popover-body-D7ovCoeA.js +2 -0
- package/assets/wizard-1E0A0kso.js +1 -0
- package/assets/{yup-01-CZlscUiz.js → yup-01-CXyCbhDP.js} +1 -1
- package/assets/{yup-03-_cQ6zYSx.js → yup-03-DlREv1-t.js} +1 -1
- package/assets/{yup-04-Dy9AqZzo.js → yup-04-Dy8s-aaY.js} +1 -1
- package/assets/{yup-05-WrE2LRAl.js → yup-05-DzUfJrew.js} +1 -1
- package/assets/{zh-Dqvial9G.js → zh-hGVdj13G.js} +1 -1
- package/index.html +11 -11
- package/package.json +2 -2
- package/assets/account-system-CdLg3pKW.js +0 -1
- package/assets/alert-06-DKcTO8SC.js +0 -1
- package/assets/alert-07-DuaaPhy4.js +0 -1
- package/assets/alert-08-Db7RcnOO.js +0 -1
- package/assets/alert-10-CWJZrK2o.js +0 -1
- package/assets/bip-bop-09-Tl9LULYQ.js +0 -1
- package/assets/catalog-Cz3JtNfO.js +0 -273
- package/assets/center-DbXC0qGn.js +0 -1
- package/assets/dialog-edit-project-DK9kgMU9.js +0 -1
- package/assets/dialog-fork-BQprfhHP.js +0 -1
- package/assets/dialog-project-upload-bq54ULi_.js +0 -2
- package/assets/dialog-select-file-BIwldBl-.js +0 -1
- package/assets/dialog-select-model-PdGraPN8.js +0 -2
- package/assets/dialog-terminal-unavailable-DjjbI2FV.js +0 -3
- package/assets/docs-CGjz1sDz.js +0 -1
- package/assets/ghostty-web-CW4JZJ_z.js +0 -13
- package/assets/home-AeX4sJBp.js +0 -1
- package/assets/index-BA1jwG_A.js +0 -2494
- package/assets/index-Bpc6ia3z.css +0 -1
- package/assets/intro-CaWNHH2V.js +0 -1
- package/assets/nope-12-CjOQ8jCx.js +0 -1
- package/assets/onescience-BpKf7M0Q.js +0 -82
- package/assets/onescience-skill-detail-dialog-CPXWVuLj.js +0 -1
- package/assets/shell-BH0laPPE.js +0 -2
- package/assets/skills-Dsu1SSpr.js +0 -1
- package/assets/status-popover-body-DIJtSAoV.js +0 -2
- package/assets/wizard-BsJBhDp_.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{be as q,a0 as ce,bb as oe,a2 as G,af as de,l as ue,p as ge,n as pe,b9 as F,bl as he,d as ye,E as J,D as Z,H as ee,J as te,c as H,v as X,ac as ae,r as ve,Q as be,i as a,b as r,m as V,S as f,F as O,f as W,s as M,ch as Ie,X as Se,t as c,bf as we,bg as B,e as Le,a5 as De,ci as xe,G as Ee,aW as Pe,a as Oe,ca as je,cj as Re,A as ie,ck as We}from"./index-BA1jwG_A.js";import{g as le,c as z}from"./catalog-Cz3JtNfO.js";import{S as He,s as Me}from"./onescience-skill-detail-dialog-CPXWVuLj.js";import{startCapabilityWizardTask as Fe}from"./wizard-BsJBhDp_.js";function Ue(e){const t=le(e);if(!t)throw new Error(`Unknown capability resource: ${e}`);return{banner:t.install.banner,prompt:t.install.prompt}}function me(e){if(!q({navigate:e.navigate,action:{type:"install",resourceId:e.resourceId},isLoggedIn:e.isLoggedIn})||!le(e.resourceId))return!1;const{banner:i,prompt:s}=Ue(e.resourceId),n=ce({path:e.path,recent:e.recent,lastCodeWorkspace:e.lastCodeWorkspace})||oe(G())||de(document,e.path);if(!n)return!1;const g=ue(n);return ge(g,s),pe(g),e.openProject?.(n),e.touchCode?.(n),F({variant:"success",title:i}),e.navigate(he(n)),!0}var Ae=c('<article class="os-client-capability-card os-client-capability-skill-card"><div class=os-client-capability-skill-card-head><h4></h4></div><p></p><div class=os-client-capability-meta><span class=os-client-capability-skill-provider></span></div><div class=os-client-capability-actions><button type=button>详情</button><button type=button data-primary=true>开发'),$e=c("<span>"),Ge=c("<div>"),Te=c("<button type=button class=os-client-capability-oneskills-expand>"),Ve=c("<section class=os-client-capability-oneskills-section><header class=os-client-capability-oneskills-section-head><div class=os-client-capability-oneskills-section-title><h3></h3></div><p>"),ze=c("<p class=os-client-capability-empty>当前分类暂无技能卡片。"),Ne=c("<span class=os-client-capability-oneskills-count> 个技能"),Qe=c("<p class=os-client-capability-oneskills-error>"),Be=c("<div class=os-client-capability-oneskills-top-row>"),Ke=c("<div class=os-client-capability-oneskills-overview>"),qe=c('<section class="os-client-capability-resource-panel os-client-capability-oneskills-panel"><header class=os-client-capability-oneskills-toolbar><div class=os-client-capability-oneskills-toolbar-copy><p>按 OneSkills 分层浏览官方技能,查看详情或进入开发。</p></div><div class=os-client-capability-oneskills-actions><span class=inline-flex><button type=button class=os-client-capability-oneskills-upgrade>'),Xe=c("<p class=os-client-capability-empty>正在加载 OneSkills 技能..."),Ye=c("<p class=os-client-capability-empty>暂无可展示的 OneSkills 技能,请先安装或更新技能。");const re=4,Y=new Set(["orchestrator","resource"]);function Je(e,t){return e.layer===t.title||e.tags.includes(t.title)||e.tags.includes(t.id)}function Ze(e){return ce(e)||Ie(G(),e.lastCodeWorkspace)||oe(G())||de(document,e.path)}function et(e){const t=()=>e.item.tags.filter(i=>i!==e.item.layer&&i!==e.item.provider).slice(0,3);return(()=>{var i=Ae(),s=i.firstChild,n=s.firstChild,g=s.nextSibling,h=g.nextSibling,S=h.firstChild,b=h.nextSibling,m=b.firstChild,w=m.nextSibling;return Le(i,"click",e.onOpen,!0),a(n,()=>e.item.title),a(g,()=>e.item.copy),a(S,()=>e.item.provider),a(h,r(O,{get each(){return t()},children:d=>(()=>{var o=$e();return a(o,d),o})()}),null),m.$$click=d=>{d.stopPropagation(),e.onOpen()},w.$$click=d=>{d.stopPropagation(),e.onDevelop()},W(d=>{var o=e.layerId,l=e.canDevelop?void 0:"登录后使用";return o!==d.e&&M(i,"data-layer",d.e=o),l!==d.t&&M(w,"title",d.t=l),d},{e:void 0,t:void 0}),i})()}function ne(e){const[t,i]=H(!1),s=()=>e.items.length,n=()=>Math.max(0,s()-re),g=()=>t()||n()===0?e.items:e.items.slice(0,re),h=()=>Y.has(e.group.id);return(()=>{var S=Ve(),b=S.firstChild,m=b.firstChild,w=m.firstChild,d=m.nextSibling;return a(w,()=>e.group.title),a(m,r(f,{get when(){return s()>0},get children(){var o=$e();return a(o,s),o}}),null),a(d,()=>e.group.copy),a(S,r(f,{get when(){return s()>0},get fallback(){return ze()},get children(){return[(()=>{var o=Ge();return a(o,r(O,{get each(){return g()},children:l=>r(et,{item:l,get layerId(){return e.group.id},get canDevelop(){return e.canDevelop},onOpen:()=>e.onOpen(l),onDevelop:()=>e.onDevelop(l)})})),W(l=>{var _=!h(),u=!!h();return _!==l.e&&o.classList.toggle("os-client-capability-page-grid",l.e=_),u!==l.t&&o.classList.toggle("os-client-capability-oneskills-compact-grid",l.t=u),l},{e:void 0,t:void 0}),o})(),r(f,{get when(){return V(()=>!h())()&&n()>0},get children(){var o=Te();return o.$$click=()=>i(l=>!l),a(o,(()=>{var l=V(()=>!!t());return()=>l()?"收起":`展开其余 ${n()} 个`})()),W(()=>M(o,"aria-expanded",t())),o}})]}}),null),W(o=>{var l=e.group.id,_=!!e.compact,u=e.group.id;return l!==o.e&&M(S,"id",o.e=l),_!==o.t&&S.classList.toggle("is-compact",o.t=_),u!==o.a&&M(S,"data-layer",o.a=u),o},{e:void 0,t:void 0,a:void 0}),S})()}function tt(){const e=J(),t=Z(),i=ee(),s=te(),[n,g]=H([]),[h,S]=H(!1),[b,m]=H(!1),[w,d]=H(),[o,l]=H(!1),[_,u]=H(),I=X(()=>!!G()?.account.id),x=X(()=>Ze({path:i.data.path,recent:ae(i.data.project),lastCodeWorkspace:t.projects.lastCode()})),p=async()=>{const y=t.current;if(!y){g([]),S(!0);return}const k=await Se(y.http.url,{limit:100});g(k.loaded?k.items:[]),S(!0)};ve(()=>{e(be("oneskills"),{replace:!0}),p()});const $=y=>n().filter(k=>Je(k,y)),j=()=>De.filter(y=>$(y).length>0),L=()=>{const y=j();return{pair:y.filter(k=>Y.has(k.id)),rest:y.filter(k=>!Y.has(k.id))}},D=y=>{u(y),l(!0)},E=()=>{l(!1),u(void 0)},U=y=>{if(!q({navigate:e,action:{type:"prompt",prompt:""},isLoggedIn:I()}))return;const k=x();if(!k){F({variant:"error",title:"无法开发",description:"未检测到工作目录"});return}const v=Me({id:y.id,title:y.title,copy:y.copy,layer:y.layer,tags:y.tags,provider:y.provider}),P=ue(k);ge(P,v.prompt,{skill:v.skill}),pe(P),s.projects.open(k),t.projects.touchCode(k),l(!1),u(void 0),F({variant:"success",title:`已为你创建「${y.title}」开发任务`}),e(he(k))},Ce=async()=>{if(!q({navigate:e,action:{type:"install",resourceId:"oneskills"},isLoggedIn:I()}))return;const y=t.current,k=x();if(!y){const v=B();d(v),F({variant:"error",title:"更新失败",description:v});return}if(!k){const v=B();d(v),F({variant:"error",title:"更新失败",description:v});return}m(!0),d(void 0);try{const v=await we(y.http.url,k);await p();const P=v.version?`版本 ${v.version} · ${v.skillCount} 个技能`:`${v.skillCount} 个技能`,A=v.seedSource==="bundled"&&v.seedFallbackReason?"原语已回退内置 seed":v.seedSource==="disk"?"原语已同步磁盘 oneskills":void 0;F({variant:"success",title:"OneSkills 已更新",description:A?`${P} · ${A}`:P})}catch(v){const P=B(v instanceof Error?v.message:"更新 OneSkills 失败");d(P),F({variant:"error",title:"更新失败",description:P})}finally{m(!1)}};return(()=>{var y=qe(),k=y.firstChild,v=k.firstChild;v.firstChild;var P=v.nextSibling,A=P.firstChild,Q=A.firstChild;return a(v,r(f,{get when(){return V(()=>!!h())()&&n().length>0},get children(){var C=Ne(),R=C.firstChild;return a(C,()=>n().length,R),C}}),null),a(P,r(f,{get when(){return w()},get children(){var C=Qe();return a(C,w),C}}),A),Q.$$click=()=>void Ce(),a(Q,()=>b()?"更新中...":"更新 OneSkills"),a(y,r(f,{get when(){return h()},get fallback(){return Xe()},get children(){return r(f,{get when(){return n().length>0},get fallback(){return Ye()},get children(){var C=Ke();return a(C,r(f,{get when(){return L().pair.length>0},get children(){var R=Be();return a(R,r(O,{get each(){return L().pair},children:T=>r(ne,{group:T,get items(){return $(T)},compact:!0,get canDevelop(){return I()},onOpen:D,onDevelop:U})})),R}}),null),a(C,r(O,{get each(){return L().rest},children:R=>r(ne,{group:R,get items(){return $(R)},get canDevelop(){return I()},onOpen:D,onDevelop:U})}),null),C}})}}),null),a(y,r(He,{variant:"workbench",get item(){return _()},get open(){return o()},get serverUrl(){return t.current?.http.url},onClose:E,onDevelop:()=>{const C=_();C&&(E(),U(C))}}),null),W(C=>{var R=I()?void 0:"登录后使用",T=b();return R!==C.e&&M(A,"title",C.e=R),T!==C.t&&(Q.disabled=C.t=T),C},{e:void 0,t:void 0}),y})()}ye(["click"]);function at(e){const t=new URLSearchParams(e).get("category");if(t==="onemodel"||t==="hpc"||t==="onedata"||t==="oneskills")return t}function lt(e){const t=new URLSearchParams(e).get("domain");if(t==="materials"||t==="weather"||t==="fluid"||t==="bio")return t;if(t==="all")return"all"}function se(e,t){const i=at(t),s=lt(t);if(i)return{categoryId:i,domainId:s??(i==="onemodel"||i==="hpc"?"all":"materials")};const n=new RegExp(`^${xe.capabilities}/([^/]+)`).exec(e),g=n?.[1]?le(n[1]):void 0;return g?{categoryId:g.category,domainId:g.domain}:{categoryId:"onemodel",domainId:"materials"}}var it=c("<span>当前范围:"),rt=c("<strong>全领域"),nt=c("<small>"),st=c("<div class=os-client-capability-domain-row role=tablist aria-label=能力中心领域>"),ct=c("<div class=os-client-capability-page><section class=os-client-capability-selector aria-label=能力中心筛选><div class=os-client-capability-current-domain></div><div class=os-client-capability-tabs role=tablist aria-label=能力中心产品能力></div></section><div class=os-client-capability-page-body>"),ot=c("<span>当前领域:"),dt=c("<strong>"),ut=c("<small>切换领域后,下方模型、HPC 软件内容同步刷新"),gt=c("<button type=button>"),pt=c("<button type=button><strong></strong><small>"),ht=c("<button type=button>安装"),yt=c('<section class=os-client-capability-resource-panel><header class="os-client-capability-page-section-head os-client-capability-page-section-head-active"><p></p></header><p class=os-client-capability-empty>onedata 卡片即将上线,敬请期待。'),vt=c("<label class=os-client-capability-catalog-search><span>搜索</span><input type=search placeholder=按名称、简介或标签筛选>"),bt=c("<div class=os-client-capability-catalog-toolbar><div class=os-client-capability-catalog-toolbar-side><span class=os-client-capability-catalog-count></span><div class=os-client-capability-view-switch role=tablist aria-label=模型展示方式>"),mt=c('<section class=os-client-capability-resource-panel><header class="os-client-capability-page-section-head os-client-capability-page-section-head-active"><p>'),$t=c("<p class=os-client-capability-empty>当前「<!>」领域暂无<!>卡片。"),ft=c("<button type=button role=tab>"),_t=c("<p class=os-client-capability-empty>没有匹配的模型,试试换个关键词。"),kt=c("<div class=os-client-capability-catalog role=list>"),Ct=c("<article class=os-client-capability-catalog-row role=listitem>"),It=c("<div class=os-client-capability-page-grid>"),St=c("<div class=os-client-capability-meta>"),wt=c("<article class=os-client-capability-card><div class=os-client-capability-card-body><div class=os-client-capability-card-head><h4></h4></div><p>"),fe=c("<span>"),Lt=c("<div class=os-client-capability-catalog-copy><h4></h4><p>"),Dt=c("<div class=os-client-capability-catalog-tags>"),xt=c("<div>");const K=[{id:"all",label:"全部"},{id:"materials",label:"材料"},{id:"weather",label:"气象"},{id:"fluid",label:"流体"},{id:"bio",label:"生信"}],N=new Set(["oneskills"]),Et=new Set(["onedata"]),Pt=[{id:"cards",label:"卡片"},{id:"list",label:"列表"}],_e="os-capability-view-mode";function Qt(e){const t=Ee(),i=J(),s=se(t.pathname,t.search),[n,g]=Pe({domainId:s.domainId,categoryId:s.categoryId}),h=()=>n.domainId==="all"?z():z(n.domainId),S=()=>h().find(l=>l.id===n.categoryId)??h()[0],b=()=>K.find(l=>l.id===n.domainId)??K[0],m=ee(),w=te(),d=Z(),o=l=>{i(be(l.categoryId,N.has(l.categoryId)?void 0:l.domainId),{replace:!0})};return Oe(()=>{const l=se(t.pathname,t.search);g({domainId:l.domainId,categoryId:l.categoryId})}),ve(()=>{const l=je();if(!l)return;const _={navigate:i,isLoggedIn:!!G(),path:m.data.path,recent:ae(m.data.project),lastCodeWorkspace:d.projects.lastCode(),openProject:u=>w.projects.open(u),touchCode:u=>d.projects.touchCode(u)};try{if(l.type==="install"){if(l.resourceId==="oneskills"){g("categoryId","oneskills"),o({domainId:n.domainId,categoryId:"oneskills"});return}if(l.resourceId.startsWith("__"))return;me({resourceId:l.resourceId,..._});return}l.type==="wizard"&&Fe({resourceId:l.resourceId,scenarioId:l.scenarioId,values:l.values,prompt:l.prompt,..._})}catch{}}),(()=>{var l=ct(),_=l.firstChild,u=_.firstChild,I=u.nextSibling,x=_.nextSibling;return a(u,r(f,{get when(){return N.has(n.categoryId)},get fallback(){return[ot(),(()=>{var p=dt();return a(p,()=>b().label),p})(),ut()]},get children(){return[it(),rt(),(()=>{var p=nt();return a(p,()=>Ot(n.categoryId)),p})()]}})),a(_,r(f,{get when(){return!N.has(n.categoryId)},get children(){var p=st();return a(p,r(O,{each:K,children:$=>(()=>{var j=gt();return j.$$click=()=>{const L=$.id==="all"?z():z($.id),D=N.has(n.categoryId)?n.categoryId:L.find(E=>E.id===n.categoryId&&E.items.length>0)?.id??L.find(E=>E.items.length>0)?.id??"onemodel";g({domainId:$.id,categoryId:D}),o({domainId:$.id,categoryId:D})},a(j,()=>$.label),W(L=>{var D=$.id===n.domainId,E=$.id===n.domainId;return D!==L.e&&j.classList.toggle("is-active",L.e=D),E!==L.t&&M(j,"aria-pressed",L.t=E),L},{e:void 0,t:void 0}),j})()})),p}}),I),a(I,r(O,{get each(){return h()},children:p=>(()=>{var $=pt(),j=$.firstChild,L=j.nextSibling;return $.$$click=()=>{g("categoryId",p.id),o({domainId:n.domainId,categoryId:p.id})},a(j,()=>p.label),a(L,()=>p.title),W(D=>{var E=n.categoryId===p.id,U=n.categoryId===p.id;return E!==D.e&&$.classList.toggle("is-active",D.e=E),U!==D.t&&M($,"aria-pressed",D.t=U),D},{e:void 0,t:void 0}),$})()})),a(x,r(f,{get when(){return S()},children:p=>r(f,{get when(){return p().id==="oneskills"},get fallback(){return r(f,{get when(){return!Et.has(p().id)},get fallback(){return r(Rt,{get category(){return p()}})},get children(){return r(Wt,{get category(){return p()},get domainLabel(){return b().label}})}})},get children(){return r(tt,{})}})})),a(l,()=>e.children,null),l})()}function Ot(e){return e==="oneskills"?"OneSkills 原语跨领域通用,不区分材料 / 气象 / 流体 / 生信":"基础设施能力跨领域通用,不随领域切换而变化"}function jt(e){const t=J(),i=ee(),s=te(),n=Z();return(()=>{var g=ht();return g.$$click=()=>me({resourceId:e.resourceId,navigate:t,isLoggedIn:!!G(),path:i.data.path,recent:ae(i.data.project),lastCodeWorkspace:n.projects.lastCode(),openProject:h=>s.projects.open(h),touchCode:h=>n.projects.touchCode(h)}),g})()}function Rt(e){return(()=>{var t=yt(),i=t.firstChild,s=i.firstChild;return a(s,()=>e.category.copy.replace(/[。.]$/,"")),t})()}function Wt(e){const[t,i]=H(""),[s,n]=H(At()),g=()=>t().trim().toLowerCase(),h=X(()=>{const b=g();return b?e.category.items.filter(m=>[m.name,m.blurb,...m.tags].some(w=>w.toLowerCase().includes(b))):e.category.items}),S=b=>{n(b),Gt(b)};return(()=>{var b=mt(),m=b.firstChild,w=m.firstChild;return a(w,()=>e.category.copy.replace(/[。.]$/,"")),a(b,r(f,{get when(){return e.category.items.length>0},get fallback(){return(()=>{var d=$t(),o=d.firstChild,l=o.nextSibling,_=l.nextSibling,u=_.nextSibling;return u.nextSibling,a(d,()=>e.domainLabel,l),a(d,(()=>{var I=V(()=>e.category.id==="hpc");return()=>I()?" HPC 软件":e.category.id==="onemodel"?"模型":""})(),u),d})()},get children(){return[(()=>{var d=bt(),o=d.firstChild,l=o.firstChild,_=l.nextSibling;return a(d,r(f,{get when(){return e.category.items.length>=6},get children(){var u=vt(),I=u.firstChild,x=I.nextSibling;return x.$$input=p=>i(p.currentTarget.value),W(()=>x.value=t()),u}}),o),a(l,(()=>{var u=V(()=>h().length===e.category.items.length);return()=>u()?`共 ${e.category.items.length} 项`:`${h().length} / ${e.category.items.length} 项`})()),a(_,r(O,{each:Pt,children:u=>(()=>{var I=ft();return I.$$click=()=>S(u.id),a(I,()=>u.label),W(x=>{var p=s()===u.id,$=s()===u.id;return p!==x.e&&M(I,"aria-selected",x.e=p),$!==x.t&&I.classList.toggle("is-active",x.t=$),x},{e:void 0,t:void 0}),I})()})),d})(),r(f,{get when(){return h().length>0},get fallback(){return _t()},get children(){return[r(f,{get when(){return s()==="list"},get children(){return r(Ht,{get items(){return h()}})}}),r(f,{get when(){return s()==="cards"},get children(){return r(Mt,{get items(){return h()}})}})]}})]}}),null),b})()}function Ht(e){return(()=>{var t=kt();return a(t,r(O,{get each(){return e.items},children:i=>(()=>{var s=Ct();return a(s,r(Ft,{item:i}),null),a(s,r(ke,{item:i}),null),s})()})),t})()}function Mt(e){return(()=>{var t=It();return a(t,r(O,{get each(){return e.items},children:i=>(()=>{var s=wt(),n=s.firstChild,g=n.firstChild,h=g.firstChild,S=g.nextSibling;return a(h,()=>i.name),a(g,r(f,{get when(){return i.tags.length>0},get children(){var b=St();return a(b,r(O,{get each(){return i.tags},children:m=>(()=>{var w=fe();return a(w,m),w})()})),b}}),null),a(S,()=>i.blurb),a(s,r(ke,{item:i,variant:"card"}),null),s})()})),t})()}function Ft(e){return(()=>{var t=Lt(),i=t.firstChild,s=i.nextSibling;return a(i,()=>e.item.name),a(s,()=>e.item.blurb),a(t,r(f,{get when(){return e.item.tags.length>0},get children(){return r(Ut,{get item(){return e.item}})}}),null),t})()}function Ut(e){return(()=>{var t=Dt();return a(t,r(O,{get each(){return e.item.tags},children:i=>(()=>{var s=fe();return a(s,i),s})()})),t})()}function ke(e){return(()=>{var t=xt();return a(t,r(ie,{get href(){return Re(e.item.id)},children:"详情"}),null),a(t,r(jt,{get resourceId(){return e.item.id}}),null),a(t,r(ie,{get href(){return We(e.item.id)},"data-primary":"true",children:"使用"}),null),W(i=>{var s=e.variant!=="card",n=e.variant==="card";return s!==i.e&&t.classList.toggle("os-client-capability-catalog-actions",i.e=s),n!==i.t&&t.classList.toggle("os-client-capability-actions",i.t=n),i},{e:void 0,t:void 0}),t})()}function At(){if(typeof localStorage>"u")return"cards";const e=localStorage.getItem(_e);return e==="cards"||e==="list"?e:"cards"}function Gt(e){typeof localStorage>"u"||localStorage.setItem(_e,e)}ye(["click","input"]);export{Qt as CapabilityCenterPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{L as S,K as w,H as D,br as $,v as o,cL as k,aW as C,cu as _,b as c,i as l,cx as L,bI as j,m as P,bJ as F,t as K}from"./index-BA1jwG_A.js";var M=K('<form class="os-client-project-create-form flex flex-col gap-5 p-5 pt-4"><div class="flex flex-col gap-3"><p class="os-client-project-create-path text-12-regular text-text-weak"></p></div><div class="flex justify-end gap-2">');function E(e){const i=S(),f=w(),b=D(),a=$(),s=o(()=>k(e.project.worktree)),u=o(()=>e.project.name||s()),x=o(()=>`${e.project.worktree.replace(/\\/g,"/").replace(/\/+$/,"")}/`),[m,h]=C({name:u()}),d=o(()=>{const t=m.name.trim();return t?t!==u():!1}),r=_(()=>({mutationFn:async()=>{const t=m.name.trim(),n=t===s()?"":t;if(e.project.id&&e.project.id!=="global"){await f.client.project.update({projectID:e.project.id,directory:e.project.worktree,name:n,icon:{color:e.project.icon?.color||"",override:e.project.icon?.override||""},commands:{start:e.project.commands?.start??""}}),i.close();return}b.project.meta(e.project.worktree,{name:n,icon:e.project.icon,commands:e.project.commands}),i.close()}}));function v(t){t.preventDefault(),!(r.isPending||!d())&&r.mutate()}return c(F,{get title(){return a.t("dialog.project.rename.title")},class:"os-client-project-create w-full max-w-[480px] mx-auto",get children(){var t=M(),n=t.firstChild,g=n.firstChild,p=n.nextSibling;return t.addEventListener("submit",v),l(n,c(L,{autofocus:!0,type:"text",get label(){return a.t("dialog.project.rename.name")},get placeholder(){return s()},get value(){return m.name},onChange:y=>h("name",y)}),g),l(g,()=>a.t("dialog.project.rename.path",{path:x()})),l(p,c(j,{type:"button",variant:"ghost",size:"large",onClick:()=>i.close(),get children(){return a.t("common.cancel")}}),null),l(p,c(j,{type:"submit",variant:"primary",size:"large",get disabled(){return r.isPending||!d()},get children(){return P(()=>!!r.isPending)()?a.t("common.saving"):a.t("common.confirm")}}),null),t}})}export{E as DialogEditProject};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d8 as b,G as D,E as S,d9 as k,bR as P,da as _,L as w,br as F,v as L,b as m,cv as $,i as u,bJ as E,db as I,l as T,b9 as g,d1 as q,t as C}from"./index-BA1jwG_A.js";var K=C('<div class="w-full flex items-center gap-2"><span class="truncate flex-1 min-w-0 text-left font-normal"></span><span class="text-text-weak shrink-0 font-normal">');function M(i){return i.toLocaleTimeString(void 0,{timeStyle:"short"})}const R=()=>{const i=b(),p=D(),f=S(),c=k(),l=P(),h=_(),x=w(),n=F(),y=L(()=>{const t=i.id;if(!t)return[];const a=c.data.message[t]??[],o=[];for(const s of a){if(s.role!=="user")continue;const e=(c.data.part[s.id]??[]).find(r=>r.type==="text"&&!r.synthetic&&!r.ignored);e&&o.push({id:s.id,text:e.text.replace(/\n/g," ").slice(0,200),time:M(new Date(s.time.created))})}return o.reverse()}),v=t=>{if(!t)return;const a=i.id;if(!a)return;const o=c.data.part[t.id]??[],s=I(o,{directory:l.directory,attachmentName:n.t("common.attachment")}),d=T(l.directory);l.client.session.fork({sessionID:a,messageID:t.id}).then(e=>{if(!e.data){g({title:n.t("common.requestFailed")});return}x.close(),h.set(s,void 0,{dir:d,id:e.data.id}),f(q(p.pathname,d,e.data.id))}).catch(e=>{const r=e instanceof Error?e.message:String(e);g({title:n.t("common.requestFailed"),description:r})})};return m(E,{get title(){return n.t("command.session.fork")},get children(){return m($,{class:"flex-1 min-h-0 [&_[data-slot=list-scroll]]:flex-1 [&_[data-slot=list-scroll]]:min-h-0",get search(){return{placeholder:n.t("common.search.placeholder"),autofocus:!0}},get emptyMessage(){return n.t("dialog.fork.empty")},key:t=>t.id,items:y,filterKeys:["text"],onSelect:v,children:t=>(()=>{var a=K(),o=a.firstChild,s=o.nextSibling;return u(o,()=>t.text),u(s,()=>t.time),a})()})}})};export{R as DialogFork};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{L as oe,br as se,D as ce,H as de,c as g,v as x,cN as ue,cO as ge,cP as pe,a as fe,cQ as he,b as n,i as t,bI as k,w as G,S as p,m as J,cR as L,cS as Q,F as xe,cT as me,bJ as ve,t as f,cU as be,cV as we,b9 as ye}from"./index-BA1jwG_A.js";var _e=f('<p class="text-12-regular text-icon-warning-base">'),U=f('<p class="text-12-regular text-text-weak">'),$e=f('<ul class="max-h-36 overflow-auto text-12-regular text-text-weak font-mono">'),Se=f('<div class="flex flex-col gap-2 rounded-md border border-border-weak-base bg-background-weak px-3 py-3"><p class="text-13-medium text-text-strong">'),ke=f("<p class=text-text-critical-base>"),je=f('<p class="text-12-regular text-text-critical-base whitespace-pre-wrap">'),Ee=f('<div class="flex flex-col gap-5 p-6 pt-0"><div class="flex flex-col gap-2"><p class="text-12-regular text-text-weak"></p><p class="text-13-medium text-text-strong break-all font-mono">/</p><p class="text-12-regular text-text-weak"></p></div><div class="flex flex-wrap gap-2"><input type=file class=hidden multiple><input type=file class=hidden multiple></div><div class="flex flex-col gap-1 text-12-regular text-text-weak"><p></p></div><div class="flex justify-end gap-2">'),Ce=f("<li class=truncate>");function Ue(w){const F=oe(),r=se(),T=ce(),X=de(),[s,q]=g([]),[K,Y]=g(!1),[D,Z]=g(!1),[I,P]=g(),[ee,j]=g(!0),[h,B]=g(!1),[z,R]=g({done:0,total:0,written:0,skipped:0,failed:0}),[A,$]=g("");let H,O;const te=x(()=>{const l=X.data.path.home,a=w.directory;return l&&a.startsWith(l)?`~${a.slice(l.length)}`:a}),E=x(()=>ue(s())),S=x(()=>ge(s())),M=x(()=>{const l=I();return l===void 0?!1:E()>l}),N=x(()=>s().length>0&&!h()&&!M()),C=x(()=>s().slice(0,pe)),re=x(()=>s().length>0&&!S());fe(()=>{const l=w.directory,a=T.current?.http;if(!l||!a){j(!1);return}let i=!1;return j(!0),he(a.url,l).then(c=>{i||P(c.availableBytes)}).catch(()=>{i||P(void 0)}).finally(()=>{i||j(!1)}),()=>{i=!0}});const V=l=>{if(!l?.length)return;$("");const a=be(l);q(a.entries),Y(a.truncated),a.truncated&&$(r.t("dialog.project.upload.tooManyFiles",{max:String(Q),selected:String(a.totalSelected)}))},le=async()=>{const l=T.current?.http;if(!l||!N())return;const a=s();B(!0),$(""),R({done:0,total:a.length,written:0,skipped:0,failed:0});let i=0,c=0,m=0;const y=[];for(let d=0;d<a.length;d+=1){const u=a[d];try{(await we(l.url,w.directory,{path:u.path,file:u.file,overwrite:D()})).status==="written"?i+=1:c+=1}catch(v){m+=1;const b=v instanceof Error?v.message:r.t("dialog.project.upload.failed");y.length<3&&y.push(`${u.path}: ${b}`)}R({done:d+1,total:a.length,written:i,skipped:c,failed:m})}if(B(!1),m===0){ye({title:r.t("toast.project.upload.success",{written:String(i),skipped:String(c)})}),w.onUploaded?.(),F.close();return}$([r.t("dialog.project.upload.partialFailed",{written:String(i),skipped:String(c),failed:String(m)}),...y].join(`
|
|
2
|
-
`)),(i>0||c>0)&&w.onUploaded?.()};return n(ve,{get title(){return r.t("command.project.upload")},class:"w-full max-w-[520px] mx-auto",get children(){var l=Ee(),a=l.firstChild,i=a.firstChild,c=i.nextSibling,m=c.firstChild,y=c.nextSibling,d=a.nextSibling,u=d.firstChild,v=u.nextSibling,b=d.nextSibling,ae=b.firstChild,_=b.nextSibling;return t(i,()=>r.t("dialog.project.upload.destinationLabel")),t(c,te,m),t(y,()=>r.t("dialog.project.upload.destinationHint")),t(d,n(k,{type:"button",variant:"secondary",size:"large",get disabled(){return h()},onClick:()=>H?.click(),get children(){return r.t("dialog.project.upload.pickFiles")}}),u),t(d,n(k,{type:"button",variant:"secondary",size:"large",get disabled(){return h()},onClick:()=>O?.click(),get children(){return r.t("dialog.project.upload.pickFolder")}}),u),u.addEventListener("change",e=>{V(e.currentTarget.files),e.currentTarget.value=""}),G(e=>{H=e},u),v.addEventListener("change",e=>{V(e.currentTarget.files),e.currentTarget.value=""}),G(e=>{O=e,e&&e.setAttribute("webkitdirectory","")},v),t(l,n(p,{get when(){return s().length>0},get children(){var e=Se(),ne=e.firstChild;return t(ne,(()=>{var o=J(()=>!!S());return()=>o()?r.t("dialog.project.upload.folderSummary",{folder:S(),count:String(s().length),size:L(E())}):r.t("dialog.project.upload.summary",{count:String(s().length),size:L(E())})})()),t(e,n(p,{get when(){return K()},get children(){var o=_e();return t(o,()=>r.t("dialog.project.upload.truncatedHint",{max:String(Q)})),o}}),null),t(e,n(p,{get when(){return S()},get children(){var o=U();return t(o,()=>r.t("dialog.project.upload.folderHint")),o}}),null),t(e,n(p,{get when(){return re()},get children(){return[(()=>{var o=$e();return t(o,n(xe,{get each(){return C()},children:ie=>(()=>{var W=Ce();return t(W,()=>ie.path),W})()})),o})(),n(p,{get when(){return s().length>C().length},get children(){var o=U();return t(o,()=>r.t("dialog.project.upload.moreFiles",{count:String(s().length-C().length)})),o}})]}}),null),e}}),b),t(ae,()=>r.t("dialog.project.upload.diskSpace",{space:ee()?r.t("common.loading"):L(I())})),t(b,n(p,{get when(){return M()},get children(){var e=ke();return t(e,()=>r.t("dialog.project.upload.diskInsufficient")),e}}),null),t(l,n(me,{get checked(){return D()},onChange:Z,get disabled(){return h()},get children(){return r.t("dialog.project.upload.overwrite")}}),_),t(l,n(p,{get when(){return h()},get children(){var e=U();return t(e,()=>r.t("dialog.project.upload.progress",{done:String(z().done),total:String(z().total)})),e}}),_),t(l,n(p,{get when(){return A()},get children(){var e=je();return t(e,A),e}}),_),t(_,n(k,{type:"button",variant:"ghost",size:"large",get disabled(){return h()},onClick:()=>F.close(),get children(){return r.t("common.cancel")}}),null),t(_,n(k,{type:"button",variant:"primary",size:"large",get disabled(){return!N()},onClick:()=>void le(),get children(){return J(()=>!!h())()?r.t("dialog.project.upload.uploading"):r.t("dialog.project.upload.confirm")}}),null),l}})}export{Ue as DialogProjectUpload};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as f,f as T,ai as Z,t as $,c0 as U,br as V,J as ee,bQ as te,L as ne,G as se,E as re,K as ae,H as oe,cW as ie,c as ce,v as b,bu as le,q as de,b as w,cv as ue,cX as fe,cY as O,S as C,cZ as ge,I as he,c_ as pe,c$ as me,cL as P,bJ as we,d0 as ye,d1 as ve,l as be}from"./index-BA1jwG_A.js";var xe=$("<span data-component=keybind>");function ke(t){return(()=>{var n=xe();return f(n,()=>t.children),T(a=>Z(n,{...t.classList,[t.class??""]:!!t.class},a)),n})()}function $e(t,n){const a=Math.floor(Math.max(0,t)/1e3),l=Math.floor(a/60),s=Math.floor(l/60),d=Math.floor(s/24);return a<60?n("common.time.justNow"):l<60?n("common.time.minutesAgo.short",{count:l}):s<24?n("common.time.hoursAgo.short",{count:s}):n("common.time.daysAgo.short",{count:d})}function Se(t,n){return $e(Date.now()-new Date(t).getTime(),n)}var q=$('<span class="text-14-regular text-text-weak truncate">'),_e=$('<div class="w-full flex items-center justify-between gap-4"><div class="flex items-center gap-2 min-w-0"><span class="text-14-regular text-text-strong whitespace-nowrap">'),De=$('<span class="text-12-regular text-text-weak whitespace-nowrap ml-2">'),Me=$('<div class="w-full flex items-center justify-between rounded-md pl-1"><div class="flex items-center gap-x-3 grow min-w-0"><div class="flex items-center gap-2 min-w-0"><span class="text-14-regular text-text-strong truncate">'),Ce=$('<div class="w-full flex items-center justify-between rounded-md pl-1"><div class="flex items-center gap-x-3 grow min-w-0"><div class="flex items-center text-14-regular"><span class="text-text-weak whitespace-nowrap overflow-hidden overflow-ellipsis truncate min-w-0"></span><span class="text-text-strong whitespace-nowrap">');const L=5,Fe=["session.new","workspace.new","session.previous","session.next","terminal.toggle","review.toggle"],A=t=>{const n=new Set,a=[];for(const l of t)n.has(l.id)||(n.add(l.id),a.push(l));return a},N=(t,n)=>({id:"command:"+t.id,type:"command",title:t.title,description:t.description,keybind:t.keybind,category:n,option:t}),F=(t,n)=>({id:"file:"+t,type:"file",title:t,category:n,path:t}),Ee=(t,n)=>({id:`session:${t.directory}:${t.id}`,type:"session",title:t.title,description:t.description,category:n,directory:t.directory,sessionID:t.id,archived:t.archived,updated:t.updated});function Te(t){const n=b(()=>t.filesOnly()?[]:t.command.options.filter(s=>!s.disabled&&!s.hidden&&!s.id.startsWith("suggested.")&&s.id!=="file.open")),a=b(()=>{const s=t.language.t("palette.group.commands");return n().map(d=>N(d,s))}),l=b(()=>{const s=n(),d=new Map(Fe.map((o,c)=>[o,c])),y=s.filter(o=>d.has(o.id)),i=y.length?y:s.slice(0,L),h=y.length?[...i].sort((o,c)=>(d.get(o.id)??0)-(d.get(c.id)??0)):i,v=t.language.t("palette.group.commands");return h.map(o=>N(o,v))});return{allowed:n,list:a,picks:l}}function Le(t){const n=ye({tabs:t.tabs,pathFromTab:t.file.pathFromTab,normalizeTab:s=>s.startsWith("file://")?t.file.tab(s):s}),a=b(()=>{const s=n.openedTabs(),d=n.activeFileTab(),y=d?[d,...s.filter(o=>o!==d)]:s,i=new Set,h=t.language.t("palette.group.files"),v=[];for(const o of y){const c=t.file.pathFromTab(o);c&&(i.has(c)||(i.add(c),v.push(F(c,h))))}return v.slice(0,L)}),l=b(()=>{const s=t.language.t("palette.group.files");return t.file.tree.children("").filter(i=>i.type==="file").map(i=>i.path).sort((i,h)=>i.localeCompare(h)).slice(0,L).map(i=>F(i,s))});return{recent:a,root:l}}function Ie(t){const n={token:0,inflight:void 0,cached:void 0};return{sessions:l=>{if(!l.trim())return n.token+=1,n.inflight=void 0,n.cached=void 0,[];if(n.cached)return n.cached;if(n.inflight)return n.inflight;const d=n.token,y=t.workspaces();return y.length===0?[]:(n.inflight=Promise.all(y.map(i=>{const h=t.label(i);return t.globalSDK.client.session.list({directory:i,roots:!0}).then(v=>(v.data??[]).filter(o=>!!o?.id).map(o=>({id:o.id,title:o.title??t.language.t("command.session.new"),description:h,directory:i,archived:o.time?.archived,updated:o.time?.updated}))).catch(()=>[])})).then(i=>{if(n.token!==d)return[];const h=new Set,v=t.language.t("command.category.session"),o=i.flat().filter(c=>{const S=`${c.directory}:${c.id}`;return h.has(S)?!1:(h.add(S),!0)}).map(c=>Ee(c,v));return n.cached=o,o}).catch(()=>[]).finally(()=>{n.inflight=void 0}),n.inflight)}}}function Ke(t){const n=U(),a=V(),l=ee(),s=te(),d=ne(),y=se(),i=re(),h=ae(),v=oe(),{params:o,tabs:c,view:S}=ie(),D=()=>t.mode==="files",k={cleanup:void 0,committed:!1},[G,H]=ce(!1),I=Te({filesOnly:D,command:n,language:a}),_=Le({file:s,tabs:c,language:a}),j=b(()=>le(o.dir)??""),K=b(()=>{const e=j();if(e)return l.projects.list().find(r=>r.worktree===e||r.sandboxes?.includes(e))}),R=b(()=>{const e=j(),r=K();if(!r)return e?[e]:[];const u=[r.worktree,...r.sandboxes??[]];return e&&!u.includes(e)?[...u,e]:u}),z=b(()=>v.data.path.home),W=e=>{const r=K(),u=r&&e===r.worktree?a.t("workspace.type.local"):a.t("workspace.type.sandbox"),[p]=v.child(e,{bootstrap:!1}),g=z(),m=g?e.replace(g,"~"):e,x=p.vcs?.branch??P(e);return`${u} : ${x||m}`},{sessions:J}=Ie({workspaces:R,label:W,globalSDK:h,language:a}),Y=async e=>{const r=e.trim();if(H(r.length>0),!r&&D()){const x=s.tree.state("")?.loaded,E=x?Promise.resolve():s.tree.list(""),M=A([..._.recent(),..._.root()]);return x||M.length>0?M:(await E,A([..._.recent(),..._.root()]))}if(!r)return[...I.picks(),..._.recent()];if(D()){const x=await s.searchFiles(r),E=a.t("palette.group.files");return x.map(M=>F(M,E))}const[u,p]=await Promise.all([s.searchFiles(r),Promise.resolve(J(r))]),g=a.t("palette.group.files"),m=u.map(x=>F(x,g));return[...I.list(),...p,...m]},B=e=>{k.cleanup?.(),e&&e.type==="command"&&(k.cleanup=e.option?.onHighlight?.())},Q=e=>{const r=s.tab(e);c().open(r),s.load(e),S().reviewPanel.opened()||S().reviewPanel.open(),l.fileTree.setTab("all"),t.onOpenFile?.(e),c().setActive(r)},X=e=>{if(e){if(k.committed=!0,k.cleanup=void 0,d.close(),e.type==="command"){e.option?.onSelect?.("palette");return}if(e.type==="session"){if(!e.directory||!e.sessionID)return;i(ve(y.pathname,be(e.directory),e.sessionID));return}e.path&&Q(e.path)}};return de(()=>{k.committed||k.cleanup?.()}),w(we,{class:"pt-3 pb-0 !max-h-[480px]",transition:!0,get children(){return w(ue,{get search(){return{placeholder:D()?a.t("session.header.searchFiles"):a.t("palette.search.placeholder"),autofocus:!0,hideIcon:!0}},get emptyMessage(){return a.t("palette.empty")},get loadingMessage(){return a.t("common.loading")},items:Y,key:e=>e.id,filterKeys:["title","description","category"],get groupBy(){return G()?e=>e.category:()=>""},onMove:B,onSelect:X,children:e=>w(fe,{get fallback(){return(()=>{var r=Ce(),u=r.firstChild,p=u.firstChild,g=p.firstChild,m=g.nextSibling;return f(u,w(pe,{get node(){return{path:e.path??"",type:"file"}},class:"shrink-0 size-4"}),p),f(g,()=>me(e.path??"")),f(m,()=>P(e.path??"")),r})()},get children(){return[w(O,{get when(){return e.type==="command"},get children(){var r=_e(),u=r.firstChild,p=u.firstChild;return f(p,()=>e.title),f(u,w(C,{get when(){return e.description},get children(){var g=q();return f(g,()=>e.description),g}}),null),f(r,w(C,{get when(){return e.keybind},get children(){return w(ke,{class:"rounded-[4px]",get children(){return ge(e.keybind??"",a.t)}})}}),null),r}}),w(O,{get when(){return e.type==="session"},get children(){var r=Me(),u=r.firstChild,p=u.firstChild,g=p.firstChild;return f(u,w(he,{name:"bubble-5",size:"small",class:"shrink-0 text-icon-weak"}),p),f(g,()=>e.title),f(p,w(C,{get when(){return e.description},get children(){var m=q();return f(m,()=>e.description),T(()=>m.classList.toggle("opacity-70",!!e.archived)),m}}),null),f(r,w(C,{get when(){return e.updated},get children(){var m=De();return f(m,()=>Se(new Date(e.updated).toISOString(),a.t)),m}}),null),T(()=>g.classList.toggle("opacity-70",!!e.archived)),r}})]}})})}})}export{Ke as DialogSelectFile};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BA1jwG_A.js","assets/index-Bpc6ia3z.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{br as x,i as d,b as i,S as h,t as b,L as y,bI as P,bJ as O,aW as T,d2 as v,O as M,d3 as S,d4 as C,d5 as z,v as B,d6 as _,d7 as p,cv as E,ag as L,c6 as I}from"./index-BA1jwG_A.js";var j=b('<div class="flex flex-col gap-1 py-1"><div class=text-13-medium></div><div class="text-12-regular text-text-invert-base"></div><div class="text-12-regular text-text-invert-base">'),A=b('<div class="text-12-regular text-text-invert-base">');const F=o=>{const n=x(),a=e=>{const l=`${e.id} ${e.name}`.toLowerCase();return/claude|anthropic/.test(l)?n.t("model.provider.anthropic"):/gpt|o[1-4]|codex|openai/.test(l)?n.t("model.provider.openai"):/gemini|palm|bard|google/.test(l)?n.t("model.provider.google"):/grok|xai/.test(l)?n.t("model.provider.xai"):/llama|meta/.test(l)?n.t("model.provider.meta"):e.provider.name},c=e=>e==="text"?n.t("model.input.text"):e==="image"?n.t("model.input.image"):e==="audio"?n.t("model.input.audio"):e==="video"?n.t("model.input.video"):e==="pdf"?n.t("model.input.pdf"):e,t=()=>{const e=[];o.latest&&e.push(n.t("model.tag.latest")),o.free&&e.push(n.t("model.tag.free")),o.limited&&e.push(n.t("model.tag.limited"));const l=e.length?` (${e.join(", ")})`:"";return`${a(o.model)} ${o.model.name}${l}`},r=()=>{if(o.model.capabilities){const g=o.model.capabilities.input,f=["text","image","audio","video","pdf"].filter(m=>g[m]).map(m=>c(m));return f.length?f.join(", "):void 0}const e=o.model.modalities?.input;if(!e)return;const l=e.map(g=>c(g));return l.length?l.join(", "):void 0},u=()=>o.model.capabilities?o.model.capabilities.reasoning?n.t("model.tooltip.reasoning.allowed"):n.t("model.tooltip.reasoning.none"):o.model.reasoning?n.t("model.tooltip.reasoning.allowed"):n.t("model.tooltip.reasoning.none"),s=()=>n.t("model.tooltip.context",{limit:o.model.limit.context.toLocaleString()});return(()=>{var e=j(),l=e.firstChild,g=l.nextSibling,D=g.nextSibling;return d(l,t),d(e,i(h,{get when(){return r()},children:f=>(()=>{var m=A();return d(m,()=>n.t("model.tooltip.allows",{inputs:f()})),m})()}),g),d(g,u),d(D,s),e})()};var K=b('<div class="w-full flex items-center gap-x-2 text-13-regular"><span class=truncate>'),R=b('<div class="flex items-center gap-1">');const $=(o,n)=>o==="opencode"&&(!n||n.input===0),w=o=>o==="onescience",k=o=>{const n=o.model??z().model,a=x(),c=B(()=>n.list().filter(r=>o.provider?r.provider.id===o.provider:!0).filter(r=>n.visible({modelID:r.id,providerID:r.provider.id})).map(r=>({...r,search:[r.provider.name,r.provider.id,r.name,r.id,r.family,$(r.provider.id,r.cost)?"free 免费":"",w(r.provider.id)?"limited 限免":"",r.latest?"latest 最新":""].join(" ")})));return i(E,{get class(){return`flex-1 min-h-0 [&_[data-slot=list-scroll]]:flex-1 [&_[data-slot=list-scroll]]:min-h-0 ${o.class??""}`},get search(){return{placeholder:a.t("dialog.model.search.placeholder"),autofocus:!0,action:o.action}},get emptyMessage(){return a.t("dialog.model.empty")},key:t=>`${t.provider.id}:${t.id}`,items:c,get current(){return n.current()},scrollToCurrent:!1,filterKeys:["search"],sortBy:(t,r)=>t.name.localeCompare(r.name),groupBy:t=>t.provider.name,sortGroupsBy:(t,r)=>{const u=t.items[0].provider.id,s=r.items[0].provider.id;return p.includes(u)&&!p.includes(s)?-1:!p.includes(u)&&p.includes(s)?1:p.indexOf(u)-p.indexOf(s)},itemWrapper:(t,r)=>i(S,{class:"w-full",placement:"right-start",gutter:12,get value(){return i(F,{model:t,get latest(){return t.latest},get free(){return $(t.provider.id,t.cost)},get limited(){return w(t.provider.id)}})},children:r}),onSelect:t=>{n.set(t?{modelID:t.id,providerID:t.provider.id}:void 0,{recent:!0}),o.onSelect()},children:t=>(()=>{var r=K(),u=r.firstChild;return d(u,()=>t.name),d(r,i(h,{get when(){return $(t.provider.id,t.cost)},get children(){return i(_,{get children(){return a.t("model.tag.free")}})}}),null),d(r,i(h,{get when(){return w(t.provider.id)},get children(){return i(_,{get children(){return a.t("model.tag.limited")}})}}),null),d(r,i(h,{get when(){return t.latest},get children(){return i(_,{get children(){return a.t("model.tag.latest")}})}}),null),r})()})};function W(o){const[n,a]=T({open:!1,dismiss:null}),c=y(),t=e=>{a("dismiss",e),a("open",!1)},r=()=>{t("manage"),c.show(()=>i(L,{tab:"models"}))},u=()=>{t("provider"),I(()=>import("./index-BA1jwG_A.js").then(e=>e.dk),__vite__mapDeps([0,1])).then(e=>{c.show(()=>i(e.DialogSelectProvider,{}))})},s=x();return i(v,{get open(){return n.open},onOpenChange:e=>{e&&a("dismiss",null),a("open",e)},modal:!1,placement:"top-start",gutter:4,get children(){return[i(v.Trigger,M({get as(){return o.triggerAs??"div"}},()=>o.triggerProps,{get children(){return o.children}})),i(v.Portal,{get children(){return i(v.Content,{class:"w-72 h-80 flex flex-col p-2 rounded-md border border-border-base bg-surface-raised-stronger-non-alpha shadow-md z-50 outline-none overflow-hidden",onEscapeKeyDown:e=>{t("escape"),e.preventDefault(),e.stopPropagation()},onPointerDownOutside:()=>t("outside"),onFocusOutside:()=>t("outside"),onCloseAutoFocus:e=>{const l=n.dismiss;l==="outside"&&e.preventDefault(),(l==="escape"||l==="select")&&(e.preventDefault(),o.onClose?.(l)),a("dismiss",null)},get children(){return[i(v.Title,{class:"sr-only",get children(){return s.t("dialog.model.select.title")}}),i(k,{get provider(){return o.provider},get model(){return o.model},onSelect:()=>t("select"),class:"p-1",get action(){return(()=>{var e=R();return d(e,i(S,{placement:"top",get value(){return s.t("command.provider.connect")},get children(){return i(C,{icon:"plus-small",variant:"ghost",iconSize:"normal",class:"size-6",get"aria-label"(){return s.t("command.provider.connect")},onClick:u})}}),null),d(e,i(S,{placement:"top",get value(){return s.t("settings.models.title")},get children(){return i(C,{icon:"sliders",variant:"ghost",iconSize:"normal",class:"size-6",get"aria-label"(){return s.t("settings.models.title")},onClick:r})}}),null),e})()}})]}})}})]}})}const G=o=>{const n=y(),a=x(),c=()=>{I(()=>import("./index-BA1jwG_A.js").then(r=>r.dk),__vite__mapDeps([0,1])).then(r=>{n.show(()=>i(r.DialogSelectProvider,{}))})},t=()=>{n.show(()=>i(L,{tab:"models"}))};return i(O,{get title(){return a.t("dialog.model.select.title")},get action(){return i(P,{class:"h-7 -my-1 text-14-medium",icon:"plus-small",tabIndex:-1,onClick:c,get children(){return a.t("command.provider.connect")}})},get children(){return[i(k,{get provider(){return o.provider},get model(){return o.model},onSelect:()=>n.close()}),i(P,{variant:"ghost",class:"ml-3 mt-5 mb-6 text-text-base self-start",onClick:t,get children(){return a.t("settings.models.title")}})]}})};export{G as DialogSelectModel,W as ModelSelectorPopover};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{L as I,v as r,a2 as $,cM as A,b as s,i as a,S as m,bI as x,bJ as N,t as b}from"./index-BA1jwG_A.js";var T=b('<pre class="m-0 shrink-0 max-h-28 overflow-y-auto rounded-lg border border-border-weak-base bg-background-weak p-3 text-12-regular text-text-strong leading-5 whitespace-pre-wrap break-all">服务端返回:'),S=b('<pre class="m-0 shrink-0 max-h-24 overflow-y-auto rounded-lg border border-border-weak-base bg-background-weak p-3 text-12-regular text-text-strong leading-5 whitespace-pre-wrap break-all">探测详情:'),D=b('<div class="flex flex-col gap-2 min-w-0 min-h-0"><div class="flex items-center justify-between gap-2 shrink-0"><strong class="text-13-medium text-text-strong">建议在服务器上执行</strong></div><pre class="m-0 max-h-[36vh] overflow-y-auto rounded-lg border border-border-weak-base bg-background-weak p-3 text-12-regular text-text-strong leading-5 whitespace-pre-wrap break-all">'),L=b('<div class="flex flex-col gap-4 px-6 pb-6 pt-0 min-h-0"><p class="text-14-regular text-text-weak m-0 leading-6 shrink-0"></p><p class="text-12-regular text-text-weak m-0 shrink-0">修改环境变量后需重启 OneCode,并在浏览器中重新登录后再打开终端。</p><div class="flex justify-end shrink-0">');function M(f={}){const k=I(),l=r(()=>$()),n=r(()=>l()?.capabilities.terminalUnavailableReason??""),w=r(()=>l()?.capabilities.terminalUnavailableDetail??""),i=r(()=>l()?.capabilities.terminalIsolation??""),h=r(()=>(f.failure??"").trim()),u=r(()=>!!l()&&l()?.capabilities.terminal===!0&&!n()),d=r(()=>!n()&&!u()&&i()==="bubblewrap"),p=r(()=>{if(u())return i()==="docker"?["# 1) 无 GPU:改用 bubblewrap 后重启 OneCode,并重新登录","export ONECODE_TERMINAL_ISOLATION=bubblewrap","# 2) 有 GPU 且必须用 docker:给运行账号加组后重新登录系统再启 OneCode",'sudo usermod -aG docker "$USER"',"docker info"]:i()==="bubblewrap"?["# A. 临时绕过隔离(先验证终端能否打开)","export ONECODE_TERMINAL_ISOLATION=native","# 然后重启 onecode,浏览器重新登录后再开终端","","# B. 继续用 bubblewrap 时,在运行 OneCode 的机器上检查:","which bwrap; bwrap --version","bwrap --unshare-all --die-with-parent --new-session --proc /proc --dev /dev --ro-bind-try /usr /usr --ro-bind-try /bin /bin --tmpfs /tmp -- /usr/bin/true; echo exit:$?","cat /proc/sys/kernel/unprivileged_userns_clone","cat /proc/sys/kernel/apparmor_restrict_unprivileged_userns 2>/dev/null || true","","# C. 若 exit 非 0,可临时放开(需管理员;重启后可能失效)","sudo sysctl -w kernel.unprivileged_userns_clone=1","sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0","","# D. 服务端日志(搜 creating session / exited)",'ls ~/.local/share/opencode/log/ 2>/dev/null || ls "$HOME"/.local/share/opencode/log/']:["# 查看服务端日志(搜 creating session / exited)",'ls ~/.local/share/opencode/log/ 2>/dev/null || ls "$HOME"/.local/share/opencode/log/',"# 临时可改:export ONECODE_TERMINAL_ISOLATION=native 后重启并重新登录"];const e=A(l());return Array.isArray(e)&&e.length>0?e:d()?["export ONECODE_TERMINAL_ISOLATION=native","cat /proc/sys/kernel/unprivileged_userns_clone"]:[]}),v=r(()=>p().length>0),_=r(()=>u()?"无法打开终端":n()==="docker-missing"?"无法打开终端:Docker 不可用":n()==="disabled"?"无法打开终端:服务未启用":n()==="bubblewrap-unusable"?"无法打开终端:bubblewrap 异常":d()?"无法打开终端:隔离环境异常":"无法打开终端:需要 bubblewrap"),O=r(()=>u()?i()==="docker"?"隔离模式为 docker,创建终端失败。常见原因是当前用户无权访问 docker.sock。无 GPU 请改用 bubblewrap;有 GPU 请把运行账号加入 docker 组。":i()==="bubblewrap"?"隔离模式为 bubblewrap,创建终端失败(服务端 POST /pty 返回错误)。可先按下方 A 改用 native 验证;若需继续隔离,再按 B/C 检查 bubblewrap 与内核命名空间。":`隔离模式为 ${i()||"native"},创建终端失败。请按下方命令查看日志或临时调整隔离模式后重试。`:n()==="docker-missing"?"已配置 docker 隔离,但当前用户无法使用 Docker。无 GPU 请改用 bubblewrap;有 GPU 请将运行账号加入 docker 组。":n()==="disabled"?"服务端未启用平台账号终端。":n()==="bubblewrap-unusable"?"已安装 bubblewrap,但无法创建用户命名空间。请按下方命令检查后重启 OneCode 并重新登录。":d()?"bubblewrap 终端启动失败。可临时改用 native,或检查 user namespace 相关 sysctl。":"需要安装 bubblewrap 后重启 OneCode 并重新登录。容器部署可使用 ONECODE_TERMINAL_ISOLATION=native。"),C=async()=>{const e=p().filter(o=>o.trim().length>0&&!o.trim().startsWith("#")).join(`
|
|
2
|
-
`);if(e)try{await navigator.clipboard.writeText(e)}catch{}};return s(N,{get title(){return _()},class:"w-full max-w-[560px] mx-auto",size:"large",get children(){var e=L(),o=e.firstChild,c=o.nextSibling,y=c.nextSibling;return a(o,O),a(e,s(m,{get when(){return h()},get children(){var t=T();return t.firstChild,a(t,h,null),t}}),c),a(e,s(m,{get when(){return w()},get children(){var t=S();return t.firstChild,a(t,w,null),t}}),c),a(e,s(m,{get when(){return v()},get children(){var t=D(),g=t.firstChild;g.firstChild;var E=g.nextSibling;return a(g,s(x,{type:"button",size:"normal",variant:"ghost",onClick:()=>void C(),children:"复制命令"}),null),a(E,()=>p().join(`
|
|
3
|
-
`)),t}}),c),a(y,s(x,{type:"button",variant:"primary",size:"large",onClick:()=>k.close(),children:"知道了"})),e}})}export{M as DialogTerminalUnavailable};
|
package/assets/docs-CGjz1sDz.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{G as M,E as N,c as O,a as P,v as R,i as t,b as d,t as n,d as W,a6 as j,A as q,f as x,s as k,F as g,S as z,a8 as B}from"./index-BA1jwG_A.js";import{d as J}from"./onescience-docs-CH5KBTI9.js";var K=n("<div class=os-client-capability-page-grid>"),Q=n('<div class="os-client-capability-page os-client-docs-page"><header class=os-client-docs-head><div class=os-client-docs-head-copy><h2>帮助</h2><p>平台使用说明、插件镜像与版本记录</p></div></header><section class=os-client-capability-selector aria-label=帮助与文档><div class=os-client-capability-current-domain><span>文档分类:</span><strong></strong><small>点击条目在新窗口打开原文</small></div><div class="os-client-capability-tabs os-client-docs-tabs"role=tablist aria-label=文档分类></div></section><div class=os-client-capability-page-body><section class=os-client-capability-resource-panel>'),T=n("<button type=button><strong></strong><small>"),U=n("<p class=os-client-capability-empty>该分类下暂无文档。"),V=n("<article class=os-client-capability-card><div><h4></h4><p></p></div><div class=os-client-capability-meta></div><div class=os-client-capability-actions><a target=_blank rel=noreferrer data-primary=true>"),X=n("<span>");const v=[{id:"manual",label:"用户手册",hint:"平台与 OneSkills 使用说明",match:e=>e.includes("用户手册")},{id:"plugins",label:"插件与镜像",hint:"插件协议与运行镜像",match:e=>e.includes("插件")||e.includes("镜像")},{id:"release",label:"发版记录",hint:"版本变化与重要调整",match:e=>e.includes("发版记录")||e.includes("版本记录")}];function w(e){const c=e.replace(/^#/,"").trim().toLowerCase();return c==="manual"||c==="plugins"||c==="release"?c:"manual"}function ee(){const e=M(),c=N(),[b,f]=O(w(e.hash));P(()=>f(w(e.hash)));const E=l=>{f(l),c(B(l),{replace:!0})},$=()=>v.find(l=>l.id===b())??v[0],_=R(()=>J.filter(l=>$().match(l.tags)));return(()=>{var l=Q(),u=l.firstChild;u.firstChild;var m=u.nextSibling,y=m.firstChild,H=y.firstChild,F=H.nextSibling,L=y.nextSibling,A=m.nextSibling,D=A.firstChild;return t(u,d(q,{get href(){return j()},class:"os-client-docs-close","aria-label":"关闭帮助",children:"×"}),null),t(F,()=>$().label),t(L,d(g,{each:v,children:i=>(()=>{var a=T(),r=a.firstChild,h=r.nextSibling;return a.$$click=()=>E(i.id),t(r,()=>i.label),t(h,()=>i.hint),x(s=>{var p=b()===i.id,o=b()===i.id;return p!==s.e&&a.classList.toggle("is-active",s.e=p),o!==s.t&&k(a,"aria-pressed",s.t=o),s},{e:void 0,t:void 0}),a})()})),t(D,d(z,{get when(){return _().length>0},get fallback(){return U()},get children(){var i=K();return t(i,d(g,{get each(){return _()},children:a=>(()=>{var r=V(),h=r.firstChild,s=h.firstChild,p=s.nextSibling,o=h.nextSibling,G=o.nextSibling,S=G.firstChild;return t(s,()=>a.title),t(p,()=>a.copy),t(o,d(g,{get each(){return a.tags},children:I=>(()=>{var C=X();return t(C,I),C})()})),t(S,()=>a.action),x(()=>k(S,"href",a.href)),r})()})),i}})),l})()}W(["click"]);export{ee as WorkbenchDocsPage};
|