@onescience/onecode-web 1.14.50 → 1.14.51
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/{alert-01-C7YX7Aal.js → alert-01-CW6wwOvC.js} +1 -1
- package/assets/{alert-02-BRTtgSFM.js → alert-02-6lH2HJgE.js} +1 -1
- package/assets/{alert-04-Bi0fUq3t.js → alert-04-CzC4DkPI.js} +1 -1
- package/assets/{alert-05-rvgwPhlO.js → alert-05-6_xUYpKY.js} +1 -1
- package/assets/alert-06-DGxdxMcO.js +1 -0
- package/assets/alert-07-zYP7tPac.js +1 -0
- package/assets/alert-08-CQB2MGsE.js +1 -0
- package/assets/alert-10-Cg4L1P2U.js +1 -0
- package/assets/bip-bop-03-JYOBGlba.js +1 -0
- package/assets/bip-bop-04-CwuPWFEP.js +1 -0
- package/assets/bip-bop-06-XgpDh7si.js +1 -0
- package/assets/bip-bop-08-Cuo_PLpP.js +1 -0
- package/assets/bip-bop-09-DGYhCCuy.js +1 -0
- package/assets/{dialog-create-project-folder-Df7AoZN3.js → dialog-create-project-folder-BcfomxJS.js} +1 -1
- package/assets/{dialog-edit-project-BxgydLD6.js → dialog-edit-project-D_df2O_R.js} +1 -1
- package/assets/{dialog-fork-BlPsgpEl.js → dialog-fork-CsNghmMe.js} +1 -1
- package/assets/{dialog-manage-models-B2Pu-2Ed.js → dialog-manage-models-BvLZMn_B.js} +1 -1
- package/assets/{dialog-select-directory-BmA55yI0.js → dialog-select-directory-Cjrn7KJ5.js} +1 -1
- package/assets/{dialog-select-file-DDMfQKOH.js → dialog-select-file-Cpz_IOae.js} +1 -1
- package/assets/{dialog-select-mcp-D4Fk_8Bh.js → dialog-select-mcp-CorJoctC.js} +1 -1
- package/assets/{dialog-select-model-TbqtFTp2.js → dialog-select-model-BWM77It1.js} +2 -2
- package/assets/{dialog-select-provider-DBAFXW9Y.js → dialog-select-provider-D2zjdaGd.js} +1 -1
- package/assets/{dialog-select-server-DEKX4zKb.js → dialog-select-server-BKRhXDIA.js} +2 -2
- package/assets/{dialog-select-ssh-vQRD5vyu.js → dialog-select-ssh-D9WfgY1Y.js} +1 -1
- package/assets/{dialog-settings-CmwUQtlX.js → dialog-settings-C4hQL70e.js} +1 -1
- package/assets/ghostty-web-CxnxzwNu.js +13 -0
- package/assets/index-BsKb4267.js +2501 -0
- package/assets/{index-B4Jlv0hK.css → index-DaUI7t-Y.css} +1 -1
- package/assets/{list-CpNOeYBH.js → list-Bm4iAmpR.js} +1 -1
- package/assets/{nope-02-BTzlbxwl.js → nope-02-DTSnEFcm.js} +1 -1
- package/assets/{nope-05-TaG3hJE-.js → nope-05-DrR7UT0F.js} +1 -1
- package/assets/{nope-08-B5VS1O6l.js → nope-08-hNR6BcH3.js} +1 -1
- package/assets/{nope-11-CPCYI8vb.js → nope-11-C_lxjVUg.js} +1 -1
- package/assets/nope-12-yTLnCxek.js +1 -0
- package/assets/{prompt-helper-dialog-eneteG4A.js → prompt-helper-dialog-CLsUOD_2.js} +1 -1
- package/assets/{server-row-CxlejZ4e.js → server-row-BlSuASA8.js} +1 -1
- package/assets/staplebops-03-CsKtL-49.js +1 -0
- package/assets/staplebops-04-ITUKYVIC.js +1 -0
- package/assets/staplebops-06-DhqvrUir.js +1 -0
- package/assets/staplebops-07-DHfC0Apk.js +1 -0
- package/assets/{status-popover-body-BgKHdQKI.js → status-popover-body-CbmFqoOr.js} +2 -2
- package/assets/{switch-C2yZIpi3.js → switch-D1CmhYGB.js} +1 -1
- package/assets/{tag-LsVlkTp8.js → tag-B9_ddZHF.js} +1 -1
- package/assets/{yup-01-D3mKRwe-.js → yup-01-7QZuklRh.js} +1 -1
- package/assets/{yup-03-DSlLP5dz.js → yup-03-DmaMyZra.js} +1 -1
- package/assets/{yup-04-BtM8nNQH.js → yup-04-BKvLbMb3.js} +1 -1
- package/assets/{yup-05-DKsTbXdS.js → yup-05-DgACT-0v.js} +1 -1
- package/index.html +9 -9
- package/package.json +2 -2
- package/assets/alert-06-BbqR6a-k.js +0 -1
- package/assets/alert-07-zb39atti.js +0 -1
- package/assets/alert-08-Bt5QOLRj.js +0 -1
- package/assets/alert-10-BzCEru8o.js +0 -1
- package/assets/bip-bop-03-B_y8WwjM.js +0 -1
- package/assets/bip-bop-04-B6gmPb9a.js +0 -1
- package/assets/bip-bop-06-Djjj5YU3.js +0 -1
- package/assets/bip-bop-08-BtAjCJUh.js +0 -1
- package/assets/bip-bop-09-D2FLYhzM.js +0 -1
- package/assets/ghostty-web-D1g35o4c.js +0 -13
- package/assets/index-C1hWguPq.js +0 -2501
- package/assets/nope-12-DlB_ucWn.js +0 -1
- package/assets/staplebops-03-AuC1-X5O.js +0 -1
- package/assets/staplebops-04-CZno_WaB.js +0 -1
- package/assets/staplebops-06-6cEb9lc7.js +0 -1
- package/assets/staplebops-07-Dx4UTR1o.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as se,H as ae,k as X,J as ce,l as $,K as oe,i,n as c,E as h,I,T as ue,v as de,r as x,L as q,N as Y,F as Q,p as B,A as E,t as f,O as fe}from"./index-
|
|
1
|
+
import{d as se,H as ae,k as X,J as ce,l as $,K as oe,i,n as c,E as h,I,T as ue,v as de,r as x,L as q,N as Y,F as Q,p as B,A as E,t as f,O as fe}from"./index-BsKb4267.js";var he=f("<div data-slot=list-item-add>"),ge=f("<div data-slot=list-header>"),Z=f("<span>"),me=f("<span data-slot=list-filter>"<!>""),ve=f("<div data-slot=list-search-wrapper><div data-slot=list-search><div data-slot=list-search-container>"),ee=f("<div data-slot=list-group><div data-slot=list-items>"),ye=f("<div data-component=list><div data-slot=list-scroll>"),$e=f("<div data-slot=list-empty-state><div data-slot=list-message>"),ke=f("<span data-slot=list-item-selected-icon>"),_e=f("<button data-slot=list-item type=button>"),we=f("<span data-slot=list-item-active-icon>"),Ae=f("<span data-slot=list-item-divider>");function te(n,m){const k=n.querySelectorAll('[data-slot="list-item"][data-key]');for(const v of k)if(v.getAttribute("data-key")===m)return v}function Fe(n){const m=ae();let k;const[v,F]=X({mouseActive:!1,scrollRef:void 0,internalFilter:""}),C=()=>v.scrollRef,D=e=>F("scrollRef",e),K=()=>v.internalFilter,W=e=>F("internalFilter",e),P=(e,r,t)=>{const l=e.getBoundingClientRect(),s=r.getBoundingClientRect(),a=s.top-l.top+e.scrollTop;a+s.height,e.scrollTop+e.clientHeight;const o=a-e.clientHeight/2+s.height/2,w=Math.max(0,e.scrollHeight-e.clientHeight);e.scrollTop=Math.max(0,Math.min(o,w))},{filter:L,grouped:T,flat:R,active:_,setActive:p,onKeyDown:S,onInput:G,refetch:O}=ce(n),y=()=>typeof n.search=="object"?n.search:{},ne=()=>y().action,j=()=>n.add,M=()=>!!j(),re=e=>e.movementX!==0||e.movementY!==0,b=(e,r)=>{const t=L();if(W(e),G(e),n.onFilter?.(e),!!r?.ref){if(t===e){O();return}queueMicrotask(()=>O())}};$(()=>{n.filter!==void 0&&n.filter!==K()&&(W(n.filter),G(n.filter))}),$(oe(L,()=>{C()?.scrollTo(0,0)},{defer:!0})),$(()=>{const e=C();if(!e||!n.current)return;const r=n.key(n.current);requestAnimationFrame(()=>{const t=te(e,r);t&&P(e,t)})}),$(()=>{const e=R();if(v.mouseActive||e.length===0)return;const r=C();if(!r)return;if(_()===n.key(e[0])){r.scrollTo(0,0);return}const t=_();if(!t)return;const l=te(r,t);l&&P(r,l)}),$(()=>{const e=R(),r=_(),t=e.find(l=>n.key(l)===r);n.onMove?.(t)});const z=(e,r)=>{n.onSelect?.(e,r)},H=e=>{if(F("mouseActive",!1),e.key==="Escape")return;const r=R(),t=r.find(s=>n.key(s)===_()),l=t?r.indexOf(t):-1;if(n.onKeyEvent?.(e,t),!e.defaultPrevented)if(e.key==="Enter"&&!e.isComposing)e.preventDefault(),t&&z(t,l);else if(n.search){if(e.ctrlKey&&!e.metaKey&&!e.altKey&&!e.shiftKey&&(e.key==="n"||e.key==="p")){S(e);return}(e.key==="ArrowDown"||e.key==="ArrowUp")&&S(e)}else S(e)};n.ref?.({onKeyDown:H,setScrollRef:D,setFilter:e=>b(e,{ref:!0})});const J=()=>{const e=j();return e?(()=>{var r=he();return i(r,()=>e.render()),x(t=>q(r,{[e.class??""]:!!e.class},t)),r})():null};function le(e){const[r,t]=X({stuck:!1,header:void 0});return $(()=>{const l=C(),s=r.header;if(!l||!s)return;const a=()=>{const g=s.getBoundingClientRect(),o=l.getBoundingClientRect();t("stuck",g.top<=o.top+1&&l.scrollTop>0)};fe(l,"scroll",a,{passive:!0}),a()}),(()=>{var l=ge();return Y(s=>t("header",s),l),i(l,()=>n.groupHeader?.(e.group)??e.group.category),x(()=>E(l,"data-stuck",r.stuck)),l})()}const ie=()=>{if(T.loading)return n.loadingMessage??m.t("ui.list.loading");if(n.emptyMessage)return n.emptyMessage;const e=L();if(!e)return m.t("ui.list.empty");const r=m.t("ui.list.emptyWithFilter.suffix");return[(()=>{var t=Z();return i(t,()=>m.t("ui.list.emptyWithFilter.prefix")),t})(),(()=>{var t=me(),l=t.firstChild,s=l.nextSibling;return s.nextSibling,i(t,e,s),t})(),c(h,{when:r,get children(){var t=Z();return i(t,r),t}})]};return(()=>{var e=ye(),r=e.firstChild;return i(e,c(h,{get when(){return!!n.search},get children(){var t=ve(),l=t.firstChild,s=l.firstChild;return l.$$pointerdown=a=>{const g=a.currentTarget;if(!(g instanceof HTMLElement))return;const o=g.querySelector("input, textarea");(o instanceof HTMLInputElement||o instanceof HTMLTextAreaElement?o:k)?.focus(),a.stopPropagation()},i(s,c(h,{get when(){return!y().hideIcon},get children(){return c(I,{name:"magnifying-glass"})}}),null),i(s,c(ue,{get autofocus(){return y().autofocus},variant:"ghost","data-slot":"list-search-input",type:"text",ref:a=>{k=a},get value(){return K()},onChange:a=>b(a),onKeyDown:H,get placeholder(){return y().placeholder},spellcheck:!1,autocorrect:"off",autocomplete:"off",autocapitalize:"off"}),null),i(l,c(h,{get when(){return K()},get children(){return c(de,{icon:"circle-x",variant:"ghost",onClick:()=>{b(""),queueMicrotask(()=>k?.focus())},get"aria-label"(){return m.t("ui.list.clearFilter")}})}}),null),i(t,ne,null),x(a=>q(l,{[y().class??""]:!!y().class},a)),t}}),r),Y(D,r),i(r,c(h,{get when(){return R().length>0||M()},get fallback(){return(()=>{var t=$e(),l=t.firstChild;return i(l,ie),t})()},get children(){return[c(Q,{get each(){return T.latest},children:(t,l)=>{const s=()=>l()===T.latest.length-1;return(()=>{var a=ee(),g=a.firstChild;return i(a,c(h,{get when(){return t.category},get children(){return c(le,{group:t})}}),g),i(g,c(Q,{get each(){return t.items},children:(o,w)=>{const N=(()=>{var d=_e();return d.addEventListener("mouseleave",()=>{v.mouseActive&&p(null)}),d.$$mousemove=u=>{re(u)&&(F("mouseActive",!0),p(n.key(o)))},d.$$keydown=H,d.$$click=()=>z(o,w()),i(d,()=>n.children(o),null),i(d,c(h,{get when(){return o===n.current},get children(){var u=ke();return i(u,c(I,{name:"check-small"})),u}}),null),i(d,c(h,{get when(){return n.activeIcon},children:u=>(()=>{var A=we();return i(A,c(I,{get name(){return u()}})),A})()}),null),i(d,(()=>{var u=B(()=>!!(n.divider&&(w()!==t.items.length-1||M()&&s())));return()=>u()&&Ae()})(),null),x(u=>{var A=n.key(o),U=n.key(o)===_(),V=o===n.current;return A!==u.e&&E(d,"data-key",u.e=A),U!==u.t&&E(d,"data-active",u.t=U),V!==u.a&&E(d,"data-selected",u.a=V),u},{e:void 0,t:void 0,a:void 0}),d})();return n.itemWrapper?n.itemWrapper(o,N):N}}),null),i(g,c(h,{get when(){return B(()=>!!M())()&&s()},get children(){return J()}}),null),a})()}}),c(h,{get when(){return B(()=>T.latest.length===0)()&&M()},get children(){var t=ee(),l=t.firstChild;return i(l,J),t}})]}})),x(t=>q(e,{[n.class??""]:!!n.class},t)),e})()}se(["pointerdown","click","keydown","mousemove"]);export{Fe as L};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.
|
|
1
|
+
const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.51/assets/nope-02-EygnDbCM.aac";export{e as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.
|
|
1
|
+
const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.51/assets/nope-05-DZsXzrQW.aac";export{e as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.
|
|
1
|
+
const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.51/assets/nope-08-COPo0uNf.aac";export{e as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.
|
|
1
|
+
const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.51/assets/nope-11-CVdXg8G-.aac";export{e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.51/assets/nope-12-BJR1Ka3c.aac";export{e as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as k,R as $,Z as u,l as S,bk as b,i as s,n as l,B as _,bl as C,F as P,E as y,bm as w,t as a,d as x}from"./index-
|
|
1
|
+
import{b as k,R as $,Z as u,l as S,bk as b,i as s,n as l,B as _,bl as C,F as P,E as y,bm as w,t as a,d as x}from"./index-BsKb4267.js";var D=a('<div class=os-modal-backdrop role=presentation><section class="os-upload-dialog os-prompt-helper-dialog"role=dialog aria-modal=true aria-label=科研提示词助手><div class=os-upload-head><div><div class=os-eyebrow>OneScience</div><h2>科研提示词助手</h2><p>选择一个科研任务类型,按目标、数据、模型和原语生成可直接发送的结构化提示词。</p></div></div><div class=os-prompt-helper-layout><aside class=os-prompt-helper-panel><strong>从科研任务开始</strong><p>选择模板后继续填写目标、资源、约束和输出要求,助手会生成适合直接发送给 AI 的完整科研提示词。</p><ul><li>结构化任务目标</li><li>补全数据与模型上下文</li><li>生成可执行工作流提示</li></ul></aside><div class=os-prompt-helper-content>'),E=a("<div class=os-skill-task-grid aria-busy=true>"),T=a('<div class="os-skill-task-card os-resource-skeleton">');function B(g){const o=k(),n=$(),[c,h]=u([]),[d,p]=u();return S(()=>{const e=n.current;e&&b(e.http.url).then(t=>h(t.items))}),(()=>{var e=D(),t=e.firstChild,i=t.firstChild;i.firstChild;var v=i.nextSibling,f=v.firstChild,m=f.nextSibling;return e.$$click=()=>o.close(),t.$$click=r=>r.stopPropagation(),s(i,l(_,{variant:"ghost",size:"normal",onClick:()=>o.close(),children:"×"}),null),s(m,l(y,{get when(){return c().length>0},get fallback(){return(()=>{var r=E();return s(r,l(P,{get each(){return Array.from({length:6})},children:()=>T()})),r})()},get children(){return l(C,{get profiles(){return c()},onStart:p})}})),s(e,l(w,{get open(){return!!d()},get serverUrl(){return n.current?.http.url},get profile(){return d()},onClose:()=>p(void 0),onStart:r=>{g.onStart(r),o.close()}}),null),e})()}x(["click"]);export{B as PromptHelperDialog};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as b,L as W,f as z,Z as E,h as M,$ as y,l as p,w as H,a0 as O,a1 as q,n as v,N as S,i as a,E as m,a2 as x,p as f,a3 as I,t as l}from"./index-
|
|
1
|
+
import{r as b,L as W,f as z,Z as E,h as M,$ as y,l as p,w as H,a0 as O,a1 as q,n as v,N as S,i as a,E as m,a2 as x,p as f,a3 as I,t as l}from"./index-BsKb4267.js";var P=l("<span class=text-text-invert-weak>v"),U=l('<span class="flex items-center gap-2"><span>'),V=l('<div><div class="flex flex-col items-start min-w-0 w-full"><div class="flex flex-row items-center gap-2 min-w-0 w-full"><span>'),Z=l("<span>v"),j=l('<div class="flex flex-row gap-3"><span>'),A=l("<span class=text-text-weak>"),B=l("<span class=text-text-weaker>"),D=l("<span class=text-text-weak>••••••••"),F=l('<div class="flex flex-row gap-3 min-w-0 text-text-weak"><span class=shrink-0>SSH</span><span class=truncate></span><span class=truncate>'),G=l("<div>");function K(t){const $=z(),[g,R]=E(!1);let u,h;const C=M(()=>y(t.conn)),_=()=>{const r=u?u.scrollWidth>u.clientWidth:!1,i=h?h.scrollWidth>h.clientWidth:!1;R(r||i)};p(()=>{C(),t.conn.http.url,t.status?.version,queueMicrotask(_)}),H(()=>{typeof ResizeObserver=="function"&&(O([u,h],_),_())});const L=()=>(()=>{var r=U(),i=r.firstChild;return a(i,()=>y(t.conn,!0)),a(r,v(m,{get when(){return t.status?.version},get children(){var o=P();return o.firstChild,a(o,()=>t.status?.version,null),o}}),null),r})(),N=q(()=>t.badge);return v(I,{class:"flex-1 min-w-0",get value(){return L()},contentStyle:{"max-width":"none","white-space":"nowrap"},placement:"top-start",get inactive(){return f(()=>!g())()&&!t.conn.displayName},get children(){var r=V(),i=r.firstChild,o=i.firstChild,w=o.firstChild,k=u;return typeof k=="function"?S(k,w):u=w,a(w,C),a(o,v(m,{get when(){return N()},get fallback(){return v(m,{get when(){return t.status?.version},get children(){var e=Z();e.firstChild;var n=h;return typeof n=="function"?S(n,e):h=e,a(e,()=>t.status?.version,null),b(()=>x(e,`${t.versionClass??"text-text-weak text-14-regular truncate"} min-w-0`)),e}})},children:e=>e()}),null),a(i,v(m,{get when(){return f(()=>!!(t.showCredentials&&t.conn.type==="http"))()&&t.conn},children:e=>(()=>{var n=j(),d=n.firstChild;return a(d,(()=>{var s=f(()=>!!e().http.username);return()=>s()?(()=>{var c=A();return a(c,()=>e().http.username),c})():(()=>{var c=B();return a(c,()=>$.t("server.row.noUsername")),c})()})()),a(n,(()=>{var s=f(()=>!!e().http.password);return()=>s()&&D()})(),null),n})()}),null),a(i,v(m,{get when(){return f(()=>!!(t.showCredentials&&t.conn.type==="ssh"))()&&t.conn},children:e=>(()=>{var n=F(),d=n.firstChild,s=d.nextSibling,c=s.nextSibling;return a(s,(()=>{var T=f(()=>!!e().username);return()=>T()?`${e().username}@${e().host}`:e().host})()),a(c,()=>e().remotePath),n})()}),null),a(r,()=>t.children,null),b(e=>{var n=t.class,d=!!t.dimmed,s=`${t.nameClass??"truncate"} min-w-0`;return n!==e.e&&x(r,e.e=n),d!==e.t&&r.classList.toggle("opacity-50",e.t=d),s!==e.a&&x(w,e.a=s),e},{e:void 0,t:void 0,a:void 0}),r}})}function Q(t){return(()=>{var $=G();return b(g=>W($,{"size-1.5 rounded-full shrink-0":!0,"bg-icon-success-base":t.health?.healthy===!0,"bg-icon-critical-base":t.health?.healthy===!1,"bg-border-weak-base":t.health===void 0},g)),$})()}export{Q as S,K as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.51/assets/staplebops-03-Aug82oH0.aac";export{e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.51/assets/staplebops-04-olyHi8qQ.aac";export{e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.51/assets/staplebops-06-Cj_2vOI4.aac";export{e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.51/assets/staplebops-07-cqQEvbIf.aac";export{e as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dialog-select-ssh-
|
|
2
|
-
import{bd as he,c as be,be as xe,R as we,u as Ce,b as Ie,f as fe,Q as Pe,l as Y,o as H,h as F,W as E,Z as Te,z as ye,y as se,i as r,n as t,aq as T,p as k,E as N,F as z,r as D,L as K,B as ne,_ as me,I as Ee,A as ae,U as Fe,k as ke,Y as _e,bf as je,bg as De,bh as Oe,V as ge,t as $,d as Me}from"./index-C1hWguPq.js";import{S as Le}from"./switch-C2yZIpi3.js";import{S as qe,a as Ne}from"./server-row-CxlejZ4e.js";var Re=$('<code class="bg-surface-raised-base px-1.5 py-0.5 rounded-sm text-text-base">'),ze=$('<div class="flex flex-col gap-2 rounded-md border border-border-weak bg-background-base p-2"><label class="flex flex-col gap-1 text-11-regular text-text-muted"><span></span><select class="h-8 rounded-md border border-border-weak bg-background-strong px-2 text-12-regular text-text-base outline-none focus:border-border-strong"><option value></option></select></label><div class="grid grid-cols-2 gap-2">'),Ae=$('<form class="flex flex-col gap-3"><div class="text-14-bold text-text-base"></div><div class="flex flex-col gap-2"><span class="text-11-regular text-text-muted"></span><div class="grid grid-cols-2 gap-2"></div></div><div class="grid grid-cols-2 gap-2">'),He=$('<div class="flex flex-col px-2 pb-2 max-h-[min(640px,calc(100vh-80px))] overflow-y-auto"><div class="flex flex-col gap-2 p-3 bg-background-base rounded-sm min-h-14">'),U=$('<div class="flex flex-col px-2 pb-2"><div class="flex flex-col p-3 bg-background-base rounded-sm min-h-14">'),Be=$('<div class="flex items-center gap-1 w-[360px] rounded-xl shadow-[var(--shadow-lg-border-base)]">'),W=$('<div class="text-14-regular text-text-base text-center my-auto">'),Qe=$('<label class="flex items-start gap-2 rounded-md border border-border-weak bg-background-strong p-2 text-left transition-colors"><input class=mt-0.5 type=radio name=onescience-runtime-mode><span class="flex flex-col gap-0.5"><strong class="text-12-bold text-text-base"></strong><small class="text-11-regular text-text-muted leading-snug">'),Ve=$("<option>"),Ke=$("<div class=flex-1>"),Ue=$('<button type=button class="flex items-center gap-2 w-full h-8 pl-3 pr-1.5 py-1.5 rounded-md transition-colors text-left">'),We=$('<span class="text-11-regular text-text-base bg-surface-base px-1.5 py-0.5 rounded-md">'),Ge=$('<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>'),Ye=$('<div class="flex items-center gap-2 w-full px-2 py-1"><div></div><span class="text-14-regular text-text-base truncate">'),Ze=$('<div class="flex items-center gap-2 w-full px-2 py-1"><div class="size-1.5 rounded-full shrink-0 bg-icon-success-base"></div><span class="text-14-regular text-text-base truncate">'),Je=$('<label class="flex flex-col gap-1 text-11-regular text-text-muted"><span></span><input class="h-8 rounded-md border border-border-weak bg-background-strong px-2 text-12-regular text-text-base outline-none focus:border-border-strong">');const Xe=1e4,$e={backend_id:"",mode:"local",ssh_name:"",remote_host:"",remote_hostname:"",remote_port:"",remote_user:"",remote_work_dir:"",cluster_partition:"",cluster_nodes:"",cluster_gpus_per_node:"",cluster_cpus_per_task:"",cluster_memory:"",cluster_time_limit:"",cluster_gpu_type:"",conda_env_name:"",script_path:"",script_template:"",script_job_name:"",script_code_path:"",script_work_dir:""},et=[{id:"local",label:"status.popover.onescience.mode.local",copy:"status.popover.onescience.mode.local.description"},{id:"slurm",label:"status.popover.onescience.mode.slurm",copy:"status.popover.onescience.mode.slurm.description"},{id:"ssh-slurm",label:"status.popover.onescience.mode.sshSlurm",copy:"status.popover.onescience.mode.sshSlurm.description"},{id:"mcp",label:"status.popover.onescience.mode.mcp",copy:"status.popover.onescience.mode.mcp.description"}],I=e=>e.trim()||void 0,G=e=>{const n=Number.parseInt(e.trim(),10);if(!(!Number.isFinite(n)||n<1))return n};function ve(e){return e?{backend_id:e.runtime.backend_id,mode:e.runtime.mode??"local",ssh_name:"",remote_host:e.runtime.remote.host??"",remote_hostname:e.runtime.remote.hostname??"",remote_port:e.runtime.remote.port?String(e.runtime.remote.port):"",remote_user:e.runtime.remote.user??"",remote_work_dir:e.runtime.remote.remote_work_dir??"",cluster_partition:e.runtime.cluster.partition??"",cluster_nodes:e.runtime.cluster.nodes?String(e.runtime.cluster.nodes):"",cluster_gpus_per_node:e.runtime.cluster.gpus_per_node?String(e.runtime.cluster.gpus_per_node):"",cluster_cpus_per_task:e.runtime.cluster.cpus_per_task?String(e.runtime.cluster.cpus_per_task):"",cluster_memory:e.runtime.cluster.memory??"",cluster_time_limit:e.runtime.cluster.time_limit??"",cluster_gpu_type:e.runtime.cluster.gpu_type??"",conda_env_name:e.runtime.conda.env_name??"",script_path:e.runtime.script.path??"",script_template:e.runtime.script.template??"",script_job_name:e.runtime.script.job_name??"",script_code_path:e.runtime.script.code_path??"",script_work_dir:e.runtime.script.work_dir??""}:$e}function tt(e,n){return{runtime:{...e.runtime,backend_id:n.backend_id.trim(),mode:I(n.mode),remote:{...e.runtime.remote,host:I(n.remote_host),hostname:I(n.remote_hostname),port:G(n.remote_port),user:I(n.remote_user),remote_work_dir:I(n.remote_work_dir)},cluster:{...e.runtime.cluster,partition:I(n.cluster_partition),nodes:G(n.cluster_nodes),gpus_per_node:G(n.cluster_gpus_per_node),cpus_per_task:G(n.cluster_cpus_per_task),memory:I(n.cluster_memory),time_limit:I(n.cluster_time_limit),gpu_type:I(n.cluster_gpu_type)},conda:{...e.runtime.conda,env_name:I(n.conda_env_name)},script:{...e.runtime.script,path:I(n.script_path),template:I(n.script_template),job_name:I(n.script_job_name),code_path:I(n.script_code_path),work_dir:I(n.script_work_dir)}}}}function rt(e,n,c){return!c||!("host"in c)?{...e,ssh_name:n}:{...e,ssh_name:n,remote_host:c.host??"",remote_hostname:c.hostName??"",remote_port:c.port?String(c.port):"",remote_user:c.username??"",remote_work_dir:c.remotePath??""}}const nt=(e,n)=>{const c=e.split(n);return c.length===1?e:[k(()=>c[0]),(()=>{var p=Re();return r(p,n),p})(),k(()=>c.slice(1).join(n))]},st=(e,n,c)=>{if(!e.length)return e;const p=new Map(e.map((d,S)=>[d,S])),i=d=>d?.healthy===!0?0:d?.healthy===!1?2:1;return e.slice().sort((d,S)=>{if(E.key(d)===n)return-1;if(E.key(S)===n)return 1;const s=i(c[E.key(d)])-i(c[E.key(S)]);return s!==0?s:(p.get(d)??0)-(p.get(S)??0)})},at=(e,n)=>{const c=Fe(),[p,i]=ke({});return Y(()=>{if(!n()){i(_e({}));return}const d=e();let S=!1;const s=async()=>{const O={};await Promise.all(d.map(async R=>{O[E.key(R)]=await c(R.http)})),!S&&i(_e(O))};s();const Z=setInterval(()=>void s(),Xe);H(()=>{S=!0,clearInterval(Z)})}),p},lt=e=>{const[n,c]=ke({url:void 0,tick:0});return Y(()=>{n.tick;let p=!1;const i=e?.();if(!i){c("url",void 0),H(()=>{p=!0});return}if(i instanceof Promise){i.then(d=>{p||c("url",d?ge(d):void 0)}),H(()=>{p=!0});return}c("url",ge(i)),H(()=>{p=!0})}),{key:()=>{const p=n.url;if(p)return E.key({type:"http",http:{url:p}})},refresh:()=>c("tick",p=>p+1)}},ot=()=>{const e=he();be();const n=xe(),c=fe(),p=je(),i=De();return ye(()=>({mutationFn:async d=>{await(e.data.mcp[d]?.status==="connected"?n.client.mcp.disconnect({name:d}):n.client.mcp.connect({name:d}))},onSuccess:()=>p.refetchQueries(i.mcp(Oe(e.directory))),onError:d=>{se({variant:"error",title:c.t("common.requestFailed"),description:d instanceof Error?d.message:String(d)})}}))};function pt(e){const n=he(),c=be(),p=xe(),i=we(),d=Ce(),S=Ie(),s=fe(),Z=Pe();Y(()=>{e.shown()});let O=0,R=!1;H(()=>{R=!0,O+=1});const le=F(()=>{const u=i.current,m=i.list;return u?m.every(P=>E.key(P)!==E.key(u))?[u,...m]:[u,...m.filter(P=>E.key(P)!==E.key(u))]:m}),B=at(le,e.shown),J=F(()=>st(le(),i.key,B)),M=ot(),oe=lt(d.getDefaultServer),X=F(()=>Object.keys(n.data.mcp??{}).sort((u,m)=>u.localeCompare(m))),ue=u=>n.data.mcp?.[u]?.status,ce=F(()=>X().filter(u=>ue(u)==="connected").length),ee=F(()=>n.data.lsp??[]),ie=F(()=>ee().length),te=F(()=>(n.data.config.plugin??[]).map(u=>typeof u=="string"?u:u[0])),pe=F(()=>te().length),Se=F(()=>nt(s.t("dialog.plugins.empty"),"opencode.json")),re=F(()=>n.data.config.onescience),de=F(()=>Object.entries(c.data.config.ssh??{}).map(([u,m])=>({name:u,config:m})).filter(u=>"host"in u.config).sort((u,m)=>u.name.localeCompare(m.name))),[_,h]=Te($e),Q=ye(()=>({mutationFn:async()=>{const u=re();return u?(await p.client.config.update({config:{onescience:tt(u,_())}})).data?.onescience:void 0},onSuccess:u=>{u&&(h(ve(u)),se({title:s.t("status.popover.onescience.saved")}))},onError:u=>{se({variant:"error",title:s.t("common.requestFailed"),description:u instanceof Error?u.message:String(u)})}}));return Y(()=>{h(ve(re()))}),(()=>{var u=Be();return r(u,t(T,{get"aria-label"(){return s.t("status.popover.ariaLabel")},class:"tabs bg-background-strong rounded-xl overflow-hidden","data-component":"tabs","data-active":"onescience",defaultValue:"onescience",variant:"alt",get children(){return[t(T.List,{"data-slot":"tablist",class:"bg-transparent border-b-0 px-4 pt-2 pb-0 gap-4 h-10",get children(){return[t(T.Trigger,{value:"onescience","data-slot":"tab",class:"text-12-regular",get children(){return s.t("status.popover.tab.onescience")}}),t(T.Trigger,{value:"servers","data-slot":"tab",class:"text-12-regular",get children(){return[k(()=>k(()=>J().length>0)()?`${J().length} `:""),k(()=>s.t("status.popover.tab.servers"))]}}),t(T.Trigger,{value:"mcp","data-slot":"tab",class:"text-12-regular",get children(){return[k(()=>k(()=>ce()>0)()?`${ce()} `:""),k(()=>s.t("status.popover.tab.mcp"))]}}),t(T.Trigger,{value:"lsp","data-slot":"tab",class:"text-12-regular",get children(){return[k(()=>k(()=>ie()>0)()?`${ie()} `:""),k(()=>s.t("status.popover.tab.lsp"))]}}),t(T.Trigger,{value:"plugins","data-slot":"tab",class:"text-12-regular",get children(){return[k(()=>k(()=>pe()>0)()?`${pe()} `:""),k(()=>s.t("status.popover.tab.plugins"))]}})]}}),t(T.Content,{value:"onescience",get children(){var m=He(),P=m.firstChild;return r(P,t(N,{get when(){return re()},get fallback(){return(()=>{var o=W();return r(o,()=>s.t("status.popover.onescience.empty")),o})()},get children(){var o=Ae(),g=o.firstChild,w=g.nextSibling,y=w.firstChild,C=y.nextSibling,b=w.nextSibling;return o.addEventListener("submit",a=>{a.preventDefault(),!Q.isPending&&Q.mutate()}),r(g,()=>s.t("status.popover.onescience.title")),r(y,()=>s.t("status.popover.onescience.mode")),r(C,t(z,{each:et,children:a=>(()=>{var l=Qe(),j=l.firstChild,L=j.nextSibling,V=L.firstChild,q=V.nextSibling;return j.$$input=v=>h(x=>({...x,mode:v.currentTarget.value})),r(V,()=>s.t(a.label)),r(q,()=>s.t(a.copy)),D(v=>K(l,{"border-border-strong bg-surface-raised-base":_().mode===a.id},v)),D(()=>j.value=a.id),D(()=>j.checked=_().mode===a.id),l})()})),r(o,t(N,{get when(){return _().mode==="ssh-slurm"},get children(){var a=ze(),l=a.firstChild,j=l.firstChild,L=j.nextSibling,V=L.firstChild,q=l.nextSibling;return r(j,()=>s.t("status.popover.onescience.ssh")),L.addEventListener("change",v=>{const x=de().find(A=>A.name===v.currentTarget.value);h(A=>rt(A,v.currentTarget.value,x?.config))}),r(V,()=>s.t("status.popover.onescience.customSsh")),r(L,t(z,{get each(){return de()},children:v=>(()=>{var x=Ve();return r(x,()=>v.name,null),r(x,(()=>{var A=k(()=>!!("host"in v.config&&v.config.host));return()=>A()?` · ${v.config.host}`:""})(),null),D(()=>x.value=v.name),x})()}),null),r(a,t(ne,{variant:"secondary",class:"self-start h-8 px-3 py-1.5",type:"button",onClick:()=>{const v=++O;me(()=>import("./dialog-select-ssh-vQRD5vyu.js"),__vite__mapDeps([0,1,2,3,4])).then(x=>{R||O!==v||S.show(()=>t(x.DialogSelectSsh,{initialMode:"add"}))})},get children(){return s.t("dialog.server.ssh.add")}}),q),r(q,t(f,{get label(){return s.t("status.popover.onescience.remote")},get value(){return _().remote_host},onInput:v=>h(x=>({...x,remote_host:v,ssh_name:""}))}),null),r(q,t(f,{get label(){return s.t("status.popover.onescience.hostname")},get value(){return _().remote_hostname},onInput:v=>h(x=>({...x,remote_hostname:v,ssh_name:""}))}),null),r(q,t(f,{get label(){return s.t("status.popover.onescience.port")},get value(){return _().remote_port},onInput:v=>h(x=>({...x,remote_port:v,ssh_name:""})),type:"number"}),null),r(q,t(f,{get label(){return s.t("status.popover.onescience.user")},get value(){return _().remote_user},onInput:v=>h(x=>({...x,remote_user:v,ssh_name:""}))}),null),r(q,t(f,{get label(){return s.t("status.popover.onescience.remoteWorkDir")},get value(){return _().remote_work_dir},onInput:v=>h(x=>({...x,remote_work_dir:v,ssh_name:""}))}),null),D(()=>L.value=_().ssh_name),a}}),b),r(b,t(f,{get label(){return s.t("status.popover.onescience.backend")},get value(){return _().backend_id},onInput:a=>h(l=>({...l,backend_id:a})),required:!0}),null),r(b,t(f,{get label(){return s.t("status.popover.onescience.partition")},get value(){return _().cluster_partition},onInput:a=>h(l=>({...l,cluster_partition:a}))}),null),r(b,t(f,{get label(){return s.t("status.popover.onescience.nodes")},get value(){return _().cluster_nodes},onInput:a=>h(l=>({...l,cluster_nodes:a})),type:"number"}),null),r(b,t(f,{get label(){return s.t("status.popover.onescience.gpusPerNode")},get value(){return _().cluster_gpus_per_node},onInput:a=>h(l=>({...l,cluster_gpus_per_node:a})),type:"number"}),null),r(b,t(f,{get label(){return s.t("status.popover.onescience.cpusPerTask")},get value(){return _().cluster_cpus_per_task},onInput:a=>h(l=>({...l,cluster_cpus_per_task:a})),type:"number"}),null),r(b,t(f,{get label(){return s.t("status.popover.onescience.memory")},get value(){return _().cluster_memory},onInput:a=>h(l=>({...l,cluster_memory:a}))}),null),r(b,t(f,{get label(){return s.t("status.popover.onescience.timeLimit")},get value(){return _().cluster_time_limit},onInput:a=>h(l=>({...l,cluster_time_limit:a}))}),null),r(b,t(f,{get label(){return s.t("status.popover.onescience.gpuType")},get value(){return _().cluster_gpu_type},onInput:a=>h(l=>({...l,cluster_gpu_type:a}))}),null),r(b,t(f,{get label(){return s.t("status.popover.onescience.condaEnv")},get value(){return _().conda_env_name},onInput:a=>h(l=>({...l,conda_env_name:a}))}),null),r(b,t(f,{get label(){return s.t("status.popover.onescience.scriptPath")},get value(){return _().script_path},onInput:a=>h(l=>({...l,script_path:a}))}),null),r(b,t(f,{get label(){return s.t("status.popover.onescience.scriptTemplate")},get value(){return _().script_template},onInput:a=>h(l=>({...l,script_template:a}))}),null),r(b,t(f,{get label(){return s.t("status.popover.onescience.jobName")},get value(){return _().script_job_name},onInput:a=>h(l=>({...l,script_job_name:a}))}),null),r(b,t(f,{get label(){return s.t("status.popover.onescience.codePath")},get value(){return _().script_code_path},onInput:a=>h(l=>({...l,script_code_path:a}))}),null),r(b,t(f,{get label(){return s.t("status.popover.onescience.workDir")},get value(){return _().script_work_dir},onInput:a=>h(l=>({...l,script_work_dir:a}))}),null),r(o,t(ne,{variant:"primary",class:"self-start h-8 px-3 py-1.5",type:"submit",get disabled(){return Q.isPending},get children(){return k(()=>!!Q.isPending)()?s.t("common.saving"):s.t("status.popover.onescience.save")}}),null),o}})),m}}),t(T.Content,{value:"servers",get children(){var m=U(),P=m.firstChild;return r(P,t(z,{get each(){return J()},children:o=>{const g=E.key(o),w=()=>B[g]?.healthy===!1;return(()=>{var y=Ue();return y.$$click=()=>{w()||(Z("/"),queueMicrotask(()=>i.setActive(g)))},r(y,t(qe,{get health(){return B[g]}}),null),r(y,t(Ne,{conn:o,get dimmed(){return w()},get status(){return B[g]},class:"flex items-center gap-2 w-full min-w-0",nameClass:"text-14-regular text-text-base truncate",versionClass:"text-12-regular text-text-weak truncate",get badge(){return t(N,{get when(){return g===oe.key()},get children(){var C=We();return r(C,()=>s.t("common.default")),C}})},get children(){return[Ke(),t(N,{get when(){return k(()=>!!i.current)()&&g===E.key(i.current)},get children(){return t(Ee,{name:"check",size:"small",class:"text-icon-weak shrink-0"})}})]}}),null),D(C=>{var b={"hover:bg-surface-raised-base-hover":!w(),"cursor-not-allowed":w()},a=w();return C.e=K(y,b,C.e),a!==C.t&&ae(y,"aria-disabled",C.t=a),C},{e:void 0,t:void 0}),y})()}}),null),r(P,t(ne,{variant:"secondary",class:"mt-3 self-start h-8 px-3 py-1.5",onClick:()=>{const o=++O;me(()=>import("./dialog-select-server-DEKX4zKb.js"),__vite__mapDeps([5,1,2,3,6])).then(g=>{R||O!==o||S.show(()=>t(g.DialogSelectServer,{}),oe.refresh)})},get children(){return s.t("status.popover.action.manageServers")}}),null),m}}),t(T.Content,{value:"mcp",get children(){var m=U(),P=m.firstChild;return r(P,t(N,{get when(){return X().length>0},get fallback(){return(()=>{var o=W();return r(o,()=>s.t("dialog.mcp.empty")),o})()},get children(){return t(z,{get each(){return X()},children:o=>{const g=()=>ue(o),w=()=>g()==="connected";return(()=>{var y=Ge(),C=y.firstChild,b=C.nextSibling,a=b.nextSibling;return y.$$click=()=>{M.isPending||M.mutate(o)},r(b,o),a.$$click=l=>l.stopPropagation(),r(a,t(Le,{get checked(){return w()},get disabled(){return k(()=>!!M.isPending)()&&M.variables===o},onChange:()=>{M.isPending||M.mutate(o)}})),D(l=>{var j=M.isPending&&M.variables===o,L={"size-1.5 rounded-full shrink-0":!0,"bg-icon-success-base":g()==="connected","bg-icon-critical-base":g()==="failed","bg-border-weak-base":g()==="disabled","bg-icon-warning-base":g()==="needs_auth"||g()==="needs_client_registration"};return j!==l.e&&(y.disabled=l.e=j),l.t=K(C,L,l.t),l},{e:void 0,t:void 0}),y})()}})}})),m}}),t(T.Content,{value:"lsp",get children(){var m=U(),P=m.firstChild;return r(P,t(N,{get when(){return ee().length>0},get fallback(){return(()=>{var o=W();return r(o,()=>s.t("dialog.lsp.empty")),o})()},get children(){return t(z,{get each(){return ee()},children:o=>(()=>{var g=Ye(),w=g.firstChild,y=w.nextSibling;return r(y,()=>o.name||o.id),D(C=>K(w,{"size-1.5 rounded-full shrink-0":!0,"bg-icon-success-base":o.status==="connected","bg-icon-critical-base":o.status==="error"},C)),g})()})}})),m}}),t(T.Content,{value:"plugins",get children(){var m=U(),P=m.firstChild;return r(P,t(N,{get when(){return te().length>0},get fallback(){return(()=>{var o=W();return r(o,Se),o})()},get children(){return t(z,{get each(){return te()},children:o=>(()=>{var g=Ze(),w=g.firstChild,y=w.nextSibling;return r(y,o),g})()})}})),m}})]}})),u})()}function f(e){return(()=>{var n=Je(),c=n.firstChild,p=c.nextSibling;return r(c,()=>e.label),p.$$input=i=>e.onInput(i.currentTarget.value),D(i=>{var d=e.type??"text",S=e.type==="number"?"1":void 0,s=e.required;return d!==i.e&&ae(p,"type",i.e=d),S!==i.t&&ae(p,"min",i.t=S),s!==i.a&&(p.required=i.a=s),i},{e:void 0,t:void 0,a:void 0}),D(()=>p.value=e.value),n})()}Me(["input","click"]);export{pt as StatusPopoverBody};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dialog-select-ssh-D9WfgY1Y.js","assets/index-BsKb4267.js","assets/index-DaUI7t-Y.css","assets/list-Bm4iAmpR.js","assets/switch-D1CmhYGB.js","assets/dialog-select-server-BKRhXDIA.js","assets/server-row-BlSuASA8.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{bd as he,c as be,be as xe,R as we,u as Ce,b as Ie,f as fe,Q as Pe,l as Y,o as H,h as F,W as E,Z as Te,z as ye,y as se,i as r,n as t,aq as T,p as k,E as N,F as z,r as D,L as K,B as ne,_ as me,I as Ee,A as ae,U as Fe,k as ke,Y as _e,bf as je,bg as De,bh as Oe,V as ge,t as $,d as Me}from"./index-BsKb4267.js";import{S as Le}from"./switch-D1CmhYGB.js";import{S as qe,a as Ne}from"./server-row-BlSuASA8.js";var Re=$('<code class="bg-surface-raised-base px-1.5 py-0.5 rounded-sm text-text-base">'),ze=$('<div class="flex flex-col gap-2 rounded-md border border-border-weak bg-background-base p-2"><label class="flex flex-col gap-1 text-11-regular text-text-muted"><span></span><select class="h-8 rounded-md border border-border-weak bg-background-strong px-2 text-12-regular text-text-base outline-none focus:border-border-strong"><option value></option></select></label><div class="grid grid-cols-2 gap-2">'),Ae=$('<form class="flex flex-col gap-3"><div class="text-14-bold text-text-base"></div><div class="flex flex-col gap-2"><span class="text-11-regular text-text-muted"></span><div class="grid grid-cols-2 gap-2"></div></div><div class="grid grid-cols-2 gap-2">'),He=$('<div class="flex flex-col px-2 pb-2 max-h-[min(640px,calc(100vh-80px))] overflow-y-auto"><div class="flex flex-col gap-2 p-3 bg-background-base rounded-sm min-h-14">'),U=$('<div class="flex flex-col px-2 pb-2"><div class="flex flex-col p-3 bg-background-base rounded-sm min-h-14">'),Be=$('<div class="flex items-center gap-1 w-[360px] rounded-xl shadow-[var(--shadow-lg-border-base)]">'),W=$('<div class="text-14-regular text-text-base text-center my-auto">'),Qe=$('<label class="flex items-start gap-2 rounded-md border border-border-weak bg-background-strong p-2 text-left transition-colors"><input class=mt-0.5 type=radio name=onescience-runtime-mode><span class="flex flex-col gap-0.5"><strong class="text-12-bold text-text-base"></strong><small class="text-11-regular text-text-muted leading-snug">'),Ve=$("<option>"),Ke=$("<div class=flex-1>"),Ue=$('<button type=button class="flex items-center gap-2 w-full h-8 pl-3 pr-1.5 py-1.5 rounded-md transition-colors text-left">'),We=$('<span class="text-11-regular text-text-base bg-surface-base px-1.5 py-0.5 rounded-md">'),Ge=$('<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>'),Ye=$('<div class="flex items-center gap-2 w-full px-2 py-1"><div></div><span class="text-14-regular text-text-base truncate">'),Ze=$('<div class="flex items-center gap-2 w-full px-2 py-1"><div class="size-1.5 rounded-full shrink-0 bg-icon-success-base"></div><span class="text-14-regular text-text-base truncate">'),Je=$('<label class="flex flex-col gap-1 text-11-regular text-text-muted"><span></span><input class="h-8 rounded-md border border-border-weak bg-background-strong px-2 text-12-regular text-text-base outline-none focus:border-border-strong">');const Xe=1e4,$e={backend_id:"",mode:"local",ssh_name:"",remote_host:"",remote_hostname:"",remote_port:"",remote_user:"",remote_work_dir:"",cluster_partition:"",cluster_nodes:"",cluster_gpus_per_node:"",cluster_cpus_per_task:"",cluster_memory:"",cluster_time_limit:"",cluster_gpu_type:"",conda_env_name:"",script_path:"",script_template:"",script_job_name:"",script_code_path:"",script_work_dir:""},et=[{id:"local",label:"status.popover.onescience.mode.local",copy:"status.popover.onescience.mode.local.description"},{id:"slurm",label:"status.popover.onescience.mode.slurm",copy:"status.popover.onescience.mode.slurm.description"},{id:"ssh-slurm",label:"status.popover.onescience.mode.sshSlurm",copy:"status.popover.onescience.mode.sshSlurm.description"},{id:"mcp",label:"status.popover.onescience.mode.mcp",copy:"status.popover.onescience.mode.mcp.description"}],I=e=>e.trim()||void 0,G=e=>{const n=Number.parseInt(e.trim(),10);if(!(!Number.isFinite(n)||n<1))return n};function ve(e){return e?{backend_id:e.runtime.backend_id,mode:e.runtime.mode??"local",ssh_name:"",remote_host:e.runtime.remote.host??"",remote_hostname:e.runtime.remote.hostname??"",remote_port:e.runtime.remote.port?String(e.runtime.remote.port):"",remote_user:e.runtime.remote.user??"",remote_work_dir:e.runtime.remote.remote_work_dir??"",cluster_partition:e.runtime.cluster.partition??"",cluster_nodes:e.runtime.cluster.nodes?String(e.runtime.cluster.nodes):"",cluster_gpus_per_node:e.runtime.cluster.gpus_per_node?String(e.runtime.cluster.gpus_per_node):"",cluster_cpus_per_task:e.runtime.cluster.cpus_per_task?String(e.runtime.cluster.cpus_per_task):"",cluster_memory:e.runtime.cluster.memory??"",cluster_time_limit:e.runtime.cluster.time_limit??"",cluster_gpu_type:e.runtime.cluster.gpu_type??"",conda_env_name:e.runtime.conda.env_name??"",script_path:e.runtime.script.path??"",script_template:e.runtime.script.template??"",script_job_name:e.runtime.script.job_name??"",script_code_path:e.runtime.script.code_path??"",script_work_dir:e.runtime.script.work_dir??""}:$e}function tt(e,n){return{runtime:{...e.runtime,backend_id:n.backend_id.trim(),mode:I(n.mode),remote:{...e.runtime.remote,host:I(n.remote_host),hostname:I(n.remote_hostname),port:G(n.remote_port),user:I(n.remote_user),remote_work_dir:I(n.remote_work_dir)},cluster:{...e.runtime.cluster,partition:I(n.cluster_partition),nodes:G(n.cluster_nodes),gpus_per_node:G(n.cluster_gpus_per_node),cpus_per_task:G(n.cluster_cpus_per_task),memory:I(n.cluster_memory),time_limit:I(n.cluster_time_limit),gpu_type:I(n.cluster_gpu_type)},conda:{...e.runtime.conda,env_name:I(n.conda_env_name)},script:{...e.runtime.script,path:I(n.script_path),template:I(n.script_template),job_name:I(n.script_job_name),code_path:I(n.script_code_path),work_dir:I(n.script_work_dir)}}}}function rt(e,n,c){return!c||!("host"in c)?{...e,ssh_name:n}:{...e,ssh_name:n,remote_host:c.host??"",remote_hostname:c.hostName??"",remote_port:c.port?String(c.port):"",remote_user:c.username??"",remote_work_dir:c.remotePath??""}}const nt=(e,n)=>{const c=e.split(n);return c.length===1?e:[k(()=>c[0]),(()=>{var p=Re();return r(p,n),p})(),k(()=>c.slice(1).join(n))]},st=(e,n,c)=>{if(!e.length)return e;const p=new Map(e.map((d,S)=>[d,S])),i=d=>d?.healthy===!0?0:d?.healthy===!1?2:1;return e.slice().sort((d,S)=>{if(E.key(d)===n)return-1;if(E.key(S)===n)return 1;const s=i(c[E.key(d)])-i(c[E.key(S)]);return s!==0?s:(p.get(d)??0)-(p.get(S)??0)})},at=(e,n)=>{const c=Fe(),[p,i]=ke({});return Y(()=>{if(!n()){i(_e({}));return}const d=e();let S=!1;const s=async()=>{const O={};await Promise.all(d.map(async R=>{O[E.key(R)]=await c(R.http)})),!S&&i(_e(O))};s();const Z=setInterval(()=>void s(),Xe);H(()=>{S=!0,clearInterval(Z)})}),p},lt=e=>{const[n,c]=ke({url:void 0,tick:0});return Y(()=>{n.tick;let p=!1;const i=e?.();if(!i){c("url",void 0),H(()=>{p=!0});return}if(i instanceof Promise){i.then(d=>{p||c("url",d?ge(d):void 0)}),H(()=>{p=!0});return}c("url",ge(i)),H(()=>{p=!0})}),{key:()=>{const p=n.url;if(p)return E.key({type:"http",http:{url:p}})},refresh:()=>c("tick",p=>p+1)}},ot=()=>{const e=he();be();const n=xe(),c=fe(),p=je(),i=De();return ye(()=>({mutationFn:async d=>{await(e.data.mcp[d]?.status==="connected"?n.client.mcp.disconnect({name:d}):n.client.mcp.connect({name:d}))},onSuccess:()=>p.refetchQueries(i.mcp(Oe(e.directory))),onError:d=>{se({variant:"error",title:c.t("common.requestFailed"),description:d instanceof Error?d.message:String(d)})}}))};function pt(e){const n=he(),c=be(),p=xe(),i=we(),d=Ce(),S=Ie(),s=fe(),Z=Pe();Y(()=>{e.shown()});let O=0,R=!1;H(()=>{R=!0,O+=1});const le=F(()=>{const u=i.current,m=i.list;return u?m.every(P=>E.key(P)!==E.key(u))?[u,...m]:[u,...m.filter(P=>E.key(P)!==E.key(u))]:m}),B=at(le,e.shown),J=F(()=>st(le(),i.key,B)),M=ot(),oe=lt(d.getDefaultServer),X=F(()=>Object.keys(n.data.mcp??{}).sort((u,m)=>u.localeCompare(m))),ue=u=>n.data.mcp?.[u]?.status,ce=F(()=>X().filter(u=>ue(u)==="connected").length),ee=F(()=>n.data.lsp??[]),ie=F(()=>ee().length),te=F(()=>(n.data.config.plugin??[]).map(u=>typeof u=="string"?u:u[0])),pe=F(()=>te().length),Se=F(()=>nt(s.t("dialog.plugins.empty"),"opencode.json")),re=F(()=>n.data.config.onescience),de=F(()=>Object.entries(c.data.config.ssh??{}).map(([u,m])=>({name:u,config:m})).filter(u=>"host"in u.config).sort((u,m)=>u.name.localeCompare(m.name))),[_,h]=Te($e),Q=ye(()=>({mutationFn:async()=>{const u=re();return u?(await p.client.config.update({config:{onescience:tt(u,_())}})).data?.onescience:void 0},onSuccess:u=>{u&&(h(ve(u)),se({title:s.t("status.popover.onescience.saved")}))},onError:u=>{se({variant:"error",title:s.t("common.requestFailed"),description:u instanceof Error?u.message:String(u)})}}));return Y(()=>{h(ve(re()))}),(()=>{var u=Be();return r(u,t(T,{get"aria-label"(){return s.t("status.popover.ariaLabel")},class:"tabs bg-background-strong rounded-xl overflow-hidden","data-component":"tabs","data-active":"onescience",defaultValue:"onescience",variant:"alt",get children(){return[t(T.List,{"data-slot":"tablist",class:"bg-transparent border-b-0 px-4 pt-2 pb-0 gap-4 h-10",get children(){return[t(T.Trigger,{value:"onescience","data-slot":"tab",class:"text-12-regular",get children(){return s.t("status.popover.tab.onescience")}}),t(T.Trigger,{value:"servers","data-slot":"tab",class:"text-12-regular",get children(){return[k(()=>k(()=>J().length>0)()?`${J().length} `:""),k(()=>s.t("status.popover.tab.servers"))]}}),t(T.Trigger,{value:"mcp","data-slot":"tab",class:"text-12-regular",get children(){return[k(()=>k(()=>ce()>0)()?`${ce()} `:""),k(()=>s.t("status.popover.tab.mcp"))]}}),t(T.Trigger,{value:"lsp","data-slot":"tab",class:"text-12-regular",get children(){return[k(()=>k(()=>ie()>0)()?`${ie()} `:""),k(()=>s.t("status.popover.tab.lsp"))]}}),t(T.Trigger,{value:"plugins","data-slot":"tab",class:"text-12-regular",get children(){return[k(()=>k(()=>pe()>0)()?`${pe()} `:""),k(()=>s.t("status.popover.tab.plugins"))]}})]}}),t(T.Content,{value:"onescience",get children(){var m=He(),P=m.firstChild;return r(P,t(N,{get when(){return re()},get fallback(){return(()=>{var o=W();return r(o,()=>s.t("status.popover.onescience.empty")),o})()},get children(){var o=Ae(),g=o.firstChild,w=g.nextSibling,y=w.firstChild,C=y.nextSibling,b=w.nextSibling;return o.addEventListener("submit",a=>{a.preventDefault(),!Q.isPending&&Q.mutate()}),r(g,()=>s.t("status.popover.onescience.title")),r(y,()=>s.t("status.popover.onescience.mode")),r(C,t(z,{each:et,children:a=>(()=>{var l=Qe(),j=l.firstChild,L=j.nextSibling,V=L.firstChild,q=V.nextSibling;return j.$$input=v=>h(x=>({...x,mode:v.currentTarget.value})),r(V,()=>s.t(a.label)),r(q,()=>s.t(a.copy)),D(v=>K(l,{"border-border-strong bg-surface-raised-base":_().mode===a.id},v)),D(()=>j.value=a.id),D(()=>j.checked=_().mode===a.id),l})()})),r(o,t(N,{get when(){return _().mode==="ssh-slurm"},get children(){var a=ze(),l=a.firstChild,j=l.firstChild,L=j.nextSibling,V=L.firstChild,q=l.nextSibling;return r(j,()=>s.t("status.popover.onescience.ssh")),L.addEventListener("change",v=>{const x=de().find(A=>A.name===v.currentTarget.value);h(A=>rt(A,v.currentTarget.value,x?.config))}),r(V,()=>s.t("status.popover.onescience.customSsh")),r(L,t(z,{get each(){return de()},children:v=>(()=>{var x=Ve();return r(x,()=>v.name,null),r(x,(()=>{var A=k(()=>!!("host"in v.config&&v.config.host));return()=>A()?` · ${v.config.host}`:""})(),null),D(()=>x.value=v.name),x})()}),null),r(a,t(ne,{variant:"secondary",class:"self-start h-8 px-3 py-1.5",type:"button",onClick:()=>{const v=++O;me(()=>import("./dialog-select-ssh-D9WfgY1Y.js"),__vite__mapDeps([0,1,2,3,4])).then(x=>{R||O!==v||S.show(()=>t(x.DialogSelectSsh,{initialMode:"add"}))})},get children(){return s.t("dialog.server.ssh.add")}}),q),r(q,t(f,{get label(){return s.t("status.popover.onescience.remote")},get value(){return _().remote_host},onInput:v=>h(x=>({...x,remote_host:v,ssh_name:""}))}),null),r(q,t(f,{get label(){return s.t("status.popover.onescience.hostname")},get value(){return _().remote_hostname},onInput:v=>h(x=>({...x,remote_hostname:v,ssh_name:""}))}),null),r(q,t(f,{get label(){return s.t("status.popover.onescience.port")},get value(){return _().remote_port},onInput:v=>h(x=>({...x,remote_port:v,ssh_name:""})),type:"number"}),null),r(q,t(f,{get label(){return s.t("status.popover.onescience.user")},get value(){return _().remote_user},onInput:v=>h(x=>({...x,remote_user:v,ssh_name:""}))}),null),r(q,t(f,{get label(){return s.t("status.popover.onescience.remoteWorkDir")},get value(){return _().remote_work_dir},onInput:v=>h(x=>({...x,remote_work_dir:v,ssh_name:""}))}),null),D(()=>L.value=_().ssh_name),a}}),b),r(b,t(f,{get label(){return s.t("status.popover.onescience.backend")},get value(){return _().backend_id},onInput:a=>h(l=>({...l,backend_id:a})),required:!0}),null),r(b,t(f,{get label(){return s.t("status.popover.onescience.partition")},get value(){return _().cluster_partition},onInput:a=>h(l=>({...l,cluster_partition:a}))}),null),r(b,t(f,{get label(){return s.t("status.popover.onescience.nodes")},get value(){return _().cluster_nodes},onInput:a=>h(l=>({...l,cluster_nodes:a})),type:"number"}),null),r(b,t(f,{get label(){return s.t("status.popover.onescience.gpusPerNode")},get value(){return _().cluster_gpus_per_node},onInput:a=>h(l=>({...l,cluster_gpus_per_node:a})),type:"number"}),null),r(b,t(f,{get label(){return s.t("status.popover.onescience.cpusPerTask")},get value(){return _().cluster_cpus_per_task},onInput:a=>h(l=>({...l,cluster_cpus_per_task:a})),type:"number"}),null),r(b,t(f,{get label(){return s.t("status.popover.onescience.memory")},get value(){return _().cluster_memory},onInput:a=>h(l=>({...l,cluster_memory:a}))}),null),r(b,t(f,{get label(){return s.t("status.popover.onescience.timeLimit")},get value(){return _().cluster_time_limit},onInput:a=>h(l=>({...l,cluster_time_limit:a}))}),null),r(b,t(f,{get label(){return s.t("status.popover.onescience.gpuType")},get value(){return _().cluster_gpu_type},onInput:a=>h(l=>({...l,cluster_gpu_type:a}))}),null),r(b,t(f,{get label(){return s.t("status.popover.onescience.condaEnv")},get value(){return _().conda_env_name},onInput:a=>h(l=>({...l,conda_env_name:a}))}),null),r(b,t(f,{get label(){return s.t("status.popover.onescience.scriptPath")},get value(){return _().script_path},onInput:a=>h(l=>({...l,script_path:a}))}),null),r(b,t(f,{get label(){return s.t("status.popover.onescience.scriptTemplate")},get value(){return _().script_template},onInput:a=>h(l=>({...l,script_template:a}))}),null),r(b,t(f,{get label(){return s.t("status.popover.onescience.jobName")},get value(){return _().script_job_name},onInput:a=>h(l=>({...l,script_job_name:a}))}),null),r(b,t(f,{get label(){return s.t("status.popover.onescience.codePath")},get value(){return _().script_code_path},onInput:a=>h(l=>({...l,script_code_path:a}))}),null),r(b,t(f,{get label(){return s.t("status.popover.onescience.workDir")},get value(){return _().script_work_dir},onInput:a=>h(l=>({...l,script_work_dir:a}))}),null),r(o,t(ne,{variant:"primary",class:"self-start h-8 px-3 py-1.5",type:"submit",get disabled(){return Q.isPending},get children(){return k(()=>!!Q.isPending)()?s.t("common.saving"):s.t("status.popover.onescience.save")}}),null),o}})),m}}),t(T.Content,{value:"servers",get children(){var m=U(),P=m.firstChild;return r(P,t(z,{get each(){return J()},children:o=>{const g=E.key(o),w=()=>B[g]?.healthy===!1;return(()=>{var y=Ue();return y.$$click=()=>{w()||(Z("/"),queueMicrotask(()=>i.setActive(g)))},r(y,t(qe,{get health(){return B[g]}}),null),r(y,t(Ne,{conn:o,get dimmed(){return w()},get status(){return B[g]},class:"flex items-center gap-2 w-full min-w-0",nameClass:"text-14-regular text-text-base truncate",versionClass:"text-12-regular text-text-weak truncate",get badge(){return t(N,{get when(){return g===oe.key()},get children(){var C=We();return r(C,()=>s.t("common.default")),C}})},get children(){return[Ke(),t(N,{get when(){return k(()=>!!i.current)()&&g===E.key(i.current)},get children(){return t(Ee,{name:"check",size:"small",class:"text-icon-weak shrink-0"})}})]}}),null),D(C=>{var b={"hover:bg-surface-raised-base-hover":!w(),"cursor-not-allowed":w()},a=w();return C.e=K(y,b,C.e),a!==C.t&&ae(y,"aria-disabled",C.t=a),C},{e:void 0,t:void 0}),y})()}}),null),r(P,t(ne,{variant:"secondary",class:"mt-3 self-start h-8 px-3 py-1.5",onClick:()=>{const o=++O;me(()=>import("./dialog-select-server-BKRhXDIA.js"),__vite__mapDeps([5,1,2,3,6])).then(g=>{R||O!==o||S.show(()=>t(g.DialogSelectServer,{}),oe.refresh)})},get children(){return s.t("status.popover.action.manageServers")}}),null),m}}),t(T.Content,{value:"mcp",get children(){var m=U(),P=m.firstChild;return r(P,t(N,{get when(){return X().length>0},get fallback(){return(()=>{var o=W();return r(o,()=>s.t("dialog.mcp.empty")),o})()},get children(){return t(z,{get each(){return X()},children:o=>{const g=()=>ue(o),w=()=>g()==="connected";return(()=>{var y=Ge(),C=y.firstChild,b=C.nextSibling,a=b.nextSibling;return y.$$click=()=>{M.isPending||M.mutate(o)},r(b,o),a.$$click=l=>l.stopPropagation(),r(a,t(Le,{get checked(){return w()},get disabled(){return k(()=>!!M.isPending)()&&M.variables===o},onChange:()=>{M.isPending||M.mutate(o)}})),D(l=>{var j=M.isPending&&M.variables===o,L={"size-1.5 rounded-full shrink-0":!0,"bg-icon-success-base":g()==="connected","bg-icon-critical-base":g()==="failed","bg-border-weak-base":g()==="disabled","bg-icon-warning-base":g()==="needs_auth"||g()==="needs_client_registration"};return j!==l.e&&(y.disabled=l.e=j),l.t=K(C,L,l.t),l},{e:void 0,t:void 0}),y})()}})}})),m}}),t(T.Content,{value:"lsp",get children(){var m=U(),P=m.firstChild;return r(P,t(N,{get when(){return ee().length>0},get fallback(){return(()=>{var o=W();return r(o,()=>s.t("dialog.lsp.empty")),o})()},get children(){return t(z,{get each(){return ee()},children:o=>(()=>{var g=Ye(),w=g.firstChild,y=w.nextSibling;return r(y,()=>o.name||o.id),D(C=>K(w,{"size-1.5 rounded-full shrink-0":!0,"bg-icon-success-base":o.status==="connected","bg-icon-critical-base":o.status==="error"},C)),g})()})}})),m}}),t(T.Content,{value:"plugins",get children(){var m=U(),P=m.firstChild;return r(P,t(N,{get when(){return te().length>0},get fallback(){return(()=>{var o=W();return r(o,Se),o})()},get children(){return t(z,{get each(){return te()},children:o=>(()=>{var g=Ze(),w=g.firstChild,y=w.nextSibling;return r(y,o),g})()})}})),m}})]}})),u})()}function f(e){return(()=>{var n=Je(),c=n.firstChild,p=c.nextSibling;return r(c,()=>e.label),p.$$input=i=>e.onInput(i.currentTarget.value),D(i=>{var d=e.type??"text",S=e.type==="number"?"1":void 0,s=e.required;return d!==i.e&&ae(p,"type",i.e=d),S!==i.t&&ae(p,"min",i.t=S),s!==i.a&&(p.required=i.a=s),i},{e:void 0,t:void 0,a:void 0}),D(()=>p.value=e.value),n})()}Me(["input","click"]);export{pt as StatusPopoverBody};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ar as $,as as m,s as w,at as A,Z as I,au as H,av as G,aw as j,h as z,n,ax as b,m as l,ay as P,az as D,aA as J,aB as S,aC as U,aD as Z,aE as Q,aF as V,aG as W,aH as X,aI as Y,aJ as ee,aK as te,a1 as re,aL as ne,p as oe,aM as C,aN as ae,aO as se,aP as ce,E as R}from"./index-
|
|
1
|
+
import{ar as $,as as m,s as w,at as A,Z as I,au as H,av as G,aw as j,h as z,n,ax as b,m as l,ay as P,az as D,aA as J,aB as S,aC as U,aD as Z,aE as Q,aF as V,aG as W,aH as X,aI as Y,aJ as ee,aK as te,a1 as re,aL as ne,p as oe,aM as C,aN as ae,aO as se,aP as ce,E as R}from"./index-BsKb4267.js";var ie={};ce(ie,{Control:()=>O,Description:()=>E,ErrorMessage:()=>_,Input:()=>M,Label:()=>B,Root:()=>T,Switch:()=>i,Thumb:()=>K,useSwitchContext:()=>f});var L=ee();function f(){const r=ae(L);if(r===void 0)throw new Error("[kobalte]: `useSwitchContext` must be used within a `Switch` component");return r}function O(r){const e=S(),t=f(),d=m({id:t.generateId("control")},r),[o,u]=w(d,["onClick","onKeyDown"]);return n(b,l({as:"div",onClick:g=>{C(g,o.onClick),t.toggle(),t.inputRef()?.focus()},onKeyDown:g=>{C(g,o.onKeyDown),g.key===se.Space&&(t.toggle(),t.inputRef()?.focus())}},()=>e.dataset(),()=>t.dataset(),u))}function E(r){const e=f();return n(Y,l(()=>e.dataset(),r))}function _(r){const e=f();return n(X,l(()=>e.dataset(),r))}function M(r){const e=S(),t=f(),d=m({id:t.generateId("input")},r),[o,u,p]=w(d,["ref","style","onChange","onFocus","onBlur"],Z),{fieldProps:h}=Q(u);return n(b,l({as:"input",ref(a){var s=D(t.setInputRef,o.ref);typeof s=="function"&&s(a)},type:"checkbox",role:"switch",get id(){return h.id()},get name(){return e.name()},get value(){return t.value()},get checked(){return t.checked()},get required(){return e.isRequired()},get disabled(){return e.isDisabled()},get readonly(){return e.isReadOnly()},get style(){return V({...W},o.style)},get"aria-checked"(){return t.checked()},get"aria-label"(){return h.ariaLabel()},get"aria-labelledby"(){return h.ariaLabelledBy()},get"aria-describedby"(){return h.ariaDescribedBy()},get"aria-invalid"(){return e.validationState()==="invalid"||void 0},get"aria-required"(){return e.isRequired()||void 0},get"aria-disabled"(){return e.isDisabled()||void 0},get"aria-readonly"(){return e.isReadOnly()||void 0},onChange:a=>{C(a,o.onChange),a.stopPropagation();const s=a.target;t.setIsChecked(s.checked),s.checked=t.checked()},onFocus:a=>{C(a,o.onFocus),t.setIsFocused(!0)},onBlur:a=>{C(a,o.onBlur),t.setIsFocused(!1)}},()=>e.dataset(),()=>t.dataset(),p))}function B(r){const e=f();return n(U,l(()=>e.dataset(),r))}function T(r){let e;const t=`switch-${$()}`,d=m({value:"on",id:t},r),[o,u,p]=w(d,["ref","children","value","checked","defaultChecked","onChange","onPointerDown"],A),[h,g]=I(),[v,y]=I(!1),{formControlContext:a}=H(u),s=G({isSelected:()=>o.checked,defaultIsSelected:()=>o.defaultChecked,onSelectedChange:c=>o.onChange?.(c),isDisabled:()=>a.isDisabled(),isReadOnly:()=>a.isReadOnly()});j(()=>e,()=>s.setIsSelected(o.defaultChecked??!1));const q=c=>{C(c,o.onPointerDown),v()&&c.preventDefault()},x=z(()=>({"data-checked":s.isSelected()?"":void 0})),k={value:()=>o.value,dataset:x,checked:()=>s.isSelected(),inputRef:h,generateId:te(()=>P(u.id)),toggle:()=>s.toggle(),setIsChecked:c=>s.setIsSelected(c),setIsFocused:y,setInputRef:g};return n(J.Provider,{value:a,get children(){return n(L.Provider,{value:k,get children(){return n(b,l({as:"div",ref(c){var F=D(N=>e=N,o.ref);typeof F=="function"&&F(c)},role:"group",get id(){return P(u.id)},onPointerDown:q},()=>a.dataset(),x,p,{get children(){return n(le,{state:k,get children(){return o.children}})}}))}})}})}function le(r){const e=re(()=>{const t=r.children;return ne(t)?t(r.state):t});return oe(e)}function K(r){const e=S(),t=f(),d=m({id:t.generateId("thumb")},r);return n(b,l({as:"div"},()=>e.dataset(),()=>t.dataset(),d))}var i=Object.assign(T,{Control:O,Description:E,ErrorMessage:_,Input:M,Label:B,Thumb:K});function ue(r){const[e,t]=w(r,["children","class","hideLabel","description"]);return n(i,l(t,{get class(){return e.class},"data-component":"switch",get children(){return[n(i.Input,{"data-slot":"switch-input"}),n(R,{get when(){return e.children},get children(){return n(i.Label,{"data-slot":"switch-label",get classList(){return{"sr-only":e.hideLabel}},get children(){return e.children}})}}),n(R,{get when(){return e.description},get children(){return n(i.Description,{"data-slot":"switch-description",get children(){return e.description}})}}),n(i.ErrorMessage,{"data-slot":"switch-error"}),n(i.Control,{"data-slot":"switch-control",get children(){return n(i.Thumb,{"data-slot":"switch-thumb"})}})]}}))}export{ue as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as r,a as l,m as i,i as n,t as c}from"./index-
|
|
1
|
+
import{s as r,a as l,m as i,i as n,t as c}from"./index-BsKb4267.js";var p=c("<span>");function m(t){const[s,e]=r(t,["size","class","classList","children"]);return(()=>{var a=p();return l(a,i(e,{"data-component":"tag",get"data-size"(){return s.size||"normal"},get classList(){return{...s.classList,[s.class??""]:!!s.class}}}),!1,!0),n(a,()=>s.children),a})()}export{m as T};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.
|
|
1
|
+
const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.51/assets/yup-01-BtRq6dLN.aac";export{e as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.
|
|
1
|
+
const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.51/assets/yup-03-BHLEoqSS.aac";export{e as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.
|
|
1
|
+
const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.51/assets/yup-04-C7yadpJT.aac";export{e as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.
|
|
1
|
+
const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.51/assets/yup-05-CuuaeyjC.aac";export{e as default};
|
package/index.html
CHANGED
|
@@ -8,17 +8,17 @@
|
|
|
8
8
|
name="description"
|
|
9
9
|
content="OneScience is an AI for Science workspace for research discovery, agent workflows, and scientific knowledge."
|
|
10
10
|
/>
|
|
11
|
-
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.
|
|
12
|
-
<link rel="shortcut icon" href="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.
|
|
13
|
-
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.
|
|
14
|
-
<link rel="manifest" href="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.
|
|
11
|
+
<link rel="icon" type="image/png" href="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.51/favicon-96x96-v3.png" sizes="96x96" />
|
|
12
|
+
<link rel="shortcut icon" href="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.51/favicon-v3.ico" />
|
|
13
|
+
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.51/apple-touch-icon-v3.png" />
|
|
14
|
+
<link rel="manifest" href="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.51/site.webmanifest" />
|
|
15
15
|
<meta name="theme-color" content="#F8F7F7" />
|
|
16
16
|
<meta name="theme-color" content="#131010" media="(prefers-color-scheme: dark)" />
|
|
17
|
-
<meta property="og:image" content="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.
|
|
18
|
-
<meta property="twitter:image" content="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.
|
|
19
|
-
<script id="oc-theme-preload-script" src="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.
|
|
20
|
-
<script type="module" crossorigin src="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.
|
|
21
|
-
<link rel="stylesheet" crossorigin href="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.
|
|
17
|
+
<meta property="og:image" content="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.51/social-share.png" />
|
|
18
|
+
<meta property="twitter:image" content="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.51/social-share.png" />
|
|
19
|
+
<script id="oc-theme-preload-script" src="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.51/oc-theme-preload.js"></script>
|
|
20
|
+
<script type="module" crossorigin src="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.51/assets/index-BsKb4267.js"></script>
|
|
21
|
+
<link rel="stylesheet" crossorigin href="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.51/assets/index-DaUI7t-Y.css">
|
|
22
22
|
</head>
|
|
23
23
|
<body class="antialiased overscroll-none text-12-regular overflow-hidden">
|
|
24
24
|
<noscript>You need to enable JavaScript to run this app.</noscript>
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onescience/onecode-web",
|
|
3
|
-
"version": "1.14.
|
|
3
|
+
"version": "1.14.51",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"description": "OneCode web UI static assets for CDN delivery.",
|
|
8
|
-
"homepage": "https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.
|
|
8
|
+
"homepage": "https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.51/index.html",
|
|
9
9
|
"jsdelivr": "index.html",
|
|
10
10
|
"files": [
|
|
11
11
|
"**/*"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50/assets/alert-06-GK5Tqy6u.aac";export{e as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50/assets/alert-07-0r0kiLGz.aac";export{e as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50/assets/alert-08-CZowNquU.aac";export{e as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50/assets/alert-10-Ck5hR7zH.aac";export{e as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50/assets/bip-bop-03-DXp7Zb0f.aac";export{e as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50/assets/bip-bop-04-CfVtpI7z.aac";export{e as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50/assets/bip-bop-06-BuvNosjK.aac";export{e as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50/assets/bip-bop-08-DBf7Bwjz.aac";export{e as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e="https://cdn.jsdelivr.net/npm/@onescience/onecode-web@1.14.50/assets/bip-bop-09-CxEgoAHQ.aac";export{e as default};
|