UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

1 lines • 2.74 kB
import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{GN as t,JN as n,Ji as r,Yi as i}from"./_2_____________________________.js";import{B as a,O as o,Rt as s,U as c,d as l,f as u,g as d,j as f,l as p,m,s as h,u as g,x as _}from"./_6____________________.js";import{v,w as y}from"./settings-controls-runtime-CwXZmgDo.js";function b(e){let t=()=>e.busy||e.disabled,[r,i]=a(`streamable-http`);var c=x(),h=c.firstChild,g=h.firstChild,_=g.nextSibling,y=h.nextSibling,b=y.firstChild,C=y.nextSibling,w=C.firstChild,T=w.nextSibling,E=C.nextSibling,D=E.firstChild,O=D.nextSibling;c.addEventListener(`submit`,t=>{t.preventDefault();let n=new FormData(t.currentTarget),i=n.get(`mcp-name`),a=n.get(`mcp-target`);e.onSubmit({name:typeof i==`string`?i.trim():``,transport:r(),target:typeof a==`string`?a.trim():``})}),l(g,()=>n(`mcpServers.nameLabel`));var k=e.onNameRef;return typeof k==`function`||Array.isArray(k)?m(()=>k,_):e.onNameRef=_,l(b,()=>n(`mcpServers.transportLabel`)),l(y,f(v,{get value(){return r()},get ariaLabel(){return n(`mcpServers.transportLabel`)},get disabled(){return t()},get options(){return[{value:`streamable-http`,label:n(`mcpServers.transportStreamableHttp`)},{value:`sse`,label:n(`mcpServers.transportSse`)},{value:`stdio`,label:n(`mcpServers.transportStdio`)}]},onChange:i}),null),l(w,()=>n(`mcpServers.targetLabel`)),l(c,f(o,{get when(){return e.error},children:e=>(()=>{var t=S();return l(t,e),t})()}),E),E._$owner=s(),D._$$click=()=>e.onCancel(),l(D,()=>n(`common.cancel`)),l(O,(()=>{var t=u(()=>!!e.busy);return()=>t()?n(`mcpServers.adding`):n(`mcpServers.add`)})()),p(()=>({e:e.autofocus,t:e.blockedReason??``,a:t(),o:r()===`stdio`?`npx some-mcp-server`:`https://mcp.example.com/mcp`,i:e.blockedReason??``,n:t(),s:e.busy,h:e.blockedReason??``,r:t()}),({e,t,a:n,o:r,i,n:a,s:o,h:s,r:c},l)=>{e!==l?.e&&d(_,`autofocus`,e),t!==l?.t&&d(_,`title`,t),n!==l?.a&&d(_,`disabled`,n),r!==l?.o&&d(T,`placeholder`,r),i!==l?.i&&d(T,`title`,i),a!==l?.n&&d(T,`disabled`,a),o!==l?.s&&d(D,`disabled`,o),s!==l?.h&&d(O,`title`,s),c!==l?.r&&d(O,`disabled`,c)}),c}var x,S;function C(){return(C=e((()=>{g(),c(),r(),t(),y(),x=_(`<form class=mcp-server-form><label><span></span><input name=mcp-name class=settings-input type=text required placeholder=context7 autocomplete=off></label><div class=mcp-server-form__field><span></span></div><label><span></span><input name=mcp-target class=settings-input type=text required spellcheck=false autocomplete=off></label><openclaw-modal-actions class=mcp-server-form__actions><button type=button class="btn btn--sm"></button><button type=submit class="btn btn--sm primary">`,1),S=_(`<div class="mcp-server-message mcp-server-message--error"role=alert>`),i(),h([`click`])})))()}export{C as n,b as t};