@lawpath-tech/openclaw 2026.2.21-10 → 2026.2.21-12
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/dist/{agents-XFUpnhyw.js → agents-Acsw6oEr.js} +4 -4
- package/dist/{agents.config-DjELUleJ.js → agents.config-BAILtL0e.js} +1 -1
- package/dist/{agents.config-CTbtf-Et.js → agents.config-DA4Kt9C5.js} +1 -1
- package/dist/{audio-preflight-Bqg8wRF0.js → audio-preflight-BnwMjf3g.js} +3 -3
- package/dist/{audio-preflight-0nE4BIvV.js → audio-preflight-C56sndLt.js} +4 -4
- package/dist/{audio-preflight-DUN77LMG.js → audio-preflight-DTxmK1ti.js} +3 -3
- package/dist/{audio-preflight-DESlWRvS.js → audio-preflight-UmMU18Rf.js} +3 -3
- package/dist/{auth-choice-C-VbNMFC.js → auth-choice-B0ExtimG.js} +1 -1
- package/dist/{auth-choice-Ce5ZhgZB.js → auth-choice-Cc9nPCSG.js} +1 -1
- package/dist/{banner-BO0EC6gi.js → banner-l8hdGVT6.js} +1 -1
- package/dist/build-info.json +3 -3
- package/dist/bundled/boot-md/handler.js +5 -5
- package/dist/bundled/session-memory/handler.js +5 -5
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/{channel-options-Dnl_ON0t.js → channel-options-BOgY_qkz.js} +1 -1
- package/dist/{channel-options-CJ562Awb.js → channel-options-DU0lH77F.js} +1 -1
- package/dist/{channel-web-C6by66Ik.js → channel-web-Bn_o0ClJ.js} +2 -2
- package/dist/{channels-cli-DmemjJTj.js → channels-cli-B8iPHVyY.js} +8 -8
- package/dist/{channels-cli-CX3e33oJ.js → channels-cli-HyoLT0X_.js} +8 -8
- package/dist/{chrome-Cag1SQQf.js → chrome-EGHj-WC_.js} +7 -7
- package/dist/{cli-CZYqgXep.js → cli-BjW27QBR.js} +5 -5
- package/dist/{cli-C-oUtdv5.js → cli-CB8wKUFa.js} +5 -5
- package/dist/{command-registry-DPgcpkAs.js → command-registry-hszLgVfh.js} +9 -9
- package/dist/{completion-cli-BIW77wm1.js → completion-cli-BTOzPrOy.js} +2 -2
- package/dist/{completion-cli-B8nHppfQ.js → completion-cli-jFF5jQZF.js} +1 -1
- package/dist/{config-cli-DLSqMYRk.js → config-cli-CV3y1IAq.js} +1 -1
- package/dist/{config-cli-DF3Frhtb.js → config-cli-Cuv_T0Jj.js} +1 -1
- package/dist/{configure-DIlxSV4l.js → configure-80FWz9jT.js} +3 -3
- package/dist/{configure-ku8C0kaJ.js → configure-BHGABgNw.js} +3 -3
- package/dist/control-ui/assets/{index-Cx1_w3YP.js → index-BfDl8X4O.js} +2 -2
- package/dist/control-ui/assets/index-BfDl8X4O.js.map +1 -0
- package/dist/control-ui/index.html +1 -1
- package/dist/{deliver-D3HyJhTX.js → deliver-B1Ddgm7X.js} +11 -6
- package/dist/{deliver-CX6Se-jI.js → deliver-BLkQFTzD.js} +11 -6
- package/dist/{deliver-Ct_AlJg5.js → deliver-J2cVd3TS.js} +11 -6
- package/dist/{deliver-BAjdrEoI.js → deliver-meQdcFaA.js} +11 -6
- package/dist/{doctor-completion-Dqrz2Mxm.js → doctor-completion-BSCz_dGZ.js} +1 -1
- package/dist/{doctor-completion-BpvOQ6nZ.js → doctor-completion-DGHNIbJN.js} +1 -1
- package/dist/entry.js +1 -1
- package/dist/extensionAPI.js +6 -6
- package/dist/{gateway-cli-eWm9cU71.js → gateway-cli-DYYSJuSK.js} +13 -13
- package/dist/{gateway-cli-DbV5glYW.js → gateway-cli-gLp4lZSu.js} +13 -13
- package/dist/{health-DxhXaHDj.js → health-BfWYn33I.js} +2 -2
- package/dist/{health-TlGblGrz.js → health-DEibfTDK.js} +2 -2
- package/dist/{hooks-cli-DN_-ZC-d.js → hooks-cli-D-nL8J6w.js} +6 -6
- package/dist/{hooks-cli-CNBIyMVL.js → hooks-cli-wQnxbc8T.js} +6 -6
- package/dist/{image-D-DzmVjC.js → image-BZOs5dHY.js} +2 -2
- package/dist/{image-CvBYo9Bu.js → image-C8HOu4vb.js} +2 -2
- package/dist/{image-paXd6zl5.js → image-Cj9tfO74.js} +2 -2
- package/dist/{image-Cgalj9ct.js → image-DuT8yGCI.js} +2 -2
- package/dist/index.js +10 -10
- package/dist/llm-slug-generator.js +5 -5
- package/dist/{models-CSk9HAo_.js → models-DFRcZ415.js} +2 -2
- package/dist/{models-cli-Cw6yV7Hw.js → models-cli-CwEUrjU_.js} +7 -7
- package/dist/{models-cli-DDUpEy7b.js → models-cli-t1rYl_DG.js} +6 -6
- package/dist/{onboard-BHWdJtCd.js → onboard-8PGPC4o-.js} +2 -2
- package/dist/{onboard-B-sVSXzj.js → onboard-XsnXtjOy.js} +2 -2
- package/dist/{onboard-channels-BCAVs_mB.js → onboard-channels-Cb8T_ers.js} +1 -1
- package/dist/{onboard-channels-CWxLkkUp.js → onboard-channels-vQihczqp.js} +1 -1
- package/dist/{onboarding-BRNVJxT8.js → onboarding-C_807D1O.js} +3 -3
- package/dist/{onboarding-BoSfn2h0.js → onboarding-EwJ1WIut.js} +3 -3
- package/dist/{onboarding.finalize-Uy8WceA5.js → onboarding.finalize-Crpg17t7.js} +10 -10
- package/dist/{onboarding.finalize-D1hu4S6g.js → onboarding.finalize-DWFR8IbD.js} +11 -11
- package/dist/{pi-embedded-CZT36FAl.js → pi-embedded-Be34NhAY.js} +29 -12
- package/dist/{pi-embedded-1isHWl0U.js → pi-embedded-BywyyGi2.js} +34 -17
- package/dist/{pi-embedded-helpers-ISSMvBMe.js → pi-embedded-helpers-BVCPWN6Q.js} +40 -8
- package/dist/{pi-embedded-helpers-Cx3WmubG.js → pi-embedded-helpers-C4Annkh_.js} +40 -8
- package/dist/{pi-embedded-helpers-DOmGm3QX.js → pi-embedded-helpers-C_U_c_EU.js} +40 -8
- package/dist/{pi-embedded-helpers-DWuT7Pe9.js → pi-embedded-helpers-Dl_FdUMU.js} +44 -12
- package/dist/{plugin-registry-CGpIcEOM.js → plugin-registry-BrN1y1ig.js} +1 -1
- package/dist/{plugin-registry-qgZzbjWa.js → plugin-registry-CtLhKV8N.js} +1 -1
- package/dist/plugin-sdk/{accounts-DUBJHEgi.js → accounts-BcQo4OUu.js} +1 -1
- package/dist/plugin-sdk/{accounts-wSu5JyDM.js → accounts-DEsAwvaZ.js} +1 -1
- package/dist/plugin-sdk/{accounts-Ciwy7Yxd.js → accounts-fnLsjAOi.js} +3 -3
- package/dist/plugin-sdk/{active-listener-Bnau4oiu.js → active-listener-CeaKSm29.js} +1 -1
- package/dist/plugin-sdk/{agent-scope-j9eoKDzr.js → agent-scope-DnU66cJq.js} +2 -2
- package/dist/plugin-sdk/agents/pi-embedded-helpers/errors.d.ts +1 -0
- package/dist/plugin-sdk/{api-key-rotation-BKOzXMVg.js → api-key-rotation-DRhVpAS4.js} +1 -1
- package/dist/plugin-sdk/{audio-preflight-BWBtA5BS.js → audio-preflight-zFFuY6Bd.js} +24 -24
- package/dist/plugin-sdk/auto-reply/reply/reply-dispatcher.d.ts +1 -0
- package/dist/plugin-sdk/{bindings-BxwR115d.js → bindings-HAeLX6mi.js} +2 -2
- package/dist/plugin-sdk/{channel-activity-CCnr-9bS.js → channel-activity-WgE8Z4Bb.js} +1 -1
- package/dist/plugin-sdk/{channel-web-C6_SUXeh.js → channel-web-DfA1sgI9.js} +22 -22
- package/dist/plugin-sdk/{chrome-CAPUVzg9.js → chrome-NvVwZ3Xn.js} +3 -3
- package/dist/plugin-sdk/{chunk-DyzO7IVo.js → chunk-CQk9vawA.js} +1 -1
- package/dist/plugin-sdk/{command-format-DcBXOX9Z.js → command-format-DHXa0Clc.js} +1 -1
- package/dist/plugin-sdk/{commands-registry-C-WjNyFR.js → commands-registry-C0vBsgUy.js} +4 -4
- package/dist/plugin-sdk/{config-DxWaFEai.js → config-C1a-yGCa.js} +9 -9
- package/dist/plugin-sdk/{deliver-C9FGk-m8.js → deliver-D4QMj1KQ.js} +20 -15
- package/dist/plugin-sdk/{diagnostic-DKyVS3IK.js → diagnostic-Up1aMyxZ.js} +1 -1
- package/dist/plugin-sdk/{image-DiGppfRt.js → image-Bu6pmW6i.js} +5 -5
- package/dist/plugin-sdk/{image-ops-Bjog8bLM.js → image-ops-6S8Fa1d6.js} +1 -1
- package/dist/plugin-sdk/index.js +53 -53
- package/dist/plugin-sdk/{ir-98uc6iQ2.js → ir-yosTlCQ0.js} +4 -4
- package/dist/plugin-sdk/{local-roots-9jdLho_V.js → local-roots-CW6TWE2a.js} +3 -3
- package/dist/plugin-sdk/{login-DTf65Ckq.js → login-CkOX36_Y.js} +7 -7
- package/dist/plugin-sdk/{login-qr-CRlrA1Km.js → login-qr-DyxTgmGK.js} +9 -9
- package/dist/plugin-sdk/{manager-B44bHk5P.js → manager-CtapJqej.js} +8 -8
- package/dist/plugin-sdk/{manifest-registry-sgHvjA6E.js → manifest-registry-DvEm2HHf.js} +1 -1
- package/dist/plugin-sdk/{markdown-tables-DV9FqwR1.js → markdown-tables-OYHjLFmr.js} +1 -1
- package/dist/plugin-sdk/{message-channel-DmB4bGFh.js → message-channel-DY9wVB2A.js} +1 -1
- package/dist/plugin-sdk/{model-selection-BALQkWtM.js → model-selection-TMsqRl-p.js} +4 -4
- package/dist/plugin-sdk/{outbound-CjucU9tz.js → outbound-Cs6LZhj-.js} +7 -7
- package/dist/plugin-sdk/{outbound-attachment-BGKevRhJ.js → outbound-attachment-C1DtqQQb.js} +2 -2
- package/dist/plugin-sdk/{pi-auth-json-CYvT0sDr.js → pi-auth-json-Dpj7O31p.js} +5 -5
- package/dist/plugin-sdk/{pi-embedded-helpers-BMLQ8noc.js → pi-embedded-helpers-DBCtPcLq.js} +57 -25
- package/dist/plugin-sdk/{plugins-DwNa_Bjz.js → plugins-BizZYn_y.js} +4 -4
- package/dist/plugin-sdk/{pw-ai-mUE_oZph.js → pw-ai-CtYVo9Ju.js} +8 -8
- package/dist/plugin-sdk/{qmd-manager-CxvLwD3u.js → qmd-manager-qSSWvVwi.js} +4 -4
- package/dist/plugin-sdk/{registry-O1yza0Vh.js → registry-DL-33c9X.js} +2 -2
- package/dist/plugin-sdk/{replies-BLJ6SuWd.js → replies-YDjHVGij.js} +3 -3
- package/dist/plugin-sdk/{reply-Fe-yY6qo.js → reply-Dl9JHnGW.js} +96 -79
- package/dist/plugin-sdk/{reply-prefix-Ohtg483v.js → reply-prefix-DNmkrWtV.js} +1 -1
- package/dist/plugin-sdk/{resolve-outbound-target-vib4nnNx.js → resolve-outbound-target-DCb1ht31.js} +2 -2
- package/dist/plugin-sdk/{resolve-route-DM-CdB9Z.js → resolve-route-BDLDhEh_.js} +3 -3
- package/dist/plugin-sdk/{retry-JFNwfUew.js → retry-5P3d0rYw.js} +1 -1
- package/dist/plugin-sdk/{runner-CCzW7WWc.js → runner-DvYaPG7_.js} +9 -9
- package/dist/plugin-sdk/{send-C-9MUMZ2.js → send-3DmbiJfM.js} +6 -6
- package/dist/plugin-sdk/{send-D4OqVuu3.js → send-BsKrW0Xh.js} +6 -6
- package/dist/plugin-sdk/{send-DQL4fKTV.js → send-CNMXFSjB.js} +10 -10
- package/dist/plugin-sdk/{send-CAhPO5Zx.js → send-DU1Pnsmd.js} +7 -7
- package/dist/plugin-sdk/{send-BzXVnK8V.js → send-DZQYUVIY.js} +10 -10
- package/dist/plugin-sdk/{session-B-KGD6AG.js → session-D38ojZ3_.js} +4 -4
- package/dist/plugin-sdk/{skill-commands-DzurlBtL.js → skill-commands-D7degVS7.js} +5 -5
- package/dist/plugin-sdk/{skills-aG_v8SgP.js → skills-DBG2n4rQ.js} +7 -7
- package/dist/plugin-sdk/slack/monitor/context.d.ts +1 -0
- package/dist/plugin-sdk/{sqlite-DUu0dwic.js → sqlite-ulpcowfN.js} +1 -1
- package/dist/plugin-sdk/{store-gutZwMLb.js → store-CMGBlFGX.js} +2 -2
- package/dist/plugin-sdk/{subsystem-C4Rh0kdL.js → subsystem-C9WnrKN8.js} +1 -1
- package/dist/plugin-sdk/{tables-DhuVe5ji.js → tables-DzujD35V.js} +1 -1
- package/dist/plugin-sdk/{target-errors-2VrFN2Zl.js → target-errors-KOPdGMxQ.js} +2 -2
- package/dist/plugin-sdk/{thinking-DK3F1Tth.js → thinking-BiNjzudU.js} +5 -5
- package/dist/plugin-sdk/{tokens-K9ITCatc.js → tokens-2475WU2Z.js} +1 -1
- package/dist/plugin-sdk/{tool-images-Bu_rB65-.js → tool-images-BlYojiWx.js} +2 -2
- package/dist/plugin-sdk/{tool-loop-detection-BBRtoox8.js → tool-loop-detection-D0ADW0h2.js} +2 -2
- package/dist/plugin-sdk/web-BFEz8bk-.js +65 -0
- package/dist/plugin-sdk/{whatsapp-actions-DfsMoZFo.js → whatsapp-actions-Bffbt65T.js} +21 -21
- package/dist/{plugins-cli-DjCM2809.js → plugins-cli-ByB9fyeR.js} +6 -6
- package/dist/{plugins-cli-CTlSXbxE.js → plugins-cli-CP_m4f99.js} +6 -6
- package/dist/{program-lAdk-rjf.js → program-DlspJVqc.js} +11 -11
- package/dist/{program-context-DvlZb8HS.js → program-context-CpcNVMdA.js} +18 -18
- package/dist/{prompt-select-styled-Ct2adJGY.js → prompt-select-styled-CWRcbfIK.js} +4 -4
- package/dist/{prompt-select-styled-BR9UJTaa.js → prompt-select-styled-DHXAx5uX.js} +4 -4
- package/dist/{provider-auth-helpers-B7pkCdJK.js → provider-auth-helpers-AORB3hk9.js} +1 -1
- package/dist/{provider-auth-helpers-B22yzT-e.js → provider-auth-helpers-TZ3D-fXq.js} +1 -1
- package/dist/{push-apns-CA7elLw_.js → push-apns-BTcu7pip.js} +1 -1
- package/dist/{push-apns-BLrPdufQ.js → push-apns-CSSSwhDY.js} +1 -1
- package/dist/{pw-ai-Bib1qJp-.js → pw-ai-Cs2YQmkQ.js} +1 -1
- package/dist/{register.agent-DWWw3Tcp.js → register.agent-C4G2zuxZ.js} +9 -9
- package/dist/{register.agent-DnXXai-R.js → register.agent-xMmK5W-R.js} +10 -10
- package/dist/{register.configure-wl-tJn4s.js → register.configure-CeFYJnjt.js} +10 -10
- package/dist/{register.configure-DzpjSPql.js → register.configure-aXmgTNuB.js} +10 -10
- package/dist/{register.maintenance-BkvduEtB.js → register.maintenance-B_bQy-mZ.js} +11 -11
- package/dist/{register.maintenance-B7aWrfAO.js → register.maintenance-CWHUzso3.js} +12 -12
- package/dist/{register.message-DooMLu1o.js → register.message-42he49is.js} +6 -6
- package/dist/{register.message-CL812HS5.js → register.message-Cx6UTHOb.js} +6 -6
- package/dist/{register.onboard-DkQtlTNE.js → register.onboard-BmtcBw-6.js} +8 -8
- package/dist/{register.onboard-C6f5DRg1.js → register.onboard-C9pozCFG.js} +8 -8
- package/dist/{register.setup-9RQgdDUL.js → register.setup-C4TWvr5B.js} +8 -8
- package/dist/{register.setup-zBBsTx7h.js → register.setup-C54kkyhM.js} +8 -8
- package/dist/{register.status-health-sessions-hl3bzjXd.js → register.status-health-sessions-DHHGaJsX.js} +7 -7
- package/dist/{register.status-health-sessions-DLETokGZ.js → register.status-health-sessions-DNqvYowR.js} +7 -7
- package/dist/{register.subclis-DJkdsClC.js → register.subclis-m5WJHhwT.js} +10 -10
- package/dist/{reply-B4tyXo72.js → reply-V8UXM1XU.js} +29 -12
- package/dist/{run-main-C1xUseJS.js → run-main-Djlctozd.js} +18 -18
- package/dist/{runner-B9g6ervv.js → runner-BMHyFfIL.js} +1 -1
- package/dist/{runner-Be7-7BcC.js → runner-CbkB3vpb.js} +1 -1
- package/dist/{runner-BIWQkeih.js → runner-DkWpm1Ly.js} +1 -1
- package/dist/{runner-U_c8SvOa.js → runner-DzmbTP-U.js} +1 -1
- package/dist/{server-node-events-CXomRKtF.js → server-node-events-D5Fen-q2.js} +6 -6
- package/dist/{server-node-events-CRVgNQ0_.js → server-node-events-Dm6MSKk0.js} +6 -6
- package/dist/{session-dirs-2TEacrvL.js → session-dirs-BmVdF2KM.js} +1 -1
- package/dist/{session-dirs-C7dOvbkp.js → session-dirs-CRnGB63U.js} +1 -1
- package/dist/{status-BlmQ68Lr.js → status-2w8d47j-.js} +2 -2
- package/dist/{status-BjUudjm_.js → status-Bi_g-8aS.js} +1 -1
- package/dist/{status-Cd-_yawg.js → status-BjjDHl4v.js} +1 -1
- package/dist/{status-CDINUwpc.js → status-DQEnKbht.js} +2 -2
- package/dist/{subagent-registry-CWSe1lKN.js → subagent-registry-DGNGenUN.js} +29 -12
- package/dist/{tui-C8TIc36Z.js → tui-BPSckkGa.js} +1 -1
- package/dist/{tui-dDj0kI9K.js → tui-Dn3NzP7B.js} +1 -1
- package/dist/{tui-cli-B1R2UxjK.js → tui-cli-DYhd0RT6.js} +2 -2
- package/dist/{tui-cli-DXNQuXf_.js → tui-cli-Dscc8usx.js} +2 -2
- package/dist/{update-cli-HS6kiKIK.js → update-cli-BQIIdEwf.js} +11 -11
- package/dist/{update-cli-BUIB_VFr.js → update-cli-C-xMtbk9.js} +12 -12
- package/dist/{web-CO5qanzX.js → web-CIdW3A5E.js} +5 -5
- package/dist/{web-Cz_gOgql.js → web-Ciz1i7yI.js} +6 -6
- package/dist/{web-CmGHJmHB.js → web-H55ayBNa.js} +5 -5
- package/dist/{web-0-iNcZsR.js → web-aUEiU7C4.js} +6 -6
- package/package.json +1 -1
- package/dist/control-ui/assets/index-Cx1_w3YP.js.map +0 -1
- package/dist/plugin-sdk/web-DbHQRXHi.js +0 -65
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-Cbj13DAv.js";
|
|
2
2
|
import { Yt as resolveStateDir, l as routeLogsToStderr, nt as pathExists } from "./entry.js";
|
|
3
|
-
import { n as getSubCliEntries, r as registerSubCliByName } from "./register.subclis-
|
|
4
|
-
import { i as registerCoreCliByName, n as getCoreCliCommandNames } from "./command-registry-
|
|
3
|
+
import { n as getSubCliEntries, r as registerSubCliByName } from "./register.subclis-m5WJHhwT.js";
|
|
4
|
+
import { i as registerCoreCliByName, n as getCoreCliCommandNames } from "./command-registry-hszLgVfh.js";
|
|
5
5
|
import { t as getProgramContext } from "./program-context-5q-A0wbP.js";
|
|
6
6
|
import os from "node:os";
|
|
7
7
|
import path from "node:path";
|
|
@@ -2,7 +2,7 @@ import { t as __exportAll } from "./rolldown-runtime-Cbj13DAv.js";
|
|
|
2
2
|
import { g as resolveStateDir } from "./paths-B4BZAPZh.js";
|
|
3
3
|
import { h as pathExists } from "./utils-BlC2Fskb.js";
|
|
4
4
|
import { i as routeLogsToStderr } from "./subsystem-8bY95KEB.js";
|
|
5
|
-
import { a as registerCoreCliByName, c as getSubCliEntries, l as registerSubCliByName, r as getCoreCliCommandNames, t as getProgramContext } from "./program-context-
|
|
5
|
+
import { a as registerCoreCliByName, c as getSubCliEntries, l as registerSubCliByName, r as getCoreCliCommandNames, t as getProgramContext } from "./program-context-CpcNVMdA.js";
|
|
6
6
|
import os from "node:os";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import fs from "node:fs/promises";
|
|
@@ -201,7 +201,7 @@ async function runConfigUnset(opts) {
|
|
|
201
201
|
}
|
|
202
202
|
function registerConfigCli(program) {
|
|
203
203
|
const cmd = program.command("config").description("Non-interactive config helpers (get/set/unset). Run without subcommand for the setup wizard.").addHelpText("after", () => `\n${theme.muted("Docs:")} ${formatDocsLink("/cli/config", "docs.openclaw.ai/cli/config")}\n`).option("--section <section>", "Configure wizard sections (repeatable). Use with no subcommand.", (value, previous) => [...previous, value], []).action(async (opts) => {
|
|
204
|
-
const { configureCommandFromSectionsArg } = await import("./configure-
|
|
204
|
+
const { configureCommandFromSectionsArg } = await import("./configure-80FWz9jT.js").then((n) => n.t);
|
|
205
205
|
await configureCommandFromSectionsArg(opts.section, defaultRuntime);
|
|
206
206
|
});
|
|
207
207
|
cmd.command("get").description("Get a config value by dot path").argument("<path>", "Config path (dot or bracket notation)").option("--json", "Output JSON", false).action(async (path, opts) => {
|
|
@@ -206,7 +206,7 @@ async function runConfigUnset(opts) {
|
|
|
206
206
|
}
|
|
207
207
|
function registerConfigCli(program) {
|
|
208
208
|
const cmd = program.command("config").description("Non-interactive config helpers (get/set/unset). Run without subcommand for the setup wizard.").addHelpText("after", () => `\n${theme.muted("Docs:")} ${formatDocsLink("/cli/config", "docs.openclaw.ai/cli/config")}\n`).option("--section <section>", "Configure wizard sections (repeatable). Use with no subcommand.", (value, previous) => [...previous, value], []).action(async (opts) => {
|
|
209
|
-
const { configureCommandFromSectionsArg } = await import("./configure-
|
|
209
|
+
const { configureCommandFromSectionsArg } = await import("./configure-BHGABgNw.js").then((n) => n.t);
|
|
210
210
|
await configureCommandFromSectionsArg(opts.section, defaultRuntime);
|
|
211
211
|
});
|
|
212
212
|
cmd.command("get").description("Get a config value by dot path").argument("<path>", "Config path (dot or bracket notation)").option("--json", "Output JSON", false).action(async (path, opts) => {
|
|
@@ -11,14 +11,14 @@ import { n as stylePromptMessage, r as stylePromptTitle, t as stylePromptHint }
|
|
|
11
11
|
import { t as note$1 } from "./note-DDecZomM.js";
|
|
12
12
|
import { t as WizardCancelledError } from "./prompts-m1IJwIAx.js";
|
|
13
13
|
import { t as createClackPrompter } from "./clack-prompter-B1aVoXd5.js";
|
|
14
|
-
import { r as setupChannels, t as noteChannelStatus } from "./onboard-channels-
|
|
14
|
+
import { r as setupChannels, t as noteChannelStatus } from "./onboard-channels-vQihczqp.js";
|
|
15
15
|
import { a as gatewayInstallErrorHint, i as buildGatewayInstallPlan, n as GATEWAY_DAEMON_RUNTIME_OPTIONS, t as DEFAULT_GATEWAY_DAEMON_RUNTIME } from "./daemon-runtime-C8zxvl0r.js";
|
|
16
16
|
import { t as resolveGatewayService } from "./service-DcFI40_W.js";
|
|
17
|
-
import { r as healthCommand } from "./health-
|
|
17
|
+
import { r as healthCommand } from "./health-DEibfTDK.js";
|
|
18
18
|
import { t as ensureControlUiAssetsBuilt } from "./control-ui-assets-Yp3N6NZ_.js";
|
|
19
19
|
import { n as logConfigUpdated } from "./logging-PVQxLC6I.js";
|
|
20
20
|
import { n as promptAuthChoiceGrouped } from "./auth-choice-prompt-DF6R_pgV.js";
|
|
21
|
-
import { i as applyAuthChoice, n as resolvePreferredProviderForAuthChoice } from "./auth-choice-
|
|
21
|
+
import { i as applyAuthChoice, n as resolvePreferredProviderForAuthChoice } from "./auth-choice-Cc9nPCSG.js";
|
|
22
22
|
import { a as promptDefaultModel, n as applyModelFallbacksFromSelection, o as promptModelAllowlist, r as applyPrimaryModel, t as applyModelAllowlist } from "./model-picker-CL9-tOhM.js";
|
|
23
23
|
import { t as ensureSystemdUserLingerInteractive } from "./systemd-linger-B8oXYjfA.js";
|
|
24
24
|
import { a as promptCustomApiConfig } from "./onboard-custom-XSotJ8LL.js";
|
|
@@ -13,14 +13,14 @@ import { n as stylePromptMessage, r as stylePromptTitle, t as stylePromptHint }
|
|
|
13
13
|
import { t as note$1 } from "./note-DRZSQe0n.js";
|
|
14
14
|
import { t as WizardCancelledError } from "./prompts-Xu2Sveka.js";
|
|
15
15
|
import { t as createClackPrompter } from "./clack-prompter-Cpl8cd_B.js";
|
|
16
|
-
import { r as setupChannels, t as noteChannelStatus } from "./onboard-channels-
|
|
16
|
+
import { r as setupChannels, t as noteChannelStatus } from "./onboard-channels-Cb8T_ers.js";
|
|
17
17
|
import { a as gatewayInstallErrorHint, i as buildGatewayInstallPlan, n as GATEWAY_DAEMON_RUNTIME_OPTIONS, t as DEFAULT_GATEWAY_DAEMON_RUNTIME } from "./daemon-runtime-9XM9A9aY.js";
|
|
18
18
|
import { t as resolveGatewayService } from "./service-CJGWS46r.js";
|
|
19
|
-
import { r as healthCommand } from "./health-
|
|
19
|
+
import { r as healthCommand } from "./health-BfWYn33I.js";
|
|
20
20
|
import { t as ensureControlUiAssetsBuilt } from "./control-ui-assets-d_j0Pdnj.js";
|
|
21
21
|
import { n as logConfigUpdated } from "./logging-DNqMaj3H.js";
|
|
22
22
|
import { n as promptAuthChoiceGrouped } from "./auth-choice-prompt-Cn6U3t8O.js";
|
|
23
|
-
import { i as applyAuthChoice, n as resolvePreferredProviderForAuthChoice } from "./auth-choice-
|
|
23
|
+
import { i as applyAuthChoice, n as resolvePreferredProviderForAuthChoice } from "./auth-choice-B0ExtimG.js";
|
|
24
24
|
import { a as promptDefaultModel, n as applyModelFallbacksFromSelection, o as promptModelAllowlist, r as applyPrimaryModel, t as applyModelAllowlist } from "./model-picker-DvJEmBNe.js";
|
|
25
25
|
import { t as ensureSystemdUserLingerInteractive } from "./systemd-linger-zXWRcQMp.js";
|
|
26
26
|
import { a as promptCustomApiConfig } from "./onboard-custom-DZ0rMdgP.js";
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
</div>
|
|
124
124
|
`}function Md(e){const t={name:e?.name??"",displayName:e?.displayName??"",about:e?.about??"",picture:e?.picture??"",banner:e?.banner??"",website:e?.website??"",nip05:e?.nip05??"",lud16:e?.lud16??""};return{values:t,original:{...t},saving:!1,importing:!1,error:null,success:null,fieldErrors:{},showAdvanced:!!(e?.banner||e?.website||e?.nip05||e?.lud16)}}async function Rd(e,t){await wd(e,t),await Ce(e,!0)}async function Id(e){await kd(e),await Ce(e,!0)}async function Pd(e){await Sd(e),await Ce(e,!0)}async function Dd(e){await ns(e),await Oe(e),await Ce(e,!0)}async function Fd(e){await Oe(e),await Ce(e,!0)}function Nd(e){if(!Array.isArray(e))return{};const t={};for(const n of e){if(typeof n!="string")continue;const[s,...i]=n.split(":");if(!s||i.length===0)continue;const a=s.trim(),o=i.join(":").trim();a&&o&&(t[a]=o)}return t}function qr(e){return(e.channelsSnapshot?.channelAccounts?.nostr??[])[0]?.accountId??e.nostrProfileAccountId??"default"}function Gr(e,t=""){return`/api/channels/nostr/${encodeURIComponent(e)}/profile${t}`}function Od(e){const t=e.hello?.auth?.deviceToken?.trim();if(t)return`Bearer ${t}`;const n=e.settings.token.trim();if(n)return`Bearer ${n}`;const s=e.password.trim();return s?`Bearer ${s}`:null}function Vr(e){const t=Od(e);return t?{Authorization:t}:{}}function Bd(e,t,n){e.nostrProfileAccountId=t,e.nostrProfileFormState=Md(n??void 0)}function Ud(e){e.nostrProfileFormState=null,e.nostrProfileAccountId=null}function zd(e,t,n){const s=e.nostrProfileFormState;s&&(e.nostrProfileFormState={...s,values:{...s.values,[t]:n},fieldErrors:{...s.fieldErrors,[t]:""}})}function Hd(e){const t=e.nostrProfileFormState;t&&(e.nostrProfileFormState={...t,showAdvanced:!t.showAdvanced})}async function jd(e){const t=e.nostrProfileFormState;if(!t||t.saving)return;const n=qr(e);e.nostrProfileFormState={...t,saving:!0,error:null,success:null,fieldErrors:{}};try{const s=await fetch(Gr(n),{method:"PUT",headers:{"Content-Type":"application/json",...Vr(e)},body:JSON.stringify(t.values)}),i=await s.json().catch(()=>null);if(!s.ok||i?.ok===!1||!i){const a=i?.error??`Profile update failed (${s.status})`;e.nostrProfileFormState={...t,saving:!1,error:a,success:null,fieldErrors:Nd(i?.details)};return}if(!i.persisted){e.nostrProfileFormState={...t,saving:!1,error:"Profile publish failed on all relays.",success:null};return}e.nostrProfileFormState={...t,saving:!1,error:null,success:"Profile published to relays.",fieldErrors:{},original:{...t.values}},await Ce(e,!0)}catch(s){e.nostrProfileFormState={...t,saving:!1,error:`Profile update failed: ${String(s)}`,success:null}}}async function Kd(e){const t=e.nostrProfileFormState;if(!t||t.importing)return;const n=qr(e);e.nostrProfileFormState={...t,importing:!0,error:null,success:null};try{const s=await fetch(Gr(n,"/import"),{method:"POST",headers:{"Content-Type":"application/json",...Vr(e)},body:JSON.stringify({autoMerge:!0})}),i=await s.json().catch(()=>null);if(!s.ok||i?.ok===!1||!i){const l=i?.error??`Profile import failed (${s.status})`;e.nostrProfileFormState={...t,importing:!1,error:l,success:null};return}const a=i.merged??i.imported??null,o=a?{...t.values,...a}:t.values,r=!!(o.banner||o.website||o.nip05||o.lud16);e.nostrProfileFormState={...t,importing:!1,values:o,error:null,success:i.saved?"Profile imported from relays. Review and publish.":"Profile imported. Review and publish.",showAdvanced:r},i.saved&&await Ce(e,!0)}catch(s){e.nostrProfileFormState={...t,importing:!1,error:`Profile import failed: ${String(s)}`,success:null}}}function Qr(e){const t=(e??"").trim();if(!t)return null;const n=t.split(":").filter(Boolean);if(n.length<3||n[0]!=="agent")return null;const s=n[1]?.trim(),i=n.slice(2).join(":");return!s||!i?null:{agentId:s,rest:i}}const bi=450;function Dn(e,t=!1,n=!1){e.chatScrollFrame&&cancelAnimationFrame(e.chatScrollFrame),e.chatScrollTimeout!=null&&(clearTimeout(e.chatScrollTimeout),e.chatScrollTimeout=null);const s=()=>{const i=e.querySelector(".chat-thread");if(i){const a=getComputedStyle(i).overflowY;if(a==="auto"||a==="scroll"||i.scrollHeight-i.clientHeight>1)return i}return document.scrollingElement??document.documentElement};e.updateComplete.then(()=>{e.chatScrollFrame=requestAnimationFrame(()=>{e.chatScrollFrame=null;const i=s();if(!i)return;const a=i.scrollHeight-i.scrollTop-i.clientHeight,o=t&&!e.chatHasAutoScrolled;if(!(o||e.chatUserNearBottom||a<bi)){e.chatNewMessagesBelow=!0;return}o&&(e.chatHasAutoScrolled=!0);const l=n&&(typeof window>"u"||typeof window.matchMedia!="function"||!window.matchMedia("(prefers-reduced-motion: reduce)").matches),d=i.scrollHeight;typeof i.scrollTo=="function"?i.scrollTo({top:d,behavior:l?"smooth":"auto"}):i.scrollTop=d,e.chatUserNearBottom=!0,e.chatNewMessagesBelow=!1;const p=o?150:120;e.chatScrollTimeout=window.setTimeout(()=>{e.chatScrollTimeout=null;const g=s();if(!g)return;const h=g.scrollHeight-g.scrollTop-g.clientHeight;(o||e.chatUserNearBottom||h<bi)&&(g.scrollTop=g.scrollHeight,e.chatUserNearBottom=!0)},p)})})}function Yr(e,t=!1){e.logsScrollFrame&&cancelAnimationFrame(e.logsScrollFrame),e.updateComplete.then(()=>{e.logsScrollFrame=requestAnimationFrame(()=>{e.logsScrollFrame=null;const n=e.querySelector(".log-stream");if(!n)return;const s=n.scrollHeight-n.scrollTop-n.clientHeight;(t||s<80)&&(n.scrollTop=n.scrollHeight)})})}function Wd(e,t){const n=t.currentTarget;if(!n)return;const s=n.scrollHeight-n.scrollTop-n.clientHeight;e.chatUserNearBottom=s<bi,e.chatUserNearBottom&&(e.chatNewMessagesBelow=!1)}function qd(e,t){const n=t.currentTarget;if(!n)return;const s=n.scrollHeight-n.scrollTop-n.clientHeight;e.logsAtBottom=s<80}function ho(e){e.chatHasAutoScrolled=!1,e.chatUserNearBottom=!0,e.chatNewMessagesBelow=!1}function Gd(e,t){if(e.length===0)return;const n=new Blob([`${e.join(`
|
|
125
125
|
`)}
|
|
126
|
-
`],{type:"text/plain"}),s=URL.createObjectURL(n),i=document.createElement("a"),a=new Date().toISOString().slice(0,19).replace(/[:T]/g,"-");i.href=s,i.download=`openclaw-logs-${t}-${a}.log`,i.click(),URL.revokeObjectURL(s)}function Vd(e){if(typeof ResizeObserver>"u")return;const t=e.querySelector(".topbar");if(!t)return;const n=()=>{const{height:s}=t.getBoundingClientRect();e.style.setProperty("--topbar-height",`${s}px`)};n(),e.topbarObserver=new ResizeObserver(()=>n()),e.topbarObserver.observe(t)}async function Ss(e){if(!(!e.client||!e.connected)&&!e.debugLoading){e.debugLoading=!0;try{const[t,n,s,i]=await Promise.all([e.client.request("status",{}),e.client.request("health",{}),e.client.request("models.list",{}),e.client.request("last-heartbeat",{})]);e.debugStatus=t,e.debugHealth=n;const a=s;e.debugModels=Array.isArray(a?.models)?a?.models:[],e.debugHeartbeat=i}catch(t){e.debugCallError=String(t)}finally{e.debugLoading=!1}}}async function Qd(e){if(!(!e.client||!e.connected)){e.debugCallError=null,e.debugCallResult=null;try{const t=e.debugCallParams.trim()?JSON.parse(e.debugCallParams):{},n=await e.client.request(e.debugCallMethod.trim(),t);e.debugCallResult=JSON.stringify(n,null,2)}catch(t){e.debugCallError=String(t)}}}const Yd=2e3,Zd=new Set(["trace","debug","info","warn","error","fatal"]);function Jd(e){if(typeof e!="string")return null;const t=e.trim();if(!t.startsWith("{")||!t.endsWith("}"))return null;try{const n=JSON.parse(t);return!n||typeof n!="object"?null:n}catch{return null}}function Xd(e){if(typeof e!="string")return null;const t=e.toLowerCase();return Zd.has(t)?t:null}function eu(e){if(!e.trim())return{raw:e,message:e};try{const t=JSON.parse(e),n=t&&typeof t._meta=="object"&&t._meta!==null?t._meta:null,s=typeof t.time=="string"?t.time:typeof n?.date=="string"?n?.date:null,i=Xd(n?.logLevelName??n?.level),a=typeof t[0]=="string"?t[0]:typeof n?.name=="string"?n?.name:null,o=Jd(a);let r=null;o&&(typeof o.subsystem=="string"?r=o.subsystem:typeof o.module=="string"&&(r=o.module)),!r&&a&&a.length<120&&(r=a);let l=null;return typeof t[1]=="string"?l=t[1]:!o&&typeof t[0]=="string"?l=t[0]:typeof t.message=="string"&&(l=t.message),{raw:e,time:s,level:i,subsystem:r,message:l??e,meta:n??void 0}}catch{return{raw:e,message:e}}}async function Xi(e,t){if(!(!e.client||!e.connected)&&!(e.logsLoading&&!t?.quiet)){t?.quiet||(e.logsLoading=!0),e.logsError=null;try{const s=await e.client.request("logs.tail",{cursor:t?.reset?void 0:e.logsCursor??void 0,limit:e.logsLimit,maxBytes:e.logsMaxBytes}),a=(Array.isArray(s.lines)?s.lines.filter(r=>typeof r=="string"):[]).map(eu),o=!!(t?.reset||s.reset||e.logsCursor==null);e.logsEntries=o?a:[...e.logsEntries,...a].slice(-Yd),typeof s.cursor=="number"&&(e.logsCursor=s.cursor),typeof s.file=="string"&&(e.logsFile=s.file),e.logsTruncated=!!s.truncated,e.logsLastFetchAt=Date.now()}catch(n){e.logsError=String(n)}finally{t?.quiet||(e.logsLoading=!1)}}}async function As(e,t){if(!(!e.client||!e.connected)&&!e.nodesLoading){e.nodesLoading=!0,t?.quiet||(e.lastError=null);try{const n=await e.client.request("node.list",{});e.nodes=Array.isArray(n.nodes)?n.nodes:[]}catch(n){t?.quiet||(e.lastError=String(n))}finally{e.nodesLoading=!1}}}function tu(e){e.nodesPollInterval==null&&(e.nodesPollInterval=window.setInterval(()=>{As(e,{quiet:!0})},5e3))}function nu(e){e.nodesPollInterval!=null&&(clearInterval(e.nodesPollInterval),e.nodesPollInterval=null)}function ea(e){e.logsPollInterval==null&&(e.logsPollInterval=window.setInterval(()=>{e.tab==="logs"&&Xi(e,{quiet:!0})},2e3))}function ta(e){e.logsPollInterval!=null&&(clearInterval(e.logsPollInterval),e.logsPollInterval=null)}function na(e){e.debugPollInterval==null&&(e.debugPollInterval=window.setInterval(()=>{e.tab==="debug"&&Ss(e)},3e3))}function sa(e){e.debugPollInterval!=null&&(clearInterval(e.debugPollInterval),e.debugPollInterval=null)}async function Zr(e,t){if(!(!e.client||!e.connected||e.agentIdentityLoading)&&!e.agentIdentityById[t]){e.agentIdentityLoading=!0,e.agentIdentityError=null;try{const n=await e.client.request("agent.identity.get",{agentId:t});n&&(e.agentIdentityById={...e.agentIdentityById,[t]:n})}catch(n){e.agentIdentityError=String(n)}finally{e.agentIdentityLoading=!1}}}async function Jr(e,t){if(!e.client||!e.connected||e.agentIdentityLoading)return;const n=t.filter(s=>!e.agentIdentityById[s]);if(n.length!==0){e.agentIdentityLoading=!0,e.agentIdentityError=null;try{for(const s of n){const i=await e.client.request("agent.identity.get",{agentId:s});i&&(e.agentIdentityById={...e.agentIdentityById,[s]:i})}}catch(s){e.agentIdentityError=String(s)}finally{e.agentIdentityLoading=!1}}}async function ss(e,t){if(!(!e.client||!e.connected)&&!e.agentSkillsLoading){e.agentSkillsLoading=!0,e.agentSkillsError=null;try{const n=await e.client.request("skills.status",{agentId:t});n&&(e.agentSkillsReport=n,e.agentSkillsAgentId=t)}catch(n){e.agentSkillsError=String(n)}finally{e.agentSkillsLoading=!1}}}async function ia(e){if(!(!e.client||!e.connected)&&!e.agentsLoading){e.agentsLoading=!0,e.agentsError=null;try{const t=await e.client.request("agents.list",{});if(t){e.agentsList=t;const n=e.agentsSelectedId,s=t.agents.some(i=>i.id===n);(!n||!s)&&(e.agentsSelectedId=t.defaultId??t.agents[0]?.id??null)}}catch(t){e.agentsError=String(t)}finally{e.agentsLoading=!1}}}function aa(e,t){if(e==null||!Number.isFinite(e)||e<=0)return;if(e<1e3)return`${Math.round(e)}ms`;const n=t?.spaced?" ":"",s=Math.round(e/1e3),i=Math.floor(s/3600),a=Math.floor(s%3600/60),o=s%60;if(i>=24){const r=Math.floor(i/24),l=i%24;return l>0?`${r}d${n}${l}h`:`${r}d`}return i>0?a>0?`${i}h${n}${a}m`:`${i}h`:a>0?o>0?`${a}m${n}${o}s`:`${a}m`:`${o}s`}function oa(e,t="n/a"){if(e==null||!Number.isFinite(e)||e<0)return t;if(e<1e3)return`${Math.round(e)}ms`;const n=Math.round(e/1e3);if(n<60)return`${n}s`;const s=Math.round(n/60);if(s<60)return`${s}m`;const i=Math.round(s/60);return i<24?`${i}h`:`${Math.round(i/24)}d`}function ee(e,t){const n=t?.fallback??"n/a";if(e==null||!Number.isFinite(e))return n;const s=Date.now()-e,i=Math.abs(s),a=s>=0,o=Math.round(i/1e3);if(o<60)return a?"just now":"in <1m";const r=Math.round(o/60);if(r<60)return a?`${r}m ago`:`in ${r}m`;const l=Math.round(r/60);if(l<48)return a?`${l}h ago`:`in ${l}h`;const d=Math.round(l/24);return a?`${d}d ago`:`in ${d}d`}const su=/<\s*\/?\s*(?:think(?:ing)?|thought|antthinking|final)\b/i,jn=/<\s*\/?\s*final\b[^<>]*>/gi,mo=/<\s*(\/?)\s*(?:think(?:ing)?|thought|antthinking)\b[^<>]*>/gi;function vo(e){const t=[],n=/(^|\n)(```|~~~)[^\n]*\n[\s\S]*?(?:\n\2(?:\n|$)|$)/g;for(const i of e.matchAll(n)){const a=(i.index??0)+i[1].length;t.push({start:a,end:a+i[0].length-i[1].length})}const s=/`+[^`]+`+/g;for(const i of e.matchAll(s)){const a=i.index??0,o=a+i[0].length;t.some(l=>a>=l.start&&o<=l.end)||t.push({start:a,end:o})}return t.sort((i,a)=>i.start-a.start),t}function bo(e,t){return t.some(n=>e>=n.start&&e<n.end)}function iu(e,t){return e.trimStart()}function au(e,t){if(!e||!su.test(e))return e;let n=e;if(jn.test(n)){jn.lastIndex=0;const r=[],l=vo(n);for(const d of n.matchAll(jn)){const p=d.index??0;r.push({start:p,length:d[0].length,inCode:bo(p,l)})}for(let d=r.length-1;d>=0;d--){const p=r[d];p.inCode||(n=n.slice(0,p.start)+n.slice(p.start+p.length))}}else jn.lastIndex=0;const s=vo(n);mo.lastIndex=0;let i="",a=0,o=!1;for(const r of n.matchAll(mo)){const l=r.index??0,d=r[1]==="/";bo(l,s)||(o?d&&(o=!1):(i+=n.slice(a,l),d||(o=!0)),a=l+r[0].length)}return i+=n.slice(a),iu(i)}function Ot(e){return!e&&e!==0?"n/a":new Date(e).toLocaleString()}function yi(e){return!e||e.length===0?"none":e.filter(t=>!!(t&&t.trim())).join(", ")}function xi(e,t=120){return e.length<=t?e:`${e.slice(0,Math.max(0,t-1))}…`}function Xr(e,t){return e.length<=t?{text:e,truncated:!1,total:e.length}:{text:e.slice(0,Math.max(0,t)),truncated:!0,total:e.length}}function ds(e,t){const n=Number(e);return Number.isFinite(n)?n:t}function qs(e){return au(e)}function ou(e){return e.sessionTarget==="isolated"&&e.payloadKind==="agentTurn"}function el(e){return e.deliveryMode!=="announce"||ou(e)?e:{...e,deliveryMode:"none"}}async function Fn(e){if(!(!e.client||!e.connected))try{const t=await e.client.request("cron.status",{});e.cronStatus=t}catch(t){e.cronError=String(t)}}async function Cs(e){if(!(!e.client||!e.connected)&&!e.cronLoading){e.cronLoading=!0,e.cronError=null;try{const t=await e.client.request("cron.list",{includeDisabled:!0});e.cronJobs=Array.isArray(t.jobs)?t.jobs:[]}catch(t){e.cronError=String(t)}finally{e.cronLoading=!1}}}function ru(e){if(e.scheduleKind==="at"){const n=Date.parse(e.scheduleAt);if(!Number.isFinite(n))throw new Error("Invalid run time.");return{kind:"at",at:new Date(n).toISOString()}}if(e.scheduleKind==="every"){const n=ds(e.everyAmount,0);if(n<=0)throw new Error("Invalid interval amount.");const s=e.everyUnit;return{kind:"every",everyMs:n*(s==="minutes"?6e4:s==="hours"?36e5:864e5)}}const t=e.cronExpr.trim();if(!t)throw new Error("Cron expression required.");return{kind:"cron",expr:t,tz:e.cronTz.trim()||void 0}}function lu(e){if(e.payloadKind==="systemEvent"){const i=e.payloadText.trim();if(!i)throw new Error("System event text required.");return{kind:"systemEvent",text:i}}const t=e.payloadText.trim();if(!t)throw new Error("Agent message required.");const n={kind:"agentTurn",message:t},s=ds(e.timeoutSeconds,0);return s>0&&(n.timeoutSeconds=s),n}async function cu(e){if(!(!e.client||!e.connected||e.cronBusy)){e.cronBusy=!0,e.cronError=null;try{const t=el(e.cronForm);t!==e.cronForm&&(e.cronForm=t);const n=ru(t),s=lu(t),i=t.deliveryMode,a=i&&i!=="none"?{mode:i,channel:i==="announce"?t.deliveryChannel.trim()||"last":void 0,to:t.deliveryTo.trim()||void 0}:void 0,o=t.agentId.trim(),r={name:t.name.trim(),description:t.description.trim()||void 0,agentId:o||void 0,enabled:t.enabled,schedule:n,sessionTarget:t.sessionTarget,wakeMode:t.wakeMode,payload:s,delivery:a};if(!r.name)throw new Error("Name required.");await e.client.request("cron.add",r),e.cronForm={...e.cronForm,name:"",description:"",payloadText:""},await Cs(e),await Fn(e)}catch(t){e.cronError=String(t)}finally{e.cronBusy=!1}}}async function du(e,t,n){if(!(!e.client||!e.connected||e.cronBusy)){e.cronBusy=!0,e.cronError=null;try{await e.client.request("cron.update",{id:t.id,patch:{enabled:n}}),await Cs(e),await Fn(e)}catch(s){e.cronError=String(s)}finally{e.cronBusy=!1}}}async function uu(e,t){if(!(!e.client||!e.connected||e.cronBusy)){e.cronBusy=!0,e.cronError=null;try{await e.client.request("cron.run",{id:t.id,mode:"force"}),await tl(e,t.id)}catch(n){e.cronError=String(n)}finally{e.cronBusy=!1}}}async function gu(e,t){if(!(!e.client||!e.connected||e.cronBusy)){e.cronBusy=!0,e.cronError=null;try{await e.client.request("cron.remove",{id:t.id}),e.cronRunsJobId===t.id&&(e.cronRunsJobId=null,e.cronRuns=[]),await Cs(e),await Fn(e)}catch(n){e.cronError=String(n)}finally{e.cronBusy=!1}}}async function tl(e,t){if(!(!e.client||!e.connected))try{const n=await e.client.request("cron.runs",{id:t,limit:50});e.cronRunsJobId=t,e.cronRuns=Array.isArray(n.entries)?n.entries:[]}catch(n){e.cronError=String(n)}}function ra(e){return e.trim()}function pu(e){if(!Array.isArray(e))return[];const t=new Set;for(const n of e){const s=n.trim();s&&t.add(s)}return[...t].toSorted()}const nl="openclaw.device.auth.v1";function la(){try{const e=window.localStorage.getItem(nl);if(!e)return null;const 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 sl(e){try{window.localStorage.setItem(nl,JSON.stringify(e))}catch{}}function fu(e){const t=la();if(!t||t.deviceId!==e.deviceId)return null;const n=ra(e.role),s=t.tokens[n];return!s||typeof s.token!="string"?null:s}function il(e){const t=ra(e.role),n={version:1,deviceId:e.deviceId,tokens:{}},s=la();s&&s.deviceId===e.deviceId&&(n.tokens={...s.tokens});const i={token:e.token,role:t,scopes:pu(e.scopes),updatedAtMs:Date.now()};return n.tokens[t]=i,sl(n),i}function al(e){const t=la();if(!t||t.deviceId!==e.deviceId)return;const n=ra(e.role);if(!t.tokens[n])return;const s={...t,tokens:{...t.tokens}};delete s.tokens[n],sl(s)}const ol={p:0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffedn,n:0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3edn,h:8n,a:0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffecn,d:0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3n,Gx:0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51an,Gy:0x6666666666666666666666666666666666666666666666666666666666666658n},{p:ye,n:is,Gx:yo,Gy:xo,a:Gs,d:Vs,h:hu}=ol,Bt=32,ca=64,mu=(...e)=>{"captureStackTrace"in Error&&typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(...e)},pe=(e="")=>{const t=new Error(e);throw mu(t,pe),t},vu=e=>typeof e=="bigint",bu=e=>typeof e=="string",yu=e=>e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array",bt=(e,t,n="")=>{const s=yu(e),i=e?.length,a=t!==void 0;if(!s||a&&i!==t){const o=n&&`"${n}" `,r=a?` of length ${t}`:"",l=s?`length=${i}`:`type=${typeof e}`;pe(o+"expected Uint8Array"+r+", got "+l)}return e},Ts=e=>new Uint8Array(e),rl=e=>Uint8Array.from(e),ll=(e,t)=>e.toString(16).padStart(t,"0"),cl=e=>Array.from(bt(e)).map(t=>ll(t,2)).join(""),et={_0:48,_9:57,A:65,F:70,a:97,f:102},$o=e=>{if(e>=et._0&&e<=et._9)return e-et._0;if(e>=et.A&&e<=et.F)return e-(et.A-10);if(e>=et.a&&e<=et.f)return e-(et.a-10)},dl=e=>{const t="hex invalid";if(!bu(e))return pe(t);const n=e.length,s=n/2;if(n%2)return pe(t);const i=Ts(s);for(let a=0,o=0;a<s;a++,o+=2){const r=$o(e.charCodeAt(o)),l=$o(e.charCodeAt(o+1));if(r===void 0||l===void 0)return pe(t);i[a]=r*16+l}return i},ul=()=>globalThis?.crypto,xu=()=>ul()?.subtle??pe("crypto.subtle must be defined, consider polyfill"),Mn=(...e)=>{const t=Ts(e.reduce((s,i)=>s+bt(i).length,0));let n=0;return e.forEach(s=>{t.set(s,n),n+=s.length}),t},$u=(e=Bt)=>ul().getRandomValues(Ts(e)),us=BigInt,_t=(e,t,n,s="bad number: out of range")=>vu(e)&&t<=e&&e<n?e:pe(s),N=(e,t=ye)=>{const n=e%t;return n>=0n?n:t+n},gl=e=>N(e,is),wu=(e,t)=>{(e===0n||t<=0n)&&pe("no inverse n="+e+" mod="+t);let n=N(e,t),s=t,i=0n,a=1n;for(;n!==0n;){const o=s/n,r=s%n,l=i-a*o;s=n,n=r,i=a,a=l}return s===1n?N(i,t):pe("no inverse")},ku=e=>{const t=ml[e];return typeof t!="function"&&pe("hashes."+e+" not set"),t},Qs=e=>e instanceof Me?e:pe("Point expected"),$i=2n**256n;class Me{static BASE;static ZERO;X;Y;Z;T;constructor(t,n,s,i){const a=$i;this.X=_t(t,0n,a),this.Y=_t(n,0n,a),this.Z=_t(s,1n,a),this.T=_t(i,0n,a),Object.freeze(this)}static CURVE(){return ol}static fromAffine(t){return new Me(t.x,t.y,1n,N(t.x*t.y))}static fromBytes(t,n=!1){const s=Vs,i=rl(bt(t,Bt)),a=t[31];i[31]=a&-129;const o=fl(i);_t(o,0n,n?$i:ye);const l=N(o*o),d=N(l-1n),p=N(s*l+1n);let{isValid:g,value:h}=Au(d,p);g||pe("bad point: y not sqrt");const u=(h&1n)===1n,f=(a&128)!==0;return!n&&h===0n&&f&&pe("bad point: x==0, isLastByteOdd"),f!==u&&(h=N(-h)),new Me(h,o,1n,N(h*o))}static fromHex(t,n){return Me.fromBytes(dl(t),n)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}assertValidity(){const t=Gs,n=Vs,s=this;if(s.is0())return pe("bad point: ZERO");const{X:i,Y:a,Z:o,T:r}=s,l=N(i*i),d=N(a*a),p=N(o*o),g=N(p*p),h=N(l*t),u=N(p*N(h+d)),f=N(g+N(n*N(l*d)));if(u!==f)return pe("bad point: equation left != right (1)");const v=N(i*a),w=N(o*r);return v!==w?pe("bad point: equation left != right (2)"):this}equals(t){const{X:n,Y:s,Z:i}=this,{X:a,Y:o,Z:r}=Qs(t),l=N(n*r),d=N(a*i),p=N(s*r),g=N(o*i);return l===d&&p===g}is0(){return this.equals(Xt)}negate(){return new Me(N(-this.X),this.Y,this.Z,N(-this.T))}double(){const{X:t,Y:n,Z:s}=this,i=Gs,a=N(t*t),o=N(n*n),r=N(2n*N(s*s)),l=N(i*a),d=t+n,p=N(N(d*d)-a-o),g=l+o,h=g-r,u=l-o,f=N(p*h),v=N(g*u),w=N(p*u),S=N(h*g);return new Me(f,v,S,w)}add(t){const{X:n,Y:s,Z:i,T:a}=this,{X:o,Y:r,Z:l,T:d}=Qs(t),p=Gs,g=Vs,h=N(n*o),u=N(s*r),f=N(a*g*d),v=N(i*l),w=N((n+s)*(o+r)-h-u),S=N(v-f),C=N(v+f),k=N(u-p*h),A=N(w*S),E=N(C*k),T=N(w*k),R=N(S*C);return new Me(A,E,R,T)}subtract(t){return this.add(Qs(t).negate())}multiply(t,n=!0){if(!n&&(t===0n||this.is0()))return Xt;if(_t(t,1n,is),t===1n)return this;if(this.equals(Ut))return Fu(t).p;let s=Xt,i=Ut;for(let a=this;t>0n;a=a.double(),t>>=1n)t&1n?s=s.add(a):n&&(i=i.add(a));return s}multiplyUnsafe(t){return this.multiply(t,!1)}toAffine(){const{X:t,Y:n,Z:s}=this;if(this.equals(Xt))return{x:0n,y:1n};const i=wu(s,ye);N(s*i)!==1n&&pe("invalid inverse");const a=N(t*i),o=N(n*i);return{x:a,y:o}}toBytes(){const{x:t,y:n}=this.assertValidity().toAffine(),s=pl(n);return s[31]|=t&1n?128:0,s}toHex(){return cl(this.toBytes())}clearCofactor(){return this.multiply(us(hu),!1)}isSmallOrder(){return this.clearCofactor().is0()}isTorsionFree(){let t=this.multiply(is/2n,!1).double();return is%2n&&(t=t.add(this)),t.is0()}}const Ut=new Me(yo,xo,1n,N(yo*xo)),Xt=new Me(0n,1n,1n,0n);Me.BASE=Ut;Me.ZERO=Xt;const pl=e=>dl(ll(_t(e,0n,$i),ca)).reverse(),fl=e=>us("0x"+cl(rl(bt(e)).reverse())),He=(e,t)=>{let n=e;for(;t-- >0n;)n*=n,n%=ye;return n},Su=e=>{const n=e*e%ye*e%ye,s=He(n,2n)*n%ye,i=He(s,1n)*e%ye,a=He(i,5n)*i%ye,o=He(a,10n)*a%ye,r=He(o,20n)*o%ye,l=He(r,40n)*r%ye,d=He(l,80n)*l%ye,p=He(d,80n)*l%ye,g=He(p,10n)*a%ye;return{pow_p_5_8:He(g,2n)*e%ye,b2:n}},wo=0x2b8324804fc1df0b2b4d00993dfbd7a72f431806ad2fe478c4ee1b274a0ea0b0n,Au=(e,t)=>{const n=N(t*t*t),s=N(n*n*t),i=Su(e*s).pow_p_5_8;let a=N(e*n*i);const o=N(t*a*a),r=a,l=N(a*wo),d=o===e,p=o===N(-e),g=o===N(-e*wo);return d&&(a=r),(p||g)&&(a=l),(N(a)&1n)===1n&&(a=N(-a)),{isValid:d||p,value:a}},wi=e=>gl(fl(e)),da=(...e)=>ml.sha512Async(Mn(...e)),Cu=(...e)=>ku("sha512")(Mn(...e)),hl=e=>{const t=e.slice(0,Bt);t[0]&=248,t[31]&=127,t[31]|=64;const n=e.slice(Bt,ca),s=wi(t),i=Ut.multiply(s),a=i.toBytes();return{head:t,prefix:n,scalar:s,point:i,pointBytes:a}},ua=e=>da(bt(e,Bt)).then(hl),Tu=e=>hl(Cu(bt(e,Bt))),_u=e=>ua(e).then(t=>t.pointBytes),Eu=e=>da(e.hashable).then(e.finish),Lu=(e,t,n)=>{const{pointBytes:s,scalar:i}=e,a=wi(t),o=Ut.multiply(a).toBytes();return{hashable:Mn(o,s,n),finish:d=>{const p=gl(a+wi(d)*i);return bt(Mn(o,pl(p)),ca)}}},Mu=async(e,t)=>{const n=bt(e),s=await ua(t),i=await da(s.prefix,n);return Eu(Lu(s,i,n))},ml={sha512Async:async e=>{const t=xu(),n=Mn(e);return Ts(await t.digest("SHA-512",n.buffer))},sha512:void 0},Ru=(e=$u(Bt))=>e,Iu={getExtendedPublicKeyAsync:ua,getExtendedPublicKey:Tu,randomSecretKey:Ru},gs=8,Pu=256,vl=Math.ceil(Pu/gs)+1,ki=2**(gs-1),Du=()=>{const e=[];let t=Ut,n=t;for(let s=0;s<vl;s++){n=t,e.push(n);for(let i=1;i<ki;i++)n=n.add(t),e.push(n);t=n.double()}return e};let ko;const So=(e,t)=>{const n=t.negate();return e?n:t},Fu=e=>{const t=ko||(ko=Du());let n=Xt,s=Ut;const i=2**gs,a=i,o=us(i-1),r=us(gs);for(let l=0;l<vl;l++){let d=Number(e&o);e>>=r,d>ki&&(d-=a,e+=1n);const p=l*ki,g=p,h=p+Math.abs(d)-1,u=l%2!==0,f=d<0;d===0?s=s.add(So(u,t[g])):n=n.add(So(f,t[h]))}return e!==0n&&pe("invalid wnaf"),{p:n,f:s}},Ys="openclaw-device-identity-v1";function Si(e){let t="";for(const n of e)t+=String.fromCharCode(n);return btoa(t).replaceAll("+","-").replaceAll("/","_").replace(/=+$/g,"")}function bl(e){const t=e.replaceAll("-","+").replaceAll("_","/"),n=t+"=".repeat((4-t.length%4)%4),s=atob(n),i=new Uint8Array(s.length);for(let a=0;a<s.length;a+=1)i[a]=s.charCodeAt(a);return i}function Nu(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}async function yl(e){const t=await crypto.subtle.digest("SHA-256",e.slice().buffer);return Nu(new Uint8Array(t))}async function Ou(){const e=Iu.randomSecretKey(),t=await _u(e);return{deviceId:await yl(t),publicKey:Si(t),privateKey:Si(e)}}async function ga(){try{const n=localStorage.getItem(Ys);if(n){const s=JSON.parse(n);if(s?.version===1&&typeof s.deviceId=="string"&&typeof s.publicKey=="string"&&typeof s.privateKey=="string"){const i=await yl(bl(s.publicKey));if(i!==s.deviceId){const a={...s,deviceId:i};return localStorage.setItem(Ys,JSON.stringify(a)),{deviceId:i,publicKey:s.publicKey,privateKey:s.privateKey}}return{deviceId:s.deviceId,publicKey:s.publicKey,privateKey:s.privateKey}}}}catch{}const e=await Ou(),t={version:1,deviceId:e.deviceId,publicKey:e.publicKey,privateKey:e.privateKey,createdAtMs:Date.now()};return localStorage.setItem(Ys,JSON.stringify(t)),e}async function Bu(e,t){const n=bl(e),s=new TextEncoder().encode(t),i=await Mu(s,n);return Si(i)}async function yt(e,t){if(!(!e.client||!e.connected)&&!e.devicesLoading){e.devicesLoading=!0,t?.quiet||(e.devicesError=null);try{const n=await e.client.request("device.pair.list",{});e.devicesList={pending:Array.isArray(n?.pending)?n.pending:[],paired:Array.isArray(n?.paired)?n.paired:[]}}catch(n){t?.quiet||(e.devicesError=String(n))}finally{e.devicesLoading=!1}}}async function Uu(e,t){if(!(!e.client||!e.connected))try{await e.client.request("device.pair.approve",{requestId:t}),await yt(e)}catch(n){e.devicesError=String(n)}}async function zu(e,t){if(!(!e.client||!e.connected||!window.confirm("Reject this device pairing request?")))try{await e.client.request("device.pair.reject",{requestId:t}),await yt(e)}catch(s){e.devicesError=String(s)}}async function Hu(e,t){if(!(!e.client||!e.connected))try{const n=await e.client.request("device.token.rotate",t);if(n?.token){const s=await ga(),i=n.role??t.role;(n.deviceId===s.deviceId||t.deviceId===s.deviceId)&&il({deviceId:s.deviceId,role:i,token:n.token,scopes:n.scopes??t.scopes??[]}),window.prompt("New device token (copy and store securely):",n.token)}await yt(e)}catch(n){e.devicesError=String(n)}}async function ju(e,t){if(!(!e.client||!e.connected||!window.confirm(`Revoke token for ${t.deviceId} (${t.role})?`)))try{await e.client.request("device.token.revoke",t);const s=await ga();t.deviceId===s.deviceId&&al({deviceId:s.deviceId,role:t.role}),await yt(e)}catch(s){e.devicesError=String(s)}}function Ku(e){if(!e||e.kind==="gateway")return{method:"exec.approvals.get",params:{}};const t=e.nodeId.trim();return t?{method:"exec.approvals.node.get",params:{nodeId:t}}:null}function Wu(e,t){if(!e||e.kind==="gateway")return{method:"exec.approvals.set",params:t};const n=e.nodeId.trim();return n?{method:"exec.approvals.node.set",params:{...t,nodeId:n}}:null}async function pa(e,t){if(!(!e.client||!e.connected)&&!e.execApprovalsLoading){e.execApprovalsLoading=!0,e.lastError=null;try{const n=Ku(t);if(!n){e.lastError="Select a node before loading exec approvals.";return}const s=await e.client.request(n.method,n.params);qu(e,s)}catch(n){e.lastError=String(n)}finally{e.execApprovalsLoading=!1}}}function qu(e,t){e.execApprovalsSnapshot=t,e.execApprovalsDirty||(e.execApprovalsForm=Nt(t.file??{}))}async function Gu(e,t){if(!(!e.client||!e.connected)){e.execApprovalsSaving=!0,e.lastError=null;try{const n=e.execApprovalsSnapshot?.hash;if(!n){e.lastError="Exec approvals hash missing; reload and retry.";return}const s=e.execApprovalsForm??e.execApprovalsSnapshot?.file??{},i=Wu(t,{file:s,baseHash:n});if(!i){e.lastError="Select a node before saving exec approvals.";return}await e.client.request(i.method,i.params),e.execApprovalsDirty=!1,await pa(e,t)}catch(n){e.lastError=String(n)}finally{e.execApprovalsSaving=!1}}}function Vu(e,t,n){const s=Nt(e.execApprovalsForm??e.execApprovalsSnapshot?.file??{});Hr(s,t,n),e.execApprovalsForm=s,e.execApprovalsDirty=!0}function Qu(e,t){const n=Nt(e.execApprovalsForm??e.execApprovalsSnapshot?.file??{});jr(n,t),e.execApprovalsForm=n,e.execApprovalsDirty=!0}async function fa(e){if(!(!e.client||!e.connected)&&!e.presenceLoading){e.presenceLoading=!0,e.presenceError=null,e.presenceStatus=null;try{const t=await e.client.request("system-presence",{});Array.isArray(t)?(e.presenceEntries=t,e.presenceStatus=t.length===0?"No instances yet.":null):(e.presenceEntries=[],e.presenceStatus="No presence payload.")}catch(t){e.presenceError=String(t)}finally{e.presenceLoading=!1}}}async function Ht(e,t){if(!(!e.client||!e.connected)&&!e.sessionsLoading){e.sessionsLoading=!0,e.sessionsError=null;try{const n=t?.includeGlobal??e.sessionsIncludeGlobal,s=t?.includeUnknown??e.sessionsIncludeUnknown,i=t?.activeMinutes??ds(e.sessionsFilterActive,0),a=t?.limit??ds(e.sessionsFilterLimit,0),o={includeGlobal:n,includeUnknown:s};i>0&&(o.activeMinutes=i),a>0&&(o.limit=a);const r=await e.client.request("sessions.list",o);r&&(e.sessionsResult=r)}catch(n){e.sessionsError=String(n)}finally{e.sessionsLoading=!1}}}async function Yu(e,t,n){if(!e.client||!e.connected)return;const s={key:t};"label"in n&&(s.label=n.label),"thinkingLevel"in n&&(s.thinkingLevel=n.thinkingLevel),"verboseLevel"in n&&(s.verboseLevel=n.verboseLevel),"reasoningLevel"in n&&(s.reasoningLevel=n.reasoningLevel);try{await e.client.request("sessions.patch",s),await Ht(e)}catch(i){e.sessionsError=String(i)}}async function Zu(e,t){if(!e.client||!e.connected||e.sessionsLoading||!window.confirm(`Delete session "${t}"?
|
|
126
|
+
`],{type:"text/plain"}),s=URL.createObjectURL(n),i=document.createElement("a"),a=new Date().toISOString().slice(0,19).replace(/[:T]/g,"-");i.href=s,i.download=`openclaw-logs-${t}-${a}.log`,i.click(),URL.revokeObjectURL(s)}function Vd(e){if(typeof ResizeObserver>"u")return;const t=e.querySelector(".topbar");if(!t)return;const n=()=>{const{height:s}=t.getBoundingClientRect();e.style.setProperty("--topbar-height",`${s}px`)};n(),e.topbarObserver=new ResizeObserver(()=>n()),e.topbarObserver.observe(t)}async function Ss(e){if(!(!e.client||!e.connected)&&!e.debugLoading){e.debugLoading=!0;try{const[t,n,s,i]=await Promise.all([e.client.request("status",{}),e.client.request("health",{}),e.client.request("models.list",{}),e.client.request("last-heartbeat",{})]);e.debugStatus=t,e.debugHealth=n;const a=s;e.debugModels=Array.isArray(a?.models)?a?.models:[],e.debugHeartbeat=i}catch(t){e.debugCallError=String(t)}finally{e.debugLoading=!1}}}async function Qd(e){if(!(!e.client||!e.connected)){e.debugCallError=null,e.debugCallResult=null;try{const t=e.debugCallParams.trim()?JSON.parse(e.debugCallParams):{},n=await e.client.request(e.debugCallMethod.trim(),t);e.debugCallResult=JSON.stringify(n,null,2)}catch(t){e.debugCallError=String(t)}}}const Yd=2e3,Zd=new Set(["trace","debug","info","warn","error","fatal"]);function Jd(e){if(typeof e!="string")return null;const t=e.trim();if(!t.startsWith("{")||!t.endsWith("}"))return null;try{const n=JSON.parse(t);return!n||typeof n!="object"?null:n}catch{return null}}function Xd(e){if(typeof e!="string")return null;const t=e.toLowerCase();return Zd.has(t)?t:null}function eu(e){if(!e.trim())return{raw:e,message:e};try{const t=JSON.parse(e),n=t&&typeof t._meta=="object"&&t._meta!==null?t._meta:null,s=typeof t.time=="string"?t.time:typeof n?.date=="string"?n?.date:null,i=Xd(n?.logLevelName??n?.level),a=typeof t[0]=="string"?t[0]:typeof n?.name=="string"?n?.name:null,o=Jd(a);let r=null;o&&(typeof o.subsystem=="string"?r=o.subsystem:typeof o.module=="string"&&(r=o.module)),!r&&a&&a.length<120&&(r=a);let l=null;return typeof t[1]=="string"?l=t[1]:!o&&typeof t[0]=="string"?l=t[0]:typeof t.message=="string"&&(l=t.message),{raw:e,time:s,level:i,subsystem:r,message:l??e,meta:n??void 0}}catch{return{raw:e,message:e}}}async function Xi(e,t){if(!(!e.client||!e.connected)&&!(e.logsLoading&&!t?.quiet)){t?.quiet||(e.logsLoading=!0),e.logsError=null;try{const s=await e.client.request("logs.tail",{cursor:t?.reset?void 0:e.logsCursor??void 0,limit:e.logsLimit,maxBytes:e.logsMaxBytes}),a=(Array.isArray(s.lines)?s.lines.filter(r=>typeof r=="string"):[]).map(eu),o=!!(t?.reset||s.reset||e.logsCursor==null);e.logsEntries=o?a:[...e.logsEntries,...a].slice(-Yd),typeof s.cursor=="number"&&(e.logsCursor=s.cursor),typeof s.file=="string"&&(e.logsFile=s.file),e.logsTruncated=!!s.truncated,e.logsLastFetchAt=Date.now()}catch(n){e.logsError=String(n)}finally{t?.quiet||(e.logsLoading=!1)}}}async function As(e,t){if(!(!e.client||!e.connected)&&!e.nodesLoading){e.nodesLoading=!0,t?.quiet||(e.lastError=null);try{const n=await e.client.request("node.list",{});e.nodes=Array.isArray(n.nodes)?n.nodes:[]}catch(n){t?.quiet||(e.lastError=String(n))}finally{e.nodesLoading=!1}}}function tu(e){e.nodesPollInterval==null&&(e.nodesPollInterval=window.setInterval(()=>{As(e,{quiet:!0})},5e3))}function nu(e){e.nodesPollInterval!=null&&(clearInterval(e.nodesPollInterval),e.nodesPollInterval=null)}function ea(e){e.logsPollInterval==null&&(e.logsPollInterval=window.setInterval(()=>{e.tab==="logs"&&Xi(e,{quiet:!0})},2e3))}function ta(e){e.logsPollInterval!=null&&(clearInterval(e.logsPollInterval),e.logsPollInterval=null)}function na(e){e.debugPollInterval==null&&(e.debugPollInterval=window.setInterval(()=>{e.tab==="debug"&&Ss(e)},3e3))}function sa(e){e.debugPollInterval!=null&&(clearInterval(e.debugPollInterval),e.debugPollInterval=null)}async function Zr(e,t){if(!(!e.client||!e.connected||e.agentIdentityLoading)&&!e.agentIdentityById[t]){e.agentIdentityLoading=!0,e.agentIdentityError=null;try{const n=await e.client.request("agent.identity.get",{agentId:t});n&&(e.agentIdentityById={...e.agentIdentityById,[t]:n})}catch(n){e.agentIdentityError=String(n)}finally{e.agentIdentityLoading=!1}}}async function Jr(e,t){if(!e.client||!e.connected||e.agentIdentityLoading)return;const n=t.filter(s=>!e.agentIdentityById[s]);if(n.length!==0){e.agentIdentityLoading=!0,e.agentIdentityError=null;try{for(const s of n){const i=await e.client.request("agent.identity.get",{agentId:s});i&&(e.agentIdentityById={...e.agentIdentityById,[s]:i})}}catch(s){e.agentIdentityError=String(s)}finally{e.agentIdentityLoading=!1}}}async function ss(e,t){if(!(!e.client||!e.connected)&&!e.agentSkillsLoading){e.agentSkillsLoading=!0,e.agentSkillsError=null;try{const n=await e.client.request("skills.status",{agentId:t});n&&(e.agentSkillsReport=n,e.agentSkillsAgentId=t)}catch(n){e.agentSkillsError=String(n)}finally{e.agentSkillsLoading=!1}}}async function ia(e){if(!(!e.client||!e.connected)&&!e.agentsLoading){e.agentsLoading=!0,e.agentsError=null;try{const t=await e.client.request("agents.list",{});if(t){e.agentsList=t;const n=e.agentsSelectedId,s=t.agents.some(i=>i.id===n);(!n||!s)&&(e.agentsSelectedId=t.defaultId??t.agents[0]?.id??null)}}catch(t){e.agentsError=String(t)}finally{e.agentsLoading=!1}}}function aa(e,t){if(e==null||!Number.isFinite(e)||e<=0)return;if(e<1e3)return`${Math.round(e)}ms`;const n=t?.spaced?" ":"",s=Math.round(e/1e3),i=Math.floor(s/3600),a=Math.floor(s%3600/60),o=s%60;if(i>=24){const r=Math.floor(i/24),l=i%24;return l>0?`${r}d${n}${l}h`:`${r}d`}return i>0?a>0?`${i}h${n}${a}m`:`${i}h`:a>0?o>0?`${a}m${n}${o}s`:`${a}m`:`${o}s`}function oa(e,t="n/a"){if(e==null||!Number.isFinite(e)||e<0)return t;if(e<1e3)return`${Math.round(e)}ms`;const n=Math.round(e/1e3);if(n<60)return`${n}s`;const s=Math.round(n/60);if(s<60)return`${s}m`;const i=Math.round(s/60);return i<24?`${i}h`:`${Math.round(i/24)}d`}function ee(e,t){const n=t?.fallback??"n/a";if(e==null||!Number.isFinite(e))return n;const s=Date.now()-e,i=Math.abs(s),a=s>=0,o=Math.round(i/1e3);if(o<60)return a?"just now":"in <1m";const r=Math.round(o/60);if(r<60)return a?`${r}m ago`:`in ${r}m`;const l=Math.round(r/60);if(l<48)return a?`${l}h ago`:`in ${l}h`;const d=Math.round(l/24);return a?`${d}d ago`:`in ${d}d`}const su=/<\s*\/?\s*(?:think(?:ing)?|thought|antthinking|final)\b/i,jn=/<\s*\/?\s*final\b[^<>]*>/gi,mo=/<\s*(\/?)\s*(?:think(?:ing)?|thought|antthinking)\b[^<>]*>/gi;function vo(e){const t=[],n=/(^|\n)(```|~~~)[^\n]*\n[\s\S]*?(?:\n\2|$)/g;for(const i of e.matchAll(n)){const a=(i.index??0)+i[1].length;t.push({start:a,end:a+i[0].length-i[1].length})}const s=/`+[^`]+`+/g;for(const i of e.matchAll(s)){const a=i.index??0,o=a+i[0].length;t.some(l=>a>=l.start&&o<=l.end)||t.push({start:a,end:o})}return t.sort((i,a)=>i.start-a.start),t}function bo(e,t){return t.some(n=>e>=n.start&&e<n.end)}function iu(e,t){return e.trimStart()}function au(e,t){if(!e||!su.test(e))return e;let n=e;if(jn.test(n)){jn.lastIndex=0;const r=[],l=vo(n);for(const d of n.matchAll(jn)){const p=d.index??0;r.push({start:p,length:d[0].length,inCode:bo(p,l)})}for(let d=r.length-1;d>=0;d--){const p=r[d];p.inCode||(n=n.slice(0,p.start)+n.slice(p.start+p.length))}}else jn.lastIndex=0;const s=vo(n);mo.lastIndex=0;let i="",a=0,o=!1;for(const r of n.matchAll(mo)){const l=r.index??0,d=r[1]==="/";bo(l,s)||(o?d&&(o=!1):(i+=n.slice(a,l),d||(o=!0)),a=l+r[0].length)}return i+=n.slice(a),iu(i)}function Ot(e){return!e&&e!==0?"n/a":new Date(e).toLocaleString()}function yi(e){return!e||e.length===0?"none":e.filter(t=>!!(t&&t.trim())).join(", ")}function xi(e,t=120){return e.length<=t?e:`${e.slice(0,Math.max(0,t-1))}…`}function Xr(e,t){return e.length<=t?{text:e,truncated:!1,total:e.length}:{text:e.slice(0,Math.max(0,t)),truncated:!0,total:e.length}}function ds(e,t){const n=Number(e);return Number.isFinite(n)?n:t}function qs(e){return au(e)}function ou(e){return e.sessionTarget==="isolated"&&e.payloadKind==="agentTurn"}function el(e){return e.deliveryMode!=="announce"||ou(e)?e:{...e,deliveryMode:"none"}}async function Fn(e){if(!(!e.client||!e.connected))try{const t=await e.client.request("cron.status",{});e.cronStatus=t}catch(t){e.cronError=String(t)}}async function Cs(e){if(!(!e.client||!e.connected)&&!e.cronLoading){e.cronLoading=!0,e.cronError=null;try{const t=await e.client.request("cron.list",{includeDisabled:!0});e.cronJobs=Array.isArray(t.jobs)?t.jobs:[]}catch(t){e.cronError=String(t)}finally{e.cronLoading=!1}}}function ru(e){if(e.scheduleKind==="at"){const n=Date.parse(e.scheduleAt);if(!Number.isFinite(n))throw new Error("Invalid run time.");return{kind:"at",at:new Date(n).toISOString()}}if(e.scheduleKind==="every"){const n=ds(e.everyAmount,0);if(n<=0)throw new Error("Invalid interval amount.");const s=e.everyUnit;return{kind:"every",everyMs:n*(s==="minutes"?6e4:s==="hours"?36e5:864e5)}}const t=e.cronExpr.trim();if(!t)throw new Error("Cron expression required.");return{kind:"cron",expr:t,tz:e.cronTz.trim()||void 0}}function lu(e){if(e.payloadKind==="systemEvent"){const i=e.payloadText.trim();if(!i)throw new Error("System event text required.");return{kind:"systemEvent",text:i}}const t=e.payloadText.trim();if(!t)throw new Error("Agent message required.");const n={kind:"agentTurn",message:t},s=ds(e.timeoutSeconds,0);return s>0&&(n.timeoutSeconds=s),n}async function cu(e){if(!(!e.client||!e.connected||e.cronBusy)){e.cronBusy=!0,e.cronError=null;try{const t=el(e.cronForm);t!==e.cronForm&&(e.cronForm=t);const n=ru(t),s=lu(t),i=t.deliveryMode,a=i&&i!=="none"?{mode:i,channel:i==="announce"?t.deliveryChannel.trim()||"last":void 0,to:t.deliveryTo.trim()||void 0}:void 0,o=t.agentId.trim(),r={name:t.name.trim(),description:t.description.trim()||void 0,agentId:o||void 0,enabled:t.enabled,schedule:n,sessionTarget:t.sessionTarget,wakeMode:t.wakeMode,payload:s,delivery:a};if(!r.name)throw new Error("Name required.");await e.client.request("cron.add",r),e.cronForm={...e.cronForm,name:"",description:"",payloadText:""},await Cs(e),await Fn(e)}catch(t){e.cronError=String(t)}finally{e.cronBusy=!1}}}async function du(e,t,n){if(!(!e.client||!e.connected||e.cronBusy)){e.cronBusy=!0,e.cronError=null;try{await e.client.request("cron.update",{id:t.id,patch:{enabled:n}}),await Cs(e),await Fn(e)}catch(s){e.cronError=String(s)}finally{e.cronBusy=!1}}}async function uu(e,t){if(!(!e.client||!e.connected||e.cronBusy)){e.cronBusy=!0,e.cronError=null;try{await e.client.request("cron.run",{id:t.id,mode:"force"}),await tl(e,t.id)}catch(n){e.cronError=String(n)}finally{e.cronBusy=!1}}}async function gu(e,t){if(!(!e.client||!e.connected||e.cronBusy)){e.cronBusy=!0,e.cronError=null;try{await e.client.request("cron.remove",{id:t.id}),e.cronRunsJobId===t.id&&(e.cronRunsJobId=null,e.cronRuns=[]),await Cs(e),await Fn(e)}catch(n){e.cronError=String(n)}finally{e.cronBusy=!1}}}async function tl(e,t){if(!(!e.client||!e.connected))try{const n=await e.client.request("cron.runs",{id:t,limit:50});e.cronRunsJobId=t,e.cronRuns=Array.isArray(n.entries)?n.entries:[]}catch(n){e.cronError=String(n)}}function ra(e){return e.trim()}function pu(e){if(!Array.isArray(e))return[];const t=new Set;for(const n of e){const s=n.trim();s&&t.add(s)}return[...t].toSorted()}const nl="openclaw.device.auth.v1";function la(){try{const e=window.localStorage.getItem(nl);if(!e)return null;const 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 sl(e){try{window.localStorage.setItem(nl,JSON.stringify(e))}catch{}}function fu(e){const t=la();if(!t||t.deviceId!==e.deviceId)return null;const n=ra(e.role),s=t.tokens[n];return!s||typeof s.token!="string"?null:s}function il(e){const t=ra(e.role),n={version:1,deviceId:e.deviceId,tokens:{}},s=la();s&&s.deviceId===e.deviceId&&(n.tokens={...s.tokens});const i={token:e.token,role:t,scopes:pu(e.scopes),updatedAtMs:Date.now()};return n.tokens[t]=i,sl(n),i}function al(e){const t=la();if(!t||t.deviceId!==e.deviceId)return;const n=ra(e.role);if(!t.tokens[n])return;const s={...t,tokens:{...t.tokens}};delete s.tokens[n],sl(s)}const ol={p:0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffedn,n:0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3edn,h:8n,a:0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffecn,d:0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3n,Gx:0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51an,Gy:0x6666666666666666666666666666666666666666666666666666666666666658n},{p:ye,n:is,Gx:yo,Gy:xo,a:Gs,d:Vs,h:hu}=ol,Bt=32,ca=64,mu=(...e)=>{"captureStackTrace"in Error&&typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(...e)},pe=(e="")=>{const t=new Error(e);throw mu(t,pe),t},vu=e=>typeof e=="bigint",bu=e=>typeof e=="string",yu=e=>e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array",bt=(e,t,n="")=>{const s=yu(e),i=e?.length,a=t!==void 0;if(!s||a&&i!==t){const o=n&&`"${n}" `,r=a?` of length ${t}`:"",l=s?`length=${i}`:`type=${typeof e}`;pe(o+"expected Uint8Array"+r+", got "+l)}return e},Ts=e=>new Uint8Array(e),rl=e=>Uint8Array.from(e),ll=(e,t)=>e.toString(16).padStart(t,"0"),cl=e=>Array.from(bt(e)).map(t=>ll(t,2)).join(""),et={_0:48,_9:57,A:65,F:70,a:97,f:102},$o=e=>{if(e>=et._0&&e<=et._9)return e-et._0;if(e>=et.A&&e<=et.F)return e-(et.A-10);if(e>=et.a&&e<=et.f)return e-(et.a-10)},dl=e=>{const t="hex invalid";if(!bu(e))return pe(t);const n=e.length,s=n/2;if(n%2)return pe(t);const i=Ts(s);for(let a=0,o=0;a<s;a++,o+=2){const r=$o(e.charCodeAt(o)),l=$o(e.charCodeAt(o+1));if(r===void 0||l===void 0)return pe(t);i[a]=r*16+l}return i},ul=()=>globalThis?.crypto,xu=()=>ul()?.subtle??pe("crypto.subtle must be defined, consider polyfill"),Mn=(...e)=>{const t=Ts(e.reduce((s,i)=>s+bt(i).length,0));let n=0;return e.forEach(s=>{t.set(s,n),n+=s.length}),t},$u=(e=Bt)=>ul().getRandomValues(Ts(e)),us=BigInt,_t=(e,t,n,s="bad number: out of range")=>vu(e)&&t<=e&&e<n?e:pe(s),N=(e,t=ye)=>{const n=e%t;return n>=0n?n:t+n},gl=e=>N(e,is),wu=(e,t)=>{(e===0n||t<=0n)&&pe("no inverse n="+e+" mod="+t);let n=N(e,t),s=t,i=0n,a=1n;for(;n!==0n;){const o=s/n,r=s%n,l=i-a*o;s=n,n=r,i=a,a=l}return s===1n?N(i,t):pe("no inverse")},ku=e=>{const t=ml[e];return typeof t!="function"&&pe("hashes."+e+" not set"),t},Qs=e=>e instanceof Me?e:pe("Point expected"),$i=2n**256n;class Me{static BASE;static ZERO;X;Y;Z;T;constructor(t,n,s,i){const a=$i;this.X=_t(t,0n,a),this.Y=_t(n,0n,a),this.Z=_t(s,1n,a),this.T=_t(i,0n,a),Object.freeze(this)}static CURVE(){return ol}static fromAffine(t){return new Me(t.x,t.y,1n,N(t.x*t.y))}static fromBytes(t,n=!1){const s=Vs,i=rl(bt(t,Bt)),a=t[31];i[31]=a&-129;const o=fl(i);_t(o,0n,n?$i:ye);const l=N(o*o),d=N(l-1n),p=N(s*l+1n);let{isValid:g,value:h}=Au(d,p);g||pe("bad point: y not sqrt");const u=(h&1n)===1n,f=(a&128)!==0;return!n&&h===0n&&f&&pe("bad point: x==0, isLastByteOdd"),f!==u&&(h=N(-h)),new Me(h,o,1n,N(h*o))}static fromHex(t,n){return Me.fromBytes(dl(t),n)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}assertValidity(){const t=Gs,n=Vs,s=this;if(s.is0())return pe("bad point: ZERO");const{X:i,Y:a,Z:o,T:r}=s,l=N(i*i),d=N(a*a),p=N(o*o),g=N(p*p),h=N(l*t),u=N(p*N(h+d)),f=N(g+N(n*N(l*d)));if(u!==f)return pe("bad point: equation left != right (1)");const v=N(i*a),w=N(o*r);return v!==w?pe("bad point: equation left != right (2)"):this}equals(t){const{X:n,Y:s,Z:i}=this,{X:a,Y:o,Z:r}=Qs(t),l=N(n*r),d=N(a*i),p=N(s*r),g=N(o*i);return l===d&&p===g}is0(){return this.equals(Xt)}negate(){return new Me(N(-this.X),this.Y,this.Z,N(-this.T))}double(){const{X:t,Y:n,Z:s}=this,i=Gs,a=N(t*t),o=N(n*n),r=N(2n*N(s*s)),l=N(i*a),d=t+n,p=N(N(d*d)-a-o),g=l+o,h=g-r,u=l-o,f=N(p*h),v=N(g*u),w=N(p*u),S=N(h*g);return new Me(f,v,S,w)}add(t){const{X:n,Y:s,Z:i,T:a}=this,{X:o,Y:r,Z:l,T:d}=Qs(t),p=Gs,g=Vs,h=N(n*o),u=N(s*r),f=N(a*g*d),v=N(i*l),w=N((n+s)*(o+r)-h-u),S=N(v-f),C=N(v+f),k=N(u-p*h),A=N(w*S),E=N(C*k),T=N(w*k),R=N(S*C);return new Me(A,E,R,T)}subtract(t){return this.add(Qs(t).negate())}multiply(t,n=!0){if(!n&&(t===0n||this.is0()))return Xt;if(_t(t,1n,is),t===1n)return this;if(this.equals(Ut))return Fu(t).p;let s=Xt,i=Ut;for(let a=this;t>0n;a=a.double(),t>>=1n)t&1n?s=s.add(a):n&&(i=i.add(a));return s}multiplyUnsafe(t){return this.multiply(t,!1)}toAffine(){const{X:t,Y:n,Z:s}=this;if(this.equals(Xt))return{x:0n,y:1n};const i=wu(s,ye);N(s*i)!==1n&&pe("invalid inverse");const a=N(t*i),o=N(n*i);return{x:a,y:o}}toBytes(){const{x:t,y:n}=this.assertValidity().toAffine(),s=pl(n);return s[31]|=t&1n?128:0,s}toHex(){return cl(this.toBytes())}clearCofactor(){return this.multiply(us(hu),!1)}isSmallOrder(){return this.clearCofactor().is0()}isTorsionFree(){let t=this.multiply(is/2n,!1).double();return is%2n&&(t=t.add(this)),t.is0()}}const Ut=new Me(yo,xo,1n,N(yo*xo)),Xt=new Me(0n,1n,1n,0n);Me.BASE=Ut;Me.ZERO=Xt;const pl=e=>dl(ll(_t(e,0n,$i),ca)).reverse(),fl=e=>us("0x"+cl(rl(bt(e)).reverse())),He=(e,t)=>{let n=e;for(;t-- >0n;)n*=n,n%=ye;return n},Su=e=>{const n=e*e%ye*e%ye,s=He(n,2n)*n%ye,i=He(s,1n)*e%ye,a=He(i,5n)*i%ye,o=He(a,10n)*a%ye,r=He(o,20n)*o%ye,l=He(r,40n)*r%ye,d=He(l,80n)*l%ye,p=He(d,80n)*l%ye,g=He(p,10n)*a%ye;return{pow_p_5_8:He(g,2n)*e%ye,b2:n}},wo=0x2b8324804fc1df0b2b4d00993dfbd7a72f431806ad2fe478c4ee1b274a0ea0b0n,Au=(e,t)=>{const n=N(t*t*t),s=N(n*n*t),i=Su(e*s).pow_p_5_8;let a=N(e*n*i);const o=N(t*a*a),r=a,l=N(a*wo),d=o===e,p=o===N(-e),g=o===N(-e*wo);return d&&(a=r),(p||g)&&(a=l),(N(a)&1n)===1n&&(a=N(-a)),{isValid:d||p,value:a}},wi=e=>gl(fl(e)),da=(...e)=>ml.sha512Async(Mn(...e)),Cu=(...e)=>ku("sha512")(Mn(...e)),hl=e=>{const t=e.slice(0,Bt);t[0]&=248,t[31]&=127,t[31]|=64;const n=e.slice(Bt,ca),s=wi(t),i=Ut.multiply(s),a=i.toBytes();return{head:t,prefix:n,scalar:s,point:i,pointBytes:a}},ua=e=>da(bt(e,Bt)).then(hl),Tu=e=>hl(Cu(bt(e,Bt))),_u=e=>ua(e).then(t=>t.pointBytes),Eu=e=>da(e.hashable).then(e.finish),Lu=(e,t,n)=>{const{pointBytes:s,scalar:i}=e,a=wi(t),o=Ut.multiply(a).toBytes();return{hashable:Mn(o,s,n),finish:d=>{const p=gl(a+wi(d)*i);return bt(Mn(o,pl(p)),ca)}}},Mu=async(e,t)=>{const n=bt(e),s=await ua(t),i=await da(s.prefix,n);return Eu(Lu(s,i,n))},ml={sha512Async:async e=>{const t=xu(),n=Mn(e);return Ts(await t.digest("SHA-512",n.buffer))},sha512:void 0},Ru=(e=$u(Bt))=>e,Iu={getExtendedPublicKeyAsync:ua,getExtendedPublicKey:Tu,randomSecretKey:Ru},gs=8,Pu=256,vl=Math.ceil(Pu/gs)+1,ki=2**(gs-1),Du=()=>{const e=[];let t=Ut,n=t;for(let s=0;s<vl;s++){n=t,e.push(n);for(let i=1;i<ki;i++)n=n.add(t),e.push(n);t=n.double()}return e};let ko;const So=(e,t)=>{const n=t.negate();return e?n:t},Fu=e=>{const t=ko||(ko=Du());let n=Xt,s=Ut;const i=2**gs,a=i,o=us(i-1),r=us(gs);for(let l=0;l<vl;l++){let d=Number(e&o);e>>=r,d>ki&&(d-=a,e+=1n);const p=l*ki,g=p,h=p+Math.abs(d)-1,u=l%2!==0,f=d<0;d===0?s=s.add(So(u,t[g])):n=n.add(So(f,t[h]))}return e!==0n&&pe("invalid wnaf"),{p:n,f:s}},Ys="openclaw-device-identity-v1";function Si(e){let t="";for(const n of e)t+=String.fromCharCode(n);return btoa(t).replaceAll("+","-").replaceAll("/","_").replace(/=+$/g,"")}function bl(e){const t=e.replaceAll("-","+").replaceAll("_","/"),n=t+"=".repeat((4-t.length%4)%4),s=atob(n),i=new Uint8Array(s.length);for(let a=0;a<s.length;a+=1)i[a]=s.charCodeAt(a);return i}function Nu(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}async function yl(e){const t=await crypto.subtle.digest("SHA-256",e.slice().buffer);return Nu(new Uint8Array(t))}async function Ou(){const e=Iu.randomSecretKey(),t=await _u(e);return{deviceId:await yl(t),publicKey:Si(t),privateKey:Si(e)}}async function ga(){try{const n=localStorage.getItem(Ys);if(n){const s=JSON.parse(n);if(s?.version===1&&typeof s.deviceId=="string"&&typeof s.publicKey=="string"&&typeof s.privateKey=="string"){const i=await yl(bl(s.publicKey));if(i!==s.deviceId){const a={...s,deviceId:i};return localStorage.setItem(Ys,JSON.stringify(a)),{deviceId:i,publicKey:s.publicKey,privateKey:s.privateKey}}return{deviceId:s.deviceId,publicKey:s.publicKey,privateKey:s.privateKey}}}}catch{}const e=await Ou(),t={version:1,deviceId:e.deviceId,publicKey:e.publicKey,privateKey:e.privateKey,createdAtMs:Date.now()};return localStorage.setItem(Ys,JSON.stringify(t)),e}async function Bu(e,t){const n=bl(e),s=new TextEncoder().encode(t),i=await Mu(s,n);return Si(i)}async function yt(e,t){if(!(!e.client||!e.connected)&&!e.devicesLoading){e.devicesLoading=!0,t?.quiet||(e.devicesError=null);try{const n=await e.client.request("device.pair.list",{});e.devicesList={pending:Array.isArray(n?.pending)?n.pending:[],paired:Array.isArray(n?.paired)?n.paired:[]}}catch(n){t?.quiet||(e.devicesError=String(n))}finally{e.devicesLoading=!1}}}async function Uu(e,t){if(!(!e.client||!e.connected))try{await e.client.request("device.pair.approve",{requestId:t}),await yt(e)}catch(n){e.devicesError=String(n)}}async function zu(e,t){if(!(!e.client||!e.connected||!window.confirm("Reject this device pairing request?")))try{await e.client.request("device.pair.reject",{requestId:t}),await yt(e)}catch(s){e.devicesError=String(s)}}async function Hu(e,t){if(!(!e.client||!e.connected))try{const n=await e.client.request("device.token.rotate",t);if(n?.token){const s=await ga(),i=n.role??t.role;(n.deviceId===s.deviceId||t.deviceId===s.deviceId)&&il({deviceId:s.deviceId,role:i,token:n.token,scopes:n.scopes??t.scopes??[]}),window.prompt("New device token (copy and store securely):",n.token)}await yt(e)}catch(n){e.devicesError=String(n)}}async function ju(e,t){if(!(!e.client||!e.connected||!window.confirm(`Revoke token for ${t.deviceId} (${t.role})?`)))try{await e.client.request("device.token.revoke",t);const s=await ga();t.deviceId===s.deviceId&&al({deviceId:s.deviceId,role:t.role}),await yt(e)}catch(s){e.devicesError=String(s)}}function Ku(e){if(!e||e.kind==="gateway")return{method:"exec.approvals.get",params:{}};const t=e.nodeId.trim();return t?{method:"exec.approvals.node.get",params:{nodeId:t}}:null}function Wu(e,t){if(!e||e.kind==="gateway")return{method:"exec.approvals.set",params:t};const n=e.nodeId.trim();return n?{method:"exec.approvals.node.set",params:{...t,nodeId:n}}:null}async function pa(e,t){if(!(!e.client||!e.connected)&&!e.execApprovalsLoading){e.execApprovalsLoading=!0,e.lastError=null;try{const n=Ku(t);if(!n){e.lastError="Select a node before loading exec approvals.";return}const s=await e.client.request(n.method,n.params);qu(e,s)}catch(n){e.lastError=String(n)}finally{e.execApprovalsLoading=!1}}}function qu(e,t){e.execApprovalsSnapshot=t,e.execApprovalsDirty||(e.execApprovalsForm=Nt(t.file??{}))}async function Gu(e,t){if(!(!e.client||!e.connected)){e.execApprovalsSaving=!0,e.lastError=null;try{const n=e.execApprovalsSnapshot?.hash;if(!n){e.lastError="Exec approvals hash missing; reload and retry.";return}const s=e.execApprovalsForm??e.execApprovalsSnapshot?.file??{},i=Wu(t,{file:s,baseHash:n});if(!i){e.lastError="Select a node before saving exec approvals.";return}await e.client.request(i.method,i.params),e.execApprovalsDirty=!1,await pa(e,t)}catch(n){e.lastError=String(n)}finally{e.execApprovalsSaving=!1}}}function Vu(e,t,n){const s=Nt(e.execApprovalsForm??e.execApprovalsSnapshot?.file??{});Hr(s,t,n),e.execApprovalsForm=s,e.execApprovalsDirty=!0}function Qu(e,t){const n=Nt(e.execApprovalsForm??e.execApprovalsSnapshot?.file??{});jr(n,t),e.execApprovalsForm=n,e.execApprovalsDirty=!0}async function fa(e){if(!(!e.client||!e.connected)&&!e.presenceLoading){e.presenceLoading=!0,e.presenceError=null,e.presenceStatus=null;try{const t=await e.client.request("system-presence",{});Array.isArray(t)?(e.presenceEntries=t,e.presenceStatus=t.length===0?"No instances yet.":null):(e.presenceEntries=[],e.presenceStatus="No presence payload.")}catch(t){e.presenceError=String(t)}finally{e.presenceLoading=!1}}}async function Ht(e,t){if(!(!e.client||!e.connected)&&!e.sessionsLoading){e.sessionsLoading=!0,e.sessionsError=null;try{const n=t?.includeGlobal??e.sessionsIncludeGlobal,s=t?.includeUnknown??e.sessionsIncludeUnknown,i=t?.activeMinutes??ds(e.sessionsFilterActive,0),a=t?.limit??ds(e.sessionsFilterLimit,0),o={includeGlobal:n,includeUnknown:s};i>0&&(o.activeMinutes=i),a>0&&(o.limit=a);const r=await e.client.request("sessions.list",o);r&&(e.sessionsResult=r)}catch(n){e.sessionsError=String(n)}finally{e.sessionsLoading=!1}}}async function Yu(e,t,n){if(!e.client||!e.connected)return;const s={key:t};"label"in n&&(s.label=n.label),"thinkingLevel"in n&&(s.thinkingLevel=n.thinkingLevel),"verboseLevel"in n&&(s.verboseLevel=n.verboseLevel),"reasoningLevel"in n&&(s.reasoningLevel=n.reasoningLevel);try{await e.client.request("sessions.patch",s),await Ht(e)}catch(i){e.sessionsError=String(i)}}async function Zu(e,t){if(!e.client||!e.connected||e.sessionsLoading||!window.confirm(`Delete session "${t}"?
|
|
127
127
|
|
|
128
128
|
Deletes the session entry and archives its transcript.`))return!1;e.sessionsLoading=!0,e.sessionsError=null;try{return await e.client.request("sessions.delete",{key:t,deleteTranscript:!0}),!0}catch(s){return e.sessionsError=String(s),!1}finally{e.sessionsLoading=!1}}async function Ju(e,t){return await Zu(e,t)?(await Ht(e),!0):!1}function nn(e,t,n){if(!t.trim())return;const s={...e.skillMessages};n?s[t]=n:delete s[t],e.skillMessages=s}function _s(e){return e instanceof Error?e.message:String(e)}async function Nn(e,t){if(t?.clearMessages&&Object.keys(e.skillMessages).length>0&&(e.skillMessages={}),!(!e.client||!e.connected)&&!e.skillsLoading){e.skillsLoading=!0,e.skillsError=null;try{const n=await e.client.request("skills.status",{});n&&(e.skillsReport=n)}catch(n){e.skillsError=_s(n)}finally{e.skillsLoading=!1}}}function Xu(e,t,n){e.skillEdits={...e.skillEdits,[t]:n}}async function eg(e,t,n){if(!(!e.client||!e.connected)){e.skillsBusyKey=t,e.skillsError=null;try{await e.client.request("skills.update",{skillKey:t,enabled:n}),await Nn(e),nn(e,t,{kind:"success",message:n?"Skill enabled":"Skill disabled"})}catch(s){const i=_s(s);e.skillsError=i,nn(e,t,{kind:"error",message:i})}finally{e.skillsBusyKey=null}}}async function tg(e,t){if(!(!e.client||!e.connected)){e.skillsBusyKey=t,e.skillsError=null;try{const n=e.skillEdits[t]??"";await e.client.request("skills.update",{skillKey:t,apiKey:n}),await Nn(e),nn(e,t,{kind:"success",message:"API key saved"})}catch(n){const s=_s(n);e.skillsError=s,nn(e,t,{kind:"error",message:s})}finally{e.skillsBusyKey=null}}}async function ng(e,t,n,s){if(!(!e.client||!e.connected)){e.skillsBusyKey=t,e.skillsError=null;try{const i=await e.client.request("skills.install",{name:n,installId:s,timeoutMs:12e4});await Nn(e),nn(e,t,{kind:"success",message:i?.message??"Installed"})}catch(i){const a=_s(i);e.skillsError=a,nn(e,t,{kind:"error",message:a})}finally{e.skillsBusyKey=null}}}const sg=[{label:"chat",tabs:["chat"]},{label:"control",tabs:["overview","channels","instances","sessions","usage","cron"]},{label:"agent",tabs:["agents","skills","nodes"]},{label:"settings",tabs:["config","debug","logs"]}],xl={agents:"/agents",overview:"/overview",channels:"/channels",instances:"/instances",sessions:"/sessions",usage:"/usage",cron:"/cron",skills:"/skills",nodes:"/nodes",chat:"/chat",config:"/config",debug:"/debug",logs:"/logs"},$l=new Map(Object.entries(xl).map(([e,t])=>[t,e]));function an(e){if(!e)return"";let t=e.trim();return t.startsWith("/")||(t=`/${t}`),t==="/"?"":(t.endsWith("/")&&(t=t.slice(0,-1)),t)}function Rn(e){if(!e)return"/";let t=e.trim();return t.startsWith("/")||(t=`/${t}`),t.length>1&&t.endsWith("/")&&(t=t.slice(0,-1)),t}function Es(e,t=""){const n=an(t),s=xl[e];return n?`${n}${s}`:s}function wl(e,t=""){const n=an(t);let s=e||"/";n&&(s===n?s="/":s.startsWith(`${n}/`)&&(s=s.slice(n.length)));let i=Rn(s).toLowerCase();return i.endsWith("/index.html")&&(i="/"),i==="/"?"chat":$l.get(i)??null}function ig(e){let t=Rn(e);if(t.endsWith("/index.html")&&(t=Rn(t.slice(0,-11))),t==="/")return"";const n=t.split("/").filter(Boolean);if(n.length===0)return"";for(let s=0;s<n.length;s++){const i=`/${n.slice(s).join("/")}`.toLowerCase();if($l.has(i)){const a=n.slice(0,s);return a.length?`/${a.join("/")}`:""}}return`/${n.join("/")}`}function ag(e){switch(e){case"agents":return"folder";case"chat":return"messageSquare";case"overview":return"barChart";case"channels":return"link";case"instances":return"radio";case"sessions":return"fileText";case"usage":return"barChart";case"cron":return"loader";case"skills":return"zap";case"nodes":return"monitor";case"config":return"settings";case"debug":return"bug";case"logs":return"scrollText";default:return"folder"}}function Ai(e){return P(`tabs.${e}`)}function og(e){return P(`subtitles.${e}`)}const kl="openclaw.control.settings.v1";function rg(){const t={gatewayUrl:`${location.protocol==="https:"?"wss":"ws"}://${location.host}`,token:"",sessionKey:"main",lastActiveSessionKey:"main",theme:"system",chatFocusMode:!1,chatShowThinking:!0,splitRatio:.6,navCollapsed:!1,navGroupsCollapsed:{}};try{const n=localStorage.getItem(kl);if(!n)return t;const s=JSON.parse(n);return{gatewayUrl:typeof s.gatewayUrl=="string"&&s.gatewayUrl.trim()?s.gatewayUrl.trim():t.gatewayUrl,token:typeof s.token=="string"?s.token:t.token,sessionKey:typeof s.sessionKey=="string"&&s.sessionKey.trim()?s.sessionKey.trim():t.sessionKey,lastActiveSessionKey:typeof s.lastActiveSessionKey=="string"&&s.lastActiveSessionKey.trim()?s.lastActiveSessionKey.trim():typeof s.sessionKey=="string"&&s.sessionKey.trim()||t.lastActiveSessionKey,theme:s.theme==="light"||s.theme==="dark"||s.theme==="system"?s.theme:t.theme,chatFocusMode:typeof s.chatFocusMode=="boolean"?s.chatFocusMode:t.chatFocusMode,chatShowThinking:typeof s.chatShowThinking=="boolean"?s.chatShowThinking:t.chatShowThinking,splitRatio:typeof s.splitRatio=="number"&&s.splitRatio>=.4&&s.splitRatio<=.7?s.splitRatio:t.splitRatio,navCollapsed:typeof s.navCollapsed=="boolean"?s.navCollapsed:t.navCollapsed,navGroupsCollapsed:typeof s.navGroupsCollapsed=="object"&&s.navGroupsCollapsed!==null?s.navGroupsCollapsed:t.navGroupsCollapsed,locale:Zi(s.locale)?s.locale:void 0}}catch{return t}}function lg(e){localStorage.setItem(kl,JSON.stringify(e))}const Kn=e=>Number.isNaN(e)?.5:e<=0?0:e>=1?1:e,cg=()=>typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches??!1,Wn=e=>{e.classList.remove("theme-transition"),e.style.removeProperty("--theme-switch-x"),e.style.removeProperty("--theme-switch-y")},dg=({nextTheme:e,applyTheme:t,context:n,currentTheme:s})=>{if(s===e)return;const i=globalThis.document??null;if(!i){t();return}const a=i.documentElement,o=i,r=cg();if(!!o.startViewTransition&&!r){let d=.5,p=.5;if(n?.pointerClientX!==void 0&&n?.pointerClientY!==void 0&&typeof window<"u")d=Kn(n.pointerClientX/window.innerWidth),p=Kn(n.pointerClientY/window.innerHeight);else if(n?.element){const g=n.element.getBoundingClientRect();g.width>0&&g.height>0&&typeof window<"u"&&(d=Kn((g.left+g.width/2)/window.innerWidth),p=Kn((g.top+g.height/2)/window.innerHeight))}a.style.setProperty("--theme-switch-x",`${d*100}%`),a.style.setProperty("--theme-switch-y",`${p*100}%`),a.classList.add("theme-transition");try{const g=o.startViewTransition?.(()=>{t()});g?.finished?g.finished.finally(()=>Wn(a)):Wn(a)}catch{Wn(a),t()}return}t(),Wn(a)};function ug(){return typeof window>"u"||typeof window.matchMedia!="function"||window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function ha(e){return e==="system"?ug():e}function mt(e,t){const n={...t,lastActiveSessionKey:t.lastActiveSessionKey?.trim()||t.sessionKey.trim()||"main"};e.settings=n,lg(n),t.theme!==e.theme&&(e.theme=t.theme,Ls(e,ha(t.theme))),e.applySessionKey=e.settings.lastActiveSessionKey}function Sl(e,t){const n=t.trim();n&&e.settings.lastActiveSessionKey!==n&&mt(e,{...e.settings,lastActiveSessionKey:n})}function gg(e){if(!window.location.search&&!window.location.hash)return;const t=new URL(window.location.href),n=new URLSearchParams(t.search),s=new URLSearchParams(t.hash.startsWith("#")?t.hash.slice(1):t.hash),i=n.get("token")??s.get("token"),a=n.get("password")??s.get("password"),o=n.get("session")??s.get("session"),r=n.get("gatewayUrl")??s.get("gatewayUrl");let l=!1;if(i!=null){const p=i.trim();p&&p!==e.settings.token&&mt(e,{...e.settings,token:p}),n.delete("token"),s.delete("token"),l=!0}if(a!=null&&(n.delete("password"),s.delete("password"),l=!0),o!=null){const p=o.trim();p&&(e.sessionKey=p,mt(e,{...e.settings,sessionKey:p,lastActiveSessionKey:p}))}if(r!=null){const p=r.trim();p&&p!==e.settings.gatewayUrl&&(e.pendingGatewayUrl=p),n.delete("gatewayUrl"),s.delete("gatewayUrl"),l=!0}if(!l)return;t.search=n.toString();const d=s.toString();t.hash=d?`#${d}`:"",window.history.replaceState({},"",t.toString())}function pg(e,t){e.tab!==t&&(e.tab=t),t==="chat"&&(e.chatHasAutoScrolled=!1),t==="logs"?ea(e):ta(e),t==="debug"?na(e):sa(e),ma(e),Cl(e,t,!1)}function fg(e,t,n){dg({nextTheme:t,applyTheme:()=>{e.theme=t,mt(e,{...e.settings,theme:t}),Ls(e,ha(t))},context:n,currentTheme:e.theme})}async function ma(e){if(e.tab==="overview"&&await Tl(e),e.tab==="channels"&&await wg(e),e.tab==="instances"&&await fa(e),e.tab==="sessions"&&await Ht(e),e.tab==="cron"&&await ps(e),e.tab==="skills"&&await Nn(e),e.tab==="agents"){await ia(e),await Oe(e);const t=e.agentsList?.agents?.map(s=>s.id)??[];t.length>0&&Jr(e,t);const n=e.agentsSelectedId??e.agentsList?.defaultId??e.agentsList?.agents?.[0]?.id;n&&(Zr(e,n),e.agentsPanel==="skills"&&ss(e,n),e.agentsPanel==="channels"&&Ce(e,!1),e.agentsPanel==="cron"&&ps(e))}e.tab==="nodes"&&(await As(e),await yt(e),await Oe(e),await pa(e)),e.tab==="chat"&&(await Fl(e),Dn(e,!e.chatHasAutoScrolled)),e.tab==="config"&&(await Kr(e),await Oe(e)),e.tab==="debug"&&(await Ss(e),e.eventLog=e.eventLogBuffer),e.tab==="logs"&&(e.logsAtBottom=!0,await Xi(e,{reset:!0}),Yr(e,!0))}function hg(){if(typeof window>"u")return"";const e=window.__OPENCLAW_CONTROL_UI_BASE_PATH__;return typeof e=="string"&&e.trim()?an(e):ig(window.location.pathname)}function mg(e){e.theme=e.settings.theme??"system",Ls(e,ha(e.theme))}function Ls(e,t){if(e.themeResolved=t,typeof document>"u")return;const n=document.documentElement;n.dataset.theme=t,n.style.colorScheme=t}function vg(e){if(typeof window>"u"||typeof window.matchMedia!="function")return;if(e.themeMedia=window.matchMedia("(prefers-color-scheme: dark)"),e.themeMediaHandler=n=>{e.theme==="system"&&Ls(e,n.matches?"dark":"light")},typeof e.themeMedia.addEventListener=="function"){e.themeMedia.addEventListener("change",e.themeMediaHandler);return}e.themeMedia.addListener(e.themeMediaHandler)}function bg(e){if(!e.themeMedia||!e.themeMediaHandler)return;if(typeof e.themeMedia.removeEventListener=="function"){e.themeMedia.removeEventListener("change",e.themeMediaHandler);return}e.themeMedia.removeListener(e.themeMediaHandler),e.themeMedia=null,e.themeMediaHandler=null}function yg(e,t){if(typeof window>"u")return;const n=wl(window.location.pathname,e.basePath)??"chat";Al(e,n),Cl(e,n,t)}function xg(e){if(typeof window>"u")return;const t=wl(window.location.pathname,e.basePath);if(!t)return;const s=new URL(window.location.href).searchParams.get("session")?.trim();s&&(e.sessionKey=s,mt(e,{...e.settings,sessionKey:s,lastActiveSessionKey:s})),Al(e,t)}function Al(e,t){e.tab!==t&&(e.tab=t),t==="chat"&&(e.chatHasAutoScrolled=!1),t==="logs"?ea(e):ta(e),t==="debug"?na(e):sa(e),e.connected&&ma(e)}function Cl(e,t,n){if(typeof window>"u")return;const s=Rn(Es(t,e.basePath)),i=Rn(window.location.pathname),a=new URL(window.location.href);t==="chat"&&e.sessionKey?a.searchParams.set("session",e.sessionKey):a.searchParams.delete("session"),i!==s&&(a.pathname=s),n?window.history.replaceState({},"",a.toString()):window.history.pushState({},"",a.toString())}function $g(e,t,n){if(typeof window>"u")return;const s=new URL(window.location.href);s.searchParams.set("session",t),window.history.replaceState({},"",s.toString())}async function Tl(e){await Promise.all([Ce(e,!1),fa(e),Ht(e),Fn(e),Ss(e)])}async function wg(e){await Promise.all([Ce(e,!0),Kr(e),Oe(e)])}async function ps(e){await Promise.all([Ce(e,!1),Fn(e),Cs(e)])}const Ao=50,kg=80,Sg=12e4;function Re(e){if(typeof e!="string")return null;const t=e.trim();return t||null}function Qt(e,t){const n=Re(t);if(!n)return null;const s=Re(e);if(s){const a=`${s}/`;if(n.toLowerCase().startsWith(a.toLowerCase())){const o=n.slice(a.length).trim();if(o)return`${s}/${o}`}return`${s}/${n}`}const i=n.indexOf("/");if(i>0){const a=n.slice(0,i).trim(),o=n.slice(i+1).trim();if(a&&o)return`${a}/${o}`}return n}function Ag(e){return Array.isArray(e)?e.map(t=>Re(t)).filter(t=>!!t):[]}function Cg(e){if(!Array.isArray(e))return[];const t=[];for(const n of e){if(!n||typeof n!="object")continue;const s=n,i=Re(s.provider),a=Re(s.model);if(!i||!a)continue;const o=Re(s.reason)?.replace(/_/g," ")??Re(s.code)??(typeof s.status=="number"?`HTTP ${s.status}`:null)??Re(s.error)??"error";t.push({provider:i,model:a,reason:o})}return t}function Tg(e){if(!e||typeof e!="object")return null;const t=e;if(typeof t.text=="string")return t.text;const n=t.content;if(!Array.isArray(n))return null;const s=n.map(i=>{if(!i||typeof i!="object")return null;const a=i;return a.type==="text"&&typeof a.text=="string"?a.text:null}).filter(i=>!!i);return s.length===0?null:s.join(`
|
|
129
129
|
`)}function Co(e){if(e==null)return null;if(typeof e=="number"||typeof e=="boolean")return String(e);const t=Tg(e);let n;if(typeof e=="string")n=e;else if(t)n=t;else try{n=JSON.stringify(e,null,2)}catch{n=String(e)}const s=Xr(n,Sg);return s.truncated?`${s.text}
|
|
@@ -7676,4 +7676,4 @@ ${JSON.stringify(e.issues,null,2)}</pre
|
|
|
7676
7676
|
`}var d0=Object.defineProperty,u0=Object.getOwnPropertyDescriptor,x=(e,t,n,s)=>{for(var i=s>1?void 0:s?u0(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(s?o(t,n,i):o(i))||i);return s&&i&&d0(t,n,i),i};const vi=ba({});function g0(){if(!window.location.search)return!1;const t=new URLSearchParams(window.location.search).get("onboarding");if(!t)return!1;const n=t.trim().toLowerCase();return n==="1"||n==="true"||n==="yes"||n==="on"}let y=class extends en{constructor(){super(),this.i18nController=new $d(this),this.settings=rg(),this.password="",this.tab="chat",this.onboarding=g0(),this.connected=!1,this.theme=this.settings.theme??"system",this.themeResolved="dark",this.hello=null,this.lastError=null,this.eventLog=[],this.eventLogBuffer=[],this.toolStreamSyncTimer=null,this.sidebarCloseTimer=null,this.assistantName=vi.name,this.assistantAvatar=vi.avatar,this.assistantAgentId=vi.agentId??null,this.sessionKey=this.settings.sessionKey,this.chatLoading=!1,this.chatSending=!1,this.chatMessage="",this.chatMessages=[],this.chatToolMessages=[],this.chatStream=null,this.chatStreamStartedAt=null,this.chatRunId=null,this.compactionStatus=null,this.fallbackStatus=null,this.chatAvatarUrl=null,this.chatThinkingLevel=null,this.chatQueue=[],this.chatAttachments=[],this.chatManualRefreshInFlight=!1,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.configLoading=!1,this.configRaw=`{
|
|
7677
7677
|
}
|
|
7678
7678
|
`,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.configFormDirty=!1,this.configFormMode="form",this.configSearchQuery="",this.configActiveSection=null,this.configActiveSubsection=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.agentsPanel="overview",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="",this.sessionsFilterLimit="120",this.sessionsIncludeGlobal=!0,this.sessionsIncludeUnknown=!1,this.usageLoading=!1,this.usageResult=null,this.usageCostSummary=null,this.usageError=null,this.usageStartDate=(()=>{const e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`})(),this.usageEndDate=(()=>{const e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`})(),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.cronJobs=[],this.cronStatus=null,this.cronError=null,this.cronForm={...op},this.cronRunsJobId=null,this.cronRuns=[],this.cronBusy=!1,this.updateAvailable=null,this.skillsLoading=!1,this.skillsReport=null,this.skillsError=null,this.skillsFilter="",this.skillEdits={},this.skillsBusyKey=null,this.skillMessages={},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.logsLoading=!1,this.logsError=null,this.logsFile=null,this.logsEntries=[],this.logsFilterText="",this.logsLevelFilters={...ap},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.chatHasAutoScrolled=!1,this.chatUserNearBottom=!0,this.chatNewMessagesBelow=!1,this.nodesPollInterval=null,this.logsPollInterval=null,this.debugPollInterval=null,this.logsScrollFrame=null,this.toolStreamById=new Map,this.toolStreamOrder=[],this.refreshSessionsAfterChat=new Set,this.basePath="",this.popStateHandler=()=>xg(this),this.themeMedia=null,this.themeMediaHandler=null,this.topbarObserver=null,Zi(this.settings.locale)&&En.setLocale(this.settings.locale)}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),wp(this)}firstUpdated(){kp(this)}disconnectedCallback(){Sp(this),super.disconnectedCallback()}updated(e){Ap(this,e)}connect(){Ul(this)}handleChatScroll(e){Wd(this,e)}handleLogsScroll(e){qd(this,e)}exportLogs(e,t){Gd(e,t)}resetToolStream(){Ms(this)}resetChatScroll(){ho(this)}scrollToBottom(e){ho(this),Dn(this,!0,!!e?.smooth)}async loadAssistantIdentity(){await Nl(this)}applySettings(e){mt(this,e)}setTab(e){pg(this,e)}setTheme(e,t){fg(this,e,t)}async loadOverview(){await Tl(this)}async loadCron(){await ps(this)}async handleAbortChat(){await Il(this)}removeQueuedMessage(e){ep(this,e)}async handleSendChat(e,t){await tp(this,e,t)}async handleWhatsAppStart(e){await Rd(this,e)}async handleWhatsAppWait(){await Id(this)}async handleWhatsAppLogout(){await Pd(this)}async handleChannelConfigSave(){await Dd(this)}async handleChannelConfigReload(){await Fd(this)}handleNostrProfileEdit(e,t){Bd(this,e,t)}handleNostrProfileCancel(){Ud(this)}handleNostrProfileFieldChange(e,t){zd(this,e,t)}async handleNostrProfileSave(){await jd(this)}async handleNostrProfileImport(){await Kd(this)}handleNostrProfileToggleAdvanced(){Hd(this)}async handleExecApprovalDecision(e){const t=this.execApprovalQueue[0];if(!(!t||!this.client||this.execApprovalBusy)){this.execApprovalBusy=!0,this.execApprovalError=null;try{await this.client.request("exec.approval.resolve",{id:t.id,decision:e}),this.execApprovalQueue=this.execApprovalQueue.filter(n=>n.id!==t.id)}catch(n){this.execApprovalError=`Exec approval failed: ${String(n)}`}finally{this.execApprovalBusy=!1}}}handleGatewayUrlConfirm(){const e=this.pendingGatewayUrl;e&&(this.pendingGatewayUrl=null,mt(this,{...this.settings,gatewayUrl:e}),this.connect())}handleGatewayUrlCancel(){this.pendingGatewayUrl=null}handleOpenSidebar(e){this.sidebarCloseTimer!=null&&(window.clearTimeout(this.sidebarCloseTimer),this.sidebarCloseTimer=null),this.sidebarContent=e,this.sidebarError=null,this.sidebarOpen=!0}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){const t=Math.max(.4,Math.min(.7,e));this.splitRatio=t,this.applySettings({...this.settings,splitRatio:t})}render(){return c0(this)}};x([$()],y.prototype,"settings",2);x([$()],y.prototype,"password",2);x([$()],y.prototype,"tab",2);x([$()],y.prototype,"onboarding",2);x([$()],y.prototype,"connected",2);x([$()],y.prototype,"theme",2);x([$()],y.prototype,"themeResolved",2);x([$()],y.prototype,"hello",2);x([$()],y.prototype,"lastError",2);x([$()],y.prototype,"eventLog",2);x([$()],y.prototype,"assistantName",2);x([$()],y.prototype,"assistantAvatar",2);x([$()],y.prototype,"assistantAgentId",2);x([$()],y.prototype,"sessionKey",2);x([$()],y.prototype,"chatLoading",2);x([$()],y.prototype,"chatSending",2);x([$()],y.prototype,"chatMessage",2);x([$()],y.prototype,"chatMessages",2);x([$()],y.prototype,"chatToolMessages",2);x([$()],y.prototype,"chatStream",2);x([$()],y.prototype,"chatStreamStartedAt",2);x([$()],y.prototype,"chatRunId",2);x([$()],y.prototype,"compactionStatus",2);x([$()],y.prototype,"fallbackStatus",2);x([$()],y.prototype,"chatAvatarUrl",2);x([$()],y.prototype,"chatThinkingLevel",2);x([$()],y.prototype,"chatQueue",2);x([$()],y.prototype,"chatAttachments",2);x([$()],y.prototype,"chatManualRefreshInFlight",2);x([$()],y.prototype,"sidebarOpen",2);x([$()],y.prototype,"sidebarContent",2);x([$()],y.prototype,"sidebarError",2);x([$()],y.prototype,"splitRatio",2);x([$()],y.prototype,"nodesLoading",2);x([$()],y.prototype,"nodes",2);x([$()],y.prototype,"devicesLoading",2);x([$()],y.prototype,"devicesError",2);x([$()],y.prototype,"devicesList",2);x([$()],y.prototype,"execApprovalsLoading",2);x([$()],y.prototype,"execApprovalsSaving",2);x([$()],y.prototype,"execApprovalsDirty",2);x([$()],y.prototype,"execApprovalsSnapshot",2);x([$()],y.prototype,"execApprovalsForm",2);x([$()],y.prototype,"execApprovalsSelectedAgent",2);x([$()],y.prototype,"execApprovalsTarget",2);x([$()],y.prototype,"execApprovalsTargetNodeId",2);x([$()],y.prototype,"execApprovalQueue",2);x([$()],y.prototype,"execApprovalBusy",2);x([$()],y.prototype,"execApprovalError",2);x([$()],y.prototype,"pendingGatewayUrl",2);x([$()],y.prototype,"configLoading",2);x([$()],y.prototype,"configRaw",2);x([$()],y.prototype,"configRawOriginal",2);x([$()],y.prototype,"configValid",2);x([$()],y.prototype,"configIssues",2);x([$()],y.prototype,"configSaving",2);x([$()],y.prototype,"configApplying",2);x([$()],y.prototype,"updateRunning",2);x([$()],y.prototype,"applySessionKey",2);x([$()],y.prototype,"configSnapshot",2);x([$()],y.prototype,"configSchema",2);x([$()],y.prototype,"configSchemaVersion",2);x([$()],y.prototype,"configSchemaLoading",2);x([$()],y.prototype,"configUiHints",2);x([$()],y.prototype,"configForm",2);x([$()],y.prototype,"configFormOriginal",2);x([$()],y.prototype,"configFormDirty",2);x([$()],y.prototype,"configFormMode",2);x([$()],y.prototype,"configSearchQuery",2);x([$()],y.prototype,"configActiveSection",2);x([$()],y.prototype,"configActiveSubsection",2);x([$()],y.prototype,"channelsLoading",2);x([$()],y.prototype,"channelsSnapshot",2);x([$()],y.prototype,"channelsError",2);x([$()],y.prototype,"channelsLastSuccess",2);x([$()],y.prototype,"whatsappLoginMessage",2);x([$()],y.prototype,"whatsappLoginQrDataUrl",2);x([$()],y.prototype,"whatsappLoginConnected",2);x([$()],y.prototype,"whatsappBusy",2);x([$()],y.prototype,"nostrProfileFormState",2);x([$()],y.prototype,"nostrProfileAccountId",2);x([$()],y.prototype,"presenceLoading",2);x([$()],y.prototype,"presenceEntries",2);x([$()],y.prototype,"presenceError",2);x([$()],y.prototype,"presenceStatus",2);x([$()],y.prototype,"agentsLoading",2);x([$()],y.prototype,"agentsList",2);x([$()],y.prototype,"agentsError",2);x([$()],y.prototype,"agentsSelectedId",2);x([$()],y.prototype,"agentsPanel",2);x([$()],y.prototype,"agentFilesLoading",2);x([$()],y.prototype,"agentFilesError",2);x([$()],y.prototype,"agentFilesList",2);x([$()],y.prototype,"agentFileContents",2);x([$()],y.prototype,"agentFileDrafts",2);x([$()],y.prototype,"agentFileActive",2);x([$()],y.prototype,"agentFileSaving",2);x([$()],y.prototype,"agentIdentityLoading",2);x([$()],y.prototype,"agentIdentityError",2);x([$()],y.prototype,"agentIdentityById",2);x([$()],y.prototype,"agentSkillsLoading",2);x([$()],y.prototype,"agentSkillsError",2);x([$()],y.prototype,"agentSkillsReport",2);x([$()],y.prototype,"agentSkillsAgentId",2);x([$()],y.prototype,"sessionsLoading",2);x([$()],y.prototype,"sessionsResult",2);x([$()],y.prototype,"sessionsError",2);x([$()],y.prototype,"sessionsFilterActive",2);x([$()],y.prototype,"sessionsFilterLimit",2);x([$()],y.prototype,"sessionsIncludeGlobal",2);x([$()],y.prototype,"sessionsIncludeUnknown",2);x([$()],y.prototype,"usageLoading",2);x([$()],y.prototype,"usageResult",2);x([$()],y.prototype,"usageCostSummary",2);x([$()],y.prototype,"usageError",2);x([$()],y.prototype,"usageStartDate",2);x([$()],y.prototype,"usageEndDate",2);x([$()],y.prototype,"usageSelectedSessions",2);x([$()],y.prototype,"usageSelectedDays",2);x([$()],y.prototype,"usageSelectedHours",2);x([$()],y.prototype,"usageChartMode",2);x([$()],y.prototype,"usageDailyChartMode",2);x([$()],y.prototype,"usageTimeSeriesMode",2);x([$()],y.prototype,"usageTimeSeriesBreakdownMode",2);x([$()],y.prototype,"usageTimeSeries",2);x([$()],y.prototype,"usageTimeSeriesLoading",2);x([$()],y.prototype,"usageTimeSeriesCursorStart",2);x([$()],y.prototype,"usageTimeSeriesCursorEnd",2);x([$()],y.prototype,"usageSessionLogs",2);x([$()],y.prototype,"usageSessionLogsLoading",2);x([$()],y.prototype,"usageSessionLogsExpanded",2);x([$()],y.prototype,"usageQuery",2);x([$()],y.prototype,"usageQueryDraft",2);x([$()],y.prototype,"usageSessionSort",2);x([$()],y.prototype,"usageSessionSortDir",2);x([$()],y.prototype,"usageRecentSessions",2);x([$()],y.prototype,"usageTimeZone",2);x([$()],y.prototype,"usageContextExpanded",2);x([$()],y.prototype,"usageHeaderPinned",2);x([$()],y.prototype,"usageSessionsTab",2);x([$()],y.prototype,"usageVisibleColumns",2);x([$()],y.prototype,"usageLogFilterRoles",2);x([$()],y.prototype,"usageLogFilterTools",2);x([$()],y.prototype,"usageLogFilterHasTools",2);x([$()],y.prototype,"usageLogFilterQuery",2);x([$()],y.prototype,"cronLoading",2);x([$()],y.prototype,"cronJobs",2);x([$()],y.prototype,"cronStatus",2);x([$()],y.prototype,"cronError",2);x([$()],y.prototype,"cronForm",2);x([$()],y.prototype,"cronRunsJobId",2);x([$()],y.prototype,"cronRuns",2);x([$()],y.prototype,"cronBusy",2);x([$()],y.prototype,"updateAvailable",2);x([$()],y.prototype,"skillsLoading",2);x([$()],y.prototype,"skillsReport",2);x([$()],y.prototype,"skillsError",2);x([$()],y.prototype,"skillsFilter",2);x([$()],y.prototype,"skillEdits",2);x([$()],y.prototype,"skillsBusyKey",2);x([$()],y.prototype,"skillMessages",2);x([$()],y.prototype,"debugLoading",2);x([$()],y.prototype,"debugStatus",2);x([$()],y.prototype,"debugHealth",2);x([$()],y.prototype,"debugModels",2);x([$()],y.prototype,"debugHeartbeat",2);x([$()],y.prototype,"debugCallMethod",2);x([$()],y.prototype,"debugCallParams",2);x([$()],y.prototype,"debugCallResult",2);x([$()],y.prototype,"debugCallError",2);x([$()],y.prototype,"logsLoading",2);x([$()],y.prototype,"logsError",2);x([$()],y.prototype,"logsFile",2);x([$()],y.prototype,"logsEntries",2);x([$()],y.prototype,"logsFilterText",2);x([$()],y.prototype,"logsLevelFilters",2);x([$()],y.prototype,"logsAutoFollow",2);x([$()],y.prototype,"logsTruncated",2);x([$()],y.prototype,"logsCursor",2);x([$()],y.prototype,"logsLastFetchAt",2);x([$()],y.prototype,"logsLimit",2);x([$()],y.prototype,"logsMaxBytes",2);x([$()],y.prototype,"logsAtBottom",2);x([$()],y.prototype,"chatNewMessagesBelow",2);y=x([Ur("openclaw-app")],y);
|
|
7679
|
-
//# sourceMappingURL=index-
|
|
7679
|
+
//# sourceMappingURL=index-BfDl8X4O.js.map
|