UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

1 lines • 12.3 kB
import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{Ju as t,mi as n,pi as r}from"./_4____________________________.js";import{Ej as i,FN as a,GN as o,JN as s,Lj as c,PN as l,fA as u,jj as d,pA as f,qN as p,wl as m,xl as h}from"./_2_____________________________.js";import{B as g,C as _,Ct as ee,F as v,I as y,Rt as te,S as ne,U as b,d as x,f as S,g as re,gt as ie,j as C,l as w,s as T,u as E,w as ae,x as D,yt as oe}from"./_6____________________.js";import{n as O,t as k}from"./en-route-subtitles-CjswZHfJ.js";import{n as A,t as j}from"./gateway-page-runtime-CW2orlv_.js";import{f as se,g as ce,m as M,o as le,p as ue,w as N,x as de}from"./settings-controls-runtime-CwXZmgDo.js";import{a as fe,o as P}from"./route-chrome-Dr9fhzjf.js";import{a as F,i as I,n as L,o as R,r as z,t as B}from"./template-draft-runtime-DZoxdWm2.js";import{n as V,t as H}from"./settings-select-row-DhCp1sjn.js";var U,W;function G(){return(G=e((()=>{n(),U={labsPage:{swarm:{groupTitle:`Parallel tasks`,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:`Subagents finished. Check the conversation for the final reply.`,childOutcomeProcessing:`Subagents finished. The parent agent is processing their results.`,details:`Subagent details`,detailsUnavailable:`Subagent details are unavailable. Counts include all accepted subagents.`,otherGroups:`{count} more active groups`},decisionAssistance:{title:`Decision assistance`,description:`Enable experimental assistance from your configured Decision model.`,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 replies; 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.`},usageRankedToolIndex:{title:`Usage-ranked tool index`,description:`Prefer frequently and recently used tools in Code Mode, Tool Search, and MCP tool directory prompt indexes. Off by default. Stores tool IDs, scores, and timestamps for 90 days in operator-owned storage, excluding incognito sessions. Changes apply at the next prompt-prefix boundary. Inspect, import, or reset with openclaw tools usage.`},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 uses the agent’s utility model and may try its configured fallback models. Session uses the current session model; Default uses the agent’s configured primary model. Without a utility model, Utility skips predictions.`,utility:`Utility model (recommended)`,conversation:`Session 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:`Desktop on the computer running OpenClaw`,description:`Watch and control the computer running OpenClaw from the Desktop panel through its existing VNC or Screen Sharing server.`},openclawId:{title:`OpenClaw ID remote access`,description:`Open this claw from your other devices and invite people. To get started, sign in from the account menu and choose Turn on remote access. Manage who has access on the Access page. While off, this feature does not contact OpenClaw ID.`},workerDesktop:{title:`Cloud device desktop`,description:`Watch and control cloud device desktops from Crabbox AWS, Azure, or Hetzner profiles with desktop support enabled.`}}},W=Object.assign(()=>{let{swarm:e,...t}=U.labsPage;Object.assign(r.labsPage,t),Object.assign(r.labsPage.swarm,e)},{catalog:U})})))()}function pe(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 me(e,t){if(t.resetScope===null)return null;let n=F(e??{},t);if(!n?.length)return null;let r=null;for(let e of n.toReversed())r={[e]:r};return r}var K;function q(){return(q=e((()=>{o(),I(),L(),K=[{...z,id:`decisionAssistance`,configPath:[`agents`,`defaults`,`experimental`,`decisionAssistance`]},{...z,id:`codeMode`,configPath:[`tools`,`codeMode`,`enabled`],onValue:`auto`,activeValues:[!0,`auto`],readEnabled:e=>e===void 0||e===!0||e===`auto`||t(e)&&(e.enabled===!0||e.enabled===`auto`)},{...z,id:`toolSearch`,configPath:[`tools`,`toolSearch`,`enabled`],readEnabled:e=>e===void 0||e===!0||t(e)&&(typeof e.enabled==`boolean`||typeof e.enabled==`string`?e.enabled===!0:Object.keys(e).some(e=>e!==`enabled`)),enableAlso:{mode:`tools`},resetScope:`parent`},{...z,id:`usageRankedToolIndex`,configPath:[`agents`,`defaults`,`experimental`,`usageRankedToolIndex`]},{...z,id:`composerPredictions`,configPath:[`gateway`,`controlUi`,`experimental`,`composerPredictions`,`enabled`]},{...z,id:`chatBubbles`,configPath:[`gateway`,`controlUi`,`experimental`,`chatBubbles`]},B,{...z,id:`hostDesktop`,configPath:[`desktop`,`host`,`enabled`],resetScope:null},{...z,id:`openclawId`,configPath:[`gateway`,`openclawId`,`enabled`],resetScope:null},{...z,id:`workerDesktop`,configPath:[`cloudWorkers`,`desktop`]}].map(e=>Object.assign({},e,{title:()=>s(`labsPage.${e.id}.title`),description:()=>s(`labsPage.${e.id}.description`)}))})))()}function J(){let e=a(),n=m(e.runtimeConfig),r=null,o=Promise.withResolvers(),[l,d]=g({completion:Promise.resolve()}),f=A({getGateway:()=>ee(()=>e.gateway),invalidateRequests:()=>{r=null,o.resolve(),o=Promise.withResolvers(),d({completion:Promise.resolve()})}}),p=v(()=>{let t=f.epoch,n=e.gateway,r=e.runtimeConfig,[i,a]=y(null),[o,s]=y(!1);return{epoch:t,gateway:n,runtimeConfig:r,expected:i,setExpected:a,saving:o,setSaving:s}}),h=()=>p().expected(),b=()=>{let e=h();return l(),r??e?.featureId??null};ie(()=>{e.runtimeConfig.ensureLoaded();let t=e.router.subscribe(()=>{let t=e.router.getState();(t.pendingMatches[0]??t.matches[0])?.routeId!==`labs`&&(o.resolve(),o=Promise.withResolvers())});return()=>{t(),o.resolve()}});function T(){return c(n.read().state.configSnapshot)}function E(){let e=n.read().state;return e.connected&&!e.configLoading&&(!e.lastError||e.configAutoSaveStatus===`rejected`)&&e.configSnapshot?.valid!==!1&&i(e)!==null&&T()!==null}function D(){let e=n.read().state;return!!(e.connected&&e.configSnapshot?.hash&&!e.configLoading)}function O(){return D()&&r===null}let k=oe(function*(e,t,n,r,i){i()&&(e.setExpected(t),e.setSaving(!0)),yield Promise.race([n,r])});function j(t,n,i){let a=f.capture(),c=e.gateway,l=e.runtimeConfig;if(!a||!O()||t===`decisionAssistance`&&!E())return;let u=p(),m=()=>f.isCurrent(a)&&e.gateway===c&&e.runtimeConfig===l;r=t;let h=o.promise,g=(async()=>{try{let e=await l.patch({raw:i,note:`labs: update ${t}`});if(m()&&!e)throw Error(l.state.lastError??s(`labsPage.saveFailed`))}finally{m()&&(r=null)}})(),_=Promise.resolve().then(()=>k(u,{featureId:t,value:n},g,h,()=>m()&&u.epoch===f.readEpoch()&&u.gateway===c&&u.runtimeConfig===l));d({completion:_}),_.catch(()=>{})}function N(e,t){let n=T(),r=t===R(n,e).defaultEnabled?me(n,e):null;j(e.id,t,r??pe(e,t))}function P(){let e=T()?.tools;return t(e)?e.codeMode:void 0}function F(e){if(e!==`node`&&e!==`quickjs`)return;let t=P();j(`codeModeExecutor`,e,{tools:{codeMode:{...t===void 0?{enabled:`auto`}:typeof t==`boolean`||t===`auto`?{enabled:t}:{},executor:e===`node`?null:e}}})}function I(){let e=P(),n=h();return(n?.featureId===`codeModeExecutor`?n.value:t(e)?e.executor:null)===`quickjs`?`quickjs`:`node`}function L(){let e=T()?.gateway,n=t(e)?e.controlUi:void 0,r=t(n)?n.experimental:void 0,i=t(r)?r.composerPredictions:void 0,a=h(),o=a?.featureId===`predictionModel`?a.value:t(i)?i.model:void 0;return o===`conversation`||o==="default"?o:`utility`}function z(e){(e===`utility`||e===`conversation`||e==="default")&&j(`predictionModel`,e,{gateway:{controlUi:{experimental:{composerPredictions:{model:e}}}}})}function B(t){let r=()=>R(T(),t.feature),i=()=>{let e=h();return e?.featureId===t.feature.id&&typeof e.value==`boolean`?e.value:r().enabled};return[S(()=>S(()=>!(t.feature.id!==`decisionAssistance`||E()))()?C(M,{get title(){return t.feature.title()},get description(){return[S(()=>t.feature.description()),` `,(()=>{var e=Y();return x(e,()=>s(n.read().state.configLoading?`labsPage.decisionAssistance.loading`:`labsPage.decisionAssistance.unavailable`)),e})()]},get control(){var t=X();return t._$$click=()=>void e.runtimeConfig.refresh(),x(t,()=>s(`labsPage.decisionAssistance.refresh`)),w(()=>!n.read().state.connected||n.read().state.configLoading,e=>{re(t,`disabled`,e)}),t}}):C(de,{get title(){return t.feature.title()},get checked(){return i()},get disabled(){return!D()||b()!==null&&b()!==t.feature.id},get saving(){return b()===t.feature.id},onChange:e=>N(t.feature,e),get description(){return[S(()=>t.feature.description()),S(()=>S(()=>!!(t.feature.id===`decisionAssistance`&&r().enabled))()?[Z(),S(()=>s(`labsPage.decisionAssistance.optedIn`))]:null)]}})),S(()=>S(()=>t.feature.id===`composerPredictions`)()?C(H,{nested:!0,get title(){return s(`labsPage.composerPredictions.model`)},get description(){return s(`labsPage.composerPredictions.modelDescription`)},get value(){return L()},get disabled(){return p().saving()||!O()},onChange:z,get options(){return[{value:`utility`,label:s(`labsPage.composerPredictions.utility`)},{value:`conversation`,label:s(`labsPage.composerPredictions.conversation`)},{value:`default`,label:s(`labsPage.composerPredictions.default`)}]}}):null),S(()=>S(()=>t.feature.id===`codeMode`)()?C(H,{nested:!0,get title(){return s(`labsPage.codeMode.executor`)},get description(){return s(`labsPage.codeMode.executorDescription`)},get value(){return I()},get disabled(){return p().saving()||!O()},onChange:F,get options(){return[{value:`node`,label:s(`labsPage.codeMode.executorNode`)},{value:`quickjs`,label:s(`labsPage.codeMode.executorQuickjs`)}]}}):null)]}function V(){let e=v(()=>l().completion.then(()=>!0));return S(()=>e()&&null)}var U=Q(),W=U.firstChild,G=W.nextSibling;return U._$owner=te(),x(U,C(ue,{get title(){return s(`tabs.labs`)},get subtitle(){return[S(()=>s(`subtitles.labs`)),` `,C(le,{url:`https://docs.openclaw.ai/concepts/experimental-features`})]}}),W),x(U,C(fe,{get children(){return C(se,{get children(){return C(ce,{get description(){return s(`labsPage.sectionDescription`)},get children(){return[C(_,{each:K,children:e=>C(B,{feature:e})}),C(_,{get each(){return n.read().state.configSnapshot?.warnings?.filter(e=>e.path===`gateway.openclawId.enabled`)},children:e=>C(M,{role:`status`,get title(){return s(`labsPage.openclawId.title`)},get description(){return e.message}})}),C(ae,{get on(){return l()},get children(){return C(ne,{fallback:e=>C(M,{role:`alert`,get title(){return s(`labsPage.saveErrorTitle`)},get description(){return C(u,{get error(){return e()}})}}),get children(){return C(V,{})}})}})]}})}})}}),G),U}var Y,X,Z,Q;function $(){return($=e((()=>{E(),b(),f(),N(),P(),G(),k(),d(),l(),h(),j(),o(),V(),I(),q(),Y=D(`<span role=status>`),X=D(`<button class="btn btn--sm">`),Z=D(`<br>`),Q=D(`<openclaw-labs-page><!><!>`,1),p(W),p(O),T([`click`])})))()}$();export{J as LabsPage};