openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
1 lines • 13.2 kB
JavaScript
import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{Ho as t,Oa as n,Qt as r,Xo as i,Xt as a,au as o,ka as s}from"./control-ui-connection-Bfj9beF_.js";import{FA as c,Ik as l,Kk as u,QC as d,Rc as f,Vc as ee,Vk as p,XC as m,ZC as h,dj as g,ej as _,mj as v,pj as y,tj as te}from"./control-ui-boot-shared-DFTSUQQ0.js";import{B as ne,C as re,Ct as ie,F as b,I as x,Rt as S,S as ae,U as C,a as w,d as T,f as E,g as D,gt as oe,j as O,l as k,s as A,u as j,w as se,x as M,yt as ce}from"./solid-runtime-C416s-HC.js";import{F as N,I as P,L as F,M as I,N as L,P as R,cn as le}from"./deferred-ui-support-D-VedBtc.js";import{_ as ue,d as z,l as de,n as fe,p as pe,u as me,y as B}from"./settings-ui-Ck6BJLhD.js";import{n as he,t as V}from"./gateway-page-BGbclR08.js";import{a as ge,o as H}from"./route-chrome-7YRVJwhf.js";import{n as U,t as W}from"./settings-select-row-D3ueky7t.js";var G,K;function q(){return(q=e((()=>{s(),G={labsPage:{swarm:{title:n.labsPage.swarm.title,groupTitle:`Parallel tasks`,defaultPhase:n.labsPage.swarm.defaultPhase,progress:`{complete} of {total}`,active:`{running} running · {queued} queued · {failed} failed or stopped`,finished:`{done} completed · {failed} failed or stopped`,completed:`{done} completed`,failedOrStopped:`Failed or stopped`,childOutcome:`Child runs finished. Check the conversation for the final response.`,childOutcomeProcessing:`Child runs finished. The parent is processing their results.`,details:`Child details`,detailsUnavailable:`Child details are unavailable. Counts include all accepted workers.`,otherGroups:`{count} more active groups`},configure:`Configure`,configureFeature:`Configure {name}`,decisionAssistance:{title:`Decision assistance`,description:`Enable experimental assistance from your configured Decision model. See the documentation for supported uses, setup, and data handling.`,optedIn:`Preference saved.`,loading:`Loading setting…`,unavailable:`Couldn’t load this setting. Reconnect or refresh to try again.`,refresh:`Refresh configuration`},codeMode:{title:`Code Mode`,description:`Set the global default for compact JavaScript tool workflows. On selects Auto for evaluated models; Off disables the default. Per-model Code Mode overrides are in Agent Defaults → Models (Advanced).`,executor:`Code Mode executor`,executorDescription:`Node.js is for trusted code; its VM is not a security sandbox. QuickJS runs code in an isolated WebAssembly runtime. Calls through OpenClaw tools use the same permissions. Applies to new runs; agent overrides take precedence.`,executorNode:`Node.js (default)`,executorQuickjs:`QuickJS (isolated)`},toolSearch:{title:`Tool Search for all models`,description:`Defer tool schemas and discover tools on demand. Enabled by default with structured tool calls; turning it off disables the global default.`},advisor:{title:`Advisor`,description:`Advisor reviews the conversation on the session's own model every few tool calls or minutes. If the agent is going off course, it steers the active run with one short correction. Adds model calls.`},composerPredictions:{title:`Composer predictions`,description:`Suggest a next message after a reply in the active conversation. Adds a tool-free model call using conversation context. Tab accepts the suggestion into your draft; it never sends automatically. Off by default.`,model:`Prediction model`,modelDescription:`Utility is recommended for short, lower-cost predictions. Conversation uses the current chat model; Default uses the agent's configured primary model. An unavailable choice skips predictions instead of switching models.`,utility:`Utility model (recommended)`,conversation:`Conversation model`,default:`Default model`},chatBubbles:{title:`Speech bubbles`,description:`Try speech bubbles with compact tool activity. Home uses bubbles by default while enabled; each browser keeps its explicit conversation choices. Disabling this lab restores the standard view without clearing those choices.`},templates:{title:`Templates`,description:`Templates are ready-made agents for specific tasks.`},hostDesktop:{title:`Host Desktop`,description:`Watch and control this Gateway machine from the Desktop panel through its existing VNC or Screen Sharing server.`},workerDesktop:{title:`Cloud Worker Desktop`,description:`Watch and control node-carried desktops from capable Crabbox AWS, Azure, or Hetzner profiles with desktop: true.`}}},K=Object.assign(()=>{let{swarm:e,...t}=G.labsPage;Object.assign(n.labsPage,t),Object.assign(n.labsPage.swarm,e)},{catalog:G})})))()}function _e(e,t){let n={[e.configPath.at(-1)]:t?e.onValue:e.offValue,...t?e.enableAlso:null};for(let t of e.configPath.slice(0,-1).toReversed())n={[t]:n};return n}function ve(e,t){if(t.resetScope===null)return null;let n=P(e??{},t);if(!n?.length)return null;let r=null;for(let e of n.toReversed())r={[e]:r};return r}var J;function Y(){return(Y=e((()=>{g(),N(),L(),J=[{...R,id:`decisionAssistance`,docsUrl:`https://docs.openclaw.ai/concepts/experimental-features#decision-assistance`,configPath:[`agents`,`defaults`,`experimental`,`decisionAssistance`]},{...R,id:`codeMode`,docsUrl:`https://docs.openclaw.ai/tools/code-mode`,configPath:[`tools`,`codeMode`,`enabled`],onValue:`auto`,activeValues:[!0,`auto`],readEnabled:e=>e===void 0||e===!0||e===`auto`||o(e)&&(e.enabled===!0||e.enabled===`auto`)},{...R,id:`toolSearch`,docsUrl:`https://docs.openclaw.ai/tools/tool-search`,configPath:[`tools`,`toolSearch`,`enabled`],readEnabled:e=>e===void 0||e===!0||o(e)&&(typeof e.enabled==`boolean`||typeof e.enabled==`string`?e.enabled===!0:Object.keys(e).some(e=>e!==`enabled`)),enableAlso:{mode:`tools`},resetScope:`parent`},{...R,id:`advisor`,docsUrl:`https://docs.openclaw.ai/concepts/experimental-features#advisor`,configPath:[`plugins`,`entries`,`advisor`,`enabled`],settingsPluginId:`advisor`},{...R,id:`composerPredictions`,docsUrl:`https://docs.openclaw.ai/web/control-ui/chat#composer-predictions`,configPath:[`gateway`,`controlUi`,`experimental`,`composerPredictions`,`enabled`]},{...R,id:`chatBubbles`,docsUrl:`https://docs.openclaw.ai/web/control-ui/chat`,configPath:[`gateway`,`controlUi`,`experimental`,`chatBubbles`]},I,{...R,id:`hostDesktop`,docsUrl:`https://docs.openclaw.ai/gateway/configuration-reference#desktop`,configPath:[`desktop`,`host`,`enabled`],resetScope:null},{...R,id:`workerDesktop`,docsUrl:`https://docs.openclaw.ai/gateway/cloud-workers#desktop-interactive`,configPath:[`cloudWorkers`,`desktop`]}].map(e=>Object.assign({},e,{title:()=>v(`labsPage.${e.id}.title`),description:()=>v(`labsPage.${e.id}.description`)}))})))()}function ye(){let e=te(),t=ee(e.runtimeConfig),n=null,r=Promise.withResolvers(),[s,d]=ne({completion:Promise.resolve()}),f=he({getGateway:()=>ie(()=>e.gateway),invalidateRequests:()=>{n=null,r.resolve(),r=Promise.withResolvers(),d({completion:Promise.resolve()})}}),p=b(()=>{let t=f.epoch,n=e.gateway,r=e.runtimeConfig,[i,a]=x(null),[o,s]=x(!1);return{epoch:t,gateway:n,runtimeConfig:r,expected:i,setExpected:a,saving:o,setSaving:s}}),g=()=>p().expected(),_=()=>{let e=g();return s(),n??e?.featureId??null};oe(()=>{e.runtimeConfig.ensureLoaded();let t=e.router.subscribe(()=>{let t=e.router.getState();(t.pendingMatches[0]??t.matches[0])?.routeId!==`labs`&&(r.resolve(),r=Promise.withResolvers())});return()=>{t(),r.resolve()}});function y(){return u(t.read().state.configSnapshot)}function C(){let e=t.read().state;return e.connected&&!e.configLoading&&!e.lastError&&e.configSnapshot?.valid!==!1&&l(e)!==null&&y()!==null}function A(){let e=t.read().state;return!!(e.connected&&e.configSnapshot?.hash&&!e.configLoading)}function j(){return A()&&n===null}let M=ce(function*(e,t,n,r,i){i()&&(e.setExpected(t),e.setSaving(!0)),yield Promise.race([n,r])});function N(t,i,a){let o=f.capture(),s=e.gateway,c=e.runtimeConfig;if(!o||!j()||t===`decisionAssistance`&&!C())return;let l=p(),u=()=>f.isCurrent(o)&&e.gateway===s&&e.runtimeConfig===c;n=t;let ee=r.promise,m=(async()=>{try{let e=await c.patch({raw:a,note:`labs: update ${t}`});if(u()&&!e)throw Error(c.state.lastError??v(`labsPage.saveFailed`))}finally{u()&&(n=null)}})(),h=Promise.resolve().then(()=>M(l,{featureId:t,value:i},m,ee,()=>u()&&l.epoch===f.readEpoch()&&l.gateway===s&&l.runtimeConfig===c));d({completion:h}),h.catch(()=>{})}function P(e,t){let n=y(),r=t===F(n,e).defaultEnabled?ve(n,e):null;N(e.id,t,r??_e(e,t))}function I(){let e=y()?.tools;return o(e)?e.codeMode:void 0}function L(e){if(e!==`node`&&e!==`quickjs`)return;let t=I();N(`codeModeExecutor`,e,{tools:{codeMode:{...t===void 0?{enabled:`auto`}:typeof t==`boolean`||t===`auto`?{enabled:t}:{},executor:e===`node`?null:e}}})}function R(){let e=I(),t=g();return(t?.featureId===`codeModeExecutor`?t.value:o(e)?e.executor:null)===`quickjs`?`quickjs`:`node`}function B(){let e=y()?.gateway,t=o(e)?e.controlUi:void 0,n=o(t)?t.experimental:void 0,r=o(n)?n.composerPredictions:void 0,i=g(),a=i?.featureId===`predictionModel`?i.value:o(r)?r.model:void 0;return a===`conversation`||a==="default"?a:`utility`}function V(e){(e===`utility`||e===`conversation`||e==="default")&&N(`predictionModel`,e,{gateway:{controlUi:{experimental:{composerPredictions:{model:e}}}}})}function H(t){let n=()=>le({pathname:i(t.pluginId,e.basePath),search:``},!0);var r=X(),a=S();return r._$$click=t=>c(t,()=>e.navigate(`plugin-settings`,n())),T(r,()=>v(`labsPage.configure`)),k(()=>({e:`${n().pathname}${n().search}`,t:v(`labsPage.configureFeature`,{name:t.featureTitle})}),({e,t},n)=>{e!==n?.e&&D(r,`href`,e),t!==n?.t&&D(r,`aria-label`,t),w(r,a)}),r}function U(n){let r=()=>F(y(),n.feature),i=()=>{let e=g();return e?.featureId===n.feature.id&&typeof e.value==`boolean`?e.value:r().enabled};return[E(()=>E(()=>!(n.feature.id!==`decisionAssistance`||C()))()?O(z,{get title(){return n.feature.title()},get description(){return[E(()=>n.feature.description()),Z(),(()=>{var e=Q();return T(e,()=>v(t.read().state.configLoading?`labsPage.decisionAssistance.loading`:`labsPage.decisionAssistance.unavailable`)),e})(),(()=>{var n=be();return n._$$click=()=>void e.runtimeConfig.refresh(),T(n,()=>v(`labsPage.decisionAssistance.refresh`)),k(()=>!t.read().state.connected||t.read().state.configLoading,e=>{D(n,`disabled`,e)}),n})()]}}):O(ue,{get title(){return n.feature.title()},get checked(){return i()},get disabled(){return!A()||_()!==null&&_()!==n.feature.id},get saving(){return _()===n.feature.id},onChange:e=>P(n.feature,e),get actions(){return E(()=>!!n.feature.settingsPluginId)()?O(H,{get pluginId(){return n.feature.settingsPluginId},get featureTitle(){return n.feature.title()}}):void 0},get description(){return[E(()=>n.feature.description()),E(()=>E(()=>!!(n.feature.id===`decisionAssistance`&&r().enabled))()?[Z(),E(()=>v(`labsPage.decisionAssistance.optedIn`))]:null),` `,(()=>{var e=xe(),t=S();return D(e,`target`,m),T(e,()=>v(`labsPage.documentation`)),k(()=>({e:n.feature.docsUrl,t:h()}),({e:n,t:r},i)=>{n!==i?.e&&D(e,`href`,n),r!==i?.t&&D(e,`rel`,r),w(e,t)}),e})(),E(()=>E(()=>!!r().overridden)()?[Z(),E(()=>v(`configForm.defaultValue`,{value:r().defaultEnabled?v(`common.enabled`):v(`common.disabled`)}))]:null)]}})),E(()=>E(()=>n.feature.id===`composerPredictions`)()?O(W,{nested:!0,get title(){return v(`labsPage.composerPredictions.model`)},get description(){return v(`labsPage.composerPredictions.modelDescription`)},get value(){return B()},get disabled(){return p().saving()||!j()},onChange:V,get options(){return[{value:`utility`,label:v(`labsPage.composerPredictions.utility`)},{value:`conversation`,label:v(`labsPage.composerPredictions.conversation`)},{value:`default`,label:v(`labsPage.composerPredictions.default`)}]}}):null),E(()=>E(()=>n.feature.id===`codeMode`)()?O(W,{nested:!0,get title(){return v(`labsPage.codeMode.executor`)},get description(){return v(`labsPage.codeMode.executorDescription`)},get value(){return R()},get disabled(){return p().saving()||!j()},onChange:L,get options(){return[{value:`node`,label:v(`labsPage.codeMode.executorNode`)},{value:`quickjs`,label:v(`labsPage.codeMode.executorQuickjs`)}]}}):null)]}function G(){let e=b(()=>s().completion.then(()=>!0));return E(()=>e()&&null)}var K=Se(),q=K.firstChild,Y=q.nextSibling;return K._$owner=S(),T(K,O(me,{get title(){return v(`tabs.labs`)},get subtitle(){return[E(()=>v(`labsPage.intro`)),` `,O(fe,{url:`https://docs.openclaw.ai/concepts/experimental-features`})]}}),q),T(K,O(ge,{get children(){return O(de,{get children(){return O(pe,{get title(){return v(`labsPage.sectionTitle`)},get description(){return v(`labsPage.sectionDescription`)},get children(){return[O(re,{each:J,children:e=>O(U,{feature:e})}),O(se,{get on(){return s()},get children(){return O(ae,{fallback:e=>O(z,{get title(){return v(`labsPage.saveErrorTitle`)},get description(){var t=Ce();return T(t,()=>a(e())),t}}),get children(){return O(G,{})}})}})]}})}})}}),Y),K}var X,Z,Q,be,xe,Se,Ce;function $(){return($=e((()=>{j(),C(),t(),B(),H(),q(),p(),d(),r(),_(),f(),V(),g(),U(),N(),Y(),X=M(`<a class="btn btn--sm oc-action oc-action-ghost">`),Z=M(`<br>`),Q=M(`<span role=status>`),be=M(`<button class="btn btn--sm">`),xe=M(`<a>`),Se=M(`<openclaw-labs-page><!><!>`,1),Ce=M(`<span role=alert>`),y(K),A([`click`])})))()}$();export{ye as LabsPage};