dexagent 2026.6.2 → 2026.6.3
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/CHANGELOG.md +19 -130
- package/README.md +47 -471
- package/dist/build-info.json +3 -3
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/control-ui/assets/{activity-iPfLHQZV.js → activity-C_HZe0c-.js} +2 -2
- package/dist/control-ui/assets/{agents-CxLl6gUk.js → agents-CeF1k4Mj.js} +2 -2
- package/dist/control-ui/assets/{channels-Bta6SaYT.js → channels-C3fGrqai.js} +2 -2
- package/dist/control-ui/assets/{cron-WrJMROVi.js → cron-01SXAnEJ.js} +2 -2
- package/dist/control-ui/assets/{debug-qbPU9J5y.js → debug-B8zuijMC.js} +2 -2
- package/dist/control-ui/assets/{index-CMqtK4Ui.js → index-D1Qre842.js} +4 -4
- package/dist/control-ui/assets/{instances-JqYUP-u5.js → instances-izquLPnA.js} +2 -2
- package/dist/control-ui/assets/{nodes-FhxY7Cc1.js → nodes-e5Cze-NX.js} +2 -2
- package/dist/control-ui/assets/{sessions-Bl-n4lmW.js → sessions-BRqy7EPO.js} +2 -2
- package/dist/control-ui/assets/{skill-workshop-C1AL77pw.js → skill-workshop-DHBE6rsG.js} +2 -2
- package/dist/control-ui/assets/{skills-BBNM4ARV.js → skills-BXLJ4lgH.js} +2 -2
- package/dist/control-ui/assets/{usage-BS9V-TP1.js → usage-CrcXmrp7.js} +2 -2
- package/dist/control-ui/assets/{workboard-D6aOg7b0.js → workboard-CnCeQDxS.js} +2 -2
- package/dist/control-ui/index.html +1 -1
- package/dist/control-ui/sw.js +1 -1
- package/dist/extensions/imessage/message-tool-api.d.ts +1 -1
- package/dist/plugin-sdk/.boundary-entry-shims.stamp +1 -1
- package/dist/plugin-sdk/{bundled-channel-config-schema-CHyVartG.d.ts → bundled-channel-config-schema-dEcj4OyK.d.ts} +2 -2
- package/dist/plugin-sdk/bundled-channel-config-schema.d.ts +1 -1
- package/dist/plugin-sdk/channel-config-schema-legacy.d.ts +1 -1
- package/dist/plugin-sdk/discord.d.ts +1 -1
- package/dist/plugin-sdk/scripts/lib/plugin-sdk-doc-metadata.d.ts +125 -0
- package/dist/postinstall-inventory.json +15 -14
- package/package.json +22 -9
- /package/{openclaw.mjs → dex.mjs} +0 -0
package/dist/build-info.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
81ca90995bd834f41e668a3a8652e068b60bc13b3a4bf769e49ff6601719bb4d
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{m as e,p as t}from"./lit-runtime-BImxIzGR.js";import{o as n,t as r}from"./string-coerce-CsmDCXq_.js";import{U as i,v as a,vt as o}from"./index-
|
|
1
|
+
import{m as e,p as t}from"./lit-runtime-BImxIzGR.js";import{o as n,t as r}from"./string-coerce-CsmDCXq_.js";import{U as i,v as a,vt as o}from"./index-D1Qre842.js";var s=[`running`,`done`,`error`];function c(e){return i(e,{hour:`numeric`,minute:`2-digit`,second:`2-digit`},``)}function l(e){if(!Number.isFinite(e)||e<0)return n(`common.na`);if(e<1e3)return n(`activity.duration.ms`,{count:String(Math.round(e))});if(e<6e4)return n(`activity.duration.seconds`,{count:(e/1e3).toFixed(1)});let t=Math.round(e/1e3),r=Math.floor(t/60),i=t%60;return n(`activity.duration.minutes`,{minutes:String(r),seconds:String(i)})}function u(e){return n(`activity.status.${e}`)}function d(e){return e===1?n(`activity.argumentHiddenOne`):n(`activity.argumentsHidden`,{count:String(e)})}function f(e){return n(`activity.entrySummary`,{argumentSummary:d(e.hiddenArgumentCount),status:u(e.status),tool:e.toolName})}function p(e,t){return t?r([e.toolName,e.status,e.summary,f(e),e.outputPreview,e.runId,e.toolCallId,e.sessionKey].filter(Boolean).join(` `)).includes(t):!0}function m(e){return o(e.map(e=>e.toolName))}function h(e){let t=r(e.filterText);return e.entries.filter(n=>!e.statusFilters[n.status]||e.toolFilter&&n.toolName!==e.toolFilter?!1:p(n,t))}function g(t,n){return e`
|
|
2
2
|
<label class="activity-status-filter activity-status-filter--${n}">
|
|
3
3
|
<input
|
|
4
4
|
type="checkbox"
|
|
@@ -121,4 +121,4 @@ import{m as e,p as t}from"./lit-runtime-BImxIzGR.js";import{o as n,t as r}from".
|
|
|
121
121
|
</div>
|
|
122
122
|
</section>
|
|
123
123
|
`}export{v as renderActivity};
|
|
124
|
-
//# sourceMappingURL=activity-
|
|
124
|
+
//# sourceMappingURL=activity-C_HZe0c-.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as e,m as t,p as n,r}from"./lit-runtime-BImxIzGR.js";import{l as i,o as a,t as o}from"./string-coerce-CsmDCXq_.js";import{v as s}from"./markdown-runtime-CUzFp-dW.js";import{$ as c,G as l,Q as u,X as d,Y as f,Z as p,_t as m,a as h,at as g,ct as _,dt as v,et as y,ft as b,it as ee,lt as te,n as x,nt as S,ot as C,r as ne,rt as w,st as T,t as E,tt as re,ut as ie,v as D}from"./index-
|
|
1
|
+
import{i as e,m as t,p as n,r}from"./lit-runtime-BImxIzGR.js";import{l as i,o as a,t as o}from"./string-coerce-CsmDCXq_.js";import{v as s}from"./markdown-runtime-CUzFp-dW.js";import{$ as c,G as l,Q as u,X as d,Y as f,Z as p,_t as m,a as h,at as g,ct as _,dt as v,et as y,ft as b,it as ee,lt as te,n as x,nt as S,ot as C,r as ne,rt as w,st as T,t as E,tt as re,ut as ie,v as D}from"./index-D1Qre842.js";import{r as O}from"./channel-config-extras-CCelgxuV.js";import{i as k,n as ae,r as A,t as j}from"./skills-shared-CNlkuf6o.js";function oe(e){let{agent:r,configForm:i,agentFilesList:o,configLoading:s,configSaving:c,configDirty:l,onConfigReload:u,onConfigSave:d,onModelChange:f,onModelFallbacksChange:m,onSelectPanel:h}=e,v=!!(e.defaultId&&r.id===e.defaultId),y=ee(i,r.id),b=r.model,te=(o&&o.agentId===r.id?o.workspace:null)||y.entry?.workspace||y.defaults?.workspace||r.workspace||`default`,x=y.entry?.model?T(y.entry?.model):y.defaults?.model?T(y.defaults?.model):T(b),ne=g(r.agentRuntime),E=T(y.defaults?.model??b),re=_(y.entry?.model),ie=_(y.defaults?.model)||(E===`-`?null:S(E))||(i?null:_(b)),D=re??ie??null,O=v?D:re,k=C(y.entry?.model)??C(y.defaults?.model)??(i?null:C(b))??[],ae=Array.isArray(y.entry?.skills)?y.entry?.skills:null,A=ae?.length??null,j=!i||s||c,oe=r.thinkingDefault??`-`,se=e=>{let t=k.filter((t,n)=>n!==e);m(r.id,t)};return t`
|
|
2
2
|
<section class="card">
|
|
3
3
|
<div class="card-title">Overview</div>
|
|
4
4
|
<div class="card-sub">Workspace paths and identity metadata.</div>
|
|
@@ -1021,4 +1021,4 @@ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error
|
|
|
1021
1021
|
`)}
|
|
1022
1022
|
</div>
|
|
1023
1023
|
`}export{Cn as renderAgents};
|
|
1024
|
-
//# sourceMappingURL=agents-
|
|
1024
|
+
//# sourceMappingURL=agents-CeF1k4Mj.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{m as e,p as t}from"./lit-runtime-BImxIzGR.js";import{o as n}from"./string-coerce-CsmDCXq_.js";import{G as r,c as i,ht as a,l as o,mt as s,q as c}from"./index-
|
|
1
|
+
import{m as e,p as t}from"./lit-runtime-BImxIzGR.js";import{o as n}from"./string-coerce-CsmDCXq_.js";import{G as r,c as i,ht as a,l as o,mt as s,q as c}from"./index-D1Qre842.js";import{n as l,t as u}from"./channel-config-extras-CCelgxuV.js";function d(e,t){let n=e;for(let e of t){if(!n)return null;let t=a(n);if(t===`object`){let t=n.properties??{};if(typeof e==`string`&&t[e]){n=t[e];continue}let r=n.additionalProperties;if(typeof e==`string`&&r&&typeof r==`object`){n=r;continue}return null}if(t===`array`){if(typeof e!=`number`)return null;n=(Array.isArray(n.items)?n.items[0]:n.items)??null;continue}return null}return n}function f(e,t){return l(e,t)??{}}var p=[`groupPolicy`,`streamMode`,`dmPolicy`];function m(t){let n=p.flatMap(e=>e in t?[[e,t[e]]]:[]);return n.length===0?null:e`
|
|
2
2
|
<div class="status-list" style="margin-top: 12px;">
|
|
3
3
|
${n.map(([t,n])=>e`
|
|
4
4
|
<div>
|
|
@@ -364,4 +364,4 @@ ${i.snapshot?JSON.stringify(i.snapshot,null,2):n(`channels.health.noSnapshotYet`
|
|
|
364
364
|
</div>
|
|
365
365
|
</div>
|
|
366
366
|
`}export{F as renderChannels};
|
|
367
|
-
//# sourceMappingURL=channels-
|
|
367
|
+
//# sourceMappingURL=channels-C3fGrqai.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{m as e,p as t,r as n,s as r}from"./lit-runtime-BImxIzGR.js";import{o as i}from"./string-coerce-CsmDCXq_.js";import{F as a,G as o,H as s,I as c,_ as l,_t as u,a as d,n as f,pt as p,yt as m}from"./index-
|
|
1
|
+
import{m as e,p as t,r as n,s as r}from"./lit-runtime-BImxIzGR.js";import{o as i}from"./string-coerce-CsmDCXq_.js";import{F as a,G as o,H as s,I as c,_ as l,_t as u,a as d,n as f,pt as p,yt as m}from"./index-D1Qre842.js";function h(){return[{value:`ok`,label:i(`cron.runs.runStatusOk`)},{value:`error`,label:i(`cron.runs.runStatusError`)},{value:`skipped`,label:i(`cron.runs.runStatusSkipped`)}]}function g(){return[{value:`delivered`,label:i(`cron.runs.deliveryDelivered`)},{value:`not-delivered`,label:i(`cron.runs.deliveryNotDelivered`)},{value:`unknown`,label:i(`cron.runs.deliveryUnknown`)},{value:`not-requested`,label:i(`cron.runs.deliveryNotRequested`)}]}function _(e,t,n){let r=new Set(e);return n?r.add(t):r.delete(t),Array.from(r)}function v(e,t){return e.length===0?t:e.length<=2?e.join(`, `):`${e[0]} +${e.length-1}`}function y(e){let t=[`last`,...e.channels.filter(Boolean)],n=e.form.deliveryChannel?.trim();n&&!t.includes(n)&&t.push(n);let r=new Set;return t.filter(e=>r.has(e)?!1:(r.add(e),!0))}function b(e,t){if(t===`last`)return`last`;let n=e.channelMeta?.find(e=>e.id===t);return n?.label?n.label:e.channelLabels?.[t]??t}function x(t){return e`
|
|
2
2
|
<div class="field cron-filter-dropdown" data-filter=${t.id}>
|
|
3
3
|
<span>${t.title}</span>
|
|
4
4
|
<details class="cron-filter-dropdown__details">
|
|
@@ -1011,4 +1011,4 @@ import{m as e,p as t,r as n,s as r}from"./lit-runtime-BImxIzGR.js";import{o as i
|
|
|
1011
1011
|
</div>
|
|
1012
1012
|
</div>
|
|
1013
1013
|
`}export{k as renderCron};
|
|
1014
|
-
//# sourceMappingURL=cron-
|
|
1014
|
+
//# sourceMappingURL=cron-01SXAnEJ.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{m as e,p as t}from"./lit-runtime-BImxIzGR.js";import{o as n}from"./string-coerce-CsmDCXq_.js";import{U as r,i}from"./index-
|
|
1
|
+
import{m as e,p as t}from"./lit-runtime-BImxIzGR.js";import{o as n}from"./string-coerce-CsmDCXq_.js";import{U as r,i}from"./index-D1Qre842.js";function a(a){let o=(a.status&&typeof a.status==`object`?a.status.securityAudit:null)?.summary??null,s=o?.critical??0,c=o?.warn??0,l=o?.info??0,u=s>0?`danger`:c>0?`warn`:`success`,d=s>0?n(`debug.security.critical`,{count:String(s)}):c>0?n(`debug.security.warnings`,{count:String(c)}):n(`debug.security.noCriticalIssues`);return e`
|
|
2
2
|
<section class="grid">
|
|
3
3
|
<div class="card">
|
|
4
4
|
<div class="row" style="justify-content: space-between;">
|
|
@@ -94,4 +94,4 @@ ${i(t.payload)}</pre
|
|
|
94
94
|
`}
|
|
95
95
|
</section>
|
|
96
96
|
`}export{a as renderDebug};
|
|
97
|
-
//# sourceMappingURL=debug-
|
|
97
|
+
//# sourceMappingURL=debug-B8zuijMC.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./agents-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./agents-CeF1k4Mj.js","./string-coerce-CsmDCXq_.js","./lit-runtime-BImxIzGR.js","./markdown-runtime-CUzFp-dW.js","./rolldown-runtime-QTnfLwEv.js","./channel-config-extras-CCelgxuV.js","./skills-shared-CNlkuf6o.js","./activity-C_HZe0c-.js","./channels-C3fGrqai.js","./cron-01SXAnEJ.js","./debug-B8zuijMC.js","./instances-izquLPnA.js","./logs-DPetTn3l.js","./nodes-e5Cze-NX.js","./sessions-BRqy7EPO.js","./skill-workshop-DHBE6rsG.js","./skills-BXLJ4lgH.js","./usage-CrcXmrp7.js","./workboard-CnCeQDxS.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{a as t,c as n,d as r,f as i,g as a,i as o,l as s,m as c,n as l,o as u,p as d,r as f,s as p,t as m,u as h}from"./lit-runtime-BImxIzGR.js";import{a as g,c as _,d as v,i as y,l as b,n as x,o as S,r as C,s as ee,t as w,u as T}from"./string-coerce-CsmDCXq_.js";import{i as te,n as ne,r as re,t as ie}from"./gateway-runtime-CMyVbEq5.js";import{n as E,r as ae,t as D}from"./config-runtime-CCw2hptH.js";import{_ as O,a as oe,c as se,d as ce,f as le,g as ue,h as k,i as de,l as fe,m as pe,n as me,o as he,p as ge,r as _e,s as ve,t as ye,u as A,v as be}from"./markdown-runtime-CUzFp-dW.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function xe(e){return(e??[]).map(e=>C(String(e))??``).filter(Boolean)}function Se(e){return[...new Set(e)]}function Ce(e){return Se(e)}function we(e){return Ce(e).toSorted((e,t)=>e<t?-1:+(e>t))}function Te(e){return e?/[\r\n]/.test(e)?null:e:null}function Ee(e){return Te(C(e.hello?.auth?.deviceToken)??null)??Te(C(e.settings?.token)??null)??Te(C(e.password)??null)??null}function De(e){let t=Ee(e);return t?`Bearer ${t}`:null}function j(e){return Ce([C(e.hello?.auth?.deviceToken),C(e.settings?.token),C(e.password)].flatMap(e=>Te(e??null)??[]))}function Oe(e){if(typeof e==`string`)return e.trim()||void 0}function ke(e){if(!Array.isArray(e))return;let t=e.map(e=>Oe(e)).filter(e=>!!e);return t.length>0?t:void 0}var M={AUTH_REQUIRED:`AUTH_REQUIRED`,AUTH_UNAUTHORIZED:`AUTH_UNAUTHORIZED`,AUTH_TOKEN_MISSING:`AUTH_TOKEN_MISSING`,AUTH_TOKEN_MISMATCH:`AUTH_TOKEN_MISMATCH`,AUTH_TOKEN_NOT_CONFIGURED:`AUTH_TOKEN_NOT_CONFIGURED`,AUTH_PASSWORD_MISSING:`AUTH_PASSWORD_MISSING`,AUTH_PASSWORD_MISMATCH:`AUTH_PASSWORD_MISMATCH`,AUTH_PASSWORD_NOT_CONFIGURED:`AUTH_PASSWORD_NOT_CONFIGURED`,AUTH_BOOTSTRAP_TOKEN_INVALID:`AUTH_BOOTSTRAP_TOKEN_INVALID`,AUTH_DEVICE_TOKEN_MISMATCH:`AUTH_DEVICE_TOKEN_MISMATCH`,AUTH_SCOPE_MISMATCH:`AUTH_SCOPE_MISMATCH`,AUTH_RATE_LIMITED:`AUTH_RATE_LIMITED`,AUTH_TAILSCALE_IDENTITY_MISSING:`AUTH_TAILSCALE_IDENTITY_MISSING`,AUTH_TAILSCALE_PROXY_MISSING:`AUTH_TAILSCALE_PROXY_MISSING`,AUTH_TAILSCALE_WHOIS_FAILED:`AUTH_TAILSCALE_WHOIS_FAILED`,AUTH_TAILSCALE_IDENTITY_MISMATCH:`AUTH_TAILSCALE_IDENTITY_MISMATCH`,CONTROL_UI_ORIGIN_NOT_ALLOWED:`CONTROL_UI_ORIGIN_NOT_ALLOWED`,PROTOCOL_MISMATCH:`PROTOCOL_MISMATCH`,CONTROL_UI_DEVICE_IDENTITY_REQUIRED:`CONTROL_UI_DEVICE_IDENTITY_REQUIRED`,DEVICE_IDENTITY_REQUIRED:`DEVICE_IDENTITY_REQUIRED`,DEVICE_AUTH_INVALID:`DEVICE_AUTH_INVALID`,DEVICE_AUTH_DEVICE_ID_MISMATCH:`DEVICE_AUTH_DEVICE_ID_MISMATCH`,DEVICE_AUTH_SIGNATURE_EXPIRED:`DEVICE_AUTH_SIGNATURE_EXPIRED`,DEVICE_AUTH_NONCE_REQUIRED:`DEVICE_AUTH_NONCE_REQUIRED`,DEVICE_AUTH_NONCE_MISMATCH:`DEVICE_AUTH_NONCE_MISMATCH`,DEVICE_AUTH_SIGNATURE_INVALID:`DEVICE_AUTH_SIGNATURE_INVALID`,DEVICE_AUTH_PUBLIC_KEY_INVALID:`DEVICE_AUTH_PUBLIC_KEY_INVALID`,PAIRING_REQUIRED:`PAIRING_REQUIRED`,CLIENT_VERSION_MISMATCH:`CLIENT_VERSION_MISMATCH`},Ae={NOT_PAIRED:`not-paired`,ROLE_UPGRADE:`role-upgrade`,SCOPE_UPGRADE:`scope-upgrade`,METADATA_UPGRADE:`metadata-upgrade`},je=new Set([`retry_with_device_token`,`update_auth_configuration`,`update_auth_credentials`,`wait_then_retry`,`review_auth_configuration`]),Me=new Set([`not-paired`,`role-upgrade`,`scope-upgrade`,`metadata-upgrade`]),Ne=/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/,Pe={"not-paired":{requirement:`device is not approved yet`,remediationHint:`Approve this device from the pending pairing requests.`,recoveryTitle:`Gateway pairing approval required.`},"role-upgrade":{requirement:`device is asking for a higher role than currently approved`,remediationHint:`Review the requested role upgrade, then approve the pending request.`,recoveryTitle:`Gateway role upgrade approval required.`},"scope-upgrade":{requirement:`device is asking for more scopes than currently approved`,remediationHint:`Review the requested scopes, then approve the pending upgrade.`,recoveryTitle:`Gateway scope upgrade approval required.`},"metadata-upgrade":{requirement:`device identity changed and must be re-approved`,remediationHint:`Review the refreshed device details, then approve the pending request.`,recoveryTitle:`Gateway device refresh approval required.`}},Fe={"not-paired":`device pairing required`,"role-upgrade":`role upgrade pending approval`,"scope-upgrade":`scope upgrade pending approval`,"metadata-upgrade":`device metadata change pending approval`};function Ie(e){if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e.code;return typeof t==`string`&&t.trim().length>0?t:null}function Le(e){if(!e||typeof e!=`object`||Array.isArray(e))return{};let t=e,n=typeof t.canRetryWithDeviceToken==`boolean`?t.canRetryWithDeviceToken:void 0,r=Oe(t.recommendedNextStep)??``;return{canRetryWithDeviceToken:n,recommendedNextStep:je.has(r)?r:void 0}}function Re(e){let t=Oe(e)??``;return Me.has(t)?t:void 0}function ze(e){let t=Oe(e);return t&&Ne.test(t)?t:void 0}function Be(e){return ke(e)}function Ve(e){return{code:M.PAIRING_REQUIRED,...e.reason?{reason:e.reason}:{},...e.requestId?{requestId:e.requestId}:{},...e.remediationHint?{remediationHint:e.remediationHint}:{},...e.recommendedNextStep?{recommendedNextStep:e.recommendedNextStep}:{},...e.retryable===void 0?{}:{retryable:e.retryable},...e.pauseReconnect===void 0?{}:{pauseReconnect:e.pauseReconnect},...e.deviceId?{deviceId:e.deviceId}:{},...e.requestedRole?{requestedRole:e.requestedRole}:{},...e.requestedScopes?{requestedScopes:e.requestedScopes}:{},...e.approvedRoles?{approvedRoles:e.approvedRoles}:{},...e.approvedScopes?{approvedScopes:e.approvedScopes}:{}}}function He(e){return e?Pe[e].requirement:`device approval is required`}function Ue(e){return e?Pe[e].remediationHint:`Approve the pending device request before retrying.`}function We(e){if(Ie(e)!==M.PAIRING_REQUIRED||!e||typeof e!=`object`||Array.isArray(e))return null;let t=e,n=Re(t.reason),r=ze(t.requestId),i=Oe(t.remediationHint)??Ue(n),a=Oe(t.recommendedNextStep)??``,o=je.has(a)?a:void 0,s=Oe(t.deviceId),c=Oe(t.requestedRole),l=Be(t.requestedScopes),u=Be(t.approvedRoles),d=Be(t.approvedScopes);return Ve({reason:n,requestId:r,remediationHint:i,recommendedNextStep:o,retryable:typeof t.retryable==`boolean`?t.retryable:void 0,pauseReconnect:typeof t.pauseReconnect==`boolean`?t.pauseReconnect:void 0,deviceId:s,requestedRole:c,requestedScopes:l,approvedRoles:u,approvedScopes:d})}function Ge(e){let t=Oe(e);if(!t)return null;let n=t.trim().toLowerCase(),r;for(let[e,t]of Object.entries(Fe))if(n.includes(t)){r=e;break}if(!r&&n.includes(`pairing required`)&&(r=Ae.NOT_PAIRED),!r)return null;let i=ze(t.match(/\(requestId:\s*([^\s)]+)\)/i)?.[1]);return{...i?{requestId:i}:{},reason:r}}function Ke(e){let t=We(e),n=Fe[t?.reason??Ae.NOT_PAIRED];return t?.requestId?`${n} (requestId: ${t.requestId})`:n}function qe(e){return Ie(e.details)===M.PAIRING_REQUIRED?Ke(e.details):Ie(e.details)===M.PROTOCOL_MISMATCH?Je(e.message,e.details):Oe(e.message)??`gateway request failed`}function Je(e,t){let n=t,r=Ye(n.clientMinProtocol),i=Ye(n.clientMaxProtocol),a=Ye(n.expectedProtocol),o=Ye(n.minimumProbeProtocol),s=[];r!==void 0&&i!==void 0&&s.push(r===i?`Control UI v${r}`:`Control UI v${r}-v${i}`),a!==void 0&&s.push(`Gateway v${a}`),o!==void 0&&s.push(`probe min v${o}`);let c=Oe(e)??`protocol mismatch`;return s.length>0?`${c}: ${s.join(`, `)}`:c}function Ye(e){return typeof e==`number`&&Number.isInteger(e)&&e>0?e:void 0}var Xe={WEBCHAT_UI:`webchat-ui`,CONTROL_UI:`openclaw-control-ui`,TUI:`openclaw-tui`,WEBCHAT:`webchat`,CLI:`cli`,GATEWAY_CLIENT:`gateway-client`,MACOS_APP:`openclaw-macos`,IOS_APP:`openclaw-ios`,ANDROID_APP:`openclaw-android`,NODE_HOST:`node-host`,TEST:`test`,FINGERPRINT:`fingerprint`,PROBE:`openclaw-probe`},Ze=Xe,Qe={WEBCHAT:`webchat`,CLI:`cli`,UI:`ui`,BACKEND:`backend`,NODE:`node`,PROBE:`probe`,TEST:`test`};new Set(Object.values(Xe)),new Set(Object.values(Qe));var $e=100,et=2e3;function tt(e){return typeof e==`object`&&!!e&&e.reason===`startup-sidecars`}function nt(e){if(!e||typeof e!=`object`)return!1;let t=e;return(t.gatewayCode??t.code)===`UNAVAILABLE`&&t.retryable===!0&&tt(t.details)}function rt(e){if(!nt(e))return null;let t=e.retryAfterMs;return Math.min(Math.max(Math.floor(typeof t==`number`&&Number.isFinite(t)?t:500),$e),et)}function it(e){let t=e.scopes.join(`,`),n=e.token??``;return[`v2`,e.deviceId,e.clientId,e.clientMode,e.role,t,String(e.signedAtMs),n,e.nonce].join(`|`)}function at(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ot(e){return at(e)?e:void 0}function st(e){return e&&typeof e==`object`?e:void 0}function ct(e){return e.trim()}function lt(e){if(!Array.isArray(e))return[];let t=new Set;for(let n of e){if(typeof n!=`string`)continue;let e=n.trim();e&&t.add(e)}return t.has(`operator.admin`)?(t.add(`operator.read`),t.add(`operator.write`)):t.has(`operator.write`)&&t.add(`operator.read`),[...t].toSorted()}function ut(e,t){if(!at(t)||typeof t.token!=`string`)return null;let n=typeof t.updatedAtMs==`number`&&Number.isFinite(t.updatedAtMs)?t.updatedAtMs:0;return{token:t.token,role:e,scopes:lt(Array.isArray(t.scopes)?t.scopes:void 0),updatedAtMs:n}}function dt(e){let t={};for(let[n,r]of Object.entries(e)){let e=ct(n);if(!e)continue;let i=ut(e,r);i&&(t[e]=i)}return t}function ft(e){let t=e.adapter.readStore();if(!t||t.deviceId!==e.deviceId)return null;let n=ct(e.role);return ut(n,t.tokens[n])}function pt(e){let t=ct(e.role),n=e.adapter.readStore(),r={version:1,deviceId:e.deviceId,tokens:n&&n.deviceId===e.deviceId&&n.tokens?dt(n.tokens):{}},i={token:e.token,role:t,scopes:lt(e.scopes),updatedAtMs:Date.now()};return r.tokens[t]=i,e.adapter.writeStore(r),i}function mt(e){let t=e.adapter.readStore();if(!t||t.deviceId!==e.deviceId)return;let n=ct(e.role);if(!t.tokens[n])return;let r={version:1,deviceId:t.deviceId,tokens:dt(t.tokens)};delete r.tokens[n],e.adapter.writeStore(r)}var ht=`openclaw.device.auth.v1`;function gt(){try{let e=T()?.getItem(ht);if(!e)return null;let t=JSON.parse(e);return!t||t.version!==1||!t.deviceId||typeof t.deviceId!=`string`||!t.tokens||typeof t.tokens!=`object`?null:t}catch{return null}}function _t(e){try{T()?.setItem(ht,JSON.stringify(e))}catch{}}function vt(e){return ft({adapter:{readStore:gt,writeStore:_t},deviceId:e.deviceId,role:e.role})}function yt(e){return pt({adapter:{readStore:gt,writeStore:_t},deviceId:e.deviceId,role:e.role,token:e.token,scopes:e.scopes})}function bt(e){mt({adapter:{readStore:gt,writeStore:_t},deviceId:e.deviceId,role:e.role})}var xt=`openclaw-device-identity-v1`;function St(e){let t=``;for(let n of e)t+=String.fromCharCode(n);return btoa(t).replaceAll(`+`,`-`).replaceAll(`/`,`_`).replace(/=+$/g,``)}function Ct(e){let t=e.replaceAll(`-`,`+`).replaceAll(`_`,`/`),n=t+`=`.repeat((4-t.length%4)%4),r=atob(n),i=new Uint8Array(r.length);for(let e=0;e<r.length;e+=1)i[e]=r.charCodeAt(e);return i}function wt(e){return Array.from(e).map(e=>e.toString(16).padStart(2,`0`)).join(``)}async function Tt(e){let t=await crypto.subtle.digest(`SHA-256`,e.slice().buffer);return wt(new Uint8Array(t))}async function Et(){let e=te.randomSecretKey(),t=await ne(e);return{deviceId:await Tt(t),publicKey:St(t),privateKey:St(e)}}async function Dt(){let e=T();try{let t=e?.getItem(xt);if(t){let n=JSON.parse(t);if(n?.version===1&&typeof n.deviceId==`string`&&typeof n.publicKey==`string`&&typeof n.privateKey==`string`){let t=await Tt(Ct(n.publicKey));if(t!==n.deviceId){let r={...n,deviceId:t};return e?.setItem(xt,JSON.stringify(r)),{deviceId:t,publicKey:n.publicKey,privateKey:n.privateKey}}return{deviceId:n.deviceId,publicKey:n.publicKey,privateKey:n.privateKey}}}}catch{}let t=await Et(),n={version:1,deviceId:t.deviceId,publicKey:t.publicKey,privateKey:t.privateKey,createdAtMs:Date.now()};return e?.setItem(xt,JSON.stringify(n)),t}async function Ot(e,t){let n=Ct(e);return St(await re(new TextEncoder().encode(t),n))}var kt=!1;function At(e){e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=``;for(let n of e)t+=n.toString(16).padStart(2,`0`);return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}function jt(){kt||(kt=!0,console.warn(`[uuid] crypto API missing; refusing insecure UUID generation`))}function Mt(e=globalThis.crypto){if(e&&typeof e.randomUUID==`function`)return e.randomUUID();if(e&&typeof e.getRandomValues==`function`){let t=new Uint8Array(16);return e.getRandomValues(t),At(t)}throw jt(),Error(`Web Crypto is required for UUID generation`)}var Nt=class extends Error{constructor(e){super(qe({message:e.message,details:Pt(e.message,e.details)})),this.name=`GatewayRequestError`,this.gatewayCode=e.code,this.details=e.details,this.retryable=e.retryable===!0,this.retryAfterMs=e.retryAfterMs}};function Pt(e,t){return Ie(t)===M.PROTOCOL_MISMATCH||!e?.toLowerCase().includes(`protocol mismatch`)?t:{code:M.PROTOCOL_MISMATCH,clientMinProtocol:4,clientMaxProtocol:4,...t&&typeof t==`object`&&!Array.isArray(t)?t:{}}}function Ft(e){return Ie(e?.details)}function It(e){let t=We(e);return t?.pauseReconnect===!1||t?.recommendedNextStep===`wait_then_retry`}function Lt(e){if(!e)return!1;let t=Ft(e);return t===M.PAIRING_REQUIRED&&It(e.details)?!1:t===M.AUTH_TOKEN_MISSING||t===M.AUTH_BOOTSTRAP_TOKEN_INVALID||t===M.AUTH_PASSWORD_MISSING||t===M.AUTH_PASSWORD_MISMATCH||t===M.AUTH_RATE_LIMITED||t===M.AUTH_DEVICE_TOKEN_MISMATCH||t===M.AUTH_SCOPE_MISMATCH||t===M.PAIRING_REQUIRED||t===M.CONTROL_UI_DEVICE_IDENTITY_REQUIRED||t===M.DEVICE_IDENTITY_REQUIRED}function Rt(e){let t=e.split(`.`);return t.length!==4||t[0]!==`127`?!1:t.every(e=>{if(!/^\d+$/.test(e))return!1;let t=Number(e);return t>=0&&t<=255})}function zt(e){try{let t=new URL(e,window.location.href),n=t.hostname.trim().toLowerCase(),r=n===`localhost`||n===`::1`||n===`[::1]`,i=Rt(n);if(r||i)return!0;let a=new URL(window.location.href);return t.host===a.host}catch{return!1}}var Bt=`operator`,Vt=[`operator.admin`,`operator.read`,`operator.write`,`operator.approvals`,`operator.pairing`],Ht=4008,Ut=4013,Wt=1006,Gt=`BROWSER_WEBSOCKET_CONSTRUCTOR_ERROR`,Kt=`BROWSER_WEBSOCKET_SECURITY_ERROR`;function qt(e){let t=e.authToken;if(t||e.authPassword)return{token:t,deviceToken:e.authDeviceToken??e.resolvedDeviceToken,password:e.authPassword}}function Jt(e){return e instanceof Error&&e.message?e.message:String(e)}function Yt(e){if(e instanceof Error&&e.name)return e.name;if(e&&typeof e==`object`&&`name`in e){let t=e.name;return typeof t==`string`&&t.trim()?t:void 0}}function Xt(e){let t=Yt(e)?.toLowerCase(),n=Jt(e).toLowerCase();return t===`securityerror`||n.includes(`security error`)||n.includes(`mixed content`)||n.includes(`insecure websocket`)}function Zt(e,t){let n=Xt(e),r=Jt(e),i=t.trim().toLowerCase().startsWith(`ws://`);return n?{code:Kt,message:`Browser refused the Gateway WebSocket for security reasons.`+(i?` Use wss:// when the Control UI is served over HTTPS/Tailscale Serve, or open the loopback dashboard at http://127.0.0.1:18789.`:` Check the Gateway WebSocket URL and browser security policy.`),details:{code:Kt,browserErrorName:Yt(e),browserMessage:r}}:{code:Gt,message:`Could not create the Gateway WebSocket: ${r}`,details:{code:Gt,browserErrorName:Yt(e),browserMessage:r}}}function Qt(e){return e.storedToken&&(e.resolvedDeviceToken===e.storedToken||e.authDeviceToken===e.storedToken)&&e.storedScopes&&e.storedScopes.length>0?[...e.storedScopes]:[...Vt]}async function $t(e){let{deviceIdentity:t}=e;if(!t)return;let n=Date.now(),r=e.connectNonce??``,i=it({deviceId:t.deviceId,clientId:e.client.id,clientMode:e.client.mode,role:e.role,scopes:e.scopes,signedAtMs:n,token:e.authToken??null,nonce:r}),a=await Ot(t.privateKey,i);return{id:t.deviceId,publicKey:t.publicKey,signature:a,signedAt:n,nonce:r}}function en(e){return!e.deviceTokenRetryBudgetUsed&&!e.authDeviceToken&&!!e.explicitGatewayToken&&!!e.deviceIdentity&&!!e.storedToken&&e.canRetryWithDeviceTokenHint&&zt(e.url)}var tn=class{constructor(e){this.opts=e,this.ws=null,this.pending=new Map,this.closed=!1,this.lastSeq=null,this.connectNonce=null,this.connectSent=!1,this.connectTimer=null,this.connectGeneration=0,this.backoffMs=800,this.pendingDeviceTokenRetry=!1,this.deviceTokenRetryBudgetUsed=!1,this.pendingStartupReconnectDelayMs=null,this.eventListeners=new Set,this.connectTiming=new Map}start(){this.closed=!1,this.connect()}stop(){this.closed=!0,this.clearConnectTimer(),this.ws?.close(),this.ws=null,this.pendingConnectError=void 0,this.pendingDeviceTokenRetry=!1,this.deviceTokenRetryBudgetUsed=!1,this.pendingStartupReconnectDelayMs=null,this.connectTiming.clear(),this.flushPending(Error(`gateway client stopped`))}get connected(){return this.ws?.readyState===WebSocket.OPEN}connect(){if(this.closed)return;let e;try{e=new WebSocket(this.opts.url)}catch(e){let t=Zt(e,this.opts.url);this.ws=null,this.pendingConnectError=void 0,this.pendingDeviceTokenRetry=!1,this.pendingStartupReconnectDelayMs=null,this.flushPending(Error(t.message)),this.opts.onClose?.({code:Wt,reason:t.code===Kt?`security error`:`websocket error`,error:t});return}let t=++this.connectGeneration;this.ws=e,this.startConnectTiming(t),e.addEventListener(`open`,()=>this.queueConnect(e,t)),e.addEventListener(`message`,n=>{this.isActiveSocket(e,t)&&this.handleMessage(e,t,String(n.data??``))}),e.addEventListener(`close`,n=>{if(this.ws!==e)return;let r=n.reason??``,i=this.pendingConnectError;if(this.pendingConnectError=void 0,this.emitConnectTiming(t,`failed`,{errorCode:i?.code??`SOCKET_CLOSED`}),this.ws=null,this.pendingStartupReconnectDelayMs!==null){this.flushPending(Error(`gateway closed (${n.code}): ${r}`)),this.scheduleReconnect();return}if(this.flushPending(Error(`gateway closed (${n.code}): ${r}`)),this.opts.onClose?.({code:n.code,reason:r,error:i}),Ft(i)===M.AUTH_TOKEN_MISMATCH){this.pendingDeviceTokenRetry&&this.scheduleReconnect();return}Lt(i)||this.scheduleReconnect()}),e.addEventListener(`error`,()=>{})}scheduleReconnect(){if(this.closed)return;let e=this.pendingStartupReconnectDelayMs;this.pendingStartupReconnectDelayMs=null;let t=e??this.backoffMs;e===null&&(this.backoffMs=Math.min(this.backoffMs*1.7,15e3)),this.clearConnectTimer(),this.connectTimer=window.setTimeout(()=>{this.connectTimer=null,this.connect()},t)}flushPending(e){for(let[t,n]of this.pending)this.emitRequestTiming(t,n,!1,`CLIENT_CLOSED`),n.reject(e);this.pending.clear()}nowMs(){return typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now()}startConnectTiming(e){let t=this.nowMs();this.connectTiming.set(e,{startedAtMs:t,lastAtMs:t,hasChallenge:!1,usedFallback:!1})}updateConnectTimingState(e,t){let n=this.connectTiming.get(e);n&&Object.assign(n,t)}emitConnectTiming(e,t,n={}){let r=this.connectTiming.get(e);if(!r)return;let i=this.nowMs();try{this.opts.onConnectTiming?.({generation:e,phase:t,durationMs:Math.max(0,i-r.startedAtMs),phaseDurationMs:Math.max(0,i-r.lastAtMs),hasChallenge:r.hasChallenge,usedFallback:r.usedFallback,...n})}catch(e){console.error(`[gateway] connect timing handler error:`,e)}finally{r.lastAtMs=i,(t===`hello`||t===`failed`)&&this.connectTiming.delete(e)}}emitRequestTiming(e,t,n,r){let i=this.nowMs();try{this.opts.onRequestTiming?.({id:e,method:t.method,ok:n,durationMs:Math.max(0,i-t.startedAtMs),startedAtMs:t.startedAtMs,endedAtMs:i,errorCode:r})}catch(e){console.error(`[gateway] request timing handler error:`,e)}}connectPlanTimingPayload(e){return{secureContext:!!e.deviceIdentity,hasDeviceIdentity:!!e.deviceIdentity,hasDevice:!!e.device,hasAuthToken:!!e.selectedAuth.authToken,hasDeviceToken:!!(e.selectedAuth.authDeviceToken??e.selectedAuth.resolvedDeviceToken),hasPassword:!!e.selectedAuth.authPassword}}buildConnectClient(){return{id:this.opts.clientName??Ze.CONTROL_UI,version:this.opts.clientVersion??`control-ui`,platform:this.opts.platform??navigator.platform??`web`,mode:this.opts.mode??Qe.WEBCHAT,instanceId:this.opts.instanceId}}buildConnectParams(e){return{minProtocol:4,maxProtocol:4,client:e.client,role:e.role,scopes:e.scopes,device:e.device,caps:[`tool-events`],auth:e.auth,userAgent:navigator.userAgent,locale:navigator.language}}async buildConnectPlan(e,t){let n=Bt,r=this.buildConnectClient(),i=this.opts.token?.trim()||void 0,a=this.opts.password?.trim()||void 0,o=typeof crypto<`u`&&!!crypto.subtle,s=null,c={authToken:i,authPassword:a,canFallbackToShared:!1};o&&(s=await Dt(),this.emitConnectTiming(t,`device-identity-ready`,{secureContext:!0,hasDeviceIdentity:!0}),c=this.selectConnectAuth({role:n,deviceId:s.deviceId}));let l=Qt(c),u=await $t({deviceIdentity:s,client:r,role:n,scopes:l,authToken:c.authToken,connectNonce:e});return this.emitConnectTiming(t,`connect-plan-ready`,{secureContext:o,hasDeviceIdentity:!!s,hasDevice:!!u,hasAuthToken:!!c.authToken,hasDeviceToken:!!(c.authDeviceToken??c.resolvedDeviceToken),hasPassword:!!c.authPassword}),{role:n,scopes:l,client:r,explicitGatewayToken:i,selectedAuth:c,auth:qt(c),deviceIdentity:s,device:u}}handleConnectHello(e,t,n,r){this.isActiveSocket(n,r)&&(this.pendingDeviceTokenRetry=!1,this.deviceTokenRetryBudgetUsed=!1,this.pendingStartupReconnectDelayMs=null,e?.auth?.deviceToken&&t.deviceIdentity&&yt({deviceId:t.deviceIdentity.deviceId,role:e.auth.role??t.role,token:e.auth.deviceToken,scopes:e.auth.scopes??[]}),this.backoffMs=800,this.emitConnectTiming(r,`hello`,this.connectPlanTimingPayload(t)),this.opts.onHello?.(e))}handleConnectFailure(e,t,n,r){if(!this.isActiveSocket(n,r))return;let i=e instanceof Nt?Ft(e):null,a=e instanceof Nt?Le(e.details):{},o=a.recommendedNextStep===`retry_with_device_token`,s=a.canRetryWithDeviceToken===!0||o||i===M.AUTH_TOKEN_MISMATCH;en({deviceTokenRetryBudgetUsed:this.deviceTokenRetryBudgetUsed,authDeviceToken:t.selectedAuth.authDeviceToken,explicitGatewayToken:t.explicitGatewayToken,deviceIdentity:t.deviceIdentity,storedToken:t.selectedAuth.storedToken,canRetryWithDeviceTokenHint:s,url:this.opts.url})&&(this.pendingDeviceTokenRetry=!0,this.deviceTokenRetryBudgetUsed=!0),e instanceof Nt?this.pendingConnectError={code:e.gatewayCode,message:e.message,details:e.details,retryable:e.retryable,retryAfterMs:e.retryAfterMs}:this.pendingConnectError=void 0,this.emitConnectTiming(r,`failed`,{...this.connectPlanTimingPayload(t),errorCode:e instanceof Nt?e.gatewayCode:`CLIENT_CONNECT_ERROR`}),t.selectedAuth.storedToken&&(t.selectedAuth.resolvedDeviceToken===t.selectedAuth.storedToken||t.selectedAuth.authDeviceToken===t.selectedAuth.storedToken)&&t.deviceIdentity&&i===M.AUTH_DEVICE_TOKEN_MISMATCH&&bt({deviceId:t.deviceIdentity.deviceId,role:t.role});let c=rt(e);if(c!==null&&(this.pendingStartupReconnectDelayMs=c),nt(e)){n.close(Ut,`gateway starting`);return}n.close(Ht,`connect failed`)}isActiveSocket(e,t){return!this.closed&&this.ws===e&&this.connectGeneration===t}async sendConnect(e,t){if(!this.isActiveSocket(e,t)||e.readyState!==WebSocket.OPEN||this.connectSent)return;this.connectSent=!0,this.clearConnectTimer();let n=await this.buildConnectPlan(this.connectNonce,t);!this.isActiveSocket(e,t)||e.readyState!==WebSocket.OPEN||(this.pendingDeviceTokenRetry&&n.selectedAuth.authDeviceToken&&(this.pendingDeviceTokenRetry=!1),this.emitConnectTiming(t,`request-sent`,this.connectPlanTimingPayload(n)),this.requestOnSocket(e,`connect`,this.buildConnectParams(n)).then(r=>this.handleConnectHello(r,n,e,t)).catch(r=>this.handleConnectFailure(r,n,e,t)))}handleMessage(e,t,n){let r;try{r=JSON.parse(n)}catch{return}let i=r;if(i.type===`event`){let n=r;if(n.event===`connect.challenge`){let r=n.payload,i=r&&typeof r.nonce==`string`?r.nonce:null;i&&(this.connectNonce=i,this.updateConnectTimingState(t,{hasChallenge:!0}),this.emitConnectTiming(t,`challenge`),this.sendConnect(e,t));return}let i=typeof n.seq==`number`?n.seq:null;i!==null&&(this.lastSeq!==null&&i>this.lastSeq+1&&this.opts.onGap?.({expected:this.lastSeq+1,received:i}),this.lastSeq=i);try{this.opts.onEvent?.(n);for(let e of this.eventListeners)e(n)}catch(e){console.error(`[gateway] event handler error:`,e)}return}if(i.type===`res`){let e=r,t=this.pending.get(e.id);if(!t)return;this.pending.delete(e.id),e.ok?(this.emitRequestTiming(e.id,t,!0),t.resolve(e.payload)):(this.emitRequestTiming(e.id,t,!1,e.error?.code),t.reject(new Nt({code:e.error?.code??`UNAVAILABLE`,message:e.error?.message??`request failed`,details:e.error?.details,retryable:e.error?.retryable,retryAfterMs:e.error?.retryAfterMs})))}}selectConnectAuth(e){let t=this.opts.token?.trim()||void 0,n=this.opts.password?.trim()||void 0,r=vt({deviceId:e.deviceId,role:e.role}),i=r?.scopes??[],a=e.role!==Bt||i.includes(`operator.read`)||i.includes(`operator.write`)||i.includes(`operator.admin`)?r?.token:void 0,o=this.pendingDeviceTokenRetry&&!!t&&!!a&&zt(this.opts.url),s=t||n?void 0:a??void 0;return{authToken:t??s,authDeviceToken:o?a??void 0:void 0,authPassword:n,resolvedDeviceToken:s,storedToken:a??void 0,storedScopes:r?.scopes??void 0,canFallbackToShared:!!(a&&t)}}request(e,t){return!this.ws||this.ws.readyState!==WebSocket.OPEN?Promise.reject(Error(`gateway not connected`)):this.requestOnSocket(this.ws,e,t)}requestOnSocket(e,t,n){if(this.ws!==e||e.readyState!==WebSocket.OPEN)return Promise.reject(Error(`gateway not connected`));let r=Mt(),i={type:`req`,id:r,method:t,params:n},a=this.nowMs(),o=new Promise((e,n)=>{this.pending.set(r,{resolve:t=>e(t),reject:n,method:t,startedAtMs:a})});return e.send(JSON.stringify(i)),o}addEventListener(e){return this.eventListeners.add(e),()=>{this.eventListeners.delete(e)}}queueConnect(e,t){this.isActiveSocket(e,t)&&(this.connectNonce=null,this.connectSent=!1,this.clearConnectTimer(),this.emitConnectTiming(t,`socket-open`),this.connectTimer=window.setTimeout(()=>{this.connectTimer=null,this.updateConnectTimingState(t,{usedFallback:!0}),this.emitConnectTiming(t,`fallback`),this.sendConnect(e,t)},750))}clearConnectTimer(){this.connectTimer!==null&&(window.clearTimeout(this.connectTimer),this.connectTimer=null)}};function nn(e){return e instanceof Nt?Ft(e)===M.AUTH_UNAUTHORIZED?!0:e.message.includes(`missing scope: operator.read`):!1}function rn(e){return`This connection is missing operator.read, so ${e} cannot be loaded yet.`}function an(e){return new Promise(t=>{setTimeout(()=>t(`timeout`),e)})}async function on(e,t,n={}){if(!e.client||!e.connected||e.channelsLoading&&(!e.channelsLoadingProbe||t))return;let r=(e.channelsRefreshSeq??0)+1;e.channelsRefreshSeq=r,e.channelsLoading=!0,e.channelsLoadingProbe=t,e.channelsError=null;let i=(async()=>{try{let n=await e.client.request(`channels.status`,{probe:t,timeoutMs:8e3});if(e.channelsRefreshSeq!==r)return;e.channelsSnapshot=n,e.channelsLastSuccess=Date.now()}catch(t){if(e.channelsRefreshSeq!==r)return;nn(t)?(e.channelsSnapshot=null,e.channelsError=rn(`channel status`)):e.channelsError=String(t)}finally{e.channelsRefreshSeq===r&&(e.channelsLoading=!1,e.channelsLoadingProbe=null)}})(),a=n.softTimeoutMs;if(typeof a==`number`&&a>0)return await Promise.race([i.then(()=>`done`),an(a)]),void 0;await i}async function sn(e,t){if(!(!e.client||!e.connected||e.whatsappBusy)){e.whatsappBusy=!0;try{let n=await e.client.request(`web.login.start`,{force:t,timeoutMs:3e4});e.whatsappLoginMessage=n.message??null,e.whatsappLoginQrDataUrl=n.qrDataUrl??null,e.whatsappLoginConnected=typeof n.connected==`boolean`?n.connected:null}catch(t){e.whatsappLoginMessage=String(t),e.whatsappLoginQrDataUrl=null,e.whatsappLoginConnected=null}finally{e.whatsappBusy=!1}}}async function cn(e){if(!(!e.client||!e.connected||e.whatsappBusy)){e.whatsappBusy=!0;try{let t=await e.client.request(`web.login.wait`,{timeoutMs:12e4,currentQrDataUrl:e.whatsappLoginQrDataUrl??void 0});e.whatsappLoginMessage=t.message??null,e.whatsappLoginConnected=t.connected??null,t.qrDataUrl?e.whatsappLoginQrDataUrl=t.qrDataUrl:t.connected&&(e.whatsappLoginQrDataUrl=null)}catch(t){e.whatsappLoginMessage=String(t),e.whatsappLoginConnected=null}finally{e.whatsappBusy=!1}}}async function ln(e){if(!(!e.client||!e.connected||e.whatsappBusy)){e.whatsappBusy=!0;try{await e.client.request(`channels.logout`,{channel:`whatsapp`}),e.whatsappLoginMessage=`Logged out.`,e.whatsappLoginQrDataUrl=null,e.whatsappLoginConnected=null}catch(t){e.whatsappLoginMessage=String(t)}finally{e.whatsappBusy=!1}}}function un(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.prototype.toString.call(e)===`[object Object]`}var dn=new Set([`__proto__`,`prototype`,`constructor`]);function fn(e){return dn.has(e)}function pn(e){return un(e)?typeof e.id==`string`&&e.id.length>0:!1}function mn(e,t,n){if(!e.every(pn))return;let r=[...e],i=new Map;for(let[e,t]of r.entries()){if(!pn(t))return;i.set(t.id,e)}for(let e of t){if(!pn(e)){r.push(structuredClone(e));continue}let t=i.get(e.id);if(t===void 0){r.push(structuredClone(e)),i.set(e.id,r.length-1);continue}r[t]=hn(r[t],e,n)}return r}function hn(e,t,n={}){if(!un(t))return t;let r=un(e)?{...e}:{};for(let[e,i]of Object.entries(t))if(!fn(e)){if(i===null){delete r[e];continue}if(n.mergeObjectArraysById&&Array.isArray(r[e])&&Array.isArray(i)){let t=mn(r[e],i,n);if(t){r[e]=t;continue}}if(un(i)){let t=r[e];r[e]=hn(un(t)?t:{},i,n);continue}r[e]=i}return r}function N(e){if(e)return Array.isArray(e.type)?e.type.find(e=>e!==`null`)??e.type[0]:e.type}function gn(e){if(!e)return``;if(e.default!==void 0)return e.default;switch(N(e)){case`object`:return{};case`array`:return[];case`boolean`:return!1;case`number`:case`integer`:return 0;case`string`:return``;default:return``}}function _n(e){return e.filter(e=>typeof e==`string`).join(`.`)}function vn(e,t){let n=t[_n(e)];if(n)return n;let r=e.map(String);for(let[e,n]of Object.entries(t)){if(!e.includes(`*`))continue;let t=e.split(`.`);if(t.length!==r.length)continue;let i=!0;for(let e=0;e<r.length;e+=1)if(t[e]!==`*`&&t[e]!==r[e]){i=!1;break}if(i)return n}}function yn(e){return e.replace(/_/g,` `).replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/\s+/g,` `).replace(/^./,e=>e.toUpperCase())}var bn=[`maxtokens`,`maxoutputtokens`,`maxinputtokens`,`maxcompletiontokens`,`contexttokens`,`totaltokens`,`tokencount`,`tokenlimit`,`tokenbudget`,`passwordfile`],xn=[/token$/i,/password/i,/secret/i,/api.?key/i,/serviceaccount(?:ref)?$/i],Sn=/^\$\{[^}]*\}$/,Cn=`[redacted - click reveal to view]`,wn=64,Tn=2e4;function En(){return{visited:0}}function Dn(e,t){return!(t>wn||(e.visited+=1,e.visited>Tn))}function On(e){return Sn.test(e.trim())}function kn(e){let t=w(e);return!bn.some(e=>t.endsWith(e))&&xn.some(t=>t.test(e))}function An(e){return typeof e==`string`?e.trim().length>0&&!On(e):e!=null}function jn(e){return e?.sensitive??!1}function Mn(e,t,n){return Nn(e,t,n,En(),0)}function Nn(e,t,n,r,i){if(!Dn(r,i))return!0;let a=_n(t);return(jn(vn(t,n))||kn(a))&&An(e)?!0:Array.isArray(e)?e.some((e,a)=>Nn(e,[...t,a],n,r,i+1)):e&&typeof e==`object`?Object.entries(e).some(([e,a])=>Nn(a,[...t,e],n,r,i+1)):!1}function Pn(e,t,n){return Fn(e,t,n,En(),0)}function Fn(e,t,n,r,i){if(!Dn(r,i))return 1;if(e==null)return 0;let a=_n(t);return(jn(vn(t,n))||kn(a))&&An(e)?1:Array.isArray(e)?e.reduce((e,a,o)=>e+Fn(a,[...t,o],n,r,i+1),0):e&&typeof e==`object`?Object.entries(e).reduce((e,[a,o])=>e+Fn(o,[...t,a],n,r,i+1),0):0}function In(e,t){let n=e.trim();if(n===``)return;let r=Number(n);return!Number.isFinite(r)||t&&!Number.isInteger(r)?e:r}function Ln(e){let t=e.trim();return t===`true`?!0:t===`false`?!1:e}function Rn(e,t){if(e==null)return e;if(t.allOf&&t.allOf.length>0){let n=e;for(let e of t.allOf)n=Rn(n,e);return n}let n=N(t);if(t.anyOf||t.oneOf){let n=(t.anyOf??t.oneOf??[]).filter(e=>!(e.type===`null`||Array.isArray(e.type)&&e.type.includes(`null`)));if(n.length===1)return Rn(e,n[0]);if(typeof e==`string`)for(let t of n){let n=N(t);if(n===`number`||n===`integer`){let t=In(e,n===`integer`);if(t===void 0||typeof t==`number`)return t}if(n===`boolean`){let t=Ln(e);if(typeof t==`boolean`)return t}}for(let t of n){let n=N(t);if(n===`object`&&typeof e==`object`&&!Array.isArray(e)||n===`array`&&Array.isArray(e))return Rn(e,t)}return e}if(n===`number`||n===`integer`){if(typeof e==`string`){let t=In(e,n===`integer`);if(t===void 0||typeof t==`number`)return t}return e}if(n===`boolean`){if(typeof e==`string`){let t=Ln(e);if(typeof t==`boolean`)return t}return e}if(n===`string`)return typeof e==`string`&&e.length===0&&t.minLength?void 0:e;if(n===`object`){if(typeof e!=`object`||Array.isArray(e))return e;let n=e,r=t.properties??{},i=t.additionalProperties&&typeof t.additionalProperties==`object`?t.additionalProperties:null,a={};for(let[e,t]of Object.entries(n)){let n=r[e]??i,o=n?Rn(t,n):t;o!==void 0&&(a[e]=o)}return a}if(n===`array`){if(!Array.isArray(e))return e;if(Array.isArray(t.items)){let n=t.items;return e.map((e,t)=>{let r=t<n.length?n[t]:void 0;return r?Rn(e,r):e})}let n=t.items;return n?e.map(e=>Rn(e,n)).filter(e=>e!==void 0):e}return e}function zn(e){return structuredClone(e)}function Bn(e){return`${JSON.stringify(e,null,2).trimEnd()}\n`}var Vn=`__DEX_REDACTED__`,Hn={omitted:!0};function Un(e){return{omitted:!1,value:e}}function Wn(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function Gn(e,t){return e!=null&&Object.hasOwn(e,t)}function Kn(e){if(e.value===Vn)return e.originalFormValue!==Vn||e.originalRawPathExists?Un(e.value):e.canOmit?Hn:Un(e.value);if(Array.isArray(e.value)){let t=Array.isArray(e.originalFormValue)?e.originalFormValue:[],n=Array.isArray(e.originalRawValue)?e.originalRawValue:[];return Un(e.value.map((e,r)=>{let i=Kn({value:e,originalFormValue:t[r],originalRawValue:n[r],originalRawPathExists:r in n,canOmit:!1});return i.omitted?e:i.value}))}if(!Wn(e.value))return Un(e.value);let t=Wn(e.originalFormValue)?e.originalFormValue:null,n=Wn(e.originalRawValue)?e.originalRawValue:null,r={};for(let[i,a]of Object.entries(e.value)){let e=t!=null&&Object.hasOwn(t,i)?t[i]:void 0,o=Gn(n,i),s=Kn({value:a,originalFormValue:e,originalRawValue:o?n?.[i]:void 0,originalRawPathExists:o,canOmit:!0});s.omitted||(r[i]=s.value)}return e.canOmit&&Object.keys(r).length===0&&!e.originalRawPathExists?Hn:Un(r)}function qn(e,t,n){if(!t||!n)return e;let r;try{r=ae.parse(n)}catch{return e}if(!Wn(r))return e;let i=Kn({value:e,originalFormValue:t,originalRawValue:r,originalRawPathExists:!0,canOmit:!1});return!i.omitted&&Wn(i.value)?i.value:e}var Jn=new Set([`__proto__`,`prototype`,`constructor`]);function Yn(e){return typeof e==`string`&&Jn.has(e)}function Xn(e,t,n){if(t.length===0||t.some(Yn))return null;let r=e;for(let e=0;e<t.length-1;e+=1){let i=t[e],a=t[e+1];if(typeof i==`number`){if(!Array.isArray(r))return null;if(r[i]==null){if(!n)return null;r[i]=typeof a==`number`?[]:{}}r=r[i];continue}if(typeof r!=`object`||!r)return null;let o=r;if(o[i]==null){if(!n)return null;o[i]=typeof a==`number`?[]:{}}r=o[i]}return{current:r,lastKey:t[t.length-1]}}function Zn(e,t,n){let r=Xn(e,t,!0);if(r){if(typeof r.lastKey==`number`){Array.isArray(r.current)&&(r.current[r.lastKey]=n);return}typeof r.current==`object`&&r.current!=null&&(r.current[r.lastKey]=n)}}function Qn(e,t){let n=Xn(e,t,!1);if(n){if(typeof n.lastKey==`number`){Array.isArray(n.current)&&n.current.splice(n.lastKey,1);return}typeof n.current==`object`&&n.current!=null&&delete n.current[n.lastKey]}}var $n=new WeakMap;async function er(e,t={}){if(!(!e.client||!e.connected)){e.configLoading=!0,e.lastError=null,e.chatError=null;try{ar(e,await e.client.request(`config.get`,{}),t)}catch(t){e.lastError=String(t)}finally{e.configLoading=!1}}}async function tr(e){if(!(!e.client||!e.connected)&&!e.configSchemaLoading){e.configSchemaLoading=!0;try{nr(e,await e.client.request(`config.schema`,{}))}catch(t){e.lastError=String(t)}finally{e.configSchemaLoading=!1}}}function nr(e,t){e.configSchema=t.schema??null,e.configUiHints=t.uiHints??{},e.configSchemaVersion=t.version??null}function rr(e){return!e||typeof e!=`object`||Array.isArray(e)?null:e}function ir(e){return rr(e?.sourceConfig)??rr(e?.resolved)??rr(e?.config)}function ar(e,t,n={}){let r=e.configFormDirty&&n.discardPendingChanges!==!0,i=e.configDraftBaseHash??e.configSnapshot?.hash??null;e.configSnapshot=t;let a=ir(t);!(typeof t.raw==`string`||a||e.configForm)&&e.configFormMode===`raw`&&(e.configFormMode=`form`);let o=typeof t.raw==`string`?t.raw:a?Bn(a):e.configRaw;r?e.configFormMode!==`raw`&&e.configForm?e.configRaw=Bn(e.configForm):e.configFormMode!==`raw`&&(e.configRaw=o):e.configRaw=o,e.configValid=typeof t.valid==`boolean`?t.valid:null,e.configIssues=Array.isArray(t.issues)?t.issues:[],r?e.configDraftBaseHash=i:(e.configForm=zn(a??{}),e.configFormOriginal=zn(a??{}),e.configRawOriginal=o,e.configFormDirty=!1,e.configDraftBaseHash=t.hash??null,$n.delete(e))}function or(e){return!e||typeof e!=`object`||Array.isArray(e)?null:e}function sr(e){if(e.configFormMode!==`form`||!e.configForm)return e.configRaw;let t=or(e.configSchema);return Bn(qn(t?Rn(e.configForm,t):e.configForm,e.configFormOriginal,e.configRawOriginal))}function cr(e){let t=(e.status??`error`).trim()||`error`,n=(e.reason??`unexpected-error`).trim()||`unexpected-error`;return{tone:t===`skipped`?`warn`:`danger`,text:`Update ${t}: ${n}. ${{dirty:`Commit or stash changes, then retry.`,"no-upstream":`Set an upstream branch, then retry.`,"not-git-install":"Not a git checkout. Run `openclaw update` from the CLI for a global reinstall.","not-openclaw-root":`Run the update from an OpenClaw checkout or use the CLI global reinstall path.`,"deps-install-failed":`Dependency install failed. Fix the install error and retry.`,"build-failed":`Build failed. Fix the build error and retry.`,"ui-build-failed":`The control UI rebuild failed. Fix the UI build error and retry.`,"global-install-failed":`The global package install did not verify on disk. Retry or reinstall from the CLI.`,"restart-disabled":"The update was not applied because gateway restarts are disabled. Enable restarts in config, then retry — or run `openclaw update` from the CLI.","restart-unavailable":`This global install cannot be safely replaced while restarts are disabled and no supervisor is present.`,"restart-unhealthy":`The replacement process never became healthy. The previous process stayed up so you can recover.`,"doctor-failed":"Doctor repair failed. Run `openclaw doctor --non-interactive` and retry."}[n]??`See the gateway logs for the exact failure and retry once the cause is fixed.`}`}}async function lr(e,t,n,r={}){if(!e.client||!e.connected)return!1;e[n]=!0,e.lastError=null,e.chatError=null;try{let n=sr(e),i=e.configDraftBaseHash??e.configSnapshot?.hash;return i?(await e.client.request(t,{raw:n,baseHash:i,...r}),e.configFormDirty=!1,e.configDraftBaseHash=null,$n.delete(e),await er(e),!0):(e.lastError=`Config hash missing; reload and retry.`,!1)}catch(t){return e.lastError=String(t),!1}finally{e[n]=!1}}function ur(e,t){let n=zn(e.configFormOriginal??ir(e.configSnapshot)??{}),r=Bn(t),i=Bn(n);e.configForm=t,e.configRaw=r,e.configFormDirty=r!==i}async function dr(e){return lr(e,`config.set`,`configSaving`)}async function fr(e){return lr(e,`config.apply`,`configApplying`,{sessionKey:e.applySessionKey})}async function pr(e){if(!(!e.client||!e.connected)){e.updateRunning=!0,e.lastError=null,e.chatError=null,e.updateStatusBanner=null;try{let t=await e.client.request(`update.run`,{sessionKey:e.applySessionKey}),n=t.result?.status??(t.ok===!0?`ok`:`error`);if(n===`ok`&&t.ok===!0){e.pendingUpdateExpectedVersion=t.result?.after?.version??null;return}e.pendingUpdateExpectedVersion=null,e.updateStatusBanner=cr({status:n,reason:t.result?.reason})}catch(t){e.lastError=String(t),e.pendingUpdateExpectedVersion=null}finally{e.updateRunning=!1}}}function mr(e,t){let n=zn(e.configForm??ir(e.configSnapshot)??{});t(n),ur(e,n)}function hr(e,t){let n=$n.get(e);n?n.add(t):$n.set(e,new Set([t]))}function gr(e,t){let n=$n.get(e);n&&(n.delete(t),n.size===0&&$n.delete(e))}function _r(e,t,n,r){if(n.length!==4||n[0]!==`plugins`||n[1]!==`entries`||typeof n[2]!=`string`||n[3]!==`enabled`)return;let i=n[2],a=t.plugins&&typeof t.plugins==`object`&&!Array.isArray(t.plugins)?t.plugins:null,o=Array.isArray(a?.allow)?a.allow:null;if(!o){gr(e,i);return}if(r===!0){if(o.includes(i))return;if(o.length===0){gr(e,i);return}Zn(t,[`plugins`,`allow`],[...o,i]),hr(e,i);return}$n.get(e)?.has(i)&&(Zn(t,[`plugins`,`allow`],o.filter(e=>e!==i)),gr(e,i))}function vr(e,t,n){mr(e,r=>{if(Zn(r,t,n),t[0]===`plugins`&&t[1]===`allow`){$n.delete(e);return}_r(e,r,t,n)})}function yr(e,t){e.configRaw=t,e.configFormDirty=t!==e.configRawOriginal,e.configFormDirty?e.configDraftBaseHash=e.configDraftBaseHash??e.configSnapshot?.hash??null:e.configDraftBaseHash=e.configSnapshot?.hash??null}function br(e,t){let n=ir(e.configSnapshot),r=e.configForm??n;if(!r||!e.configForm&&!e.configSnapshot?.hash)return;let i=hn(zn(r),t);!i||typeof i!=`object`||Array.isArray(i)||ur(e,zn(i))}function xr(e){let t=ir(e.configSnapshot);e.configForm=zn(e.configFormOriginal??t??{}),e.configRaw=e.configRawOriginal??Bn(e.configFormOriginal??t??{}),e.configFormDirty=!1,e.configDraftBaseHash=e.configSnapshot?.hash??null,$n.delete(e)}function Sr(e,t){mr(e,e=>Qn(e,t))}function Cr(e,t,n){mr(e,e=>{let r=[`mcp`,`servers`,t];if(!n){Zn(e,[...r,`enabled`],!1);return}Qn(e,[...r,`enabled`]);let i=rr(rr(rr(e.mcp)?.servers)?.[t]);i&&Object.keys(i).length===0&&Qn(e,r)})}function wr(e,t){let n=t.trim();if(!n)return-1;let r=e?.agents?.list;return Array.isArray(r)?r.findIndex(e=>e&&typeof e==`object`&&`id`in e&&e.id===n):-1}function Tr(e,t){let n=t.trim();if(!n)return-1;let r=e.configForm??ir(e.configSnapshot),i=wr(r,n);if(i>=0)return i;let a=r?.agents?.list,o=Array.isArray(a)?a.length:0;return vr(e,[`agents`,`list`,o,`id`],n),o}function Er(e,t){let n=t.trim();if(!n)return!1;let r=wr(e.configForm??ir(e.configSnapshot),n);return r<0?!1:(mr(e,e=>{let t=e?.agents?.list;if(Array.isArray(t))for(let e=0;e<t.length;e++){let n=t[e];if(!n||typeof n!=`object`||Array.isArray(n))continue;let i=n;e===r?i.default=!0:delete i.default}}),!0)}async function Dr(e){if(!(!e.client||!e.connected)){e.lastError=null,e.chatError=null;try{let t=await e.client.request(`config.openFile`,{});if(!t.ok){e.lastError=t.error||`Failed to open config file`;let n=t.path||e.configSnapshot?.path;if(n)try{await navigator.clipboard.writeText(n),e.lastError+=`\n\nFile path copied to clipboard: ${n}`}catch{e.lastError+=`\n\nFile path: ${n}`}}}catch(t){let n=e.configSnapshot?.path;if(n)try{await navigator.clipboard.writeText(n)}catch{}e.lastError=String(t)}}}function Or(e){let{values:t,original:n}=e;return t.name!==n.name||t.displayName!==n.displayName||t.about!==n.about||t.picture!==n.picture||t.banner!==n.banner||t.website!==n.website||t.nip05!==n.nip05||t.lud16!==n.lud16}function kr(e){let{state:t,callbacks:n,accountId:r}=e,i=Or(t),a=(e,r,i={})=>{let{type:a=`text`,placeholder:o,maxLength:s,help:l}=i,u=t.values[e]??``,f=t.fieldErrors[e],p=`nostr-profile-${e}`;return a===`textarea`?c`
|
|
3
3
|
<div class="form-field" style="margin-bottom: 12px;">
|
|
4
4
|
<label for="${p}" style="display: block; margin-bottom: 4px; font-weight: 500;">
|
|
@@ -6119,7 +6119,7 @@ ${e.pluginDescription}</pre
|
|
|
6119
6119
|
aria-label=${S(`sessions.sessionDetails.activeRun`)}
|
|
6120
6120
|
></span>`:d}
|
|
6121
6121
|
</a>
|
|
6122
|
-
`}var fG=jz(()=>b(()=>import(`./agents-CxLl6gUk.js`),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url),ZW),pG=jz(()=>b(()=>import(`./activity-iPfLHQZV.js`),__vite__mapDeps([7,1,2]),import.meta.url),ZW),mG=jz(()=>b(()=>import(`./channels-Bta6SaYT.js`),__vite__mapDeps([8,1,2,5]),import.meta.url),ZW),hG=jz(()=>b(()=>import(`./cron-WrJMROVi.js`),__vite__mapDeps([9,1,2]),import.meta.url),ZW),gG=jz(()=>b(()=>import(`./debug-qbPU9J5y.js`),__vite__mapDeps([10,1,2]),import.meta.url),ZW),_G=jz(()=>b(()=>import(`./instances-JqYUP-u5.js`),__vite__mapDeps([11,1,2]),import.meta.url),ZW),vG=jz(()=>b(()=>import(`./logs-DPetTn3l.js`),__vite__mapDeps([12,1,2]),import.meta.url),ZW),yG=jz(()=>b(()=>import(`./nodes-FhxY7Cc1.js`),__vite__mapDeps([13,1,2]),import.meta.url),ZW),bG=jz(()=>b(()=>import(`./sessions-Bl-n4lmW.js`),__vite__mapDeps([14,1,2]),import.meta.url),ZW),xG=jz(()=>b(()=>import(`./skill-workshop-C1AL77pw.js`),__vite__mapDeps([15,2]),import.meta.url),ZW),SG=jz(()=>b(()=>import(`./skills-BBNM4ARV.js`),__vite__mapDeps([16,1,2,6]),import.meta.url),ZW),CG=jz(()=>b(()=>import(`./usage-BS9V-TP1.js`),__vite__mapDeps([17,1,2]),import.meta.url),ZW),wG=jz(()=>b(()=>import(`./workboard-D6aOg7b0.js`),__vite__mapDeps([18,1,2]),import.meta.url),ZW),TG=new WeakMap,EG=new WeakMap;function DG(e,t){let n=TG.get(e);if(n?.agentId===t)return n;let r={activeName:null,agentId:t,error:null,list:null,loading:!1,requestId:0};return TG.set(e,r),r}function OG(e){return dl(e,{hour:`numeric`,minute:`2-digit`},``)||null}function kG(e){if(!e?.phases)return null;let t;for(let n of Object.values(e.phases))!n.enabled||typeof n.nextRunAtMs!=`number`||(t===void 0||n.nextRunAtMs<t)&&(t=n.nextRunAtMs);return OG(t)}var AG=null,jG=`openclaw:control-ui:update-banner-dismissed:v1`,MG=[`off`,`minimal`,`low`,`medium`,`high`],NG=[`UTC`,`America/Los_Angeles`,`America/Denver`,`America/Chicago`,`America/New_York`,`Europe/London`,`Europe/Berlin`,`Asia/Tokyo`];function PG(e){return/^https?:\/\//i.test(e.trim())}function FG(e){return typeof e==`string`?e.trim():``}function IG(e){let t=new Set,n=[];for(let r of e){let e=r.trim();if(!e)continue;let i=e.toLowerCase();t.has(i)||(t.add(i),n.push(e))}return n}function LG(){try{let e=T()?.getItem(jG);if(!e)return null;let t=JSON.parse(e);return!t||typeof t.latestVersion!=`string`?null:{latestVersion:t.latestVersion,channel:typeof t.channel==`string`?t.channel:null,dismissedAtMs:typeof t.dismissedAtMs==`number`?t.dismissedAtMs:Date.now()}}catch{return null}}function RG(e){let t=LG();if(!t)return!1;let n=e,r=n&&typeof n.latestVersion==`string`?n.latestVersion:null,i=n&&typeof n.channel==`string`?n.channel:null;return!!(r&&t.latestVersion===r&&t.channel===i)}function zG(e){let t=e,n=t&&typeof t.latestVersion==`string`?t.latestVersion:null;if(!n)return;let r={latestVersion:n,channel:t&&typeof t.channel==`string`?t.channel:null,dismissedAtMs:Date.now()};try{T()?.setItem(jG,JSON.stringify(r))}catch{}}var BG=[`messages`,`broadcast`,`__notifications__`,`talk`,`audio`,`channels`],VG=[`__appearance__`,`ui`,`wizard`],HG=[`commands`,`hooks`,`bindings`,`cron`,`approvals`,`plugins`],UG=[`gateway`,`web`,`browser`,`nodeHost`,`canvasHost`,`discovery`,`media`,`acp`,`mcp`],WG=[`agents`,`models`,`skills`,`tools`,`memory`,`session`],GG=new Set([...BG,...VG,...HG,...UG,...WG]);function KG(e,t){return e&&GG.has(e)?{activeSection:null,activeSubsection:null}:{activeSection:e,activeSubsection:t}}function qG(e,t,n){return e&&!n.includes(e)?{activeSection:null,activeSubsection:null}:{activeSection:e,activeSubsection:t}}function JG(e,t,n){if(!e||typeof e!=`object`||Array.isArray(e))return 0;let r=e.properties;if(!r||typeof r!=`object`||Array.isArray(r))return 0;let i=t?.length?new Set(t):null,a=n?.length?new Set(n):null;return Object.keys(r).filter(e=>!(i&&!i.has(e)||a?.has(e))).length}function YG(e,t,n,r){let i=B(),a=r();return th(e,t,{...n,durationMs:V(B()-i)}),a}function XG(e){return n([e.sessionKey,e.connected,e.client,e.onboarding,e.chatManualRefreshInFlight,e.chatLoading,e.chatSending,e.chatStream,e.chatRunId,e.chatMobileControlsOpen,e.sessionsHideCron??!0,e.sessionsResult,e.sessionsShowArchived,e.agentsList,e.chatModelOverrides,e.chatModelSwitchPromises,e.chatModelsLoading,e.chatModelCatalog,e.settings.chatShowThinking,e.settings.chatShowToolCalls,e.settings.chatAutoScroll,e.chatSessionPickerOpen,e.chatSessionPickerSurface,e.chatSessionPickerQuery,e.chatSessionPickerAppliedQuery,e.chatSessionPickerLoading,e.chatSessionPickerError,e.chatSessionPickerResult,e.sessionSwitchNotice?.id??null,e.sessionSwitchNotice?.text??null,e.sessionSwitchFlashKey,g.getLocale()],()=>Sz(e))}function ZG(e){let t=e.agentsList?.agents??[],n=F(e.sessionKey)?.agentId??e.agentsList?.defaultId??`main`,r=t.find(e=>e.id===n)?.identity,i=r?.avatarUrl??r?.avatar;if(i&&Xa(i))return i}function QG(e){if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e.ui;if(!t||typeof t!=`object`||Array.isArray(t))return null;let n=t.assistant;return!n||typeof n!=`object`||Array.isArray(n)?null:C(n.avatar)??null}function $G(e,t){let n=Bi(e??``),r=encodeURIComponent(t);return n?`${n}/avatar/${r}`:`/avatar/${r}`}var eK=[{id:`telegram`,label:`Telegram`},{id:`discord`,label:`Discord`},{id:`slack`,label:`Slack`},{id:`whatsapp`,label:`WhatsApp`},{id:`signal`,label:`Signal`},{id:`imessage`,label:`iMessage`}];function tK(e){let t=e.trim();return t?t.split(/[-_]+/).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `):`Unknown`}function nK(e){let t=e.configForm??e.configSnapshot?.config;if(!t||typeof t!=`object`)return[];let n=`channels`in t&&t.channels&&typeof t.channels==`object`?t.channels:{},r=Object.keys(n).filter(e=>e.trim().length>0),i=r.length>0?r.toSorted((e,t)=>e.localeCompare(t)):eK.map(({id:e})=>e),a=new Map(eK.map(({id:e,label:t})=>[e,t])),o=[];for(let e of i){let t=n[e],r=typeof t==`object`&&!!t&&Object.keys(t).length>0;o.push({id:e,label:a.get(e)??tK(e),connected:r,detail:r?`Configured`:void 0})}return o}function rK(e){let t=e.configForm??e.configSnapshot?.config;if(!t||typeof t!=`object`)return 0;let n=t.mcp;if(!n||typeof n!=`object`)return 0;let r=`servers`in n&&n.servers&&typeof n.servers==`object`?n.servers:{};return Object.keys(r).length}function iK(e){let t=e.configForm??e.configSnapshot?.config;if(!t||typeof t!=`object`)return{gatewayAuth:`unknown`,execPolicy:`unknown`,deviceAuth:!1,browserEnabled:!0,toolProfile:`full`};let n=t,r=`gateway`in n&&n.gateway&&typeof n.gateway==`object`?n.gateway:null,i=r&&`auth`in r&&r.auth&&typeof r.auth==`object`?r.auth:null,a=`unknown`;i&&(a=(typeof i.mode==`string`?i.mode.trim():``)||(i.password?`password`:i.token?`token`:i.trustedProxy?`trusted-proxy`:`none`));let o=`allowlist`,s=`full`,c=n.tools;if(c&&typeof c==`object`){let e=c.profile;if(typeof e==`string`){let t=e.trim();t&&(s=t)}let t=c.exec;if(t&&typeof t==`object`){let e=t.security;if(typeof e==`string`){let t=e.trim();t&&(o=t)}}}let l=!0,u=`browser`in n&&n.browser&&typeof n.browser==`object`?n.browser:null;u&&typeof u.enabled==`boolean`&&(l=u.enabled);let d=!0;return r&&(`controlUi`in r&&r.controlUi&&typeof r.controlUi==`object`?r.controlUi:null)?.dangerouslyDisableDeviceAuth===!0&&(d=!1),{gatewayAuth:a,execPolicy:o,deviceAuth:d,browserEnabled:l,toolProfile:s}}function aK(e){return e.sessionsResult?.sessions?.find(t=>t.key===e.sessionKey)}function oK(e,t){return kH({open:e.cronQuickCreateOpen,step:e.cronQuickCreateStep,draft:e.cronQuickCreateDraft??yH(),onDraftChange:n=>{e.cronQuickCreateDraft={...e.cronQuickCreateDraft??yH(),...n},t?.()},onStepChange:n=>{e.cronQuickCreateStep=n,t?.()},onCreate:()=>{let n=xH(e.cronQuickCreateDraft??yH());e.cronEditingJobId=null,e.cronForm={...Yy,...n},t?.(),(async()=>{if(!await _x(e)){t?.();return}e.cronQuickCreateOpen=!1,e.cronQuickCreateStep=`what`,e.cronQuickCreateDraft=null,t?.()})()},onAdvancedCreate:()=>{let n=xH(e.cronQuickCreateDraft??yH());e.cronEditingJobId=null,e.cronForm=Yb({...Yy,...n}),e.cronFieldErrors=Xb(e.cronForm),e.cronQuickCreateOpen=!1,e.cronQuickCreateStep=`what`,e.cronQuickCreateDraft=null,e.cronFormCollapsed=!1,t?.()},onCancel:()=>{e.cronQuickCreateOpen=!1,e.cronQuickCreateStep=`what`,e.cronQuickCreateDraft=null,t?.()}})}function sK(e,t){return/\.(?:md|markdown|mdx)$/i.test(e)?t:`# ${e}\n\n\`\`\`${e.match(/\.([a-z0-9_-]+)$/i)?.[1]?.toLowerCase()??``}\n${t}\n\`\`\``}function cK(e){let t=e,n=typeof t.requestUpdate==`function`?()=>t.requestUpdate?.():void 0;if(XW=n,!e.connected)return c` ${mW(e)} ${eW(e)} `;let r=e.presenceEntries.length,i=e.sessionsResult?.count??null,a=e.cronStatus?.nextWakeAtMs??null,o=e.connected?null:S(`chat.disconnected`),s=e.tab===`chat`,l=!s&&e.lastError!==e.chatError?e.lastError:null,u=e.lastError,f=s&&(e.onboarding||e.chatHeaderControlsHidden),p=e.navDrawerOpen&&!e.onboarding,h=e.settings.navCollapsed&&!p,g=cz(e),_=e.onboarding?!1:e.settings.chatShowThinking,v=e.onboarding?!0:e.settings.chatShowToolCalls,y=C(us().avatar)??null,b=ZG(e),x=y?`data`:e.chatAvatarStatus??e.assistantAvatarStatus??null,ee=y?null:e.chatAvatarReason??e.assistantAvatarReason??null,w=x===`none`&&ee===`missing`,T=y??(w?null:e.assistantAvatar),te=y??e.chatAvatarUrl??(w?null:b??null),ne=y?`data`:e.assistantAvatarStatus??e.chatAvatarStatus??null,re=y?null:e.assistantAvatarReason??e.chatAvatarReason??null,ie=y??e.assistantAvatarSource??e.chatAvatarSource??null,E=ne===`none`&&re===`missing`,ae=y??(E||ne===`local`?null:e.assistantAvatar),D=y??(ne===`local`&&e.assistantAgentId?$G(e.basePath,e.assistantAgentId):e.chatAvatarUrl??(E?null:b??null)),O=e.configForm??e.configSnapshot?.config,oe=Zx(O),se=e.dreamingStatus?.enabled??oe.enabled,ce=kG(e.dreamingStatus),le=nz(e),ue=ZR(e,e.sessionKey),k=()=>{e.selectedAgentId=ue},de=e.dreamingStatusLoading||e.dreamingModeSaving,fe=e.dreamingStatusLoading||e.dreamDiaryLoading,pe=()=>{(async()=>{k(),await er(e),await Promise.all([fS(e),pS(e),mS(e),hS(e)])})()},me=async t=>{if(!e.client||!e.connected)return null;let n=await e.client.request(`wiki.get`,{lookup:t,fromLine:1,lineCount:5e3}),r=typeof n?.title==`string`&&n.title.trim()?n.title.trim():t,i=typeof n?.path==`string`&&n.path.trim()?n.path.trim():t,a=typeof n?.content==`string`&&n.content.length>0?n.content:`No wiki content available.`,o=typeof n?.updatedAt==`string`&&n.updatedAt.trim()?n.updatedAt.trim():void 0,s=typeof n?.totalLines==`number`&&Number.isFinite(n.totalLines)?Math.max(0,Math.floor(n.totalLines)):void 0,c=n?.truncated===!0;return{title:r,path:i,content:a,...s===void 0?{}:{totalLines:s},...c?{truncated:c}:{},...o?{updatedAt:o}:{}}},he=t=>{e.dreamingModeSaving||e.dreamingRestartConfirmLoading||e.dreamingRestartConfirmOpen||se===t||(e.dreamingPendingEnabled=t,e.dreamingRestartConfirmOpen=!0,e.dreamingStatusError=null)},ge=()=>{e.dreamingRestartConfirmLoading||(e.dreamingRestartConfirmOpen=!1,e.dreamingPendingEnabled=null,e.dreamingStatusError=null)},_e=()=>{let t=e.dreamingPendingEnabled;t==null||e.dreamingRestartConfirmLoading||(async()=>{e.dreamingRestartConfirmLoading=!0,e.dreamingStatusError=null;try{if(!await DS(e,t)){e.dreamingStatusError||=S(`dreaming.restartConfirmation.failed`);return}await er(e),await fS(e),e.dreamingRestartConfirmOpen=!1,e.dreamingPendingEnabled=null}finally{e.dreamingRestartConfirmLoading=!1}})()},ve=Bi(e.basePath??``),ye=()=>e.agentsSelectedId??e.agentsList?.defaultId??e.agentsList?.agents?.[0]?.id??null,A=ye(),be=C(e.sessionKey)?.toLowerCase(),Se=be===`global`?null:Ql(e.sessionKey),Ce=Ev(e,e.sessionKey).agentId,we=L(e.assistantAgentId??e.agentsList?.defaultId??e.agentsList?.agents?.[0]?.id??`main`),Te=()=>{let t=C(e.sessionKey)?.toLowerCase(),n=t===`global`?null:Ql(e.sessionKey),r=Ev(e,e.sessionKey).agentId;return t===`global`?r??we:n??r??we},Ee=be===`global`?Ce??we:Se??Ce??we,De=!!(A&&A===Ee),j=DG(e,Ee),Oe=()=>Te()===Ee?DG(e,Ee):null,ke=()=>e.configForm??e.configSnapshot?.config,M=e=>wr(ke(),e),Ae=t=>Tr(e,t),je=(e,t)=>{let n=t?Ae(e):M(e);return n>=0?[`agents`,`list`,n,`tools`]:null},Me=e=>{let t=ke()?.agents?.list,n=Array.isArray(t)?t[e]?.model:void 0;return{basePath:[`agents`,`list`,e,`model`],existing:n}},Ne=vo(new Set([...e.agentsList?.agents?.map(e=>e.id.trim())??[],...e.cronJobs.map(e=>typeof e.agentId==`string`?e.agentId.trim():``).filter(Boolean)].filter(Boolean))),Pe=vo(new Set([...e.cronModelSuggestions,...yo(O),...e.cronJobs.map(e=>{let t=Wb(e);return t?.kind!==`agentTurn`||typeof t.model!=`string`?``:t.model.trim()}).filter(Boolean)].filter(Boolean))),Fe=ix(e),Ie=e.cronForm.deliveryChannel&&e.cronForm.deliveryChannel.trim()?e.cronForm.deliveryChannel.trim():`last`,Le=e.cronJobs.map(e=>FG(e.delivery?.to)).filter(Boolean),Re=(Ie===`last`?Object.values(e.channelsSnapshot?.channelAccounts??{}).flat():e.channelsSnapshot?.channelAccounts?.[Ie]??[]).flatMap(e=>[FG(e.accountId),FG(e.name)]).filter(Boolean),ze=IG([...Le,...Re]),Be=IG(Re),Ve=e.cronForm.deliveryMode===`webhook`?ze.filter(e=>PG(e)):ze,He={raw:e.configRaw,originalRaw:e.configRawOriginal,valid:e.configValid,issues:e.configIssues,loading:e.configLoading,saving:e.configSaving,applying:e.configApplying,updating:e.updateRunning,connected:e.connected,schema:e.configSchema,schemaLoading:e.configSchemaLoading,uiHints:e.configUiHints,formValue:e.configForm,originalValue:e.configFormOriginal,onRawChange:t=>{yr(e,t)},onRequestUpdate:n,onFormPatch:(t,n)=>vr(e,t,n),onReload:()=>void er(e,{discardPendingChanges:!0}),onReset:()=>xr(e),onSave:()=>void dr(e),onApply:()=>void fr(e),onUpdate:()=>void pr(e),onOpenFile:()=>void Dr(e),version:e.hello?.server?.version??``,theme:e.theme,themeMode:e.themeMode,setTheme:(t,n)=>e.setTheme(t,n),setThemeMode:(t,n)=>e.setThemeMode(t,n),hasCustomTheme:!!e.settings.customTheme,customThemeLabel:e.settings.customTheme?.label??null,customThemeSourceUrl:e.settings.customTheme?.sourceUrl??null,customThemeImportUrl:e.customThemeImportUrl,customThemeImportBusy:e.customThemeImportBusy,customThemeImportMessage:e.customThemeImportMessage,customThemeImportExpanded:e.customThemeImportExpanded,customThemeImportFocusToken:e.customThemeImportFocusToken,onCustomThemeImportUrlChange:t=>e.setCustomThemeImportUrl(t),onOpenCustomThemeImport:()=>e.openCustomThemeImport(),onImportCustomTheme:()=>void e.importCustomTheme(),onClearCustomTheme:()=>e.clearCustomTheme(),borderRadius:e.settings.borderRadius,setBorderRadius:t=>e.setBorderRadius(t),textScale:e.settings.textScale??100,setTextScale:t=>e.setTextScale(t),gatewayUrl:e.settings.gatewayUrl,assistantName:e.assistantName,configPath:e.configSnapshot?.path??null,rawAvailable:typeof e.configSnapshot?.raw==`string`||!!e.configSnapshot?.config||!!e.configForm},Ue=t=>{let n=t.includeSections?.[0]??null,r=t.activeSection??n,i=t.showRootTab??!t.includeSections?.length;return YG(e,`config`,{tab:e.tab,formMode:t.formMode,activeSection:r,activeSubsection:t.activeSubsection,schemaSectionCount:JG(He.schema,t.includeSections,t.excludeSections),hasSearch:!!t.searchQuery?.trim()},()=>gH({...He,includeVirtualSections:!1,...t,activeSection:r,showRootTab:i}))},We=KG(e.configActiveSection,e.configActiveSubsection),Ge=qG(e.communicationsActiveSection,e.communicationsActiveSubsection,BG),Ke=qG(e.appearanceActiveSection,e.appearanceActiveSubsection,VG),qe=qG(e.automationActiveSection,e.automationActiveSubsection,HG),Je=qG(e.infrastructureActiveSection,e.infrastructureActiveSubsection,UG),Ye=qG(e.aiAgentsActiveSection,e.aiAgentsActiveSubsection,WG),Xe=()=>{switch(e.tab){case`config`:if(e.configSettingsMode===`quick`){let t=e.configForm??e.configSnapshot?.config??{},r=y??QG(t),i=t.agents?.defaults??{},a=aK(e),o=typeof a?.model==`string`?a.model:typeof i.model==`string`?i.model:`default`,s=typeof a?.thinkingLevel==`string`?a.thinkingLevel:typeof i.thinkingLevel==`string`?i.thinkingLevel:`off`,c=typeof a?.fastMode==`boolean`?a.fastMode:i.fastMode===!0;return KB({currentModel:o,thinkingLevel:s,fastMode:c,onModelChange:()=>{e.configSettingsMode=`advanced`,e.aiAgentsActiveSection=`models`,e.setTab(`aiAgents`)},onThinkingChange:t=>{lv(e,e.sessionKey,{thinkingLevel:t}).then(()=>n?.())},onFastModeToggle:()=>{lv(e,e.sessionKey,{fastMode:!c}).then(()=>n?.())},channels:nK(e),onChannelConfigure:()=>{e.setTab(`channels`)},automation:{cronJobCount:e.cronJobs?.length??0,skillCount:e.skillsReport?.skills?.length??0,mcpServerCount:rK(e)},onManageCron:()=>{e.setTab(`cron`)},onBrowseSkills:()=>{e.setTab(`skills`)},onConfigureMcp:()=>{e.setTab(`mcp`)},security:iK(e),onSecurityConfigure:()=>{e.configSettingsMode=`advanced`,e.configActiveSection=`auth`,n?.()},onBrowserEnabledToggle:t=>{vr(e,[`browser`,`enabled`],t),n?.()},onToolProfileChange:t=>{vr(e,[`tools`,`profile`],t),n?.()},theme:e.theme,themeMode:e.themeMode,hasCustomTheme:!!e.settings.customTheme,customThemeLabel:e.settings.customTheme?.label??null,borderRadius:e.settings.borderRadius,textScale:e.settings.textScale??100,setTheme:(t,n)=>e.setTheme(t,n),onOpenCustomThemeImport:()=>{e.setTab(`appearance`),e.appearanceFormMode=`form`,e.appearanceSearchQuery=``,e.appearanceActiveSection=`__appearance__`,e.appearanceActiveSubsection=null,e.openCustomThemeImport(),n?.()},setThemeMode:(t,n)=>e.setThemeMode(t,n),setBorderRadius:t=>e.setBorderRadius(t),setTextScale:t=>e.setTextScale(t),userAvatar:e.userAvatar??null,onUserAvatarChange:t=>e.applyLocalUserIdentity?.({avatar:t}),assistantAvatar:ae,assistantAvatarUrl:D,assistantAvatarSource:ie,assistantAvatarStatus:ne,assistantAvatarReason:re,assistantAvatarOverride:r,assistantAvatarUploadBusy:e.assistantAvatarUploadBusy,assistantAvatarUploadError:e.assistantAvatarUploadError,onAssistantAvatarOverrideChange:t=>{VF(e,t),e.chatAvatarUrl=t,e.chatAvatarSource=t,e.chatAvatarStatus=`data`,e.chatAvatarReason=null,e.assistantAvatarUploadError=null,n?.()},onAssistantAvatarClearOverride:()=>{VF(e,null),e.chatAvatarUrl=null,e.chatAvatarSource=null,e.chatAvatarStatus=null,e.chatAvatarReason=null,e.assistantAvatarUploadError=null,e.loadAssistantIdentity?.().finally(()=>n?.()),n?.()},basePath:e.basePath??``,configObject:t,savedConfigObject:e.configSnapshot?.config??{},configDirty:e.configFormDirty,configSaving:e.configSaving,configApplying:e.configApplying,configReady:!!e.configSnapshot?.hash,onSelectPreset:t=>{let r=fB(t);r&&(br(e,r.patch),n?.())},onResetConfig:()=>xr(e),onSaveConfig:()=>void dr(e),onApplyConfig:()=>void fr(e),onAdvancedSettings:()=>{e.configSettingsMode=`advanced`,n?.()},connected:e.connected,gatewayUrl:e.settings.gatewayUrl,assistantName:e.assistantName,version:e.hello?.server?.version??``})}return Ue({formMode:e.configFormMode,searchQuery:e.configSearchQuery,activeSection:We.activeSection,activeSubsection:We.activeSubsection,onFormModeChange:t=>e.configFormMode=t,onSearchChange:t=>e.configSearchQuery=t,onSectionChange:t=>{e.configActiveSection=t,e.configActiveSubsection=null},onSubsectionChange:t=>e.configActiveSubsection=t,showModeToggle:!0,settingsLayout:`accordion`,onBackToQuick:()=>{e.configSettingsMode=`quick`,n?.()},excludeSections:[...BG,...HG,...UG,...WG,`ui`,`wizard`]});case`channels`:return Nz(mG,t=>t.renderChannels({connected:e.connected,loading:e.channelsLoading,snapshot:e.channelsSnapshot,lastError:e.channelsError,lastSuccessAt:e.channelsLastSuccess,whatsappMessage:e.whatsappLoginMessage,whatsappQrDataUrl:e.whatsappLoginQrDataUrl,whatsappConnected:e.whatsappLoginConnected,whatsappBusy:e.whatsappBusy,configSchema:e.configSchema,configSchemaLoading:e.configSchemaLoading,configForm:e.configForm,configUiHints:e.configUiHints,configSaving:e.configSaving,configFormDirty:e.configFormDirty,nostrProfileFormState:e.nostrProfileFormState,nostrProfileAccountId:e.nostrProfileAccountId,onRefresh:t=>void on(e,t),onWhatsAppStart:t=>void e.handleWhatsAppStart(t),onWhatsAppWait:()=>void e.handleWhatsAppWait(),onWhatsAppLogout:()=>void e.handleWhatsAppLogout(),onConfigPatch:(t,n)=>vr(e,t,n),onConfigSave:()=>void e.handleChannelConfigSave(),onConfigReload:()=>void e.handleChannelConfigReload(),onNostrProfileEdit:(t,n)=>e.handleNostrProfileEdit(t,n),onNostrProfileCancel:()=>e.handleNostrProfileCancel(),onNostrProfileFieldChange:(t,n)=>e.handleNostrProfileFieldChange(t,n),onNostrProfileSave:()=>void e.handleNostrProfileSave(),onNostrProfileImport:()=>void e.handleNostrProfileImport(),onNostrProfileToggleAdvanced:()=>e.handleNostrProfileToggleAdvanced()}));case`communications`:return Ue({formMode:e.communicationsFormMode,searchQuery:e.communicationsSearchQuery,activeSection:Ge.activeSection,activeSubsection:Ge.activeSubsection,onFormModeChange:t=>e.communicationsFormMode=t,onSearchChange:t=>e.communicationsSearchQuery=t,onSectionChange:t=>{e.communicationsActiveSection=t,e.communicationsActiveSubsection=null},onSubsectionChange:t=>e.communicationsActiveSubsection=t,navRootLabel:`Communication`,includeSections:[...BG],includeVirtualSections:!0,webPush:{supported:e.webPushSupported,permission:e.webPushPermission,subscribed:e.webPushSubscribed,loading:e.webPushLoading},onWebPushSubscribe:()=>void e.handleWebPushSubscribe(),onWebPushUnsubscribe:()=>void e.handleWebPushUnsubscribe(),onWebPushTest:()=>void e.handleWebPushTest()});case`appearance`:return Ue({formMode:e.appearanceFormMode,searchQuery:e.appearanceSearchQuery,activeSection:Ke.activeSection,activeSubsection:Ke.activeSubsection,onFormModeChange:t=>e.appearanceFormMode=t,onSearchChange:t=>e.appearanceSearchQuery=t,onSectionChange:t=>{e.appearanceActiveSection=t,e.appearanceActiveSubsection=null},onSubsectionChange:t=>e.appearanceActiveSubsection=t,navRootLabel:S(`tabs.appearance`),includeSections:[...VG],includeVirtualSections:!0});case`automation`:return Ue({formMode:e.automationFormMode,searchQuery:e.automationSearchQuery,activeSection:qe.activeSection,activeSubsection:qe.activeSubsection,onFormModeChange:t=>e.automationFormMode=t,onSearchChange:t=>e.automationSearchQuery=t,onSectionChange:t=>{e.automationActiveSection=t,e.automationActiveSubsection=null},onSubsectionChange:t=>e.automationActiveSubsection=t,navRootLabel:`Automation`,includeSections:[...HG]});case`mcp`:return TW({configObject:e.configForm??(e.configSnapshot?.config||{}),configDirty:e.configFormDirty,configSaving:e.configSaving,configApplying:e.configApplying,connected:e.connected,onSaveConfig:()=>void dr(e),onApplyConfig:()=>void fr(e),onServerEnabledChange:(t,r)=>{Cr(e,t,r),n?.()},editor:Ue({formMode:`form`,searchQuery:``,activeSection:`mcp`,activeSubsection:null,onFormModeChange:()=>void 0,onSearchChange:()=>void 0,onSectionChange:()=>{e.infrastructureActiveSection=`mcp`,e.infrastructureActiveSubsection=null},onSubsectionChange:t=>e.infrastructureActiveSubsection=t,navRootLabel:`MCP`,includeSections:[`mcp`]})});case`infrastructure`:return Ue({formMode:e.infrastructureFormMode,searchQuery:e.infrastructureSearchQuery,activeSection:Je.activeSection,activeSubsection:Je.activeSubsection,onFormModeChange:t=>e.infrastructureFormMode=t,onSearchChange:t=>e.infrastructureSearchQuery=t,onSectionChange:t=>{e.infrastructureActiveSection=t,e.infrastructureActiveSubsection=null},onSubsectionChange:t=>e.infrastructureActiveSubsection=t,navRootLabel:`Infrastructure`,includeSections:[...UG]});case`aiAgents`:return Ue({formMode:e.aiAgentsFormMode,searchQuery:e.aiAgentsSearchQuery,activeSection:Ye.activeSection,activeSubsection:Ye.activeSubsection,onFormModeChange:t=>e.aiAgentsFormMode=t,onSearchChange:t=>e.aiAgentsSearchQuery=t,onSectionChange:t=>{e.aiAgentsActiveSection=t,e.aiAgentsActiveSubsection=null},onSubsectionChange:t=>e.aiAgentsActiveSubsection=t,navRootLabel:`AI & Agents`,includeSections:[...WG]});default:return d}},Ze=t=>{if(t)switch(e.agentsPanel){case`files`:Eb(e,t);return;case`skills`:jb(e,t);return;case`tools`:Fb(e,t),zb(e);case`overview`:case`channels`:case`cron`:}},Qe=t=>{if(t===`channels`){on(e,!1);return}t===`cron`&&e.loadCron()},$e=(t=!1)=>{e.agentFilesList=null,e.agentFilesError=null,e.agentFileActive=null,e.agentFileContents={},e.agentFileDrafts={},t&&(e.agentFilesLoading=!1)},et=()=>{$e(!0),e.agentSkillsReport=null,e.agentSkillsError=null,e.agentSkillsAgentId=null,e.toolsCatalogResult=null,e.toolsCatalogError=null,e.toolsCatalogLoading=!1,Lb(e)};s&&e.connected&&e.agentsList&&!j.loading&&!j.error&&j.list?.agentId!==Ee&&nt();let tt=()=>{nt({force:!0})};function nt(t){if(!e.client||!e.connected||j.loading)return;let r=j.requestId+1;j.requestId=r,j.loading=!0,j.error=null,t?.force&&(j.list=null);let i=j;(async()=>{try{let t=await e.client?.request(`agents.files.list`,{agentId:Ee}),n=Oe();if(n!==i||n.requestId!==r)return;n.list=t??null,n.activeName&&!t?.files.some(e=>e.name===n.activeName)&&(n.activeName=null)}catch(e){let t=Oe();t===i&&t.requestId===r&&(t.error=String(e))}finally{let e=Oe();e===i&&e.requestId===r&&(e.loading=!1),n?.()}})()}let rt=t=>{j.activeName=t;let r={agentId:Ee,id:(EG.get(e)?.id??0)+1,name:t,sessionKey:e.sessionKey};EG.set(e,r);let i=()=>{let n=EG.get(e),i=Oe();return n?.id===r.id&&n.agentId===Te()&&n.name===t&&n.sessionKey===e.sessionKey&&i?.activeName===t};(async()=>{if(!(!e.client||!e.connected)){j.error=null;try{let r=(await e.client.request(`agents.files.get`,{agentId:Ee,name:t}))?.file?.content;if(typeof r!=`string`){i()&&(j.error=`Failed to load ${t}`,n?.());return}if(!i())return;e.handleOpenSidebar({kind:`markdown`,content:sK(t,r),rawText:r})}catch(e){i()&&(j.error=String(e))}finally{n?.()}}})()};return c`
|
|
6122
|
+
`}var fG=jz(()=>b(()=>import(`./agents-CeF1k4Mj.js`),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url),ZW),pG=jz(()=>b(()=>import(`./activity-C_HZe0c-.js`),__vite__mapDeps([7,1,2]),import.meta.url),ZW),mG=jz(()=>b(()=>import(`./channels-C3fGrqai.js`),__vite__mapDeps([8,1,2,5]),import.meta.url),ZW),hG=jz(()=>b(()=>import(`./cron-01SXAnEJ.js`),__vite__mapDeps([9,1,2]),import.meta.url),ZW),gG=jz(()=>b(()=>import(`./debug-B8zuijMC.js`),__vite__mapDeps([10,1,2]),import.meta.url),ZW),_G=jz(()=>b(()=>import(`./instances-izquLPnA.js`),__vite__mapDeps([11,1,2]),import.meta.url),ZW),vG=jz(()=>b(()=>import(`./logs-DPetTn3l.js`),__vite__mapDeps([12,1,2]),import.meta.url),ZW),yG=jz(()=>b(()=>import(`./nodes-e5Cze-NX.js`),__vite__mapDeps([13,1,2]),import.meta.url),ZW),bG=jz(()=>b(()=>import(`./sessions-BRqy7EPO.js`),__vite__mapDeps([14,1,2]),import.meta.url),ZW),xG=jz(()=>b(()=>import(`./skill-workshop-DHBE6rsG.js`),__vite__mapDeps([15,2]),import.meta.url),ZW),SG=jz(()=>b(()=>import(`./skills-BXLJ4lgH.js`),__vite__mapDeps([16,1,2,6]),import.meta.url),ZW),CG=jz(()=>b(()=>import(`./usage-CrcXmrp7.js`),__vite__mapDeps([17,1,2]),import.meta.url),ZW),wG=jz(()=>b(()=>import(`./workboard-CnCeQDxS.js`),__vite__mapDeps([18,1,2]),import.meta.url),ZW),TG=new WeakMap,EG=new WeakMap;function DG(e,t){let n=TG.get(e);if(n?.agentId===t)return n;let r={activeName:null,agentId:t,error:null,list:null,loading:!1,requestId:0};return TG.set(e,r),r}function OG(e){return dl(e,{hour:`numeric`,minute:`2-digit`},``)||null}function kG(e){if(!e?.phases)return null;let t;for(let n of Object.values(e.phases))!n.enabled||typeof n.nextRunAtMs!=`number`||(t===void 0||n.nextRunAtMs<t)&&(t=n.nextRunAtMs);return OG(t)}var AG=null,jG=`openclaw:control-ui:update-banner-dismissed:v1`,MG=[`off`,`minimal`,`low`,`medium`,`high`],NG=[`UTC`,`America/Los_Angeles`,`America/Denver`,`America/Chicago`,`America/New_York`,`Europe/London`,`Europe/Berlin`,`Asia/Tokyo`];function PG(e){return/^https?:\/\//i.test(e.trim())}function FG(e){return typeof e==`string`?e.trim():``}function IG(e){let t=new Set,n=[];for(let r of e){let e=r.trim();if(!e)continue;let i=e.toLowerCase();t.has(i)||(t.add(i),n.push(e))}return n}function LG(){try{let e=T()?.getItem(jG);if(!e)return null;let t=JSON.parse(e);return!t||typeof t.latestVersion!=`string`?null:{latestVersion:t.latestVersion,channel:typeof t.channel==`string`?t.channel:null,dismissedAtMs:typeof t.dismissedAtMs==`number`?t.dismissedAtMs:Date.now()}}catch{return null}}function RG(e){let t=LG();if(!t)return!1;let n=e,r=n&&typeof n.latestVersion==`string`?n.latestVersion:null,i=n&&typeof n.channel==`string`?n.channel:null;return!!(r&&t.latestVersion===r&&t.channel===i)}function zG(e){let t=e,n=t&&typeof t.latestVersion==`string`?t.latestVersion:null;if(!n)return;let r={latestVersion:n,channel:t&&typeof t.channel==`string`?t.channel:null,dismissedAtMs:Date.now()};try{T()?.setItem(jG,JSON.stringify(r))}catch{}}var BG=[`messages`,`broadcast`,`__notifications__`,`talk`,`audio`,`channels`],VG=[`__appearance__`,`ui`,`wizard`],HG=[`commands`,`hooks`,`bindings`,`cron`,`approvals`,`plugins`],UG=[`gateway`,`web`,`browser`,`nodeHost`,`canvasHost`,`discovery`,`media`,`acp`,`mcp`],WG=[`agents`,`models`,`skills`,`tools`,`memory`,`session`],GG=new Set([...BG,...VG,...HG,...UG,...WG]);function KG(e,t){return e&&GG.has(e)?{activeSection:null,activeSubsection:null}:{activeSection:e,activeSubsection:t}}function qG(e,t,n){return e&&!n.includes(e)?{activeSection:null,activeSubsection:null}:{activeSection:e,activeSubsection:t}}function JG(e,t,n){if(!e||typeof e!=`object`||Array.isArray(e))return 0;let r=e.properties;if(!r||typeof r!=`object`||Array.isArray(r))return 0;let i=t?.length?new Set(t):null,a=n?.length?new Set(n):null;return Object.keys(r).filter(e=>!(i&&!i.has(e)||a?.has(e))).length}function YG(e,t,n,r){let i=B(),a=r();return th(e,t,{...n,durationMs:V(B()-i)}),a}function XG(e){return n([e.sessionKey,e.connected,e.client,e.onboarding,e.chatManualRefreshInFlight,e.chatLoading,e.chatSending,e.chatStream,e.chatRunId,e.chatMobileControlsOpen,e.sessionsHideCron??!0,e.sessionsResult,e.sessionsShowArchived,e.agentsList,e.chatModelOverrides,e.chatModelSwitchPromises,e.chatModelsLoading,e.chatModelCatalog,e.settings.chatShowThinking,e.settings.chatShowToolCalls,e.settings.chatAutoScroll,e.chatSessionPickerOpen,e.chatSessionPickerSurface,e.chatSessionPickerQuery,e.chatSessionPickerAppliedQuery,e.chatSessionPickerLoading,e.chatSessionPickerError,e.chatSessionPickerResult,e.sessionSwitchNotice?.id??null,e.sessionSwitchNotice?.text??null,e.sessionSwitchFlashKey,g.getLocale()],()=>Sz(e))}function ZG(e){let t=e.agentsList?.agents??[],n=F(e.sessionKey)?.agentId??e.agentsList?.defaultId??`main`,r=t.find(e=>e.id===n)?.identity,i=r?.avatarUrl??r?.avatar;if(i&&Xa(i))return i}function QG(e){if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e.ui;if(!t||typeof t!=`object`||Array.isArray(t))return null;let n=t.assistant;return!n||typeof n!=`object`||Array.isArray(n)?null:C(n.avatar)??null}function $G(e,t){let n=Bi(e??``),r=encodeURIComponent(t);return n?`${n}/avatar/${r}`:`/avatar/${r}`}var eK=[{id:`telegram`,label:`Telegram`},{id:`discord`,label:`Discord`},{id:`slack`,label:`Slack`},{id:`whatsapp`,label:`WhatsApp`},{id:`signal`,label:`Signal`},{id:`imessage`,label:`iMessage`}];function tK(e){let t=e.trim();return t?t.split(/[-_]+/).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `):`Unknown`}function nK(e){let t=e.configForm??e.configSnapshot?.config;if(!t||typeof t!=`object`)return[];let n=`channels`in t&&t.channels&&typeof t.channels==`object`?t.channels:{},r=Object.keys(n).filter(e=>e.trim().length>0),i=r.length>0?r.toSorted((e,t)=>e.localeCompare(t)):eK.map(({id:e})=>e),a=new Map(eK.map(({id:e,label:t})=>[e,t])),o=[];for(let e of i){let t=n[e],r=typeof t==`object`&&!!t&&Object.keys(t).length>0;o.push({id:e,label:a.get(e)??tK(e),connected:r,detail:r?`Configured`:void 0})}return o}function rK(e){let t=e.configForm??e.configSnapshot?.config;if(!t||typeof t!=`object`)return 0;let n=t.mcp;if(!n||typeof n!=`object`)return 0;let r=`servers`in n&&n.servers&&typeof n.servers==`object`?n.servers:{};return Object.keys(r).length}function iK(e){let t=e.configForm??e.configSnapshot?.config;if(!t||typeof t!=`object`)return{gatewayAuth:`unknown`,execPolicy:`unknown`,deviceAuth:!1,browserEnabled:!0,toolProfile:`full`};let n=t,r=`gateway`in n&&n.gateway&&typeof n.gateway==`object`?n.gateway:null,i=r&&`auth`in r&&r.auth&&typeof r.auth==`object`?r.auth:null,a=`unknown`;i&&(a=(typeof i.mode==`string`?i.mode.trim():``)||(i.password?`password`:i.token?`token`:i.trustedProxy?`trusted-proxy`:`none`));let o=`allowlist`,s=`full`,c=n.tools;if(c&&typeof c==`object`){let e=c.profile;if(typeof e==`string`){let t=e.trim();t&&(s=t)}let t=c.exec;if(t&&typeof t==`object`){let e=t.security;if(typeof e==`string`){let t=e.trim();t&&(o=t)}}}let l=!0,u=`browser`in n&&n.browser&&typeof n.browser==`object`?n.browser:null;u&&typeof u.enabled==`boolean`&&(l=u.enabled);let d=!0;return r&&(`controlUi`in r&&r.controlUi&&typeof r.controlUi==`object`?r.controlUi:null)?.dangerouslyDisableDeviceAuth===!0&&(d=!1),{gatewayAuth:a,execPolicy:o,deviceAuth:d,browserEnabled:l,toolProfile:s}}function aK(e){return e.sessionsResult?.sessions?.find(t=>t.key===e.sessionKey)}function oK(e,t){return kH({open:e.cronQuickCreateOpen,step:e.cronQuickCreateStep,draft:e.cronQuickCreateDraft??yH(),onDraftChange:n=>{e.cronQuickCreateDraft={...e.cronQuickCreateDraft??yH(),...n},t?.()},onStepChange:n=>{e.cronQuickCreateStep=n,t?.()},onCreate:()=>{let n=xH(e.cronQuickCreateDraft??yH());e.cronEditingJobId=null,e.cronForm={...Yy,...n},t?.(),(async()=>{if(!await _x(e)){t?.();return}e.cronQuickCreateOpen=!1,e.cronQuickCreateStep=`what`,e.cronQuickCreateDraft=null,t?.()})()},onAdvancedCreate:()=>{let n=xH(e.cronQuickCreateDraft??yH());e.cronEditingJobId=null,e.cronForm=Yb({...Yy,...n}),e.cronFieldErrors=Xb(e.cronForm),e.cronQuickCreateOpen=!1,e.cronQuickCreateStep=`what`,e.cronQuickCreateDraft=null,e.cronFormCollapsed=!1,t?.()},onCancel:()=>{e.cronQuickCreateOpen=!1,e.cronQuickCreateStep=`what`,e.cronQuickCreateDraft=null,t?.()}})}function sK(e,t){return/\.(?:md|markdown|mdx)$/i.test(e)?t:`# ${e}\n\n\`\`\`${e.match(/\.([a-z0-9_-]+)$/i)?.[1]?.toLowerCase()??``}\n${t}\n\`\`\``}function cK(e){let t=e,n=typeof t.requestUpdate==`function`?()=>t.requestUpdate?.():void 0;if(XW=n,!e.connected)return c` ${mW(e)} ${eW(e)} `;let r=e.presenceEntries.length,i=e.sessionsResult?.count??null,a=e.cronStatus?.nextWakeAtMs??null,o=e.connected?null:S(`chat.disconnected`),s=e.tab===`chat`,l=!s&&e.lastError!==e.chatError?e.lastError:null,u=e.lastError,f=s&&(e.onboarding||e.chatHeaderControlsHidden),p=e.navDrawerOpen&&!e.onboarding,h=e.settings.navCollapsed&&!p,g=cz(e),_=e.onboarding?!1:e.settings.chatShowThinking,v=e.onboarding?!0:e.settings.chatShowToolCalls,y=C(us().avatar)??null,b=ZG(e),x=y?`data`:e.chatAvatarStatus??e.assistantAvatarStatus??null,ee=y?null:e.chatAvatarReason??e.assistantAvatarReason??null,w=x===`none`&&ee===`missing`,T=y??(w?null:e.assistantAvatar),te=y??e.chatAvatarUrl??(w?null:b??null),ne=y?`data`:e.assistantAvatarStatus??e.chatAvatarStatus??null,re=y?null:e.assistantAvatarReason??e.chatAvatarReason??null,ie=y??e.assistantAvatarSource??e.chatAvatarSource??null,E=ne===`none`&&re===`missing`,ae=y??(E||ne===`local`?null:e.assistantAvatar),D=y??(ne===`local`&&e.assistantAgentId?$G(e.basePath,e.assistantAgentId):e.chatAvatarUrl??(E?null:b??null)),O=e.configForm??e.configSnapshot?.config,oe=Zx(O),se=e.dreamingStatus?.enabled??oe.enabled,ce=kG(e.dreamingStatus),le=nz(e),ue=ZR(e,e.sessionKey),k=()=>{e.selectedAgentId=ue},de=e.dreamingStatusLoading||e.dreamingModeSaving,fe=e.dreamingStatusLoading||e.dreamDiaryLoading,pe=()=>{(async()=>{k(),await er(e),await Promise.all([fS(e),pS(e),mS(e),hS(e)])})()},me=async t=>{if(!e.client||!e.connected)return null;let n=await e.client.request(`wiki.get`,{lookup:t,fromLine:1,lineCount:5e3}),r=typeof n?.title==`string`&&n.title.trim()?n.title.trim():t,i=typeof n?.path==`string`&&n.path.trim()?n.path.trim():t,a=typeof n?.content==`string`&&n.content.length>0?n.content:`No wiki content available.`,o=typeof n?.updatedAt==`string`&&n.updatedAt.trim()?n.updatedAt.trim():void 0,s=typeof n?.totalLines==`number`&&Number.isFinite(n.totalLines)?Math.max(0,Math.floor(n.totalLines)):void 0,c=n?.truncated===!0;return{title:r,path:i,content:a,...s===void 0?{}:{totalLines:s},...c?{truncated:c}:{},...o?{updatedAt:o}:{}}},he=t=>{e.dreamingModeSaving||e.dreamingRestartConfirmLoading||e.dreamingRestartConfirmOpen||se===t||(e.dreamingPendingEnabled=t,e.dreamingRestartConfirmOpen=!0,e.dreamingStatusError=null)},ge=()=>{e.dreamingRestartConfirmLoading||(e.dreamingRestartConfirmOpen=!1,e.dreamingPendingEnabled=null,e.dreamingStatusError=null)},_e=()=>{let t=e.dreamingPendingEnabled;t==null||e.dreamingRestartConfirmLoading||(async()=>{e.dreamingRestartConfirmLoading=!0,e.dreamingStatusError=null;try{if(!await DS(e,t)){e.dreamingStatusError||=S(`dreaming.restartConfirmation.failed`);return}await er(e),await fS(e),e.dreamingRestartConfirmOpen=!1,e.dreamingPendingEnabled=null}finally{e.dreamingRestartConfirmLoading=!1}})()},ve=Bi(e.basePath??``),ye=()=>e.agentsSelectedId??e.agentsList?.defaultId??e.agentsList?.agents?.[0]?.id??null,A=ye(),be=C(e.sessionKey)?.toLowerCase(),Se=be===`global`?null:Ql(e.sessionKey),Ce=Ev(e,e.sessionKey).agentId,we=L(e.assistantAgentId??e.agentsList?.defaultId??e.agentsList?.agents?.[0]?.id??`main`),Te=()=>{let t=C(e.sessionKey)?.toLowerCase(),n=t===`global`?null:Ql(e.sessionKey),r=Ev(e,e.sessionKey).agentId;return t===`global`?r??we:n??r??we},Ee=be===`global`?Ce??we:Se??Ce??we,De=!!(A&&A===Ee),j=DG(e,Ee),Oe=()=>Te()===Ee?DG(e,Ee):null,ke=()=>e.configForm??e.configSnapshot?.config,M=e=>wr(ke(),e),Ae=t=>Tr(e,t),je=(e,t)=>{let n=t?Ae(e):M(e);return n>=0?[`agents`,`list`,n,`tools`]:null},Me=e=>{let t=ke()?.agents?.list,n=Array.isArray(t)?t[e]?.model:void 0;return{basePath:[`agents`,`list`,e,`model`],existing:n}},Ne=vo(new Set([...e.agentsList?.agents?.map(e=>e.id.trim())??[],...e.cronJobs.map(e=>typeof e.agentId==`string`?e.agentId.trim():``).filter(Boolean)].filter(Boolean))),Pe=vo(new Set([...e.cronModelSuggestions,...yo(O),...e.cronJobs.map(e=>{let t=Wb(e);return t?.kind!==`agentTurn`||typeof t.model!=`string`?``:t.model.trim()}).filter(Boolean)].filter(Boolean))),Fe=ix(e),Ie=e.cronForm.deliveryChannel&&e.cronForm.deliveryChannel.trim()?e.cronForm.deliveryChannel.trim():`last`,Le=e.cronJobs.map(e=>FG(e.delivery?.to)).filter(Boolean),Re=(Ie===`last`?Object.values(e.channelsSnapshot?.channelAccounts??{}).flat():e.channelsSnapshot?.channelAccounts?.[Ie]??[]).flatMap(e=>[FG(e.accountId),FG(e.name)]).filter(Boolean),ze=IG([...Le,...Re]),Be=IG(Re),Ve=e.cronForm.deliveryMode===`webhook`?ze.filter(e=>PG(e)):ze,He={raw:e.configRaw,originalRaw:e.configRawOriginal,valid:e.configValid,issues:e.configIssues,loading:e.configLoading,saving:e.configSaving,applying:e.configApplying,updating:e.updateRunning,connected:e.connected,schema:e.configSchema,schemaLoading:e.configSchemaLoading,uiHints:e.configUiHints,formValue:e.configForm,originalValue:e.configFormOriginal,onRawChange:t=>{yr(e,t)},onRequestUpdate:n,onFormPatch:(t,n)=>vr(e,t,n),onReload:()=>void er(e,{discardPendingChanges:!0}),onReset:()=>xr(e),onSave:()=>void dr(e),onApply:()=>void fr(e),onUpdate:()=>void pr(e),onOpenFile:()=>void Dr(e),version:e.hello?.server?.version??``,theme:e.theme,themeMode:e.themeMode,setTheme:(t,n)=>e.setTheme(t,n),setThemeMode:(t,n)=>e.setThemeMode(t,n),hasCustomTheme:!!e.settings.customTheme,customThemeLabel:e.settings.customTheme?.label??null,customThemeSourceUrl:e.settings.customTheme?.sourceUrl??null,customThemeImportUrl:e.customThemeImportUrl,customThemeImportBusy:e.customThemeImportBusy,customThemeImportMessage:e.customThemeImportMessage,customThemeImportExpanded:e.customThemeImportExpanded,customThemeImportFocusToken:e.customThemeImportFocusToken,onCustomThemeImportUrlChange:t=>e.setCustomThemeImportUrl(t),onOpenCustomThemeImport:()=>e.openCustomThemeImport(),onImportCustomTheme:()=>void e.importCustomTheme(),onClearCustomTheme:()=>e.clearCustomTheme(),borderRadius:e.settings.borderRadius,setBorderRadius:t=>e.setBorderRadius(t),textScale:e.settings.textScale??100,setTextScale:t=>e.setTextScale(t),gatewayUrl:e.settings.gatewayUrl,assistantName:e.assistantName,configPath:e.configSnapshot?.path??null,rawAvailable:typeof e.configSnapshot?.raw==`string`||!!e.configSnapshot?.config||!!e.configForm},Ue=t=>{let n=t.includeSections?.[0]??null,r=t.activeSection??n,i=t.showRootTab??!t.includeSections?.length;return YG(e,`config`,{tab:e.tab,formMode:t.formMode,activeSection:r,activeSubsection:t.activeSubsection,schemaSectionCount:JG(He.schema,t.includeSections,t.excludeSections),hasSearch:!!t.searchQuery?.trim()},()=>gH({...He,includeVirtualSections:!1,...t,activeSection:r,showRootTab:i}))},We=KG(e.configActiveSection,e.configActiveSubsection),Ge=qG(e.communicationsActiveSection,e.communicationsActiveSubsection,BG),Ke=qG(e.appearanceActiveSection,e.appearanceActiveSubsection,VG),qe=qG(e.automationActiveSection,e.automationActiveSubsection,HG),Je=qG(e.infrastructureActiveSection,e.infrastructureActiveSubsection,UG),Ye=qG(e.aiAgentsActiveSection,e.aiAgentsActiveSubsection,WG),Xe=()=>{switch(e.tab){case`config`:if(e.configSettingsMode===`quick`){let t=e.configForm??e.configSnapshot?.config??{},r=y??QG(t),i=t.agents?.defaults??{},a=aK(e),o=typeof a?.model==`string`?a.model:typeof i.model==`string`?i.model:`default`,s=typeof a?.thinkingLevel==`string`?a.thinkingLevel:typeof i.thinkingLevel==`string`?i.thinkingLevel:`off`,c=typeof a?.fastMode==`boolean`?a.fastMode:i.fastMode===!0;return KB({currentModel:o,thinkingLevel:s,fastMode:c,onModelChange:()=>{e.configSettingsMode=`advanced`,e.aiAgentsActiveSection=`models`,e.setTab(`aiAgents`)},onThinkingChange:t=>{lv(e,e.sessionKey,{thinkingLevel:t}).then(()=>n?.())},onFastModeToggle:()=>{lv(e,e.sessionKey,{fastMode:!c}).then(()=>n?.())},channels:nK(e),onChannelConfigure:()=>{e.setTab(`channels`)},automation:{cronJobCount:e.cronJobs?.length??0,skillCount:e.skillsReport?.skills?.length??0,mcpServerCount:rK(e)},onManageCron:()=>{e.setTab(`cron`)},onBrowseSkills:()=>{e.setTab(`skills`)},onConfigureMcp:()=>{e.setTab(`mcp`)},security:iK(e),onSecurityConfigure:()=>{e.configSettingsMode=`advanced`,e.configActiveSection=`auth`,n?.()},onBrowserEnabledToggle:t=>{vr(e,[`browser`,`enabled`],t),n?.()},onToolProfileChange:t=>{vr(e,[`tools`,`profile`],t),n?.()},theme:e.theme,themeMode:e.themeMode,hasCustomTheme:!!e.settings.customTheme,customThemeLabel:e.settings.customTheme?.label??null,borderRadius:e.settings.borderRadius,textScale:e.settings.textScale??100,setTheme:(t,n)=>e.setTheme(t,n),onOpenCustomThemeImport:()=>{e.setTab(`appearance`),e.appearanceFormMode=`form`,e.appearanceSearchQuery=``,e.appearanceActiveSection=`__appearance__`,e.appearanceActiveSubsection=null,e.openCustomThemeImport(),n?.()},setThemeMode:(t,n)=>e.setThemeMode(t,n),setBorderRadius:t=>e.setBorderRadius(t),setTextScale:t=>e.setTextScale(t),userAvatar:e.userAvatar??null,onUserAvatarChange:t=>e.applyLocalUserIdentity?.({avatar:t}),assistantAvatar:ae,assistantAvatarUrl:D,assistantAvatarSource:ie,assistantAvatarStatus:ne,assistantAvatarReason:re,assistantAvatarOverride:r,assistantAvatarUploadBusy:e.assistantAvatarUploadBusy,assistantAvatarUploadError:e.assistantAvatarUploadError,onAssistantAvatarOverrideChange:t=>{VF(e,t),e.chatAvatarUrl=t,e.chatAvatarSource=t,e.chatAvatarStatus=`data`,e.chatAvatarReason=null,e.assistantAvatarUploadError=null,n?.()},onAssistantAvatarClearOverride:()=>{VF(e,null),e.chatAvatarUrl=null,e.chatAvatarSource=null,e.chatAvatarStatus=null,e.chatAvatarReason=null,e.assistantAvatarUploadError=null,e.loadAssistantIdentity?.().finally(()=>n?.()),n?.()},basePath:e.basePath??``,configObject:t,savedConfigObject:e.configSnapshot?.config??{},configDirty:e.configFormDirty,configSaving:e.configSaving,configApplying:e.configApplying,configReady:!!e.configSnapshot?.hash,onSelectPreset:t=>{let r=fB(t);r&&(br(e,r.patch),n?.())},onResetConfig:()=>xr(e),onSaveConfig:()=>void dr(e),onApplyConfig:()=>void fr(e),onAdvancedSettings:()=>{e.configSettingsMode=`advanced`,n?.()},connected:e.connected,gatewayUrl:e.settings.gatewayUrl,assistantName:e.assistantName,version:e.hello?.server?.version??``})}return Ue({formMode:e.configFormMode,searchQuery:e.configSearchQuery,activeSection:We.activeSection,activeSubsection:We.activeSubsection,onFormModeChange:t=>e.configFormMode=t,onSearchChange:t=>e.configSearchQuery=t,onSectionChange:t=>{e.configActiveSection=t,e.configActiveSubsection=null},onSubsectionChange:t=>e.configActiveSubsection=t,showModeToggle:!0,settingsLayout:`accordion`,onBackToQuick:()=>{e.configSettingsMode=`quick`,n?.()},excludeSections:[...BG,...HG,...UG,...WG,`ui`,`wizard`]});case`channels`:return Nz(mG,t=>t.renderChannels({connected:e.connected,loading:e.channelsLoading,snapshot:e.channelsSnapshot,lastError:e.channelsError,lastSuccessAt:e.channelsLastSuccess,whatsappMessage:e.whatsappLoginMessage,whatsappQrDataUrl:e.whatsappLoginQrDataUrl,whatsappConnected:e.whatsappLoginConnected,whatsappBusy:e.whatsappBusy,configSchema:e.configSchema,configSchemaLoading:e.configSchemaLoading,configForm:e.configForm,configUiHints:e.configUiHints,configSaving:e.configSaving,configFormDirty:e.configFormDirty,nostrProfileFormState:e.nostrProfileFormState,nostrProfileAccountId:e.nostrProfileAccountId,onRefresh:t=>void on(e,t),onWhatsAppStart:t=>void e.handleWhatsAppStart(t),onWhatsAppWait:()=>void e.handleWhatsAppWait(),onWhatsAppLogout:()=>void e.handleWhatsAppLogout(),onConfigPatch:(t,n)=>vr(e,t,n),onConfigSave:()=>void e.handleChannelConfigSave(),onConfigReload:()=>void e.handleChannelConfigReload(),onNostrProfileEdit:(t,n)=>e.handleNostrProfileEdit(t,n),onNostrProfileCancel:()=>e.handleNostrProfileCancel(),onNostrProfileFieldChange:(t,n)=>e.handleNostrProfileFieldChange(t,n),onNostrProfileSave:()=>void e.handleNostrProfileSave(),onNostrProfileImport:()=>void e.handleNostrProfileImport(),onNostrProfileToggleAdvanced:()=>e.handleNostrProfileToggleAdvanced()}));case`communications`:return Ue({formMode:e.communicationsFormMode,searchQuery:e.communicationsSearchQuery,activeSection:Ge.activeSection,activeSubsection:Ge.activeSubsection,onFormModeChange:t=>e.communicationsFormMode=t,onSearchChange:t=>e.communicationsSearchQuery=t,onSectionChange:t=>{e.communicationsActiveSection=t,e.communicationsActiveSubsection=null},onSubsectionChange:t=>e.communicationsActiveSubsection=t,navRootLabel:`Communication`,includeSections:[...BG],includeVirtualSections:!0,webPush:{supported:e.webPushSupported,permission:e.webPushPermission,subscribed:e.webPushSubscribed,loading:e.webPushLoading},onWebPushSubscribe:()=>void e.handleWebPushSubscribe(),onWebPushUnsubscribe:()=>void e.handleWebPushUnsubscribe(),onWebPushTest:()=>void e.handleWebPushTest()});case`appearance`:return Ue({formMode:e.appearanceFormMode,searchQuery:e.appearanceSearchQuery,activeSection:Ke.activeSection,activeSubsection:Ke.activeSubsection,onFormModeChange:t=>e.appearanceFormMode=t,onSearchChange:t=>e.appearanceSearchQuery=t,onSectionChange:t=>{e.appearanceActiveSection=t,e.appearanceActiveSubsection=null},onSubsectionChange:t=>e.appearanceActiveSubsection=t,navRootLabel:S(`tabs.appearance`),includeSections:[...VG],includeVirtualSections:!0});case`automation`:return Ue({formMode:e.automationFormMode,searchQuery:e.automationSearchQuery,activeSection:qe.activeSection,activeSubsection:qe.activeSubsection,onFormModeChange:t=>e.automationFormMode=t,onSearchChange:t=>e.automationSearchQuery=t,onSectionChange:t=>{e.automationActiveSection=t,e.automationActiveSubsection=null},onSubsectionChange:t=>e.automationActiveSubsection=t,navRootLabel:`Automation`,includeSections:[...HG]});case`mcp`:return TW({configObject:e.configForm??(e.configSnapshot?.config||{}),configDirty:e.configFormDirty,configSaving:e.configSaving,configApplying:e.configApplying,connected:e.connected,onSaveConfig:()=>void dr(e),onApplyConfig:()=>void fr(e),onServerEnabledChange:(t,r)=>{Cr(e,t,r),n?.()},editor:Ue({formMode:`form`,searchQuery:``,activeSection:`mcp`,activeSubsection:null,onFormModeChange:()=>void 0,onSearchChange:()=>void 0,onSectionChange:()=>{e.infrastructureActiveSection=`mcp`,e.infrastructureActiveSubsection=null},onSubsectionChange:t=>e.infrastructureActiveSubsection=t,navRootLabel:`MCP`,includeSections:[`mcp`]})});case`infrastructure`:return Ue({formMode:e.infrastructureFormMode,searchQuery:e.infrastructureSearchQuery,activeSection:Je.activeSection,activeSubsection:Je.activeSubsection,onFormModeChange:t=>e.infrastructureFormMode=t,onSearchChange:t=>e.infrastructureSearchQuery=t,onSectionChange:t=>{e.infrastructureActiveSection=t,e.infrastructureActiveSubsection=null},onSubsectionChange:t=>e.infrastructureActiveSubsection=t,navRootLabel:`Infrastructure`,includeSections:[...UG]});case`aiAgents`:return Ue({formMode:e.aiAgentsFormMode,searchQuery:e.aiAgentsSearchQuery,activeSection:Ye.activeSection,activeSubsection:Ye.activeSubsection,onFormModeChange:t=>e.aiAgentsFormMode=t,onSearchChange:t=>e.aiAgentsSearchQuery=t,onSectionChange:t=>{e.aiAgentsActiveSection=t,e.aiAgentsActiveSubsection=null},onSubsectionChange:t=>e.aiAgentsActiveSubsection=t,navRootLabel:`AI & Agents`,includeSections:[...WG]});default:return d}},Ze=t=>{if(t)switch(e.agentsPanel){case`files`:Eb(e,t);return;case`skills`:jb(e,t);return;case`tools`:Fb(e,t),zb(e);case`overview`:case`channels`:case`cron`:}},Qe=t=>{if(t===`channels`){on(e,!1);return}t===`cron`&&e.loadCron()},$e=(t=!1)=>{e.agentFilesList=null,e.agentFilesError=null,e.agentFileActive=null,e.agentFileContents={},e.agentFileDrafts={},t&&(e.agentFilesLoading=!1)},et=()=>{$e(!0),e.agentSkillsReport=null,e.agentSkillsError=null,e.agentSkillsAgentId=null,e.toolsCatalogResult=null,e.toolsCatalogError=null,e.toolsCatalogLoading=!1,Lb(e)};s&&e.connected&&e.agentsList&&!j.loading&&!j.error&&j.list?.agentId!==Ee&&nt();let tt=()=>{nt({force:!0})};function nt(t){if(!e.client||!e.connected||j.loading)return;let r=j.requestId+1;j.requestId=r,j.loading=!0,j.error=null,t?.force&&(j.list=null);let i=j;(async()=>{try{let t=await e.client?.request(`agents.files.list`,{agentId:Ee}),n=Oe();if(n!==i||n.requestId!==r)return;n.list=t??null,n.activeName&&!t?.files.some(e=>e.name===n.activeName)&&(n.activeName=null)}catch(e){let t=Oe();t===i&&t.requestId===r&&(t.error=String(e))}finally{let e=Oe();e===i&&e.requestId===r&&(e.loading=!1),n?.()}})()}let rt=t=>{j.activeName=t;let r={agentId:Ee,id:(EG.get(e)?.id??0)+1,name:t,sessionKey:e.sessionKey};EG.set(e,r);let i=()=>{let n=EG.get(e),i=Oe();return n?.id===r.id&&n.agentId===Te()&&n.name===t&&n.sessionKey===e.sessionKey&&i?.activeName===t};(async()=>{if(!(!e.client||!e.connected)){j.error=null;try{let r=(await e.client.request(`agents.files.get`,{agentId:Ee,name:t}))?.file?.content;if(typeof r!=`string`){i()&&(j.error=`Failed to load ${t}`,n?.());return}if(!i())return;e.handleOpenSidebar({kind:`markdown`,content:sK(t,r),rawText:r})}catch(e){i()&&(j.error=String(e))}finally{n?.()}}})()};return c`
|
|
6123
6123
|
${uB({open:e.paletteOpen,query:e.paletteQuery,activeIndex:e.paletteActiveIndex,onToggle:()=>{e.paletteOpen=!e.paletteOpen},onQueryChange:t=>{e.paletteQuery=t},onActiveIndexChange:t=>{e.paletteActiveIndex=t},onNavigate:t=>{e.setTab(t)},onSlashCommand:t=>{e.setTab(`chat`),e.handleChatDraftChange(t.endsWith(` `)?t:`${t} `)}})}
|
|
6124
6124
|
<div
|
|
6125
6125
|
class="shell ${s?`shell--chat`:``} ${h?`shell--nav-collapsed`:``} ${p?`shell--nav-drawer-open`:``} ${e.onboarding?`shell--onboarding`:``}"
|
|
@@ -6341,5 +6341,5 @@ ${e.pluginDescription}</pre
|
|
|
6341
6341
|
`).trim()}function XK(e){if(!e)return;let t=e.error?.trim();if(e.status===`error`)return Error(t||`OpenClaw tool call failed`);if(e.status!==`timeout`||e.pendingError)return;let n=e.stopReason?.trim(),r=e.timeoutPhase?.trim(),i=e.livenessState?.trim();if(e.endedAt!==void 0||t!==void 0||e.aborted===!0||i!==void 0&&i.length>0||e.yielded===!0||n!==void 0&&n.length>0||r===`preflight`||r===`provider`||r===`post_turn`||e.providerStarted===!0)return Error(t||`OpenClaw tool call timed out`)}function ZK(e){return new Promise((t,n)=>{if(e.signal?.aborted){n(new DOMException(`OpenClaw tool call aborted`,`AbortError`));return}let r=window.setTimeout(()=>{u(Error(`OpenClaw tool call timed out`))},e.timeoutMs),i=!1,a=!1,o,s=()=>{u(new DOMException(`OpenClaw tool call aborted`,`AbortError`))};e.signal?.addEventListener(`abort`,s,{once:!0});let c=()=>void 0,l=e=>{i||(i=!0,f(),t(e))},u=e=>{i||(i=!0,f(),n(e))},d=()=>{a||(a=!0,e.client.request(`agent.wait`,{runId:e.runId,timeoutMs:e.timeoutMs}).then(e=>{if(i)return;let t=XK(e);if(t){u(t);return}e?.status!==`timeout`&&(o=window.setTimeout(()=>{l(`OpenClaw finished with no text.`)},JK))}).catch(e=>{u(e instanceof Error?e:Error(String(e)))}))};c=e.client.addEventListener(t=>{if(t.event!==`chat`)return;let n=t.payload;if(!(!n||n.runId!==e.runId))if(QK(e.emitTalkEvent,n),n.state===`final`){let e=YK(n.message);if(e){l(e);return}d()}else n.state===`aborted`?u(new DOMException(n.errorMessage??`OpenClaw tool call aborted`,`AbortError`)):n.state===`error`&&u(Error(n.errorMessage??`OpenClaw tool call failed`))});function f(){window.clearTimeout(r),o!==void 0&&window.clearTimeout(o),e.signal?.removeEventListener(`abort`,s),c()}})}function QK(e,t){if(!e||t.stream!==`tool`)return;let n=t.data&&typeof t.data==`object`?t.data:{},r=typeof n.phase==`string`?n.phase:void 0,i=typeof n.name==`string`?n.name:void 0;e({type:`tool.progress`,callId:typeof n.toolCallId==`string`?n.toolCallId:void 0,payload:{runId:t.runId,...i?{name:i}:{},...r?{phase:r}:{}}})}async function $K(e){let t=e.text.trim();if(!t)return;let n=e.sessionId&&e.sessionId.trim()?e.ctx.client.request(`talk.session.steer`,{sessionId:e.sessionId,sessionKey:e.ctx.sessionKey,text:t,...e.mode?{mode:e.mode}:{}}):e.ctx.client.request(`talk.client.steer`,{sessionKey:e.ctx.sessionKey,text:t,...e.mode?{mode:e.mode}:{}});try{let t=await n;e.onControlResult?.(t),tq(t,e.speakControlResult,e.suppressSpeechForModes),e.emitTalkEvent?.({type:`tool.progress`,payload:{name:`openclaw_agent_control`,result:t},final:t&&typeof t==`object`&&`mode`in t?t.mode===`status`||t.mode===`cancel`:void 0})}catch(t){e.emitTalkEvent?.({type:`tool.error`,payload:{message:t instanceof Error?t.message:String(t)},final:!0})}}async function eq(e){try{let t=VK(e.args),n=e.sessionId&&e.sessionId.trim()?await e.ctx.client.request(`talk.session.steer`,{sessionId:e.sessionId,sessionKey:e.ctx.sessionKey,text:t.text,mode:t.mode}):await e.ctx.client.request(`talk.client.steer`,{sessionKey:e.ctx.sessionKey,text:t.text,mode:t.mode});e.emitTalkEvent?.({type:`tool.progress`,callId:e.callId,payload:{name:`openclaw_agent_control`,result:n},final:n&&typeof n==`object`&&`mode`in n?n.mode===`status`||n.mode===`cancel`:void 0}),e.submit(e.callId,n)}catch(t){let n=t instanceof Error?t.message:String(t);e.emitTalkEvent?.({type:`tool.error`,callId:e.callId,payload:{message:n},final:!0}),e.submit(e.callId,{error:n})}}function tq(e,t,n){if(!t||!e||typeof e!=`object`)return;let r=e,i=typeof r.mode==`string`?r.mode:void 0;if(i&&n?.includes(i))return;let a=typeof r.message==`string`?r.message.trim():``;(r.speak===!0&&r.suppress!==!0||r.ok===!0&&i===`steer`&&r.suppress===!0)&&a&&t(UK(a))}async function nq(e){let{ctx:t,callId:n,submit:r}=e;t.callbacks.onStatus?.(`thinking`);let i,a=!1,o=!1,s=e=>{o||(o=!0,r(n,e))},c=()=>{e.submitAbortResult!==!1&&s(WK())},l=()=>{a=!0,i&&t.client.request(`chat.abort`,{sessionKey:t.sessionKey,runId:i})};if(e.signal?.aborted){c();return}e.signal?.addEventListener(`abort`,l,{once:!0});try{let r=typeof e.args==`string`?JSON.parse(e.args||`{}`):e.args??{},a=await t.client.request(`talk.client.toolCall`,{sessionKey:t.sessionKey,callId:n,name:kK,args:r,...e.relaySessionId?{relaySessionId:e.relaySessionId}:{}});if(i=a.runId??a.idempotencyKey,!i)throw Error(`OpenClaw realtime tool call did not return a run id`);if(e.signal?.aborted){l(),c();return}s({result:await ZK({client:t.client,runId:i,timeoutMs:12e4,emitTalkEvent:e.emitTalkEvent,signal:e.signal})})}catch(t){if(a||e.signal?.aborted||rq(t)){c();return}s({error:t instanceof Error?t.message:String(t)})}finally{e.signal?.removeEventListener(`abort`,l),!a&&!e.signal?.aborted&&t.callbacks.onStatus?.(`listening`)}}function rq(e){return typeof DOMException<`u`&&e instanceof DOMException&&e.name===`AbortError`}var iq=.02,aq=.08,oq=2,sq=class{constructor(e,t){this.session=e,this.ctx=t,this.media=null,this.inputContext=null,this.outputContext=null,this.inputSource=null,this.inputProcessor=null,this.unsubscribe=null,this.closed=!1,this.outputQueue=new OK,this.consultAbortControllers=new Map,this.completedToolCalls=new Set,this.cancelRequestedForPlayback=!1,this.speechFramesDuringPlayback=0}async start(){if(!navigator.mediaDevices?.getUserMedia)throw Error(`Realtime Talk requires browser microphone access`);if(this.session.audio.inputEncoding!==`pcm16`||this.session.audio.outputEncoding!==`pcm16`)throw Error(`Gateway-relay realtime Talk currently requires PCM16 audio`);this.closed=!1,this.unsubscribe=this.ctx.client.addEventListener(e=>{e.event===`talk.event`&&this.handleRelayEvent(e.payload)}),this.media=await navigator.mediaDevices.getUserMedia({audio:{autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0}}),this.inputContext=new AudioContext({sampleRate:this.session.audio.inputSampleRateHz}),this.outputContext=new AudioContext({sampleRate:this.session.audio.outputSampleRateHz}),this.startMicrophonePump()}stop(){let e=this.closed;this.stopLocal(),e||this.ctx.client.request(`talk.session.close`,{sessionId:this.session.relaySessionId}).catch(()=>void 0)}stopLocal(){this.closed=!0,this.unsubscribe?.(),this.unsubscribe=null,this.inputProcessor?.disconnect(),this.inputProcessor=null,this.inputSource?.disconnect(),this.inputSource=null,this.abortConsults(),this.media?.getTracks().forEach(e=>e.stop()),this.media=null,this.stopOutput(),this.inputContext?.close(),this.inputContext=null,this.outputContext?.close(),this.outputContext=null}startMicrophonePump(){!this.media||!this.inputContext||(this.inputSource=this.inputContext.createMediaStreamSource(this.media),this.inputProcessor=this.inputContext.createScriptProcessor(4096,1,1),this.inputProcessor.onaudioprocess=e=>{if(this.closed)return;let t=e.inputBuffer.getChannelData(0),n=EK(t);this.detectBargeInSpeech(t)&&this.cancelOutputForBargeIn(),this.ctx.client.request(`talk.session.appendAudio`,{sessionId:this.session.relaySessionId,audioBase64:wK(n),timestamp:Math.round((this.inputContext?.currentTime??0)*1e3)}).catch(e=>{this.closed||(this.ctx.callbacks.onStatus?.(`error`,e instanceof Error?e.message:String(e)),this.stop())})},this.inputSource.connect(this.inputProcessor),this.inputProcessor.connect(this.inputContext.destination))}handleRelayEvent(e){if(!(e.relaySessionId!==this.session.relaySessionId||this.closed))switch(e.talkEvent&&this.ctx.callbacks.onTalkEvent?.(e.talkEvent),e.type){case`ready`:this.ctx.callbacks.onStatus?.(`listening`);return;case`audio`:e.audioBase64&&(this.cancelRequestedForPlayback=!1,this.speechFramesDuringPlayback=0,this.playPcm16(e.audioBase64));return;case`clear`:this.stopOutput();return;case`mark`:this.scheduleMarkAck();return;case`transcript`:e.role&&e.text&&this.ctx.callbacks.onTranscript?.({role:e.role,text:e.text,final:e.final??!1});return;case`toolCall`:this.handleToolCall(e);return;case`toolResult`:this.isFinalToolResult(e)&&this.completeToolCall(e.callId);return;case`error`:this.lastRelayError=e.message??`Realtime relay failed`,this.ctx.callbacks.onStatus?.(`error`,this.lastRelayError);return;case`close`:this.abortConsults(),this.closed||(this.ctx.callbacks.onStatus?.(e.reason===`error`?`error`:`idle`,e.reason===`error`?this.lastRelayError??`Realtime relay closed`:void 0),this.stopLocal());default:}}playPcm16(e){this.outputQueue.play(e,this.outputContext,this.session.audio.outputSampleRateHz)}stopOutput(){this.outputQueue.stop(this.outputContext),this.speechFramesDuringPlayback=0}scheduleMarkAck(){let e=Math.max(0,Math.ceil(((this.outputQueue.queuedUntil||this.outputContext?.currentTime||0)-(this.outputContext?.currentTime??0))*1e3));window.setTimeout(()=>{},e)}async handleToolCall(e){let t=e.callId?.trim(),n=e.name?.trim();if(!t||!n)return;if(n===`openclaw_agent_control`){await eq({ctx:this.ctx,callId:t,args:e.args??{},sessionId:this.session.relaySessionId,submit:(e,t)=>this.submitToolResult(e,t)});return}if(n!==`openclaw_agent_consult`){this.submitToolResult(t,{error:`Tool "${n}" not available in browser Talk`});return}let r=new AbortController;this.consultAbortControllers.set(t,r);try{e.forced&&this.submitToolResult(t,{status:`working`,tool:kK,message:`Tell the person briefly that you are checking, then wait for the final OpenClaw result before answering with the actual result.`},{willContinue:!0}),await nq({ctx:this.ctx,callId:t,args:e.args??{},relaySessionId:this.session.relaySessionId,signal:r.signal,submit:(e,t)=>this.submitToolResult(e,t)})}finally{this.consultAbortControllers.delete(t)}}submitToolResult(e,t,n){this.completedToolCalls.has(e)||this.ctx.client.request(`talk.session.submitToolResult`,{sessionId:this.session.relaySessionId,callId:e,result:t,...n?{options:n}:{}})}completeToolCall(e){let t=e?.trim();t&&(this.completedToolCalls.add(t),this.consultAbortControllers.get(t)?.abort(),this.consultAbortControllers.delete(t))}isFinalToolResult(e){let t=e.talkEvent;return!(t?.type===`tool.progress`||t?.type===`tool.result`&&t.final===!1)}cancelOutputForBargeIn(){!this.outputQueue.isPlaying||this.cancelRequestedForPlayback||(this.cancelRequestedForPlayback=!0,this.stopOutput(),this.ctx.client.request(`talk.session.cancelOutput`,{sessionId:this.session.relaySessionId,reason:`barge-in`}))}abortConsults(){for(let e of this.consultAbortControllers.values())e.abort();this.consultAbortControllers.clear()}detectBargeInSpeech(e){if(!this.outputQueue.isPlaying||this.cancelRequestedForPlayback||e.length===0)return this.speechFramesDuringPlayback=0,!1;let t=0,n=0;for(let r of e)n=Math.max(n,Math.abs(r)),t+=r*r;return Math.sqrt(t/e.length)>=iq&&n>=aq?this.speechFramesDuringPlayback+=1:this.speechFramesDuringPlayback=0,this.speechFramesDuringPlayback>=oq}},cq=`generativelanguage.googleapis.com`,lq=/^\/ws\/google\.ai\.generativelanguage\.v[0-9a-z]+\.GenerativeService\.BidiGenerateContent(?:Constrained)?$/;function uq(e){let t;try{t=new URL(e.websocketUrl)}catch{throw Error(`Invalid Google Live WebSocket URL`)}if(t.protocol!==`wss:`)throw Error(`Google Live WebSocket URL must use wss://`);if(t.hostname.toLowerCase()!==cq)throw Error(`Untrusted Google Live WebSocket host`);if(t.username||t.password)throw Error(`Google Live WebSocket URL must not include credentials`);if(!lq.test(t.pathname))throw Error(`Untrusted Google Live WebSocket path`);return t.search=``,t.searchParams.set(`access_token`,e.clientSecret),t.toString()}var dq=class{constructor(e,t){this.session=e,this.ctx=t,this.ws=null,this.media=null,this.inputContext=null,this.outputContext=null,this.inputSource=null,this.inputProcessor=null,this.closed=!1,this.pendingCalls=new Map,this.consultAbortControllers=new Set,this.outputQueue=new OK,this.emitTalkEvent=GK(t,e)}async start(){if(!navigator.mediaDevices?.getUserMedia||typeof WebSocket>`u`)throw Error(`Realtime Talk requires browser WebSocket and microphone access`);if(this.session.protocol!==`google-live-bidi`)throw Error(`Unsupported realtime WebSocket protocol: ${this.session.protocol}`);let e=uq(this.session);this.closed=!1,this.media=await navigator.mediaDevices.getUserMedia({audio:!0}),this.inputContext=new AudioContext({sampleRate:this.session.audio.inputSampleRateHz}),this.outputContext=new AudioContext({sampleRate:this.session.audio.outputSampleRateHz}),this.ws=new WebSocket(e),this.ws.binaryType=`arraybuffer`,this.ws.addEventListener(`open`,()=>{this.closed||(this.send(this.session.initialMessage??{setup:{}}),this.startMicrophonePump())}),this.ws.addEventListener(`message`,e=>{this.handleMessage(e.data)}),this.ws.addEventListener(`close`,()=>{this.closed||this.ctx.callbacks.onStatus?.(`error`,`Realtime connection closed`)}),this.ws.addEventListener(`error`,()=>{this.closed||this.ctx.callbacks.onStatus?.(`error`,`Realtime connection failed`)})}stop(){this.closed||this.emitTalkEvent({type:`session.closed`,final:!0}),this.closed=!0;for(let e of this.consultAbortControllers)e.abort();this.consultAbortControllers.clear(),this.pendingCalls.clear(),this.inputProcessor?.disconnect(),this.inputProcessor=null,this.inputSource?.disconnect(),this.inputSource=null,this.media?.getTracks().forEach(e=>e.stop()),this.media=null,this.stopOutput(),this.inputContext?.close(),this.inputContext=null,this.outputContext?.close(),this.outputContext=null,this.ws?.close(),this.ws=null}startMicrophonePump(){this.closed||!this.media||!this.inputContext||(this.inputSource=this.inputContext.createMediaStreamSource(this.media),this.inputProcessor=this.inputContext.createScriptProcessor(4096,1,1),this.inputProcessor.onaudioprocess=e=>{if(this.ws?.readyState!==WebSocket.OPEN)return;let t=EK(e.inputBuffer.getChannelData(0));this.send({realtimeInput:{audio:{data:wK(t),mimeType:`audio/pcm;rate=${this.inputContext?.sampleRate??16e3}`}}})},this.inputSource.connect(this.inputProcessor),this.inputProcessor.connect(this.inputContext.destination))}send(e){!this.closed&&this.ws?.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify(e))}async handleMessage(e){if(this.closed)return;let t;try{t=JSON.parse(await fq(e))}catch{return}if(this.closed)return;t.setupComplete&&(this.ctx.callbacks.onStatus?.(`listening`),this.emitTalkEvent({type:`session.ready`}));let n=t.serverContent;n?.interrupted&&(this.stopOutput(),this.emitTalkEvent({type:`turn.cancelled`,final:!0,payload:{reason:`provider-interrupted`}})),n?.inputTranscription?.text&&(this.ctx.callbacks.onTranscript?.({role:`user`,text:n.inputTranscription.text,final:n.inputTranscription.finished??!1}),this.emitTalkEvent({type:n.inputTranscription.finished?`transcript.done`:`transcript.delta`,final:n.inputTranscription.finished??!1,payload:{role:`user`,text:n.inputTranscription.text}}),n.inputTranscription.finished&&this.consultAbortControllers.size>0&&BK(n.inputTranscription.text)&&$K({ctx:this.ctx,text:n.inputTranscription.text,emitTalkEvent:this.emitTalkEvent,onControlResult:e=>this.stopOutputForSuppressedControl(e),speakControlResult:e=>this.sendControlSpeechMessage(e),suppressSpeechForModes:[`cancel`]})),n?.outputTranscription?.text&&(this.ctx.callbacks.onTranscript?.({role:`assistant`,text:n.outputTranscription.text,final:n.outputTranscription.finished??!1}),this.emitTalkEvent({type:n.outputTranscription.finished?`output.text.done`:`output.text.delta`,final:n.outputTranscription.finished??!1,payload:{text:n.outputTranscription.text}}));for(let e of n?.modelTurn?.parts??[])e.inlineData?.data?(this.emitTalkEvent({type:`output.audio.delta`,payload:{byteLength:TK(e.inlineData.data).byteLength,mimeType:e.inlineData.mimeType}}),this.playPcm16(e.inlineData.data)):!e.thought&&typeof e.text==`string`&&e.text.trim()&&(this.ctx.callbacks.onTranscript?.({role:`assistant`,text:e.text,final:n?.turnComplete??!1}),this.emitTalkEvent({type:n?.turnComplete?`output.text.done`:`output.text.delta`,final:n?.turnComplete??!1,payload:{text:e.text}}));n?.turnComplete&&this.emitTalkEvent({type:`turn.ended`,final:!0});for(let e of t.toolCall?.functionCalls??[])this.handleToolCall(e)}playPcm16(e){this.outputQueue.play(e,this.outputContext,this.session.audio.outputSampleRateHz)}stopOutput(){this.outputQueue.stop(this.outputContext)}async handleToolCall(e){let t=e.name?.trim(),n=e.id?.trim();if(!t||!n)return;if(this.pendingCalls.set(n,{name:t,args:e.args??{}}),this.emitTalkEvent({type:`tool.call`,callId:n,payload:{name:t,args:e.args??{}}}),t===`openclaw_agent_control`){await eq({ctx:this.createActiveContext(),callId:n,args:e.args??{},emitTalkEvent:this.emitTalkEvent,submit:(e,t)=>this.submitToolResult(e,t)});return}if(t!==`openclaw_agent_consult`)return;let r=new AbortController;this.consultAbortControllers.add(r);try{await nq({ctx:this.createActiveContext(),callId:n,args:e.args??{},signal:r.signal,emitTalkEvent:this.emitTalkEvent,submit:(e,t)=>this.submitToolResult(e,t)})}finally{this.consultAbortControllers.delete(r)}}createActiveContext(){return{...this.ctx,callbacks:{onStatus:(e,t)=>{this.closed||this.ctx.callbacks.onStatus?.(e,t)},onTranscript:e=>{this.closed||this.ctx.callbacks.onTranscript?.(e)},onTalkEvent:e=>{this.closed||this.ctx.callbacks.onTalkEvent?.(e)}}}}submitToolResult(e,t){let n=this.pendingCalls.get(e);n&&(this.pendingCalls.delete(e),this.send({toolResponse:{functionResponses:[{id:e,name:n.name,scheduling:`WHEN_IDLE`,response:t&&typeof t==`object`&&!Array.isArray(t)?t:{output:t}}]}}))}sendControlSpeechMessage(e){this.stopOutput(),this.send({clientContent:{turns:[{role:`user`,parts:[{text:e}]}],turnComplete:!0}})}stopOutputForSuppressedControl(e){if(!e||typeof e!=`object`)return;let t=e;t.ok===!0&&(t.mode===`cancel`||t.suppress===!0&&t.mode!==`steer`)&&this.stopOutput()}};async function fq(e){let t=e;return typeof t==`string`?t:(typeof Blob<`u`&&t instanceof Blob&&(t=await t.arrayBuffer()),pq(t)?new TextDecoder().decode(new Uint8Array(t)):ArrayBuffer.isView(t)?new TextDecoder().decode(new Uint8Array(t.buffer,t.byteOffset,t.byteLength)):String(t))}function pq(e){return e instanceof ArrayBuffer||Object.prototype.toString.call(e)===`[object ArrayBuffer]`}var mq=class{constructor(e,t){this.session=e,this.ctx=t,this.peer=null,this.channel=null,this.media=null,this.audio=null,this.closed=!1,this.responseActive=!1,this.responseCreateInFlight=!1,this.responseCreatePending=!1,this.toolBuffers=new Map,this.consultAbortControllers=new Set,this.emitTalkEvent=GK(t,e)}async start(){if(!navigator.mediaDevices?.getUserMedia||typeof RTCPeerConnection>`u`)throw Error(`Realtime Talk requires browser WebRTC and microphone access`);this.closed=!1,this.peer=new RTCPeerConnection,this.audio=document.createElement(`audio`),this.audio.autoplay=!0,this.audio.style.display=`none`,document.body.append(this.audio),this.peer.addEventListener(`track`,e=>{this.audio&&(this.audio.srcObject=e.streams[0])}),this.media=await navigator.mediaDevices.getUserMedia({audio:!0});for(let e of this.media.getAudioTracks())this.peer.addTrack(e,this.media);this.channel=this.peer.createDataChannel(`oai-events`),this.channel.addEventListener(`open`,()=>{this.ctx.callbacks.onStatus?.(`listening`),this.emitTalkEvent({type:`session.ready`})}),this.channel.addEventListener(`message`,e=>this.handleRealtimeEvent(e.data)),this.peer.addEventListener(`connectionstatechange`,()=>{this.closed||(this.peer?.connectionState===`failed`||this.peer?.connectionState===`closed`)&&this.ctx.callbacks.onStatus?.(`error`,`Realtime connection closed`)});let e=await this.peer.createOffer();await this.peer.setLocalDescription(e);let t=await fetch(this.session.offerUrl??`https://api.openai.com/v1/realtime/calls`,{method:`POST`,body:e.sdp,headers:{...this.session.offerHeaders,Authorization:`Bearer ${this.session.clientSecret}`,"Content-Type":`application/sdp`}});if(!t.ok)throw Error(`Realtime WebRTC setup failed (${t.status})`);await this.peer.setRemoteDescription({type:`answer`,sdp:await t.text()})}stop(){this.closed||this.emitTalkEvent({type:`session.closed`,final:!0}),this.closed=!0,this.channel?.close(),this.channel=null,this.peer?.close(),this.peer=null,this.media?.getTracks().forEach(e=>e.stop()),this.media=null,this.audio?.remove(),this.audio=null;for(let e of this.consultAbortControllers)e.abort();this.consultAbortControllers.clear(),this.toolBuffers.clear(),this.responseActive=!1,this.responseCreateInFlight=!1,this.responseCreatePending=!1}send(e){this.channel?.readyState===`open`&&this.channel.send(JSON.stringify(e))}handleRealtimeEvent(e){if(this.closed)return;let t;try{t=JSON.parse(String(e))}catch{return}switch(t.type){case`conversation.item.input_audio_transcription.completed`:t.transcript&&(this.ctx.callbacks.onTranscript?.({role:`user`,text:t.transcript,final:!0}),this.emitTalkEvent({type:`transcript.done`,final:!0,itemId:t.item_id,payload:{role:`user`,text:t.transcript}}),this.consultAbortControllers.size>0&&BK(t.transcript)&&$K({ctx:this.ctx,text:t.transcript,emitTalkEvent:this.emitTalkEvent,onControlResult:e=>this.interruptSuppressedControlResponse(e),speakControlResult:e=>this.sendControlSpeechMessage(e),suppressSpeechForModes:[`cancel`]}));return;case`response.audio_transcript.done`:t.transcript&&(this.ctx.callbacks.onTranscript?.({role:`assistant`,text:t.transcript,final:!0}),this.emitTalkEvent({type:`output.text.done`,final:!0,itemId:t.item_id,payload:{text:t.transcript}}));return;case`response.function_call_arguments.delta`:this.bufferToolDelta(t);return;case`response.function_call_arguments.done`:this.handleToolCall(t);return;case`input_audio_buffer.speech_started`:this.ctx.callbacks.onStatus?.(`listening`,`Speech detected`),this.emitTalkEvent({type:`turn.started`,payload:{source:t.type}});return;case`input_audio_buffer.speech_stopped`:this.ctx.callbacks.onStatus?.(`thinking`,`Processing speech`),this.emitTalkEvent({type:`input.audio.committed`,final:!0});return;case`response.created`:this.responseActive=!0,this.responseCreateInFlight=!1,this.ctx.callbacks.onStatus?.(`thinking`,`Generating response`);return;case`response.cancelled`:case`response.done`:this.responseActive=!1,this.responseCreateInFlight=!1,this.ctx.callbacks.onStatus?.(`listening`,this.extractResponseStatus(t)),this.emitTalkEvent({type:`turn.ended`,final:!0,payload:{status:t.response?.status??(t.type===`response.cancelled`?`cancelled`:`completed`)}}),this.flushPendingResponseCreate();return;case`error`:this.responseCreateInFlight=!1,this.ctx.callbacks.onStatus?.(`error`,this.extractErrorDetail(t.error)),this.emitTalkEvent({type:`session.error`,final:!0,payload:{message:this.extractErrorDetail(t.error)}});default:}}extractResponseStatus(e){let t=e.response?.status;return t&&t!==`completed`?`Response ${t}`:void 0}extractErrorDetail(e){if(!e||typeof e!=`object`)return`Realtime provider error`;let t=e,n=typeof t.message==`string`?t.message.trim():``,r=typeof t.code==`string`?t.code.trim():``,i=typeof t.type==`string`?t.type.trim():``;return n||r||i||`Realtime provider error`}bufferToolDelta(e){let t=e.item_id??`unknown`,n=this.toolBuffers.get(t);if(n){n.args+=e.delta??``;return}this.toolBuffers.set(t,{name:e.name??``,callId:e.call_id??``,args:e.delta??``})}async handleToolCall(e){let t=e.item_id??`unknown`,n=this.toolBuffers.get(t);this.toolBuffers.delete(t);let r=n?.name||e.name||``,i=n?.callId||e.call_id||``;if(!i)return;if(r===`openclaw_agent_control`){await eq({ctx:this.ctx,callId:i,args:n?.args||e.arguments||`{}`,emitTalkEvent:this.emitTalkEvent,submit:(e,t)=>this.submitToolResult(e,t)});return}if(r!==`openclaw_agent_consult`)return;this.emitTalkEvent({type:`tool.call`,callId:i,itemId:t,payload:{name:r,args:n?.args||e.arguments||`{}`}});let a=new AbortController;this.consultAbortControllers.add(a);try{await nq({ctx:this.ctx,callId:i,args:n?.args||e.arguments||`{}`,signal:a.signal,emitTalkEvent:this.emitTalkEvent,submit:(e,t)=>this.submitToolResult(e,t)})}finally{this.consultAbortControllers.delete(a)}}submitToolResult(e,t){this.send({type:`conversation.item.create`,item:{type:`function_call_output`,call_id:e,output:JSON.stringify(t)}}),this.requestResponseCreate()}sendControlSpeechMessage(e){this.responseActive&&this.send({type:`response.cancel`}),this.send({type:`conversation.item.create`,item:{type:`message`,role:`user`,content:[{type:`input_text`,text:e}]}}),this.requestResponseCreate()}interruptSuppressedControlResponse(e){if(!this.responseActive||!e||typeof e!=`object`)return;let t=e;t.ok===!0&&(t.mode===`cancel`||t.suppress===!0&&t.mode!==`steer`)&&this.send({type:`response.cancel`})}requestResponseCreate(){if(this.responseActive||this.responseCreateInFlight){this.responseCreatePending=!0;return}this.responseCreatePending=!1,this.responseCreateInFlight=!0,this.send({type:`response.create`})}flushPendingResponseCreate(){this.responseCreatePending&&(this.responseCreatePending=!1,this.requestResponseCreate())}};function hq(e,t){let n=gq(e);if(n===`webrtc`)return new mq(e,t);if(n===`provider-websocket`)return new dq(e,t);if(n===`gateway-relay`)return new sq(e,t);if(n===`managed-room`)throw Error(`Managed-room realtime Talk sessions are not available in this UI yet`);let r=e.transport??`unknown`;throw Error(`Unsupported realtime Talk transport: ${r}`)}function gq(e){return CK(e.transport)??`webrtc`}function _q(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0))}var vq=class{constructor(e,t,n={},r={}){this.client=e,this.sessionKey=t,this.callbacks=n,this.options=r,this.transport=null,this.closed=!1}async start(){this.closed=!1,this.callbacks.onStatus?.(`connecting`);let e=await this.createSession();this.closed||(this.transport=hq(e,{client:this.client,sessionKey:this.sessionKey,callbacks:this.callbacks,consultThinkingLevel:e.consultThinkingLevel,consultFastMode:e.consultFastMode}),await this.transport.start())}async createSession(){try{return await this.client.request(`talk.client.create`,_q({sessionKey:this.sessionKey,...this.options}))}catch(e){if(this.options.transport&&this.options.transport!==`gateway-relay`)throw e;try{return await this.client.request(`talk.session.create`,_q({sessionKey:this.sessionKey,...this.options,mode:`realtime`,transport:this.options.transport??`gateway-relay`,brain:`agent-consult`}))}catch{throw e}}}stop(){this.closed=!0,this.callbacks.onStatus?.(`idle`),this.transport?.stop(),this.transport=null}},yq=Ca({}),bq=cs(),xq=5e5;function Sq(e){return!!(e&&(e.kind===`markdown`||e.kind===`canvas`))}function Cq(e){switch(e){case`oversized`:return`Full content is unavailable because the stored transcript entry is too large to return safely.`;case`not_visible`:return`Full content is unavailable because this transcript entry does not have a visible WebChat projection.`;default:return`Full content is no longer available for this transcript entry.`}}function wq(){if(!window.location.search)return!1;let e=new URLSearchParams(window.location.search).get(`onboarding`);if(!e)return!1;let t=e.trim().toLowerCase();return t===`1`||t===`true`||t===`yes`||t===`on`}var $=class extends i{constructor(){super(),this.i18nController=new y(this),this.clientInstanceId=Mt(),this.connectGeneration=0,this.settings=os(),this.password=``,this.loginShowGatewayToken=!1,this.loginShowGatewayPassword=!1,this.tab=`chat`,this.onboarding=wq(),this.connected=!1,this.theme=this.settings.theme??`claw`,this.themeMode=this.settings.themeMode??`system`,this.themeResolved=`dark`,this.themeOrder=this.buildThemeOrder(this.theme),this.customThemeImportUrl=``,this.customThemeImportBusy=!1,this.customThemeImportMessage=null,this.customThemeImportExpanded=!1,this.customThemeImportFocusToken=0,this.customThemeImportSelectOnSuccess=!1,this.hello=null,this.lastError=null,this.lastErrorCode=null,this.chatError=null,this.eventLog=[],this.eventLogBuffer=[],this.toolStreamSyncTimer=null,this.sidebarCloseTimer=null,this.assistantName=yq.name,this.assistantAvatar=yq.avatar,this.assistantAvatarSource=yq.avatarSource??null,this.assistantAvatarStatus=yq.avatarStatus??null,this.assistantAvatarReason=yq.avatarReason??null,this.assistantAvatarUploadBusy=!1,this.assistantAvatarUploadError=null,this.assistantAgentId=yq.agentId??null,this.userName=bq.name,this.userAvatar=bq.avatar,this.localMediaPreviewRoots=[],this.embedSandboxMode=`strict`,this.allowExternalEmbedUrls=!1,this.chatMessageMaxWidth=null,this.serverVersion=null,this.sessionKey=this.settings.sessionKey,this.chatSessionMessageSubscriptionKey=null,this.chatSessionMessageSubscriptionRequestedKey=null,this.currentSessionId=null,this.chatLoading=!1,this.chatSending=!1,this.chatMessage=``,this.chatMessages=[],this.chatToolMessages=[],this.activityEntries=[],this.activityFilterText=``,this.activityStatusFilters={running:!0,done:!0,error:!0},this.activityToolFilter=``,this.activityExpandedIds=new Set,this.activityAutoFollow=!0,this.activityAtBottom=!0,this.chatStreamSegments=[],this.chatStream=null,this.chatStreamStartedAt=null,this.chatRunId=null,this.chatSideResult=null,this.compactionStatus=null,this.fallbackStatus=null,this.chatRunStatus=null,this.chatRunStatusClearTimer=null,this.chatAvatarUrl=null,this.chatAvatarSource=null,this.chatAvatarStatus=null,this.chatAvatarReason=null,this.chatThinkingLevel=null,this.chatModelOverrides={},this.chatModelSwitchPromises={},this.chatModelsLoading=!1,this.chatModelCatalog=[],this.sessionSwitchNotice=null,this.sessionSwitchFlashKey=null,this.chatSessionPickerOpen=!1,this.chatSessionPickerSurface=null,this.chatSessionPickerQuery=``,this.chatSessionPickerAppliedQuery=``,this.chatSessionPickerLoading=!1,this.chatSessionPickerError=null,this.chatSessionPickerResult=null,this.sessionSwitchNoticeSeq=0,this.sessionSwitchNoticeTimer=null,this.sessionSwitchFlashTimer=null,this.chatComposerPersistTimer=null,this.chatComposerPersistSnapshot=null,this.chatQueue=[],this.chatQueueBySession={},this.chatAttachments=[],this.realtimeTalkActive=!1,this.realtimeTalkStatus=`idle`,this.realtimeTalkDetail=null,this.realtimeTalkTranscript=null,this.realtimeTalkConversation=[],this.realtimeTalkOptionsOpen=!1,this.realtimeTalkOptions={provider:``,model:``,voice:``,transport:``,vadThreshold:``,silenceDurationMs:``,prefixPaddingMs:``,reasoningEffort:``},this.realtimeTalkSession=null,this.realtimeTalkConversationState=uK(),this.nativeBridgeCleanup=null,this.chatManualRefreshInFlight=!1,this.chatHeaderControlsHidden=!1,this.chatMobileControlsOpen=!1,this.chatMobileControlsTrigger=null,this.navDrawerOpen=!1,this.chatLocalInputHistoryBySession={},this.chatInputHistorySessionKey=null,this.chatInputHistoryItems=null,this.chatInputHistoryIndex=-1,this.chatDraftBeforeHistory=null,this.sidebarOpen=!1,this.sidebarContent=null,this.sidebarError=null,this.splitRatio=this.settings.splitRatio,this.nodesLoading=!1,this.nodes=[],this.devicesLoading=!1,this.devicesError=null,this.devicesList=null,this.execApprovalsLoading=!1,this.execApprovalsSaving=!1,this.execApprovalsDirty=!1,this.execApprovalsSnapshot=null,this.execApprovalsForm=null,this.execApprovalsSelectedAgent=null,this.execApprovalsTarget=`gateway`,this.execApprovalsTargetNodeId=null,this.execApprovalQueue=[],this.execApprovalBusy=!1,this.execApprovalError=null,this.pendingGatewayUrl=null,this.pendingGatewayToken=null,this.configLoading=!1,this.configRaw=`{
|
|
6342
6342
|
}
|
|
6343
6343
|
`,this.configRawOriginal=``,this.configValid=null,this.configIssues=[],this.configSaving=!1,this.configApplying=!1,this.updateRunning=!1,this.applySessionKey=this.settings.lastActiveSessionKey,this.configSnapshot=null,this.configSchema=null,this.configSchemaVersion=null,this.configSchemaLoading=!1,this.configUiHints={},this.configForm=null,this.configFormOriginal=null,this.selectedAgentId=null,this.dreamingStatusLoading=!1,this.dreamingStatusError=null,this.dreamingStatus=null,this.dreamingModeSaving=!1,this.dreamingRestartConfirmOpen=!1,this.dreamingRestartConfirmLoading=!1,this.dreamingPendingEnabled=null,this.dreamDiaryLoading=!1,this.dreamDiaryActionLoading=!1,this.dreamDiaryActionMessage=null,this.dreamDiaryActionArchivePath=null,this.dreamDiaryError=null,this.dreamDiaryPath=null,this.dreamDiaryContent=null,this.wikiImportInsightsLoading=!1,this.wikiImportInsightsError=null,this.wikiImportInsights=null,this.wikiMemoryPalaceLoading=!1,this.wikiMemoryPalaceError=null,this.wikiMemoryPalace=null,this.configFormDirty=!1,this.configSettingsMode=`quick`,this.configFormMode=`form`,this.configSearchQuery=``,this.configActiveSection=null,this.configActiveSubsection=null,this.pendingUpdateExpectedVersion=null,this.updateStatusBanner=null,this.communicationsFormMode=`form`,this.communicationsSearchQuery=``,this.communicationsActiveSection=null,this.communicationsActiveSubsection=null,this.appearanceFormMode=`form`,this.appearanceSearchQuery=``,this.appearanceActiveSection=null,this.appearanceActiveSubsection=null,this.automationFormMode=`form`,this.automationSearchQuery=``,this.automationActiveSection=null,this.automationActiveSubsection=null,this.infrastructureFormMode=`form`,this.infrastructureSearchQuery=``,this.infrastructureActiveSection=null,this.infrastructureActiveSubsection=null,this.aiAgentsFormMode=`form`,this.aiAgentsSearchQuery=``,this.aiAgentsActiveSection=null,this.aiAgentsActiveSubsection=null,this.channelsLoading=!1,this.channelsSnapshot=null,this.channelsError=null,this.channelsLastSuccess=null,this.whatsappLoginMessage=null,this.whatsappLoginQrDataUrl=null,this.whatsappLoginConnected=null,this.whatsappBusy=!1,this.nostrProfileFormState=null,this.nostrProfileAccountId=null,this.presenceLoading=!1,this.presenceEntries=[],this.presenceError=null,this.presenceStatus=null,this.agentsLoading=!1,this.agentsList=null,this.agentsError=null,this.agentsSelectedId=null,this.toolsCatalogLoading=!1,this.toolsCatalogError=null,this.toolsCatalogResult=null,this.toolsEffectiveLoading=!1,this.toolsEffectiveLoadingKey=null,this.toolsEffectiveResultKey=null,this.toolsEffectiveError=null,this.toolsEffectiveResult=null,this.agentsPanel=`files`,this.agentFilesLoading=!1,this.agentFilesError=null,this.agentFilesList=null,this.agentFileContents={},this.agentFileDrafts={},this.agentFileActive=null,this.agentFileSaving=!1,this.agentIdentityLoading=!1,this.agentIdentityError=null,this.agentIdentityById={},this.agentSkillsLoading=!1,this.agentSkillsError=null,this.agentSkillsReport=null,this.agentSkillsAgentId=null,this.sessionsLoading=!1,this.sessionsResult=null,this.sessionsError=null,this.sessionsFilterActive=Jy.activeMinutes,this.sessionsFilterLimit=Jy.limit,this.sessionsIncludeGlobal=!0,this.sessionsIncludeUnknown=!1,this.sessionsShowArchived=!1,this.sessionsFiltersCollapsed=!1,this.sessionsHideCron=!0,this.sessionsSearchQuery=``,this.sessionsSortColumn=`updated`,this.sessionsSortDir=`desc`,this.sessionsPage=0,this.sessionsPageSize=25,this.sessionsSelectedKeys=new Set,this.sessionsExpandedCheckpointKey=null,this.sessionsCheckpointItemsByKey={},this.sessionsCheckpointLoadingKey=null,this.sessionsCheckpointBusyKey=null,this.sessionsCheckpointErrorByKey={},this.usageLoading=!1,this.usageResult=null,this.usageCostSummary=null,this.usageError=null,this.usageStartDate=(()=>{let e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`})(),this.usageEndDate=(()=>{let e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`})(),this.usageScope=`family`,this.usageAgentId=null,this.usageSelectedSessions=[],this.usageSelectedDays=[],this.usageSelectedHours=[],this.usageChartMode=`tokens`,this.usageDailyChartMode=`by-type`,this.usageTimeSeriesMode=`per-turn`,this.usageTimeSeriesBreakdownMode=`by-type`,this.usageTimeSeries=null,this.usageTimeSeriesLoading=!1,this.usageTimeSeriesCursorStart=null,this.usageTimeSeriesCursorEnd=null,this.usageSessionLogs=null,this.usageSessionLogsLoading=!1,this.usageSessionLogsExpanded=!1,this.usageQuery=``,this.usageQueryDraft=``,this.usageSessionSort=`recent`,this.usageSessionSortDir=`desc`,this.usageRecentSessions=[],this.usageTimeZone=`local`,this.usageContextExpanded=!1,this.usageHeaderPinned=!1,this.usageSessionsTab=`all`,this.usageVisibleColumns=[`channel`,`agent`,`provider`,`model`,`messages`,`tools`,`errors`,`duration`],this.usageLogFilterRoles=[],this.usageLogFilterTools=[],this.usageLogFilterHasTools=!1,this.usageLogFilterQuery=``,this.usageQueryDebounceTimer=null,this.cronLoading=!1,this.cronQuickCreateOpen=!1,this.cronQuickCreateStep=`what`,this.cronQuickCreateDraft=null,this.cronJobsLoadingMore=!1,this.cronJobsReloadPending=!1,this.cronJobsReloadPendingTableFilters=!1,this.cronJobs=[],this.cronJobsTotal=0,this.cronJobsHasMore=!1,this.cronJobsNextOffset=null,this.cronJobsLimit=50,this.cronJobsQuery=``,this.cronJobsEnabledFilter=`all`,this.cronJobsScheduleKindFilter=`all`,this.cronJobsLastStatusFilter=`all`,this.cronJobsSortBy=`nextRunAtMs`,this.cronJobsSortDir=`asc`,this.cronStatus=null,this.cronError=null,this.cronForm={...Yy},this.cronFormCollapsed=!0,this.cronFieldErrors={},this.cronEditingJobId=null,this.cronRunsJobId=null,this.cronRunsLoadingMore=!1,this.cronRuns=[],this.cronRunsTotal=0,this.cronRunsHasMore=!1,this.cronRunsNextOffset=null,this.cronRunsLimit=50,this.cronRunsScope=`all`,this.cronRunsStatuses=[],this.cronRunsDeliveryStatuses=[],this.cronRunsStatusFilter=`all`,this.cronRunsQuery=``,this.cronRunsSortDir=`desc`,this.cronModelSuggestions=[],this.cronBusy=!1,this.updateAvailable=null,this.attentionItems=[],this.paletteOpen=!1,this.paletteQuery=``,this.paletteActiveIndex=0,this.overviewShowGatewayToken=!1,this.overviewShowGatewayPassword=!1,this.overviewLogLines=[],this.overviewLogCursor=0,this.skillsLoading=!1,this.skillsReport=null,this.skillsError=null,this.skillsFilter=``,this.skillsStatusFilter=`all`,this.skillEdits={},this.skillsBusyKey=null,this.skillMessages={},this.skillsDetailKey=null,this.skillsDetailTab=`overview`,this.clawhubSearchQuery=``,this.clawhubSearchResults=null,this.clawhubSearchLoading=!1,this.clawhubSearchError=null,this.clawhubDetail=null,this.clawhubDetailSlug=null,this.clawhubDetailLoading=!1,this.clawhubDetailError=null,this.clawhubInstallSlug=null,this.clawhubInstallMessage=null,this.clawhubVerdicts={},this.clawhubVerdictsLoading=!1,this.clawhubVerdictsError=null,this.skillCardContents={},this.skillCardContentKeys={},this.skillCardLoadingKey=null,this.skillCardErrors={},this.skillWorkshopLoading=!1,this.skillWorkshopLoaded=!1,this.skillWorkshopError=null,this.skillWorkshopInspectingKey=null,this.skillWorkshopProposals=[],this.skillWorkshopSelectedKey=null,this.skillWorkshopActionBusy=null,this.skillWorkshopActionNotice=null,this.skillWorkshopActionNoticeTimer=null,this.skillWorkshopRevisionKey=null,this.skillWorkshopRevisionDraft=``,this.skillWorkshopStatusFilter=`pending`,this.skillWorkshopQuery=``,this.skillWorkshopFilePreviewKey=null,this.skillWorkshopFilePreviewQuery=``,this.skillWorkshopQueueWidth=360,this.skillWorkshopMode=eG(),this.healthLoading=!1,this.healthResult=null,this.healthError=null,this.modelAuthStatusLoading=!1,this.modelAuthStatusResult=null,this.modelAuthStatusError=null,this.debugLoading=!1,this.debugStatus=null,this.debugHealth=null,this.debugModels=[],this.debugHeartbeat=null,this.debugCallMethod=``,this.debugCallParams=`{}`,this.debugCallResult=null,this.debugCallError=null,this.webPushSupported=!1,this.webPushPermission=`unsupported`,this.webPushSubscribed=!1,this.webPushLoading=!1,this.logsLoading=!1,this.logsError=null,this.logsFile=null,this.logsEntries=[],this.logsFilterText=``,this.logsLevelFilters={...qy},this.logsAutoFollow=!0,this.logsTruncated=!1,this.logsCursor=null,this.logsLastFetchAt=null,this.logsLimit=500,this.logsMaxBytes=25e4,this.logsAtBottom=!0,this.client=null,this.chatScrollFrame=null,this.chatScrollTimeout=null,this.chatLastScrollTop=0,this.chatHasAutoScrolled=!1,this.chatUserNearBottom=!0,this.chatIsProgrammaticScroll=!1,this.chatProgrammaticScrollTarget=0,this.chatNewMessagesBelow=!1,this.nodesPollInterval=null,this.logsPollInterval=null,this.debugPollInterval=null,this.sessionsChangedReloadTimer=null,this.logsScrollFrame=null,this.activityScrollFrame=null,this.controlUiResponsivenessObserver=null,this.toolStreamById=new Map,this.toolStreamOrder=[],this.refreshSessionsAfterChat=new Map,this.chatSideResultTerminalRuns=new Set,this.basePath=``,this.popStateHandler=()=>_F(this),this.topbarObserver=null,this.globalKeydownHandler=e=>{(e.metaKey||e.ctrlKey)&&!e.shiftKey&&e.key===`k`&&(e.preventDefault(),this.paletteOpen=!this.paletteOpen,this.paletteOpen&&(this.paletteQuery=``,this.paletteActiveIndex=0))},this.chatMobileControlsKeydownHandler=e=>{if(e.key!==`Escape`)return;if(this.chatSessionPickerOpen){e.preventDefault(),this.chatSessionPickerOpen=!1,this.chatSessionPickerSurface=null;return}let t=this.querySelectorAll(`.chat-controls__inline-select[open], .agent-chat__talk-select[open], .agent-chat__talk-options-advanced[open]`);if(t.length>0){e.preventDefault(),t.forEach(e=>{e.open=!1});return}if(this.realtimeTalkOptionsOpen){e.preventDefault(),this.realtimeTalkOptionsOpen=!1;return}this.chatMobileControlsOpen&&(e.preventDefault(),this.setChatMobileControlsOpen(!1,{restoreFocus:!0}))},this.chatMobileControlsPointerdownHandler=e=>{let t=e.composedPath();if(this.querySelectorAll(`.chat-controls__inline-select[open], .agent-chat__talk-select[open], .agent-chat__talk-options-advanced[open]`).forEach(e=>{t.includes(e)||(e.open=!1)}),this.realtimeTalkOptionsOpen&&(Array.from(this.querySelectorAll(`.agent-chat__talk-options, [aria-label='Talk settings'], [aria-label='Talk options']`)).some(e=>t.includes(e))||(this.realtimeTalkOptionsOpen=!1)),this.chatSessionPickerOpen&&(Array.from(this.querySelectorAll(`.chat-controls__session-picker`)).some(e=>t.includes(e))||(this.chatSessionPickerOpen=!1,this.chatSessionPickerSurface=null)),!this.chatMobileControlsOpen)return;let n=this.querySelector(`.chat-settings-popover-wrapper`)??this.querySelector(`.chat-mobile-controls-wrapper`);n&&t.includes(n)||this.setChatMobileControlsOpen(!1)},_(this.settings.locale)&&g.setLocale(this.settings.locale)}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.onSlashAction=async e=>{switch(e){case`new-session`:await Tz(this);break;case`export`:HA(this.chatMessages,this.assistantName);break;case`refresh-tools-effective`:await zb(this);break}},document.addEventListener(`keydown`,this.globalKeydownHandler),document.addEventListener(`keydown`,this.chatMobileControlsKeydownHandler),document.addEventListener(`pointerdown`,this.chatMobileControlsPointerdownHandler),pL(this),this.nativeBridgeCleanup=EL(this),this.initWebPushState()}firstUpdated(){mL(this)}disconnectedCallback(){document.removeEventListener(`keydown`,this.globalKeydownHandler),this.nativeBridgeCleanup?.(),this.nativeBridgeCleanup=null,document.removeEventListener(`keydown`,this.chatMobileControlsKeydownHandler),document.removeEventListener(`pointerdown`,this.chatMobileControlsPointerdownHandler),this.sessionSwitchNoticeTimer!==null&&(window.clearTimeout(this.sessionSwitchNoticeTimer),this.sessionSwitchNoticeTimer=null),this.sessionSwitchFlashTimer!==null&&(window.clearTimeout(this.sessionSwitchFlashTimer),this.sessionSwitchFlashTimer=null),this.chatMobileControlsTrigger=null,xL(this),super.disconnectedCallback()}updated(e){if(SL(this,e),e.has(`tab`)&&this.tab!==`chat`&&this.chatMobileControlsOpen&&this.setChatMobileControlsOpen(!1),!e.has(`sessionKey`)||this.agentsPanel!==`tools`)return;let t=Ql(this.sessionKey);if(this.agentsSelectedId&&this.agentsSelectedId===t){Ib(this,{agentId:this.agentsSelectedId,sessionKey:this.sessionKey});return}this.toolsEffectiveResult=null,this.toolsEffectiveResultKey=null,this.toolsEffectiveError=null,this.toolsEffectiveLoading=!1,this.toolsEffectiveLoadingKey=null}connect(){nL(this)}handleChatScroll(e){bs(this,e)}handleLogsScroll(e){xs(this,e)}handleActivityScroll(e){Ss(this,e)}scheduleActivityScroll(e=!1){ys(this,e)}exportLogs(e,t){ws(e,t)}resetToolStream(){Du(this)}resetChatScroll(){Cs(this)}scrollToBottom(e){Cs(this),_s(this,!0,!!e?.smooth,{source:`manual`})}async loadAssistantIdentity(){await BF(this)}applySettings(e){YP(this,e)}applyLocalUserIdentity(e){XP(this,e)}setTab(e){tF(this,e),e!==`chat`&&this.setChatMobileControlsOpen(!1),this.navDrawerOpen=!1}setChatMobileControlsOpen(e,t){if(e){this.chatMobileControlsTrigger=t?.trigger??this.chatMobileControlsTrigger,this.chatMobileControlsOpen=!0;return}let n=t?.restoreFocus?this.chatMobileControlsTrigger:null;this.chatMobileControlsOpen=!1,this.chatSessionPickerSurface===`mobile`&&(this.chatSessionPickerOpen=!1,this.chatSessionPickerSurface=null),this.chatMobileControlsTrigger=null,!(!(n instanceof HTMLElement)||!n.isConnected)&&requestAnimationFrame(()=>{n.isConnected&&n.focus()})}setTheme(e,t){rF(this,e,t),this.themeOrder=this.buildThemeOrder(e)}setThemeMode(e,t){iF(this,e,t)}setCustomThemeImportUrl(e){this.customThemeImportUrl=e,this.customThemeImportMessage?.kind===`error`&&(this.customThemeImportMessage=null)}openCustomThemeImport(){this.customThemeImportExpanded=!0,this.customThemeImportFocusToken+=1,this.settings.customTheme||(this.customThemeImportSelectOnSuccess=!0)}async importCustomTheme(){if(!this.customThemeImportBusy){this.customThemeImportExpanded=!0,this.customThemeImportBusy=!0,this.customThemeImportMessage=null;try{let e=await Mi(this.customThemeImportUrl),t=this.theme===`custom`||!this.settings.customTheme||this.customThemeImportSelectOnSuccess;YP(this,{...this.settings,theme:t?`custom`:this.settings.theme,customTheme:e}),this.themeOrder=this.buildThemeOrder(t?`custom`:this.theme),this.customThemeImportUrl=``,this.customThemeImportSelectOnSuccess=!1,this.customThemeImportMessage={kind:`success`,text:`Imported ${e.label}.`}}catch(e){this.customThemeImportMessage={kind:`error`,text:e instanceof Error?e.message:`Failed to import tweakcn theme.`}}finally{this.customThemeImportBusy=!1}}}clearCustomTheme(){let e=this.theme===`custom`?`claw`:this.theme;this.customThemeImportExpanded=!0,this.customThemeImportSelectOnSuccess=!1,YP(this,{...this.settings,theme:e,customTheme:void 0}),this.themeOrder=this.buildThemeOrder(e),this.customThemeImportMessage={kind:`success`,text:`Cleared custom theme.`}}setBorderRadius(e){YP(this,{...this.settings,borderRadius:e}),this.requestUpdate()}setTextScale(e){YP(this,{...this.settings,textScale:e}),this.requestUpdate()}announceSessionSwitch(e,t){let n=++this.sessionSwitchNoticeSeq;this.sessionSwitchNoticeTimer!==null&&window.clearTimeout(this.sessionSwitchNoticeTimer),this.sessionSwitchFlashTimer!==null&&window.clearTimeout(this.sessionSwitchFlashTimer),this.sessionSwitchNotice={id:n,text:S(`chat.switchedSession`,{session:t})},this.sessionSwitchFlashKey=e,this.sessionSwitchFlashTimer=window.setTimeout(()=>{this.sessionSwitchNotice?.id===n&&(this.sessionSwitchFlashKey=null),this.sessionSwitchFlashTimer=null},200),this.sessionSwitchNoticeTimer=window.setTimeout(()=>{this.sessionSwitchNotice?.id===n&&(this.sessionSwitchNotice=null),this.sessionSwitchNoticeTimer=null},2800)}buildThemeOrder(e){return[e,...[...Yi].filter(t=>t!==e)]}async loadOverview(e){await wF(this,e)}async loadCron(){await MF(this)}async handleAbortChat(e){await kv(this,e)}handleChatDraftChange(e){gf(this,e)}handleChatInputHistoryKey(e){return bf(this,e)}resetChatInputHistoryNavigation(){hf(this)}removeQueuedMessage(e){gy(this,e)}async retryQueuedChatMessage(e){await Sy(this,e)}async handleSendChat(e,t){await Cy(this,e,t)}updateRealtimeTalkOptions(e){this.realtimeTalkOptions={...this.realtimeTalkOptions,...e}}buildRealtimeTalkLaunchOptions(){let e=this.realtimeTalkOptions??{provider:``,model:``,voice:``,transport:``,vadThreshold:``,silenceDurationMs:``,prefixPaddingMs:``,reasoningEffort:``},t=e=>e.trim()||void 0,n=e=>{let t=e.trim();if(!t)return;let n=Number(t);return Number.isFinite(n)?n:void 0},r=t(e.transport);return{provider:t(e.provider),model:t(e.model),voice:t(e.voice),transport:r,vadThreshold:n(e.vadThreshold),silenceDurationMs:n(e.silenceDurationMs),prefixPaddingMs:n(e.prefixPaddingMs),reasoningEffort:t(e.reasoningEffort)}}async toggleRealtimeTalk(){if(this.realtimeTalkSession)if(this.realtimeTalkStatus===`error`)this.realtimeTalkSession.stop(),this.realtimeTalkSession=null;else{this.realtimeTalkSession.stop(),this.realtimeTalkSession=null,this.realtimeTalkActive=!1,this.realtimeTalkStatus=`idle`,this.realtimeTalkDetail=null,this.realtimeTalkTranscript=null,this.resetRealtimeTalkConversation();return}if(!this.client||!this.connected){this.lastError=`Gateway not connected`,this.chatError=this.lastError;return}this.realtimeTalkActive=!0,this.realtimeTalkStatus=`connecting`,this.realtimeTalkDetail=null,this.realtimeTalkTranscript=null,this.resetRealtimeTalkConversation();let e=new vq(this.client,this.sessionKey,{onStatus:(e,t)=>{this.realtimeTalkStatus=e,this.realtimeTalkDetail=t??null,(e===`idle`||e===`error`)&&(this.realtimeTalkActive=e!==`idle`),e===`error`&&this.realtimeTalkDetail&&(this.lastError=this.realtimeTalkDetail,this.chatError=this.realtimeTalkDetail)},onTranscript:e=>{this.realtimeTalkTranscript=`${e.role===`user`?`You`:`OpenClaw`}: ${e.text}`,this.realtimeTalkConversationState=dK(this.realtimeTalkConversationState,e),this.realtimeTalkConversation=this.realtimeTalkConversationState.entries}},this.buildRealtimeTalkLaunchOptions());this.realtimeTalkSession=e;try{await e.start()}catch(t){e.stop(),this.realtimeTalkSession===e&&(this.realtimeTalkSession=null),this.realtimeTalkActive=!1,this.realtimeTalkStatus=`error`,this.realtimeTalkDetail=t instanceof Error?t.message:String(t),this.lastError=this.realtimeTalkDetail,this.chatError=this.realtimeTalkDetail}}resetRealtimeTalkConversation(){this.realtimeTalkConversationState=uK(),this.realtimeTalkConversation=[]}async steerQueuedChatMessage(e){await ly(this,e)}async handleWhatsAppStart(e){await jr(this,e)}async handleWhatsAppWait(){await Mr(this)}async handleWhatsAppLogout(){await Nr(this)}async handleChannelConfigSave(){await Pr(this)}async handleChannelConfigReload(){await Fr(this)}handleNostrProfileEdit(e,t){Br(this,e,t)}handleNostrProfileCancel(){Vr(this)}handleNostrProfileFieldChange(e,t){Hr(this,e,t)}async handleNostrProfileSave(){await Wr(this)}async handleNostrProfileImport(){await Gr(this)}handleNostrProfileToggleAdvanced(){Ur(this)}async handleExecApprovalDecision(e){let t=this.execApprovalQueue[0];if(!(!t||!this.client||this.execApprovalBusy)){this.execApprovalBusy=!0,this.execApprovalError=null;try{let n=t.kind===`plugin`?`plugin.approval.resolve`:`exec.approval.resolve`;await this.client.request(n,{id:t.id,decision:e}),hI(this,t.id)}catch(e){if(oI(e)){hI(this,t.id),await mI(this);return}if(!this.execApprovalQueue.some(e=>e.id===t.id))return;this.execApprovalError=`Approval failed: ${String(e)}`}finally{this.execApprovalBusy=!1}}}handleGatewayUrlConfirm(){let e=this.pendingGatewayUrl;if(!e)return;let t=this.pendingGatewayToken?.trim()||``;this.pendingGatewayUrl=null,this.pendingGatewayToken=null,YP(this,{...this.settings,gatewayUrl:e,token:t}),yd(this,{preserveCurrent:!0}),this.connect()}handleGatewayUrlCancel(){this.pendingGatewayUrl=null,this.pendingGatewayToken=null,yd(this,{preserveCurrent:!0})}async maybeUpgradeSidebarToFullMessage(e){let t=e.fullMessageRequest;if(!(!t||!this.client))try{let n=await this.client.request(`chat.message.get`,{sessionKey:t.sessionKey,...t.agentId?{agentId:t.agentId}:{},messageId:t.messageId,maxChars:xq});if(this.sidebarContent!==e)return;if(!n?.ok||!n.message||typeof n.message!=`object`){this.sidebarContent={...e,unavailableReason:n?.unavailableReason??`not_found`},this.sidebarError=Cq(n?.unavailableReason??`not_found`);return}let r=n.message,i=(typeof r.text==`string`?r.text:typeof r.content==`string`?r.content:Array.isArray(r.content)?r.content.map(e=>e&&typeof e==`object`&&typeof e.text==`string`?e.text:null).filter(e=>typeof e==`string`).join(`
|
|
6344
|
-
`):null)??(typeof e.rawText==`string`?e.rawText:e.kind===`markdown`?e.content:null);e.kind===`markdown`?this.sidebarContent={...e,content:i||e.content,rawText:i||e.rawText||e.content,unavailableReason:null}:this.sidebarContent={...e,rawText:i||e.rawText||null,unavailableReason:null},this.sidebarError=null}catch(t){if(this.sidebarContent!==e)return;this.sidebarError=`Failed to load full content: ${t instanceof Error?t.message:String(t)}`}}handleOpenSidebar(e){this.sidebarCloseTimer!=null&&(window.clearTimeout(this.sidebarCloseTimer),this.sidebarCloseTimer=null),this.sidebarContent=e,this.sidebarError=null,this.sidebarOpen=!0,Sq(e)&&e.fullMessageRequest&&this.maybeUpgradeSidebarToFullMessage(e)}handleCloseSidebar(){this.sidebarOpen=!1,this.sidebarCloseTimer!=null&&window.clearTimeout(this.sidebarCloseTimer),this.sidebarCloseTimer=window.setTimeout(()=>{this.sidebarOpen||(this.sidebarContent=null,this.sidebarError=null,this.sidebarCloseTimer=null)},200)}handleSplitRatioChange(e){let t=Math.max(.4,Math.min(.7,e));this.splitRatio=t,this.applySettings({...this.settings,splitRatio:t})}async initWebPushState(){let e=`serviceWorker`in navigator&&`PushManager`in window&&`Notification`in window;if(this.webPushSupported=e,this.webPushPermission=e?Notification.permission:`unsupported`,e)try{let{getExistingSubscription:e}=await b(async()=>{let{getExistingSubscription:e}=await import(`./push-subscription-BB--F2Xo.js`);return{getExistingSubscription:e}},[],import.meta.url),t=await e();this.webPushSubscribed=t!==null}catch{}}async reconcileWebPushState(){if(this.client)try{let{getExistingSubscription:e}=await b(async()=>{let{getExistingSubscription:e}=await import(`./push-subscription-BB--F2Xo.js`);return{getExistingSubscription:e}},[],import.meta.url),t=await e();if(!t)return;this.webPushSubscribed=!0;let n=t.toJSON();n.endpoint&&n.keys?.p256dh&&n.keys?.auth&&await this.client.request(`push.web.subscribe`,{endpoint:n.endpoint,keys:{p256dh:n.keys.p256dh,auth:n.keys.auth}})}catch{}}async handleWebPushSubscribe(){if(!(!this.client||this.webPushLoading)){this.webPushLoading=!0;try{let{subscribeToWebPush:e}=await b(async()=>{let{subscribeToWebPush:e}=await import(`./push-subscription-BB--F2Xo.js`);return{subscribeToWebPush:e}},[],import.meta.url);await e(this.client),this.webPushSubscribed=!0,this.webPushPermission=Notification.permission}catch(e){this.lastError=String(e)}finally{this.webPushLoading=!1,`Notification`in window&&(this.webPushPermission=Notification.permission)}}}async handleWebPushUnsubscribe(){if(!(!this.client||this.webPushLoading)){this.webPushLoading=!0;try{let{unsubscribeFromWebPush:e}=await b(async()=>{let{unsubscribeFromWebPush:e}=await import(`./push-subscription-BB--F2Xo.js`);return{unsubscribeFromWebPush:e}},[],import.meta.url);await e(this.client),this.webPushSubscribed=!1}catch(e){this.lastError=String(e)}finally{this.webPushLoading=!1}}}async handleWebPushTest(){if(this.client)try{let{sendTestWebPush:e}=await b(async()=>{let{sendTestWebPush:e}=await import(`./push-subscription-BB--F2Xo.js`);return{sendTestWebPush:e}},[],import.meta.url);await e(this.client)}catch(e){this.lastError=String(e)}}render(){return cK(this)}};if(Y([h()],$.prototype,`settings`,void 0),Y([h()],$.prototype,`password`,void 0),Y([h()],$.prototype,`loginShowGatewayToken`,void 0),Y([h()],$.prototype,`loginShowGatewayPassword`,void 0),Y([h()],$.prototype,`tab`,void 0),Y([h()],$.prototype,`onboarding`,void 0),Y([h()],$.prototype,`connected`,void 0),Y([h()],$.prototype,`theme`,void 0),Y([h()],$.prototype,`themeMode`,void 0),Y([h()],$.prototype,`themeResolved`,void 0),Y([h()],$.prototype,`themeOrder`,void 0),Y([h()],$.prototype,`customThemeImportUrl`,void 0),Y([h()],$.prototype,`customThemeImportBusy`,void 0),Y([h()],$.prototype,`customThemeImportMessage`,void 0),Y([h()],$.prototype,`customThemeImportExpanded`,void 0),Y([h()],$.prototype,`customThemeImportFocusToken`,void 0),Y([h()],$.prototype,`hello`,void 0),Y([h()],$.prototype,`lastError`,void 0),Y([h()],$.prototype,`lastErrorCode`,void 0),Y([h()],$.prototype,`chatError`,void 0),Y([h()],$.prototype,`eventLog`,void 0),Y([h()],$.prototype,`assistantName`,void 0),Y([h()],$.prototype,`assistantAvatar`,void 0),Y([h()],$.prototype,`assistantAvatarSource`,void 0),Y([h()],$.prototype,`assistantAvatarStatus`,void 0),Y([h()],$.prototype,`assistantAvatarReason`,void 0),Y([h()],$.prototype,`assistantAvatarUploadBusy`,void 0),Y([h()],$.prototype,`assistantAvatarUploadError`,void 0),Y([h()],$.prototype,`assistantAgentId`,void 0),Y([h()],$.prototype,`userName`,void 0),Y([h()],$.prototype,`userAvatar`,void 0),Y([h()],$.prototype,`localMediaPreviewRoots`,void 0),Y([h()],$.prototype,`embedSandboxMode`,void 0),Y([h()],$.prototype,`allowExternalEmbedUrls`,void 0),Y([h()],$.prototype,`chatMessageMaxWidth`,void 0),Y([h()],$.prototype,`serverVersion`,void 0),Y([h()],$.prototype,`sessionKey`,void 0),Y([h()],$.prototype,`chatLoading`,void 0),Y([h()],$.prototype,`chatSending`,void 0),Y([h()],$.prototype,`chatMessage`,void 0),Y([h()],$.prototype,`chatMessages`,void 0),Y([h()],$.prototype,`chatToolMessages`,void 0),Y([h()],$.prototype,`activityEntries`,void 0),Y([h()],$.prototype,`activityFilterText`,void 0),Y([h()],$.prototype,`activityStatusFilters`,void 0),Y([h()],$.prototype,`activityToolFilter`,void 0),Y([h()],$.prototype,`activityExpandedIds`,void 0),Y([h()],$.prototype,`activityAutoFollow`,void 0),Y([h()],$.prototype,`activityAtBottom`,void 0),Y([h()],$.prototype,`chatStreamSegments`,void 0),Y([h()],$.prototype,`chatStream`,void 0),Y([h()],$.prototype,`chatStreamStartedAt`,void 0),Y([h()],$.prototype,`chatRunId`,void 0),Y([h()],$.prototype,`chatSideResult`,void 0),Y([h()],$.prototype,`compactionStatus`,void 0),Y([h()],$.prototype,`fallbackStatus`,void 0),Y([h()],$.prototype,`chatRunStatus`,void 0),Y([h()],$.prototype,`chatAvatarUrl`,void 0),Y([h()],$.prototype,`chatAvatarSource`,void 0),Y([h()],$.prototype,`chatAvatarStatus`,void 0),Y([h()],$.prototype,`chatAvatarReason`,void 0),Y([h()],$.prototype,`chatThinkingLevel`,void 0),Y([h()],$.prototype,`chatModelOverrides`,void 0),Y([h()],$.prototype,`chatModelSwitchPromises`,void 0),Y([h()],$.prototype,`chatModelsLoading`,void 0),Y([h()],$.prototype,`chatModelCatalog`,void 0),Y([h()],$.prototype,`sessionSwitchNotice`,void 0),Y([h()],$.prototype,`sessionSwitchFlashKey`,void 0),Y([h()],$.prototype,`chatSessionPickerOpen`,void 0),Y([h()],$.prototype,`chatSessionPickerSurface`,void 0),Y([h()],$.prototype,`chatSessionPickerQuery`,void 0),Y([h()],$.prototype,`chatSessionPickerAppliedQuery`,void 0),Y([h()],$.prototype,`chatSessionPickerLoading`,void 0),Y([h()],$.prototype,`chatSessionPickerError`,void 0),Y([h()],$.prototype,`chatSessionPickerResult`,void 0),Y([h()],$.prototype,`chatQueue`,void 0),Y([h()],$.prototype,`chatQueueBySession`,void 0),Y([h()],$.prototype,`chatAttachments`,void 0),Y([h()],$.prototype,`realtimeTalkActive`,void 0),Y([h()],$.prototype,`realtimeTalkStatus`,void 0),Y([h()],$.prototype,`realtimeTalkDetail`,void 0),Y([h()],$.prototype,`realtimeTalkTranscript`,void 0),Y([h()],$.prototype,`realtimeTalkConversation`,void 0),Y([h()],$.prototype,`realtimeTalkOptionsOpen`,void 0),Y([h()],$.prototype,`realtimeTalkOptions`,void 0),Y([h()],$.prototype,`chatManualRefreshInFlight`,void 0),Y([h()],$.prototype,`chatHeaderControlsHidden`,void 0),Y([h()],$.prototype,`chatMobileControlsOpen`,void 0),Y([h()],$.prototype,`navDrawerOpen`,void 0),Y([h()],$.prototype,`chatInputHistoryIndex`,void 0),Y([h()],$.prototype,`sidebarOpen`,void 0),Y([h()],$.prototype,`sidebarContent`,void 0),Y([h()],$.prototype,`sidebarError`,void 0),Y([h()],$.prototype,`splitRatio`,void 0),Y([h()],$.prototype,`nodesLoading`,void 0),Y([h()],$.prototype,`nodes`,void 0),Y([h()],$.prototype,`devicesLoading`,void 0),Y([h()],$.prototype,`devicesError`,void 0),Y([h()],$.prototype,`devicesList`,void 0),Y([h()],$.prototype,`execApprovalsLoading`,void 0),Y([h()],$.prototype,`execApprovalsSaving`,void 0),Y([h()],$.prototype,`execApprovalsDirty`,void 0),Y([h()],$.prototype,`execApprovalsSnapshot`,void 0),Y([h()],$.prototype,`execApprovalsForm`,void 0),Y([h()],$.prototype,`execApprovalsSelectedAgent`,void 0),Y([h()],$.prototype,`execApprovalsTarget`,void 0),Y([h()],$.prototype,`execApprovalsTargetNodeId`,void 0),Y([h()],$.prototype,`execApprovalQueue`,void 0),Y([h()],$.prototype,`execApprovalBusy`,void 0),Y([h()],$.prototype,`execApprovalError`,void 0),Y([h()],$.prototype,`pendingGatewayUrl`,void 0),Y([h()],$.prototype,`configLoading`,void 0),Y([h()],$.prototype,`configRaw`,void 0),Y([h()],$.prototype,`configRawOriginal`,void 0),Y([h()],$.prototype,`configValid`,void 0),Y([h()],$.prototype,`configIssues`,void 0),Y([h()],$.prototype,`configSaving`,void 0),Y([h()],$.prototype,`configApplying`,void 0),Y([h()],$.prototype,`updateRunning`,void 0),Y([h()],$.prototype,`applySessionKey`,void 0),Y([h()],$.prototype,`configSnapshot`,void 0),Y([h()],$.prototype,`configSchema`,void 0),Y([h()],$.prototype,`configSchemaVersion`,void 0),Y([h()],$.prototype,`configSchemaLoading`,void 0),Y([h()],$.prototype,`configUiHints`,void 0),Y([h()],$.prototype,`configForm`,void 0),Y([h()],$.prototype,`configFormOriginal`,void 0),Y([h()],$.prototype,`selectedAgentId`,void 0),Y([h()],$.prototype,`dreamingStatusLoading`,void 0),Y([h()],$.prototype,`dreamingStatusError`,void 0),Y([h()],$.prototype,`dreamingStatus`,void 0),Y([h()],$.prototype,`dreamingModeSaving`,void 0),Y([h()],$.prototype,`dreamingRestartConfirmOpen`,void 0),Y([h()],$.prototype,`dreamingRestartConfirmLoading`,void 0),Y([h()],$.prototype,`dreamingPendingEnabled`,void 0),Y([h()],$.prototype,`dreamDiaryLoading`,void 0),Y([h()],$.prototype,`dreamDiaryActionLoading`,void 0),Y([h()],$.prototype,`dreamDiaryActionMessage`,void 0),Y([h()],$.prototype,`dreamDiaryActionArchivePath`,void 0),Y([h()],$.prototype,`dreamDiaryError`,void 0),Y([h()],$.prototype,`dreamDiaryPath`,void 0),Y([h()],$.prototype,`dreamDiaryContent`,void 0),Y([h()],$.prototype,`wikiImportInsightsLoading`,void 0),Y([h()],$.prototype,`wikiImportInsightsError`,void 0),Y([h()],$.prototype,`wikiImportInsights`,void 0),Y([h()],$.prototype,`wikiMemoryPalaceLoading`,void 0),Y([h()],$.prototype,`wikiMemoryPalaceError`,void 0),Y([h()],$.prototype,`wikiMemoryPalace`,void 0),Y([h()],$.prototype,`configFormDirty`,void 0),Y([h()],$.prototype,`configSettingsMode`,void 0),Y([h()],$.prototype,`configFormMode`,void 0),Y([h()],$.prototype,`configSearchQuery`,void 0),Y([h()],$.prototype,`configActiveSection`,void 0),Y([h()],$.prototype,`configActiveSubsection`,void 0),Y([h()],$.prototype,`pendingUpdateExpectedVersion`,void 0),Y([h()],$.prototype,`updateStatusBanner`,void 0),Y([h()],$.prototype,`communicationsFormMode`,void 0),Y([h()],$.prototype,`communicationsSearchQuery`,void 0),Y([h()],$.prototype,`communicationsActiveSection`,void 0),Y([h()],$.prototype,`communicationsActiveSubsection`,void 0),Y([h()],$.prototype,`appearanceFormMode`,void 0),Y([h()],$.prototype,`appearanceSearchQuery`,void 0),Y([h()],$.prototype,`appearanceActiveSection`,void 0),Y([h()],$.prototype,`appearanceActiveSubsection`,void 0),Y([h()],$.prototype,`automationFormMode`,void 0),Y([h()],$.prototype,`automationSearchQuery`,void 0),Y([h()],$.prototype,`automationActiveSection`,void 0),Y([h()],$.prototype,`automationActiveSubsection`,void 0),Y([h()],$.prototype,`infrastructureFormMode`,void 0),Y([h()],$.prototype,`infrastructureSearchQuery`,void 0),Y([h()],$.prototype,`infrastructureActiveSection`,void 0),Y([h()],$.prototype,`infrastructureActiveSubsection`,void 0),Y([h()],$.prototype,`aiAgentsFormMode`,void 0),Y([h()],$.prototype,`aiAgentsSearchQuery`,void 0),Y([h()],$.prototype,`aiAgentsActiveSection`,void 0),Y([h()],$.prototype,`aiAgentsActiveSubsection`,void 0),Y([h()],$.prototype,`channelsLoading`,void 0),Y([h()],$.prototype,`channelsSnapshot`,void 0),Y([h()],$.prototype,`channelsError`,void 0),Y([h()],$.prototype,`channelsLastSuccess`,void 0),Y([h()],$.prototype,`whatsappLoginMessage`,void 0),Y([h()],$.prototype,`whatsappLoginQrDataUrl`,void 0),Y([h()],$.prototype,`whatsappLoginConnected`,void 0),Y([h()],$.prototype,`whatsappBusy`,void 0),Y([h()],$.prototype,`nostrProfileFormState`,void 0),Y([h()],$.prototype,`nostrProfileAccountId`,void 0),Y([h()],$.prototype,`presenceLoading`,void 0),Y([h()],$.prototype,`presenceEntries`,void 0),Y([h()],$.prototype,`presenceError`,void 0),Y([h()],$.prototype,`presenceStatus`,void 0),Y([h()],$.prototype,`agentsLoading`,void 0),Y([h()],$.prototype,`agentsList`,void 0),Y([h()],$.prototype,`agentsError`,void 0),Y([h()],$.prototype,`agentsSelectedId`,void 0),Y([h()],$.prototype,`toolsCatalogLoading`,void 0),Y([h()],$.prototype,`toolsCatalogError`,void 0),Y([h()],$.prototype,`toolsCatalogResult`,void 0),Y([h()],$.prototype,`toolsEffectiveLoading`,void 0),Y([h()],$.prototype,`toolsEffectiveLoadingKey`,void 0),Y([h()],$.prototype,`toolsEffectiveResultKey`,void 0),Y([h()],$.prototype,`toolsEffectiveError`,void 0),Y([h()],$.prototype,`toolsEffectiveResult`,void 0),Y([h()],$.prototype,`agentsPanel`,void 0),Y([h()],$.prototype,`agentFilesLoading`,void 0),Y([h()],$.prototype,`agentFilesError`,void 0),Y([h()],$.prototype,`agentFilesList`,void 0),Y([h()],$.prototype,`agentFileContents`,void 0),Y([h()],$.prototype,`agentFileDrafts`,void 0),Y([h()],$.prototype,`agentFileActive`,void 0),Y([h()],$.prototype,`agentFileSaving`,void 0),Y([h()],$.prototype,`agentIdentityLoading`,void 0),Y([h()],$.prototype,`agentIdentityError`,void 0),Y([h()],$.prototype,`agentIdentityById`,void 0),Y([h()],$.prototype,`agentSkillsLoading`,void 0),Y([h()],$.prototype,`agentSkillsError`,void 0),Y([h()],$.prototype,`agentSkillsReport`,void 0),Y([h()],$.prototype,`agentSkillsAgentId`,void 0),Y([h()],$.prototype,`sessionsLoading`,void 0),Y([h()],$.prototype,`sessionsResult`,void 0),Y([h()],$.prototype,`sessionsError`,void 0),Y([h()],$.prototype,`sessionsFilterActive`,void 0),Y([h()],$.prototype,`sessionsFilterLimit`,void 0),Y([h()],$.prototype,`sessionsIncludeGlobal`,void 0),Y([h()],$.prototype,`sessionsIncludeUnknown`,void 0),Y([h()],$.prototype,`sessionsShowArchived`,void 0),Y([h()],$.prototype,`sessionsFiltersCollapsed`,void 0),Y([h()],$.prototype,`sessionsHideCron`,void 0),Y([h()],$.prototype,`sessionsSearchQuery`,void 0),Y([h()],$.prototype,`sessionsSortColumn`,void 0),Y([h()],$.prototype,`sessionsSortDir`,void 0),Y([h()],$.prototype,`sessionsPage`,void 0),Y([h()],$.prototype,`sessionsPageSize`,void 0),Y([h()],$.prototype,`sessionsSelectedKeys`,void 0),Y([h()],$.prototype,`sessionsExpandedCheckpointKey`,void 0),Y([h()],$.prototype,`sessionsCheckpointItemsByKey`,void 0),Y([h()],$.prototype,`sessionsCheckpointLoadingKey`,void 0),Y([h()],$.prototype,`sessionsCheckpointBusyKey`,void 0),Y([h()],$.prototype,`sessionsCheckpointErrorByKey`,void 0),Y([h()],$.prototype,`usageLoading`,void 0),Y([h()],$.prototype,`usageResult`,void 0),Y([h()],$.prototype,`usageCostSummary`,void 0),Y([h()],$.prototype,`usageError`,void 0),Y([h()],$.prototype,`usageStartDate`,void 0),Y([h()],$.prototype,`usageEndDate`,void 0),Y([h()],$.prototype,`usageScope`,void 0),Y([h()],$.prototype,`usageAgentId`,void 0),Y([h()],$.prototype,`usageSelectedSessions`,void 0),Y([h()],$.prototype,`usageSelectedDays`,void 0),Y([h()],$.prototype,`usageSelectedHours`,void 0),Y([h()],$.prototype,`usageChartMode`,void 0),Y([h()],$.prototype,`usageDailyChartMode`,void 0),Y([h()],$.prototype,`usageTimeSeriesMode`,void 0),Y([h()],$.prototype,`usageTimeSeriesBreakdownMode`,void 0),Y([h()],$.prototype,`usageTimeSeries`,void 0),Y([h()],$.prototype,`usageTimeSeriesLoading`,void 0),Y([h()],$.prototype,`usageTimeSeriesCursorStart`,void 0),Y([h()],$.prototype,`usageTimeSeriesCursorEnd`,void 0),Y([h()],$.prototype,`usageSessionLogs`,void 0),Y([h()],$.prototype,`usageSessionLogsLoading`,void 0),Y([h()],$.prototype,`usageSessionLogsExpanded`,void 0),Y([h()],$.prototype,`usageQuery`,void 0),Y([h()],$.prototype,`usageQueryDraft`,void 0),Y([h()],$.prototype,`usageSessionSort`,void 0),Y([h()],$.prototype,`usageSessionSortDir`,void 0),Y([h()],$.prototype,`usageRecentSessions`,void 0),Y([h()],$.prototype,`usageTimeZone`,void 0),Y([h()],$.prototype,`usageContextExpanded`,void 0),Y([h()],$.prototype,`usageHeaderPinned`,void 0),Y([h()],$.prototype,`usageSessionsTab`,void 0),Y([h()],$.prototype,`usageVisibleColumns`,void 0),Y([h()],$.prototype,`usageLogFilterRoles`,void 0),Y([h()],$.prototype,`usageLogFilterTools`,void 0),Y([h()],$.prototype,`usageLogFilterHasTools`,void 0),Y([h()],$.prototype,`usageLogFilterQuery`,void 0),Y([h()],$.prototype,`cronLoading`,void 0),Y([h()],$.prototype,`cronQuickCreateOpen`,void 0),Y([h()],$.prototype,`cronQuickCreateStep`,void 0),Y([h()],$.prototype,`cronQuickCreateDraft`,void 0),Y([h()],$.prototype,`cronJobsLoadingMore`,void 0),Y([h()],$.prototype,`cronJobs`,void 0),Y([h()],$.prototype,`cronJobsTotal`,void 0),Y([h()],$.prototype,`cronJobsHasMore`,void 0),Y([h()],$.prototype,`cronJobsNextOffset`,void 0),Y([h()],$.prototype,`cronJobsLimit`,void 0),Y([h()],$.prototype,`cronJobsQuery`,void 0),Y([h()],$.prototype,`cronJobsEnabledFilter`,void 0),Y([h()],$.prototype,`cronJobsScheduleKindFilter`,void 0),Y([h()],$.prototype,`cronJobsLastStatusFilter`,void 0),Y([h()],$.prototype,`cronJobsSortBy`,void 0),Y([h()],$.prototype,`cronJobsSortDir`,void 0),Y([h()],$.prototype,`cronStatus`,void 0),Y([h()],$.prototype,`cronError`,void 0),Y([h()],$.prototype,`cronForm`,void 0),Y([h()],$.prototype,`cronFormCollapsed`,void 0),Y([h()],$.prototype,`cronFieldErrors`,void 0),Y([h()],$.prototype,`cronEditingJobId`,void 0),Y([h()],$.prototype,`cronRunsJobId`,void 0),Y([h()],$.prototype,`cronRunsLoadingMore`,void 0),Y([h()],$.prototype,`cronRuns`,void 0),Y([h()],$.prototype,`cronRunsTotal`,void 0),Y([h()],$.prototype,`cronRunsHasMore`,void 0),Y([h()],$.prototype,`cronRunsNextOffset`,void 0),Y([h()],$.prototype,`cronRunsLimit`,void 0),Y([h()],$.prototype,`cronRunsScope`,void 0),Y([h()],$.prototype,`cronRunsStatuses`,void 0),Y([h()],$.prototype,`cronRunsDeliveryStatuses`,void 0),Y([h()],$.prototype,`cronRunsStatusFilter`,void 0),Y([h()],$.prototype,`cronRunsQuery`,void 0),Y([h()],$.prototype,`cronRunsSortDir`,void 0),Y([h()],$.prototype,`cronModelSuggestions`,void 0),Y([h()],$.prototype,`cronBusy`,void 0),Y([h()],$.prototype,`updateAvailable`,void 0),Y([h()],$.prototype,`attentionItems`,void 0),Y([h()],$.prototype,`paletteOpen`,void 0),Y([h()],$.prototype,`paletteQuery`,void 0),Y([h()],$.prototype,`paletteActiveIndex`,void 0),Y([h()],$.prototype,`overviewShowGatewayToken`,void 0),Y([h()],$.prototype,`overviewShowGatewayPassword`,void 0),Y([h()],$.prototype,`overviewLogLines`,void 0),Y([h()],$.prototype,`overviewLogCursor`,void 0),Y([h()],$.prototype,`skillsLoading`,void 0),Y([h()],$.prototype,`skillsReport`,void 0),Y([h()],$.prototype,`skillsError`,void 0),Y([h()],$.prototype,`skillsFilter`,void 0),Y([h()],$.prototype,`skillsStatusFilter`,void 0),Y([h()],$.prototype,`skillEdits`,void 0),Y([h()],$.prototype,`skillsBusyKey`,void 0),Y([h()],$.prototype,`skillMessages`,void 0),Y([h()],$.prototype,`skillsDetailKey`,void 0),Y([h()],$.prototype,`skillsDetailTab`,void 0),Y([h()],$.prototype,`clawhubSearchQuery`,void 0),Y([h()],$.prototype,`clawhubSearchResults`,void 0),Y([h()],$.prototype,`clawhubSearchLoading`,void 0),Y([h()],$.prototype,`clawhubSearchError`,void 0),Y([h()],$.prototype,`clawhubDetail`,void 0),Y([h()],$.prototype,`clawhubDetailSlug`,void 0),Y([h()],$.prototype,`clawhubDetailLoading`,void 0),Y([h()],$.prototype,`clawhubDetailError`,void 0),Y([h()],$.prototype,`clawhubInstallSlug`,void 0),Y([h()],$.prototype,`clawhubInstallMessage`,void 0),Y([h()],$.prototype,`clawhubVerdicts`,void 0),Y([h()],$.prototype,`clawhubVerdictsLoading`,void 0),Y([h()],$.prototype,`clawhubVerdictsError`,void 0),Y([h()],$.prototype,`skillCardContents`,void 0),Y([h()],$.prototype,`skillCardContentKeys`,void 0),Y([h()],$.prototype,`skillCardLoadingKey`,void 0),Y([h()],$.prototype,`skillCardErrors`,void 0),Y([h()],$.prototype,`skillWorkshopLoading`,void 0),Y([h()],$.prototype,`skillWorkshopLoaded`,void 0),Y([h()],$.prototype,`skillWorkshopError`,void 0),Y([h()],$.prototype,`skillWorkshopInspectingKey`,void 0),Y([h()],$.prototype,`skillWorkshopProposals`,void 0),Y([h()],$.prototype,`skillWorkshopSelectedKey`,void 0),Y([h()],$.prototype,`skillWorkshopActionBusy`,void 0),Y([h()],$.prototype,`skillWorkshopActionNotice`,void 0),Y([h()],$.prototype,`skillWorkshopRevisionKey`,void 0),Y([h()],$.prototype,`skillWorkshopRevisionDraft`,void 0),Y([h()],$.prototype,`skillWorkshopStatusFilter`,void 0),Y([h()],$.prototype,`skillWorkshopQuery`,void 0),Y([h()],$.prototype,`skillWorkshopFilePreviewKey`,void 0),Y([h()],$.prototype,`skillWorkshopFilePreviewQuery`,void 0),Y([h()],$.prototype,`skillWorkshopQueueWidth`,void 0),Y([h()],$.prototype,`skillWorkshopMode`,void 0),Y([h()],$.prototype,`healthLoading`,void 0),Y([h()],$.prototype,`healthResult`,void 0),Y([h()],$.prototype,`healthError`,void 0),Y([h()],$.prototype,`modelAuthStatusLoading`,void 0),Y([h()],$.prototype,`modelAuthStatusResult`,void 0),Y([h()],$.prototype,`modelAuthStatusError`,void 0),Y([h()],$.prototype,`debugLoading`,void 0),Y([h()],$.prototype,`debugStatus`,void 0),Y([h()],$.prototype,`debugHealth`,void 0),Y([h()],$.prototype,`debugModels`,void 0),Y([h()],$.prototype,`debugHeartbeat`,void 0),Y([h()],$.prototype,`debugCallMethod`,void 0),Y([h()],$.prototype,`debugCallParams`,void 0),Y([h()],$.prototype,`debugCallResult`,void 0),Y([h()],$.prototype,`debugCallError`,void 0),Y([h()],$.prototype,`webPushSupported`,void 0),Y([h()],$.prototype,`webPushPermission`,void 0),Y([h()],$.prototype,`webPushSubscribed`,void 0),Y([h()],$.prototype,`webPushLoading`,void 0),Y([h()],$.prototype,`logsLoading`,void 0),Y([h()],$.prototype,`logsError`,void 0),Y([h()],$.prototype,`logsFile`,void 0),Y([h()],$.prototype,`logsEntries`,void 0),Y([h()],$.prototype,`logsFilterText`,void 0),Y([h()],$.prototype,`logsLevelFilters`,void 0),Y([h()],$.prototype,`logsAutoFollow`,void 0),Y([h()],$.prototype,`logsTruncated`,void 0),Y([h()],$.prototype,`logsCursor`,void 0),Y([h()],$.prototype,`logsLastFetchAt`,void 0),Y([h()],$.prototype,`logsLimit`,void 0),Y([h()],$.prototype,`logsMaxBytes`,void 0),Y([h()],$.prototype,`logsAtBottom`,void 0),Y([h()],$.prototype,`chatNewMessagesBelow`,void 0),customElements.get(`openclaw-app`)||customElements.define(`openclaw-app`,$),Tq(),`serviceWorker`in navigator){let e=new URL(Va(`sw.js`),window.location.origin);e.searchParams.set(`v`,`2026.6.2-c2a05f29e95f`),navigator.serviceWorker.register(e,{updateViaCache:`none`})}function Tq(){Eq(`link[rel="icon"][type="image/svg+xml"]`,`favicon.svg`),Eq(`link[rel="icon"][type="image/png"]`,`favicon-32.png`),Eq(`link[rel="apple-touch-icon"]`,`apple-touch-icon.png`),Eq(`link[rel="manifest"]`,`manifest.webmanifest`)}function Eq(e,t){let n=document.querySelector(e);n&&(n.href=Va(t))}export{Eo as $,VT as A,fl as B,KT as C,Hw as D,ST as E,Kb as F,Fs as G,ll as H,Wb as I,Ms as J,Ns as K,xf as L,aE as M,zT as N,uT as O,dC as P,oo as Q,ml as R,WT as S,pT as T,dl as U,pl as V,yl as W,co as X,ao as Y,So as Z,wj as _,xe as _t,AW as a,lo as at,HT as b,kV as c,po as ct,WL as d,Ka as dt,Do as et,HL as f,da as ft,jj as g,lt as gt,DN as h,N as ht,MW as i,so as it,iE as j,UT as k,dV as l,Oo as lt,ON as m,kr as mt,PW as n,fo as nt,kW as o,mo as ot,Y as p,Hi as pt,Ps as q,NW as r,bo as rt,jW as s,uo as st,FW as t,Ja as tt,UL as u,qa as ut,q as v,we as vt,oE as w,GT as x,bw as y,Ce as yt,ul as z};
|
|
6345
|
-
//# sourceMappingURL=index-
|
|
6344
|
+
`):null)??(typeof e.rawText==`string`?e.rawText:e.kind===`markdown`?e.content:null);e.kind===`markdown`?this.sidebarContent={...e,content:i||e.content,rawText:i||e.rawText||e.content,unavailableReason:null}:this.sidebarContent={...e,rawText:i||e.rawText||null,unavailableReason:null},this.sidebarError=null}catch(t){if(this.sidebarContent!==e)return;this.sidebarError=`Failed to load full content: ${t instanceof Error?t.message:String(t)}`}}handleOpenSidebar(e){this.sidebarCloseTimer!=null&&(window.clearTimeout(this.sidebarCloseTimer),this.sidebarCloseTimer=null),this.sidebarContent=e,this.sidebarError=null,this.sidebarOpen=!0,Sq(e)&&e.fullMessageRequest&&this.maybeUpgradeSidebarToFullMessage(e)}handleCloseSidebar(){this.sidebarOpen=!1,this.sidebarCloseTimer!=null&&window.clearTimeout(this.sidebarCloseTimer),this.sidebarCloseTimer=window.setTimeout(()=>{this.sidebarOpen||(this.sidebarContent=null,this.sidebarError=null,this.sidebarCloseTimer=null)},200)}handleSplitRatioChange(e){let t=Math.max(.4,Math.min(.7,e));this.splitRatio=t,this.applySettings({...this.settings,splitRatio:t})}async initWebPushState(){let e=`serviceWorker`in navigator&&`PushManager`in window&&`Notification`in window;if(this.webPushSupported=e,this.webPushPermission=e?Notification.permission:`unsupported`,e)try{let{getExistingSubscription:e}=await b(async()=>{let{getExistingSubscription:e}=await import(`./push-subscription-BB--F2Xo.js`);return{getExistingSubscription:e}},[],import.meta.url),t=await e();this.webPushSubscribed=t!==null}catch{}}async reconcileWebPushState(){if(this.client)try{let{getExistingSubscription:e}=await b(async()=>{let{getExistingSubscription:e}=await import(`./push-subscription-BB--F2Xo.js`);return{getExistingSubscription:e}},[],import.meta.url),t=await e();if(!t)return;this.webPushSubscribed=!0;let n=t.toJSON();n.endpoint&&n.keys?.p256dh&&n.keys?.auth&&await this.client.request(`push.web.subscribe`,{endpoint:n.endpoint,keys:{p256dh:n.keys.p256dh,auth:n.keys.auth}})}catch{}}async handleWebPushSubscribe(){if(!(!this.client||this.webPushLoading)){this.webPushLoading=!0;try{let{subscribeToWebPush:e}=await b(async()=>{let{subscribeToWebPush:e}=await import(`./push-subscription-BB--F2Xo.js`);return{subscribeToWebPush:e}},[],import.meta.url);await e(this.client),this.webPushSubscribed=!0,this.webPushPermission=Notification.permission}catch(e){this.lastError=String(e)}finally{this.webPushLoading=!1,`Notification`in window&&(this.webPushPermission=Notification.permission)}}}async handleWebPushUnsubscribe(){if(!(!this.client||this.webPushLoading)){this.webPushLoading=!0;try{let{unsubscribeFromWebPush:e}=await b(async()=>{let{unsubscribeFromWebPush:e}=await import(`./push-subscription-BB--F2Xo.js`);return{unsubscribeFromWebPush:e}},[],import.meta.url);await e(this.client),this.webPushSubscribed=!1}catch(e){this.lastError=String(e)}finally{this.webPushLoading=!1}}}async handleWebPushTest(){if(this.client)try{let{sendTestWebPush:e}=await b(async()=>{let{sendTestWebPush:e}=await import(`./push-subscription-BB--F2Xo.js`);return{sendTestWebPush:e}},[],import.meta.url);await e(this.client)}catch(e){this.lastError=String(e)}}render(){return cK(this)}};if(Y([h()],$.prototype,`settings`,void 0),Y([h()],$.prototype,`password`,void 0),Y([h()],$.prototype,`loginShowGatewayToken`,void 0),Y([h()],$.prototype,`loginShowGatewayPassword`,void 0),Y([h()],$.prototype,`tab`,void 0),Y([h()],$.prototype,`onboarding`,void 0),Y([h()],$.prototype,`connected`,void 0),Y([h()],$.prototype,`theme`,void 0),Y([h()],$.prototype,`themeMode`,void 0),Y([h()],$.prototype,`themeResolved`,void 0),Y([h()],$.prototype,`themeOrder`,void 0),Y([h()],$.prototype,`customThemeImportUrl`,void 0),Y([h()],$.prototype,`customThemeImportBusy`,void 0),Y([h()],$.prototype,`customThemeImportMessage`,void 0),Y([h()],$.prototype,`customThemeImportExpanded`,void 0),Y([h()],$.prototype,`customThemeImportFocusToken`,void 0),Y([h()],$.prototype,`hello`,void 0),Y([h()],$.prototype,`lastError`,void 0),Y([h()],$.prototype,`lastErrorCode`,void 0),Y([h()],$.prototype,`chatError`,void 0),Y([h()],$.prototype,`eventLog`,void 0),Y([h()],$.prototype,`assistantName`,void 0),Y([h()],$.prototype,`assistantAvatar`,void 0),Y([h()],$.prototype,`assistantAvatarSource`,void 0),Y([h()],$.prototype,`assistantAvatarStatus`,void 0),Y([h()],$.prototype,`assistantAvatarReason`,void 0),Y([h()],$.prototype,`assistantAvatarUploadBusy`,void 0),Y([h()],$.prototype,`assistantAvatarUploadError`,void 0),Y([h()],$.prototype,`assistantAgentId`,void 0),Y([h()],$.prototype,`userName`,void 0),Y([h()],$.prototype,`userAvatar`,void 0),Y([h()],$.prototype,`localMediaPreviewRoots`,void 0),Y([h()],$.prototype,`embedSandboxMode`,void 0),Y([h()],$.prototype,`allowExternalEmbedUrls`,void 0),Y([h()],$.prototype,`chatMessageMaxWidth`,void 0),Y([h()],$.prototype,`serverVersion`,void 0),Y([h()],$.prototype,`sessionKey`,void 0),Y([h()],$.prototype,`chatLoading`,void 0),Y([h()],$.prototype,`chatSending`,void 0),Y([h()],$.prototype,`chatMessage`,void 0),Y([h()],$.prototype,`chatMessages`,void 0),Y([h()],$.prototype,`chatToolMessages`,void 0),Y([h()],$.prototype,`activityEntries`,void 0),Y([h()],$.prototype,`activityFilterText`,void 0),Y([h()],$.prototype,`activityStatusFilters`,void 0),Y([h()],$.prototype,`activityToolFilter`,void 0),Y([h()],$.prototype,`activityExpandedIds`,void 0),Y([h()],$.prototype,`activityAutoFollow`,void 0),Y([h()],$.prototype,`activityAtBottom`,void 0),Y([h()],$.prototype,`chatStreamSegments`,void 0),Y([h()],$.prototype,`chatStream`,void 0),Y([h()],$.prototype,`chatStreamStartedAt`,void 0),Y([h()],$.prototype,`chatRunId`,void 0),Y([h()],$.prototype,`chatSideResult`,void 0),Y([h()],$.prototype,`compactionStatus`,void 0),Y([h()],$.prototype,`fallbackStatus`,void 0),Y([h()],$.prototype,`chatRunStatus`,void 0),Y([h()],$.prototype,`chatAvatarUrl`,void 0),Y([h()],$.prototype,`chatAvatarSource`,void 0),Y([h()],$.prototype,`chatAvatarStatus`,void 0),Y([h()],$.prototype,`chatAvatarReason`,void 0),Y([h()],$.prototype,`chatThinkingLevel`,void 0),Y([h()],$.prototype,`chatModelOverrides`,void 0),Y([h()],$.prototype,`chatModelSwitchPromises`,void 0),Y([h()],$.prototype,`chatModelsLoading`,void 0),Y([h()],$.prototype,`chatModelCatalog`,void 0),Y([h()],$.prototype,`sessionSwitchNotice`,void 0),Y([h()],$.prototype,`sessionSwitchFlashKey`,void 0),Y([h()],$.prototype,`chatSessionPickerOpen`,void 0),Y([h()],$.prototype,`chatSessionPickerSurface`,void 0),Y([h()],$.prototype,`chatSessionPickerQuery`,void 0),Y([h()],$.prototype,`chatSessionPickerAppliedQuery`,void 0),Y([h()],$.prototype,`chatSessionPickerLoading`,void 0),Y([h()],$.prototype,`chatSessionPickerError`,void 0),Y([h()],$.prototype,`chatSessionPickerResult`,void 0),Y([h()],$.prototype,`chatQueue`,void 0),Y([h()],$.prototype,`chatQueueBySession`,void 0),Y([h()],$.prototype,`chatAttachments`,void 0),Y([h()],$.prototype,`realtimeTalkActive`,void 0),Y([h()],$.prototype,`realtimeTalkStatus`,void 0),Y([h()],$.prototype,`realtimeTalkDetail`,void 0),Y([h()],$.prototype,`realtimeTalkTranscript`,void 0),Y([h()],$.prototype,`realtimeTalkConversation`,void 0),Y([h()],$.prototype,`realtimeTalkOptionsOpen`,void 0),Y([h()],$.prototype,`realtimeTalkOptions`,void 0),Y([h()],$.prototype,`chatManualRefreshInFlight`,void 0),Y([h()],$.prototype,`chatHeaderControlsHidden`,void 0),Y([h()],$.prototype,`chatMobileControlsOpen`,void 0),Y([h()],$.prototype,`navDrawerOpen`,void 0),Y([h()],$.prototype,`chatInputHistoryIndex`,void 0),Y([h()],$.prototype,`sidebarOpen`,void 0),Y([h()],$.prototype,`sidebarContent`,void 0),Y([h()],$.prototype,`sidebarError`,void 0),Y([h()],$.prototype,`splitRatio`,void 0),Y([h()],$.prototype,`nodesLoading`,void 0),Y([h()],$.prototype,`nodes`,void 0),Y([h()],$.prototype,`devicesLoading`,void 0),Y([h()],$.prototype,`devicesError`,void 0),Y([h()],$.prototype,`devicesList`,void 0),Y([h()],$.prototype,`execApprovalsLoading`,void 0),Y([h()],$.prototype,`execApprovalsSaving`,void 0),Y([h()],$.prototype,`execApprovalsDirty`,void 0),Y([h()],$.prototype,`execApprovalsSnapshot`,void 0),Y([h()],$.prototype,`execApprovalsForm`,void 0),Y([h()],$.prototype,`execApprovalsSelectedAgent`,void 0),Y([h()],$.prototype,`execApprovalsTarget`,void 0),Y([h()],$.prototype,`execApprovalsTargetNodeId`,void 0),Y([h()],$.prototype,`execApprovalQueue`,void 0),Y([h()],$.prototype,`execApprovalBusy`,void 0),Y([h()],$.prototype,`execApprovalError`,void 0),Y([h()],$.prototype,`pendingGatewayUrl`,void 0),Y([h()],$.prototype,`configLoading`,void 0),Y([h()],$.prototype,`configRaw`,void 0),Y([h()],$.prototype,`configRawOriginal`,void 0),Y([h()],$.prototype,`configValid`,void 0),Y([h()],$.prototype,`configIssues`,void 0),Y([h()],$.prototype,`configSaving`,void 0),Y([h()],$.prototype,`configApplying`,void 0),Y([h()],$.prototype,`updateRunning`,void 0),Y([h()],$.prototype,`applySessionKey`,void 0),Y([h()],$.prototype,`configSnapshot`,void 0),Y([h()],$.prototype,`configSchema`,void 0),Y([h()],$.prototype,`configSchemaVersion`,void 0),Y([h()],$.prototype,`configSchemaLoading`,void 0),Y([h()],$.prototype,`configUiHints`,void 0),Y([h()],$.prototype,`configForm`,void 0),Y([h()],$.prototype,`configFormOriginal`,void 0),Y([h()],$.prototype,`selectedAgentId`,void 0),Y([h()],$.prototype,`dreamingStatusLoading`,void 0),Y([h()],$.prototype,`dreamingStatusError`,void 0),Y([h()],$.prototype,`dreamingStatus`,void 0),Y([h()],$.prototype,`dreamingModeSaving`,void 0),Y([h()],$.prototype,`dreamingRestartConfirmOpen`,void 0),Y([h()],$.prototype,`dreamingRestartConfirmLoading`,void 0),Y([h()],$.prototype,`dreamingPendingEnabled`,void 0),Y([h()],$.prototype,`dreamDiaryLoading`,void 0),Y([h()],$.prototype,`dreamDiaryActionLoading`,void 0),Y([h()],$.prototype,`dreamDiaryActionMessage`,void 0),Y([h()],$.prototype,`dreamDiaryActionArchivePath`,void 0),Y([h()],$.prototype,`dreamDiaryError`,void 0),Y([h()],$.prototype,`dreamDiaryPath`,void 0),Y([h()],$.prototype,`dreamDiaryContent`,void 0),Y([h()],$.prototype,`wikiImportInsightsLoading`,void 0),Y([h()],$.prototype,`wikiImportInsightsError`,void 0),Y([h()],$.prototype,`wikiImportInsights`,void 0),Y([h()],$.prototype,`wikiMemoryPalaceLoading`,void 0),Y([h()],$.prototype,`wikiMemoryPalaceError`,void 0),Y([h()],$.prototype,`wikiMemoryPalace`,void 0),Y([h()],$.prototype,`configFormDirty`,void 0),Y([h()],$.prototype,`configSettingsMode`,void 0),Y([h()],$.prototype,`configFormMode`,void 0),Y([h()],$.prototype,`configSearchQuery`,void 0),Y([h()],$.prototype,`configActiveSection`,void 0),Y([h()],$.prototype,`configActiveSubsection`,void 0),Y([h()],$.prototype,`pendingUpdateExpectedVersion`,void 0),Y([h()],$.prototype,`updateStatusBanner`,void 0),Y([h()],$.prototype,`communicationsFormMode`,void 0),Y([h()],$.prototype,`communicationsSearchQuery`,void 0),Y([h()],$.prototype,`communicationsActiveSection`,void 0),Y([h()],$.prototype,`communicationsActiveSubsection`,void 0),Y([h()],$.prototype,`appearanceFormMode`,void 0),Y([h()],$.prototype,`appearanceSearchQuery`,void 0),Y([h()],$.prototype,`appearanceActiveSection`,void 0),Y([h()],$.prototype,`appearanceActiveSubsection`,void 0),Y([h()],$.prototype,`automationFormMode`,void 0),Y([h()],$.prototype,`automationSearchQuery`,void 0),Y([h()],$.prototype,`automationActiveSection`,void 0),Y([h()],$.prototype,`automationActiveSubsection`,void 0),Y([h()],$.prototype,`infrastructureFormMode`,void 0),Y([h()],$.prototype,`infrastructureSearchQuery`,void 0),Y([h()],$.prototype,`infrastructureActiveSection`,void 0),Y([h()],$.prototype,`infrastructureActiveSubsection`,void 0),Y([h()],$.prototype,`aiAgentsFormMode`,void 0),Y([h()],$.prototype,`aiAgentsSearchQuery`,void 0),Y([h()],$.prototype,`aiAgentsActiveSection`,void 0),Y([h()],$.prototype,`aiAgentsActiveSubsection`,void 0),Y([h()],$.prototype,`channelsLoading`,void 0),Y([h()],$.prototype,`channelsSnapshot`,void 0),Y([h()],$.prototype,`channelsError`,void 0),Y([h()],$.prototype,`channelsLastSuccess`,void 0),Y([h()],$.prototype,`whatsappLoginMessage`,void 0),Y([h()],$.prototype,`whatsappLoginQrDataUrl`,void 0),Y([h()],$.prototype,`whatsappLoginConnected`,void 0),Y([h()],$.prototype,`whatsappBusy`,void 0),Y([h()],$.prototype,`nostrProfileFormState`,void 0),Y([h()],$.prototype,`nostrProfileAccountId`,void 0),Y([h()],$.prototype,`presenceLoading`,void 0),Y([h()],$.prototype,`presenceEntries`,void 0),Y([h()],$.prototype,`presenceError`,void 0),Y([h()],$.prototype,`presenceStatus`,void 0),Y([h()],$.prototype,`agentsLoading`,void 0),Y([h()],$.prototype,`agentsList`,void 0),Y([h()],$.prototype,`agentsError`,void 0),Y([h()],$.prototype,`agentsSelectedId`,void 0),Y([h()],$.prototype,`toolsCatalogLoading`,void 0),Y([h()],$.prototype,`toolsCatalogError`,void 0),Y([h()],$.prototype,`toolsCatalogResult`,void 0),Y([h()],$.prototype,`toolsEffectiveLoading`,void 0),Y([h()],$.prototype,`toolsEffectiveLoadingKey`,void 0),Y([h()],$.prototype,`toolsEffectiveResultKey`,void 0),Y([h()],$.prototype,`toolsEffectiveError`,void 0),Y([h()],$.prototype,`toolsEffectiveResult`,void 0),Y([h()],$.prototype,`agentsPanel`,void 0),Y([h()],$.prototype,`agentFilesLoading`,void 0),Y([h()],$.prototype,`agentFilesError`,void 0),Y([h()],$.prototype,`agentFilesList`,void 0),Y([h()],$.prototype,`agentFileContents`,void 0),Y([h()],$.prototype,`agentFileDrafts`,void 0),Y([h()],$.prototype,`agentFileActive`,void 0),Y([h()],$.prototype,`agentFileSaving`,void 0),Y([h()],$.prototype,`agentIdentityLoading`,void 0),Y([h()],$.prototype,`agentIdentityError`,void 0),Y([h()],$.prototype,`agentIdentityById`,void 0),Y([h()],$.prototype,`agentSkillsLoading`,void 0),Y([h()],$.prototype,`agentSkillsError`,void 0),Y([h()],$.prototype,`agentSkillsReport`,void 0),Y([h()],$.prototype,`agentSkillsAgentId`,void 0),Y([h()],$.prototype,`sessionsLoading`,void 0),Y([h()],$.prototype,`sessionsResult`,void 0),Y([h()],$.prototype,`sessionsError`,void 0),Y([h()],$.prototype,`sessionsFilterActive`,void 0),Y([h()],$.prototype,`sessionsFilterLimit`,void 0),Y([h()],$.prototype,`sessionsIncludeGlobal`,void 0),Y([h()],$.prototype,`sessionsIncludeUnknown`,void 0),Y([h()],$.prototype,`sessionsShowArchived`,void 0),Y([h()],$.prototype,`sessionsFiltersCollapsed`,void 0),Y([h()],$.prototype,`sessionsHideCron`,void 0),Y([h()],$.prototype,`sessionsSearchQuery`,void 0),Y([h()],$.prototype,`sessionsSortColumn`,void 0),Y([h()],$.prototype,`sessionsSortDir`,void 0),Y([h()],$.prototype,`sessionsPage`,void 0),Y([h()],$.prototype,`sessionsPageSize`,void 0),Y([h()],$.prototype,`sessionsSelectedKeys`,void 0),Y([h()],$.prototype,`sessionsExpandedCheckpointKey`,void 0),Y([h()],$.prototype,`sessionsCheckpointItemsByKey`,void 0),Y([h()],$.prototype,`sessionsCheckpointLoadingKey`,void 0),Y([h()],$.prototype,`sessionsCheckpointBusyKey`,void 0),Y([h()],$.prototype,`sessionsCheckpointErrorByKey`,void 0),Y([h()],$.prototype,`usageLoading`,void 0),Y([h()],$.prototype,`usageResult`,void 0),Y([h()],$.prototype,`usageCostSummary`,void 0),Y([h()],$.prototype,`usageError`,void 0),Y([h()],$.prototype,`usageStartDate`,void 0),Y([h()],$.prototype,`usageEndDate`,void 0),Y([h()],$.prototype,`usageScope`,void 0),Y([h()],$.prototype,`usageAgentId`,void 0),Y([h()],$.prototype,`usageSelectedSessions`,void 0),Y([h()],$.prototype,`usageSelectedDays`,void 0),Y([h()],$.prototype,`usageSelectedHours`,void 0),Y([h()],$.prototype,`usageChartMode`,void 0),Y([h()],$.prototype,`usageDailyChartMode`,void 0),Y([h()],$.prototype,`usageTimeSeriesMode`,void 0),Y([h()],$.prototype,`usageTimeSeriesBreakdownMode`,void 0),Y([h()],$.prototype,`usageTimeSeries`,void 0),Y([h()],$.prototype,`usageTimeSeriesLoading`,void 0),Y([h()],$.prototype,`usageTimeSeriesCursorStart`,void 0),Y([h()],$.prototype,`usageTimeSeriesCursorEnd`,void 0),Y([h()],$.prototype,`usageSessionLogs`,void 0),Y([h()],$.prototype,`usageSessionLogsLoading`,void 0),Y([h()],$.prototype,`usageSessionLogsExpanded`,void 0),Y([h()],$.prototype,`usageQuery`,void 0),Y([h()],$.prototype,`usageQueryDraft`,void 0),Y([h()],$.prototype,`usageSessionSort`,void 0),Y([h()],$.prototype,`usageSessionSortDir`,void 0),Y([h()],$.prototype,`usageRecentSessions`,void 0),Y([h()],$.prototype,`usageTimeZone`,void 0),Y([h()],$.prototype,`usageContextExpanded`,void 0),Y([h()],$.prototype,`usageHeaderPinned`,void 0),Y([h()],$.prototype,`usageSessionsTab`,void 0),Y([h()],$.prototype,`usageVisibleColumns`,void 0),Y([h()],$.prototype,`usageLogFilterRoles`,void 0),Y([h()],$.prototype,`usageLogFilterTools`,void 0),Y([h()],$.prototype,`usageLogFilterHasTools`,void 0),Y([h()],$.prototype,`usageLogFilterQuery`,void 0),Y([h()],$.prototype,`cronLoading`,void 0),Y([h()],$.prototype,`cronQuickCreateOpen`,void 0),Y([h()],$.prototype,`cronQuickCreateStep`,void 0),Y([h()],$.prototype,`cronQuickCreateDraft`,void 0),Y([h()],$.prototype,`cronJobsLoadingMore`,void 0),Y([h()],$.prototype,`cronJobs`,void 0),Y([h()],$.prototype,`cronJobsTotal`,void 0),Y([h()],$.prototype,`cronJobsHasMore`,void 0),Y([h()],$.prototype,`cronJobsNextOffset`,void 0),Y([h()],$.prototype,`cronJobsLimit`,void 0),Y([h()],$.prototype,`cronJobsQuery`,void 0),Y([h()],$.prototype,`cronJobsEnabledFilter`,void 0),Y([h()],$.prototype,`cronJobsScheduleKindFilter`,void 0),Y([h()],$.prototype,`cronJobsLastStatusFilter`,void 0),Y([h()],$.prototype,`cronJobsSortBy`,void 0),Y([h()],$.prototype,`cronJobsSortDir`,void 0),Y([h()],$.prototype,`cronStatus`,void 0),Y([h()],$.prototype,`cronError`,void 0),Y([h()],$.prototype,`cronForm`,void 0),Y([h()],$.prototype,`cronFormCollapsed`,void 0),Y([h()],$.prototype,`cronFieldErrors`,void 0),Y([h()],$.prototype,`cronEditingJobId`,void 0),Y([h()],$.prototype,`cronRunsJobId`,void 0),Y([h()],$.prototype,`cronRunsLoadingMore`,void 0),Y([h()],$.prototype,`cronRuns`,void 0),Y([h()],$.prototype,`cronRunsTotal`,void 0),Y([h()],$.prototype,`cronRunsHasMore`,void 0),Y([h()],$.prototype,`cronRunsNextOffset`,void 0),Y([h()],$.prototype,`cronRunsLimit`,void 0),Y([h()],$.prototype,`cronRunsScope`,void 0),Y([h()],$.prototype,`cronRunsStatuses`,void 0),Y([h()],$.prototype,`cronRunsDeliveryStatuses`,void 0),Y([h()],$.prototype,`cronRunsStatusFilter`,void 0),Y([h()],$.prototype,`cronRunsQuery`,void 0),Y([h()],$.prototype,`cronRunsSortDir`,void 0),Y([h()],$.prototype,`cronModelSuggestions`,void 0),Y([h()],$.prototype,`cronBusy`,void 0),Y([h()],$.prototype,`updateAvailable`,void 0),Y([h()],$.prototype,`attentionItems`,void 0),Y([h()],$.prototype,`paletteOpen`,void 0),Y([h()],$.prototype,`paletteQuery`,void 0),Y([h()],$.prototype,`paletteActiveIndex`,void 0),Y([h()],$.prototype,`overviewShowGatewayToken`,void 0),Y([h()],$.prototype,`overviewShowGatewayPassword`,void 0),Y([h()],$.prototype,`overviewLogLines`,void 0),Y([h()],$.prototype,`overviewLogCursor`,void 0),Y([h()],$.prototype,`skillsLoading`,void 0),Y([h()],$.prototype,`skillsReport`,void 0),Y([h()],$.prototype,`skillsError`,void 0),Y([h()],$.prototype,`skillsFilter`,void 0),Y([h()],$.prototype,`skillsStatusFilter`,void 0),Y([h()],$.prototype,`skillEdits`,void 0),Y([h()],$.prototype,`skillsBusyKey`,void 0),Y([h()],$.prototype,`skillMessages`,void 0),Y([h()],$.prototype,`skillsDetailKey`,void 0),Y([h()],$.prototype,`skillsDetailTab`,void 0),Y([h()],$.prototype,`clawhubSearchQuery`,void 0),Y([h()],$.prototype,`clawhubSearchResults`,void 0),Y([h()],$.prototype,`clawhubSearchLoading`,void 0),Y([h()],$.prototype,`clawhubSearchError`,void 0),Y([h()],$.prototype,`clawhubDetail`,void 0),Y([h()],$.prototype,`clawhubDetailSlug`,void 0),Y([h()],$.prototype,`clawhubDetailLoading`,void 0),Y([h()],$.prototype,`clawhubDetailError`,void 0),Y([h()],$.prototype,`clawhubInstallSlug`,void 0),Y([h()],$.prototype,`clawhubInstallMessage`,void 0),Y([h()],$.prototype,`clawhubVerdicts`,void 0),Y([h()],$.prototype,`clawhubVerdictsLoading`,void 0),Y([h()],$.prototype,`clawhubVerdictsError`,void 0),Y([h()],$.prototype,`skillCardContents`,void 0),Y([h()],$.prototype,`skillCardContentKeys`,void 0),Y([h()],$.prototype,`skillCardLoadingKey`,void 0),Y([h()],$.prototype,`skillCardErrors`,void 0),Y([h()],$.prototype,`skillWorkshopLoading`,void 0),Y([h()],$.prototype,`skillWorkshopLoaded`,void 0),Y([h()],$.prototype,`skillWorkshopError`,void 0),Y([h()],$.prototype,`skillWorkshopInspectingKey`,void 0),Y([h()],$.prototype,`skillWorkshopProposals`,void 0),Y([h()],$.prototype,`skillWorkshopSelectedKey`,void 0),Y([h()],$.prototype,`skillWorkshopActionBusy`,void 0),Y([h()],$.prototype,`skillWorkshopActionNotice`,void 0),Y([h()],$.prototype,`skillWorkshopRevisionKey`,void 0),Y([h()],$.prototype,`skillWorkshopRevisionDraft`,void 0),Y([h()],$.prototype,`skillWorkshopStatusFilter`,void 0),Y([h()],$.prototype,`skillWorkshopQuery`,void 0),Y([h()],$.prototype,`skillWorkshopFilePreviewKey`,void 0),Y([h()],$.prototype,`skillWorkshopFilePreviewQuery`,void 0),Y([h()],$.prototype,`skillWorkshopQueueWidth`,void 0),Y([h()],$.prototype,`skillWorkshopMode`,void 0),Y([h()],$.prototype,`healthLoading`,void 0),Y([h()],$.prototype,`healthResult`,void 0),Y([h()],$.prototype,`healthError`,void 0),Y([h()],$.prototype,`modelAuthStatusLoading`,void 0),Y([h()],$.prototype,`modelAuthStatusResult`,void 0),Y([h()],$.prototype,`modelAuthStatusError`,void 0),Y([h()],$.prototype,`debugLoading`,void 0),Y([h()],$.prototype,`debugStatus`,void 0),Y([h()],$.prototype,`debugHealth`,void 0),Y([h()],$.prototype,`debugModels`,void 0),Y([h()],$.prototype,`debugHeartbeat`,void 0),Y([h()],$.prototype,`debugCallMethod`,void 0),Y([h()],$.prototype,`debugCallParams`,void 0),Y([h()],$.prototype,`debugCallResult`,void 0),Y([h()],$.prototype,`debugCallError`,void 0),Y([h()],$.prototype,`webPushSupported`,void 0),Y([h()],$.prototype,`webPushPermission`,void 0),Y([h()],$.prototype,`webPushSubscribed`,void 0),Y([h()],$.prototype,`webPushLoading`,void 0),Y([h()],$.prototype,`logsLoading`,void 0),Y([h()],$.prototype,`logsError`,void 0),Y([h()],$.prototype,`logsFile`,void 0),Y([h()],$.prototype,`logsEntries`,void 0),Y([h()],$.prototype,`logsFilterText`,void 0),Y([h()],$.prototype,`logsLevelFilters`,void 0),Y([h()],$.prototype,`logsAutoFollow`,void 0),Y([h()],$.prototype,`logsTruncated`,void 0),Y([h()],$.prototype,`logsCursor`,void 0),Y([h()],$.prototype,`logsLastFetchAt`,void 0),Y([h()],$.prototype,`logsLimit`,void 0),Y([h()],$.prototype,`logsMaxBytes`,void 0),Y([h()],$.prototype,`logsAtBottom`,void 0),Y([h()],$.prototype,`chatNewMessagesBelow`,void 0),customElements.get(`openclaw-app`)||customElements.define(`openclaw-app`,$),Tq(),`serviceWorker`in navigator){let e=new URL(Va(`sw.js`),window.location.origin);e.searchParams.set(`v`,`2026.6.3-ff8762d12612`),navigator.serviceWorker.register(e,{updateViaCache:`none`})}function Tq(){Eq(`link[rel="icon"][type="image/svg+xml"]`,`favicon.svg`),Eq(`link[rel="icon"][type="image/png"]`,`favicon-32.png`),Eq(`link[rel="apple-touch-icon"]`,`apple-touch-icon.png`),Eq(`link[rel="manifest"]`,`manifest.webmanifest`)}function Eq(e,t){let n=document.querySelector(e);n&&(n.href=Va(t))}export{Eo as $,VT as A,fl as B,KT as C,Hw as D,ST as E,Kb as F,Fs as G,ll as H,Wb as I,Ms as J,Ns as K,xf as L,aE as M,zT as N,uT as O,dC as P,oo as Q,ml as R,WT as S,pT as T,dl as U,pl as V,yl as W,co as X,ao as Y,So as Z,wj as _,xe as _t,AW as a,lo as at,HT as b,kV as c,po as ct,WL as d,Ka as dt,Do as et,HL as f,da as ft,jj as g,lt as gt,DN as h,N as ht,MW as i,so as it,iE as j,UT as k,dV as l,Oo as lt,ON as m,kr as mt,PW as n,fo as nt,kW as o,mo as ot,Y as p,Hi as pt,Ps as q,NW as r,bo as rt,jW as s,uo as st,FW as t,Ja as tt,UL as u,qa as ut,q as v,we as vt,oE as w,GT as x,bw as y,Ce as yt,ul as z};
|
|
6345
|
+
//# sourceMappingURL=index-D1Qre842.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{m as e,p as t}from"./lit-runtime-BImxIzGR.js";import{o as n}from"./string-coerce-CsmDCXq_.js";import{o as r,v as i}from"./index-
|
|
1
|
+
import{m as e,p as t}from"./lit-runtime-BImxIzGR.js";import{o as n}from"./string-coerce-CsmDCXq_.js";import{o as r,v as i}from"./index-D1Qre842.js";var a=!1;function o(r){let o=!a;return e`
|
|
2
2
|
<section class="card">
|
|
3
3
|
<div class="row" style="justify-content: space-between;">
|
|
4
4
|
<div>
|
|
@@ -54,4 +54,4 @@ import{m as e,p as t}from"./lit-runtime-BImxIzGR.js";import{o as n}from"./string
|
|
|
54
54
|
</div>
|
|
55
55
|
</div>
|
|
56
56
|
`}export{o as renderInstances};
|
|
57
|
-
//# sourceMappingURL=instances-
|
|
57
|
+
//# sourceMappingURL=instances-izquLPnA.js.map
|