sealclaw 2026.6.27 → 2026.6.28
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/build-info.json +3 -3
- package/dist/cli-startup-metadata.json +2 -2
- package/dist/control-ui/assets/{agents-VWd8R17e.js → agents-CAmTjL2H.js} +2 -2
- package/dist/control-ui/assets/{channels-CFaY00i-.js → channels-1cjrTMwB.js} +2 -2
- package/dist/control-ui/assets/{channels.cn-B7UxGaDR.js → channels.cn-C_H6e9d6.js} +2 -2
- package/dist/control-ui/assets/{cron-BgkWQdD4.js → cron-BtOWAQd-.js} +2 -2
- package/dist/control-ui/assets/{cron-task-list-BI0vwEbN.js → cron-task-list-47yZC4F_.js} +2 -2
- package/dist/control-ui/assets/{debug-ktScbDsU.js → debug-BkVmAx6w.js} +2 -2
- package/dist/control-ui/assets/{filespace-BQjTE0C_.js → filespace-BCO0sWG5.js} +2 -2
- package/dist/control-ui/assets/{index-BK0f0HoK.js → index-DZ9XVD38.js} +7 -7
- package/dist/control-ui/assets/{instances-DqQQ9pjz.js → instances-6i8ma6iW.js} +2 -2
- package/dist/control-ui/assets/{nodes-DUnqUD1a.js → nodes-Du49WHjP.js} +2 -2
- package/dist/control-ui/assets/{sessions-CMPXW9x2.js → sessions-BmEME1Ct.js} +2 -2
- package/dist/control-ui/assets/{skill-center-DyXm1Zam.js → skill-center-DNcOO6Ju.js} +2 -2
- package/dist/control-ui/assets/{skill-publish-CPc7JMbn.js → skill-publish-CuICGNtU.js} +2 -2
- package/dist/control-ui/assets/{skills-K02WMIMn.js → skills-B_7WeHCK.js} +2 -2
- package/dist/control-ui/assets/store-DLzVZn7l.js +2 -0
- package/dist/control-ui/index.html +2 -2
- package/dist/plugin-sdk/.boundary-entry-shims.stamp +1 -1
- package/dist/postinstall-inventory.json +15 -15
- package/package.json +1 -1
- package/dist/control-ui/assets/store-Cf_1pKfx.js +0 -2
package/dist/build-info.json
CHANGED
|
@@ -28,6 +28,6 @@
|
|
|
28
28
|
"channelCatalogSignature": "a10ec4b29627b2b2532a1f0f270469824d8d2064",
|
|
29
29
|
"rootHelpBundleSignature": "8c72c25168ed5c786f38c6fe27d5da8600c442bc",
|
|
30
30
|
"browserHelpSourceSignature": "d156a6812a8f418f4337caf0c6716406b270bdb0",
|
|
31
|
-
"browserHelpText": "\n🦞 SealClaw 2026.6.
|
|
32
|
-
"rootHelpText": "\n🦞 SealClaw 2026.6.
|
|
31
|
+
"browserHelpText": "\n🦞 SealClaw 2026.6.28 (c756f4b)\n I don't just autocomplete—I auto-commit (emotionally), then ask you to review (logically).\n\nUsage: openclaw browser [options] [command]\n\nManage OpenClaw's dedicated browser (Chrome/Chromium)\n\nOptions:\n --browser-profile <name> Browser profile name (default from config)\n --expect-final Wait for final response (agent) (default: false)\n -h, --help Display help for command\n --json Output machine-readable JSON (default: false)\n --timeout <ms> Timeout in ms (default: \"30000\")\n --token <token> Gateway token (if required)\n --url <url> Gateway WebSocket URL (defaults to\n gateway.remote.url when configured)\n\nCommands:\n click Click an element by ref from snapshot\n click-coords Click viewport coordinates\n close Close a tab (target id optional)\n console Get recent console messages\n cookies Read/write cookies\n create-profile Create a new browser profile\n delete-profile Delete a browser profile\n dialog Arm the next modal dialog (alert/confirm/prompt)\n doctor Check browser plugin readiness\n download Click a ref and save the resulting download\n drag Drag from one ref to another\n errors Get recent page errors\n evaluate Evaluate a function against the page or a ref\n fill Fill a form with JSON field descriptors\n focus Focus a tab by target id, tab id, label, or unique\n target id prefix\n highlight Highlight an element by ref\n hover Hover an element by ai ref\n navigate Navigate the current tab to a URL\n open Open a URL in a new tab\n pdf Save page as PDF\n press Press a key\n profiles List all browser profiles\n requests Get recent network requests (best-effort)\n reset-profile Reset browser profile (moves it to Trash)\n resize Resize the viewport\n responsebody Wait for a network response and return its body\n screenshot Capture a screenshot (MEDIA:<path>)\n scrollintoview Scroll an element into view by ref from snapshot\n select Select option(s) in a select element\n set Browser environment settings\n snapshot Capture a snapshot (default: ai; aria is the\n accessibility tree)\n start Start the browser (no-op if already running)\n status Show browser status\n stop Stop the browser (best-effort)\n storage Read/write localStorage/sessionStorage\n tab Tab shortcuts (index-based)\n tabs List open tabs\n trace Record a Playwright trace\n type Type into an element by ref from snapshot\n upload Arm file upload for the next file chooser\n wait Wait for time, selector, URL, load state, or JS\n conditions\n waitfordownload Wait for the next download (and save it)\n\nExamples:\n openclaw browser status\n openclaw browser start\n openclaw browser start --headless\n openclaw browser stop\n openclaw browser tabs\n openclaw browser open https://example.com\n openclaw browser focus abcd1234\n openclaw browser close abcd1234\n openclaw browser screenshot\n openclaw browser screenshot --full-page\n openclaw browser screenshot --ref 12\n openclaw browser snapshot\n openclaw browser snapshot --format aria --limit 200\n openclaw browser snapshot --efficient\n openclaw browser snapshot --labels\n openclaw browser navigate https://example.com\n openclaw browser resize 1280 720\n openclaw browser click 12 --double\n openclaw browser click-coords 120 340\n openclaw browser type 23 \"hello\" --submit\n openclaw browser press Enter\n openclaw browser hover 44\n openclaw browser drag 10 11\n openclaw browser select 9 OptionA OptionB\n openclaw browser upload /tmp/openclaw/uploads/file.pdf\n openclaw browser fill --fields '[{\"ref\":\"1\",\"value\":\"Ada\"}]'\n openclaw browser dialog --accept\n openclaw browser wait --text \"Done\"\n openclaw browser evaluate --fn '(el) => el.textContent' --ref 7\n openclaw browser console --level error\n openclaw browser pdf\n\nDocs: https://docs.openclaw.ai/cli/browser\n\n",
|
|
32
|
+
"rootHelpText": "\n🦞 SealClaw 2026.6.28 (c756f4b) — Half butler, half debugger, full crustacean.\n\nUsage: openclaw [options] [command]\n\nOptions:\n --container <name> Run the CLI inside a running Podman/Docker container\n named <name> (default: env OPENCLAW_CONTAINER)\n --dev Dev profile: isolate state under ~/.openclaw-dev, default\n gateway port 19001, and shift derived ports\n (browser/canvas)\n -h, --help Display help for command\n --log-level <level> Global log level override for file + console\n (silent|fatal|error|warn|info|debug|trace)\n --no-color Disable ANSI colors\n --profile <name> Use a named profile (isolates\n OPENCLAW_STATE_DIR/OPENCLAW_CONFIG_PATH under\n ~/.openclaw-<name>)\n -V, --version output the version number\n\nCommands:\n Hint: commands suffixed with * have subcommands. Run <command> --help for details.\n acp * Agent Control Protocol tools\n agent Run one agent turn via the Gateway\n agents * Manage isolated agents (workspaces, auth, routing)\n approvals * Manage exec approvals (gateway or node host)\n backup * Create and verify local backup archives for OpenClaw\n state\n capability * Run provider-backed inference commands (fallback alias:\n infer)\n channels * Manage connected chat channels (Telegram, Discord, etc.)\n chat Open a local terminal UI (alias for tui --local)\n clawbot * Legacy clawbot command aliases\n commitments * List and manage inferred follow-up commitments\n completion Generate shell completion script\n config * Non-interactive config helpers\n (get/set/unset/file/validate). Default: starts guided\n setup.\n configure Interactive configuration for credentials, channels,\n gateway, and agent defaults\n crestodian Open the ring-zero setup and repair helper\n cron * Manage cron jobs via the Gateway scheduler\n daemon * Gateway service (legacy alias)\n dashboard Open the Control UI with your current token\n devices * Device pairing + token management\n directory * Lookup contact and group IDs (self, peers, groups) for\n supported chat channels\n dns * DNS helpers for wide-area discovery (Tailscale + CoreDNS)\n docs Search the live OpenClaw docs\n doctor Health checks + quick fixes for the gateway and channels\n exec-policy * Show or synchronize requested exec policy with host\n approvals\n gateway * Run, inspect, and query the WebSocket Gateway\n health Fetch health from the running gateway\n help Display help for command\n hooks * Manage internal agent hooks\n infer * Run provider-backed inference commands\n logs Tail gateway file logs via RPC\n mcp * Manage OpenClaw MCP config and channel bridge\n memory Search, inspect, and reindex memory files\n message * Send, read, and manage messages\n migrate * Import state from another agent system\n models * Discover, scan, and configure models\n node * Run and manage the headless node host service\n nodes * Manage gateway-owned node pairing and node commands\n onboard Interactive onboarding for gateway, workspace, and skills\n pairing * Secure DM pairing (approve inbound requests)\n plugins * Manage OpenClaw plugins\n proxy * Run the OpenClaw debug proxy and inspect captured traffic\n qr Generate mobile pairing QR/setup code\n reset Reset local config/state (keeps the CLI installed)\n sandbox * Manage sandbox containers for agent isolation\n secrets * Secrets runtime reload controls\n security * Security tools and local config audits\n sessions * List stored conversation sessions\n setup Initialize local config and agent workspace\n skills * List and inspect available skills\n status Show channel health and recent session recipients\n system * System events, heartbeat, and presence\n tasks * Inspect durable background task state\n terminal Open a local terminal UI (alias for tui --local)\n tui Open a terminal UI connected to the Gateway\n uninstall Uninstall the gateway service + local data (CLI remains)\n update * Update OpenClaw and inspect update channel status\n webhooks * Webhook helpers and integrations\n\nExamples:\n openclaw models --help\n Show detailed help for the models command.\n openclaw channels login --verbose\n Link personal WhatsApp Web and show QR + connection logs.\n openclaw message send --target +15555550123 --message \"Hi\" --json\n Send via your web session and print JSON result.\n openclaw gateway --port 18789\n Run the WebSocket Gateway locally.\n openclaw --dev gateway\n Run a dev Gateway (isolated state/config) on ws://127.0.0.1:19001.\n openclaw gateway --force\n Kill anything bound to the default gateway port, then start it.\n openclaw gateway ...\n Gateway control via WebSocket.\n openclaw agent --to +15555550123 --message \"Run summary\" --deliver\n Talk directly to the agent using the Gateway; optionally send the WhatsApp reply.\n openclaw message send --channel telegram --target @mychat --message \"Hi\"\n Send via your Telegram bot.\n\nDocs: https://docs.openclaw.ai/cli\n\n"
|
|
33
33
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,n as t}from"./lit-xS7RrYW6.js";import{t as n}from"./string-coerce-OVejwecW.js";import{n as r,t as i}from"./directive-Dk4hInuL.js";import{A as a,C as o,D as s,E as c,F as l,J as u,M as d,N as f,O as p,P as m,R as h,S as g,T as _,W as v,Z as y,b,d as ee,h as x,i as S,j as C,k as te,n as w,o as T,r as E,v as D,w as O,x as ne,y as k,z as A}from"./index-
|
|
1
|
+
import{a as e,n as t}from"./lit-xS7RrYW6.js";import{t as n}from"./string-coerce-OVejwecW.js";import{n as r,t as i}from"./directive-Dk4hInuL.js";import{A as a,C as o,D as s,E as c,F as l,J as u,M as d,N as f,O as p,P as m,R as h,S as g,T as _,W as v,Z as y,b,d as ee,h as x,i as S,j as C,k as te,n as w,o as T,r as E,v as D,w as O,x as ne,y as k,z as A}from"./index-DZ9XVD38.js";import{r as re}from"./channel-config-extras-B1l5nZ9H.js";import{i as j,n as M,r as N,t as ie}from"./skills-shared-D4QYNbRK.js";var ae=i(class extends r{constructor(){super(...arguments),this.key=t}render(e,t){return this.key=e,t}update(e,[t,n]){return t!==this.key&&(u(e),this.key=t),n}});function oe(n){var r,i,o,l,u,d,f,m,h,g,v,y,ee;let{agent:x,configForm:S,agentFilesList:w,configLoading:T,configSaving:E,configDirty:D,onConfigReload:O,onConfigSave:ne,onModelChange:k,onModelFallbacksChange:A,onSelectPanel:re}=n,j=!!(n.defaultId&&x.id===n.defaultId),M=s(S,x.id),N=x.model,ie=(w&&w.agentId===x.id?w.workspace:null)||((r=M.entry)==null?void 0:r.workspace)||((i=M.defaults)==null?void 0:i.workspace)||x.workspace||`default`,ae=(o=M.entry)!=null&&o.model?a((l=M.entry)==null?void 0:l.model):(u=M.defaults)!=null&&u.model?a((d=M.defaults)==null?void 0:d.model):a(N),oe=p(x.agentRuntime),se=a(((f=M.defaults)==null?void 0:f.model)??N),ce=C((m=M.entry)==null?void 0:m.model),P=C((h=M.defaults)==null?void 0:h.model)||(se===`-`?null:_(se))||(S?null:C(N)),le=ce??P??null,F=j?le:ce,I=te((g=M.entry)==null?void 0:g.model)??te((v=M.defaults)==null?void 0:v.model)??(S?null:te(N))??[],L=Array.isArray((y=M.entry)==null?void 0:y.skills)?(ee=M.entry)==null?void 0:ee.skills:null,ue=(L==null?void 0:L.length)??null,R=!S||T||E,de=e=>{let t=I.filter((t,n)=>n!==e);A(x.id,t)};return e`
|
|
2
2
|
<section class="card">
|
|
3
3
|
<div class="card-title">Overview</div>
|
|
4
4
|
<div class="card-sub">Workspace paths and identity metadata.</div>
|
|
@@ -999,4 +999,4 @@ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error
|
|
|
999
999
|
`)}
|
|
1000
1000
|
</div>
|
|
1001
1001
|
`}export{wn as renderAgents};
|
|
1002
|
-
//# sourceMappingURL=agents-
|
|
1002
|
+
//# sourceMappingURL=agents-CAmTjL2H.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,n as t}from"./lit-xS7RrYW6.js";import{G as n,W as r,X as i,Y as a,l as o,u as s}from"./index-
|
|
1
|
+
import{a as e,n as t}from"./lit-xS7RrYW6.js";import{G as n,W as r,X as i,Y as a,l as o,u as s}from"./index-DZ9XVD38.js";import{n as c,t as l}from"./channel-config-extras-B1l5nZ9H.js";function u(e,t){let n=e;for(let e of t){if(!n)return null;let t=i(n);if(t===`object`){let t=n.properties??{};if(typeof e==`string`&&t[e]){n=t[e];continue}let r=n.additionalProperties;if(typeof e==`string`&&r&&typeof r==`object`){n=r;continue}return null}if(t===`array`){if(typeof e!=`number`)return null;n=(Array.isArray(n.items)?n.items[0]:n.items)??null;continue}return null}return n}function d(e,t){return c(e,t)??{}}var f=[`groupPolicy`,`streamMode`,`dmPolicy`];function p(t){let n=f.flatMap(e=>e in t?[[e,t[e]]]:[]);return n.length===0?null:e`
|
|
2
2
|
<div class="status-list" style="margin-top: 12px;">
|
|
3
3
|
${n.map(([t,n])=>e`
|
|
4
4
|
<div>
|
|
@@ -346,4 +346,4 @@ ${n.snapshot?JSON.stringify(n.snapshot,null,2):`尚无快照。`}
|
|
|
346
346
|
</div>
|
|
347
347
|
</div>
|
|
348
348
|
`}export{P as renderChannels};
|
|
349
|
-
//# sourceMappingURL=channels-
|
|
349
|
+
//# sourceMappingURL=channels-1cjrTMwB.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,n as t}from"./lit-xS7RrYW6.js";import{R as n}from"./index-
|
|
1
|
+
import{a as e,n as t}from"./lit-xS7RrYW6.js";import{R as n}from"./index-DZ9XVD38.js";var r={weixin:`微信`,wecom:`企业微信`,feishu:`飞书`,dingtalk:`钉钉`},i={weixin:`接入微信对话`,wecom:`接入企业微信对话`,feishu:`接入飞书对话`,dingtalk:`接入钉钉对话`},a={weixin:`https://gw.alicdn.com/imgextra/i4/O1CN01GsAob11fkfDWVIb3R_!!6000000004045-2-tps-400-400.png`,wecom:`https://gw.alicdn.com/imgextra/i1/O1CN01HWtzmr1hkK9beQICJ_!!6000000004315-2-tps-400-400.png`,dingtalk:`https://gw.alicdn.com/imgextra/i4/O1CN01g1u9vB1KdEreWzDdv_!!6000000001186-2-tps-400-400.png`,feishu:`https://gw.alicdn.com/imgextra/i4/O1CN01jsn08m225euyUoaFN_!!6000000007069-2-tps-400-400.png`},o={weixin:{successStatus:`confirmed`,successCredentialKey:`bot_token`,pollInterval:2e3,credentialFields:[`bot_token`]},wecom:{successStatus:`success`,successCredentialKey:`bot_id`,pollInterval:3e3,credentialFields:[`bot_id`,`secret`]},dingtalk:{successStatus:`success`,successCredentialKey:`client_id`,pollInterval:5e3,credentialFields:[`client_id`,`client_secret`]},feishu:{successStatus:``,successCredentialKey:``,pollInterval:0,credentialFields:[]}},s=[`weixin`,`wecom`,`feishu`,`dingtalk`];async function c(e,t){if(!(!e.client||!e.connected)){e.cnChannelsLoading=!0,e.cnChannelsError=null,t==null||t();try{e.cnChannelsData=(await e.client.request(`channels.cn.config.list`,{})).channels??null}catch(t){e.cnChannelsError=String(t)}finally{e.cnChannelsLoading=!1,t==null||t()}}}async function l(e,t,n,r){e.client&&(await e.client.request(`channels.cn.config.set`,{channel:t,config:n}),await c(e,r))}async function u(e,t,n){if(e.client){f(e),e.cnQrcodeChannel=t,e.cnQrcodeImg=null,e.cnQrcodeToken=null,e.cnQrcodeLoading=!0,n==null||n();try{let r=await e.client.request(`channels.cn.qrcode.get`,{channel:t});if(!r.qrcode_img){e.cnQrcodeLoading=!1,n==null||n();return}e.cnQrcodeImg=r.qrcode_img,e.cnQrcodeToken=r.poll_token,d(e,t,r.poll_token,n)}catch{e.cnQrcodeImg=null}finally{e.cnQrcodeLoading=!1,n==null||n()}}}function d(e,t,n,r){let i=o[t],a=async()=>{if(!(!e.client||e.cnQrcodeChannel!==t||e.cnQrcodeToken!==n)){try{let a=await e.client.request(`channels.cn.qrcode.status`,{channel:t,token:n});if(a.status===i.successStatus&&a.credentials[i.successCredentialKey]){e.cnQrcodeImg=null,e.cnQrcodeToken=null,e.cnQrcodeChannel=null;let n={enabled:!0};for(let e of i.credentialFields)a.credentials[e]!==void 0&&(n[e]=a.credentials[e]);e.cnConnecting=t,r==null||r();try{await l(e,t,n,r)}finally{e.cnConnecting=null,r==null||r()}return}if(a.status===`expired`){e.cnQrcodeImg=null,e.cnQrcodeToken=null,r==null||r();return}}catch{}e.cnQrcodePollTimer=setTimeout(a,i.pollInterval)}};e.cnQrcodePollTimer=setTimeout(a,i.pollInterval)}function f(e){e.cnQrcodePollTimer!==null&&(clearTimeout(e.cnQrcodePollTimer),e.cnQrcodePollTimer=null)}function p(t,o,s){var c;let d=!!(((c=o.cnChannelsData)==null?void 0:c[t])??{enabled:!1}).enabled,f=o.cnConnecting===t,p=r[t],m=i[t];return e`
|
|
2
2
|
<div class="cn-channel-card">
|
|
3
3
|
<div class="cn-channel-card__top">
|
|
4
4
|
<div class="cn-channel-card__icon-wrap">
|
|
@@ -126,4 +126,4 @@ import{a as e,n as t}from"./lit-xS7RrYW6.js";import{R as n}from"./index-BK0f0HoK
|
|
|
126
126
|
${m(r,i)}
|
|
127
127
|
${h(r,i)}
|
|
128
128
|
`):t}export{c as loadCnChannels,g as renderCnChannelsPanel,u as startCnQrcode,f as stopCnQrcodePoll};
|
|
129
|
-
//# sourceMappingURL=channels.cn-
|
|
129
|
+
//# sourceMappingURL=channels.cn-C_H6e9d6.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,n as t}from"./lit-xS7RrYW6.js";import{H as n,I as r,W as i,_ as a,g as o,m as s,o as c,r as l,z as u}from"./index-
|
|
1
|
+
import{a as e,n as t}from"./lit-xS7RrYW6.js";import{H as n,I as r,W as i,_ as a,g as o,m as s,o as c,r as l,z as u}from"./index-DZ9XVD38.js";function d(){return[{value:`ok`,label:`成功`},{value:`error`,label:`错误`},{value:`skipped`,label:`已跳过`}]}function f(){return[{value:`delivered`,label:`已投递`},{value:`not-delivered`,label:`未投递`},{value:`unknown`,label:`未知`},{value:`not-requested`,label:`未请求`}]}function p(e,t,n){let r=new Set(e);return n?r.add(t):r.delete(t),Array.from(r)}function m(e,t){return e.length===0?t:e.length<=2?e.join(`, `):`${e[0]} +${e.length-1}`}function h(e){var t;let n=[`last`,...e.channels.filter(Boolean)],r=(t=e.form.deliveryChannel)==null?void 0:t.trim();r&&!n.includes(r)&&n.push(r);let i=new Set;return n.filter(e=>i.has(e)?!1:(i.add(e),!0))}function g(e,t){var n,r;if(t===`last`)return`last`;let i=(n=e.channelMeta)==null?void 0:n.find(e=>e.id===t);return i!=null&&i.label?i.label:((r=e.channelLabels)==null?void 0:r[t])??t}function _(t){return e`
|
|
2
2
|
<div class="field cron-filter-dropdown" data-filter=${t.id}>
|
|
3
3
|
<span>${t.title}</span>
|
|
4
4
|
<details class="cron-filter-dropdown__details">
|
|
@@ -960,4 +960,4 @@ import{a as e,n as t}from"./lit-xS7RrYW6.js";import{H as n,I as r,W as i,_ as a,
|
|
|
960
960
|
</div>
|
|
961
961
|
</div>
|
|
962
962
|
`}export{T as renderCron};
|
|
963
|
-
//# sourceMappingURL=cron-
|
|
963
|
+
//# sourceMappingURL=cron-BtOWAQd-.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,n as t}from"./lit-xS7RrYW6.js";import{G as n,H as r,K as i,R as a,f as o}from"./index-
|
|
1
|
+
import{a as e,n as t}from"./lit-xS7RrYW6.js";import{G as n,H as r,K as i,R as a,f as o}from"./index-DZ9XVD38.js";var s=`万能玺虾`;function c(e){if(e==null||!Number.isFinite(e)||e<0)return`未知`;if(e<1e3)return`${Math.round(e)} 毫秒`;let t=Math.round(e/1e3);if(t<60)return`${t} 秒`;let n=Math.round(t/60);if(n<60)return`${n} 分钟`;let r=Math.round(n/60);return r<24?`${r} 小时`:`${Math.round(r/24)} 天`}function l(e){let t=e.schedule;return t.kind===`at`?`指定时间 ${r(Date.parse(t.at))}`:t.kind===`every`?`每 ${c(t.everyMs)}`:`${t.expr}${t.tz?` (${t.tz})`:``}`}function u(e){let t=e.payload;if(t.kind===`agentTurn`){var n;return((n=t.model)==null?void 0:n.trim())||`自动选择`}return`系统事件`}function d(e){var t,n;if((t=e.description)!=null&&t.trim())return e.description.trim();let r=e.payload;if(r.kind===`agentTurn`){var i;return((i=r.message)==null?void 0:i.trim())??``}return((n=r.text)==null?void 0:n.trim())??``}function f(t){var n,r;let i=(n=t.state)==null?void 0:n.lastStatus;return typeof((r=t.state)==null?void 0:r.runningAtMs)==`number`?e`<span class="ctl-pill ctl-pill--running">${`进行中`}</span>`:t.deleteAfterRun&&!t.enabled||!t.enabled?e`<span class="ctl-pill ctl-pill--muted">${`已暂停`}</span>`:i===`ok`?e`<span class="ctl-pill ctl-pill--ok">${`上次成功`}</span>`:i===`error`?e`<span class="ctl-pill ctl-pill--error">${`上次失败`}</span>`:i===`skipped`?e`<span class="ctl-pill ctl-pill--muted">${`已跳过`}</span>`:e`<span class="ctl-pill ctl-pill--muted">${`未运行`}</span>`}function p(e){var t;let n=(t=e.state)==null?void 0:t.nextRunAtMs;if(!e.enabled||!n)return`—`;let r=n-Date.now();if(r<=0)return`即将运行`;let i=Math.round(r/1e3);if(i<60)return`1 分钟内`;let a=Math.round(i/60);if(a<60)return`${a} 分钟后`;let o=Math.round(a/60);return o<48?`${o} 小时后`:`${Math.round(o/24)} 天后`}function m(n,r){let i=r.skills?o({value:n,data:r.skills}):null;return i?e`<div class="ctl-card__desc" title=${n}>
|
|
2
2
|
<span class="ctl-card__skill-tag">${a.zap}<span>${i.label}</span></span
|
|
3
3
|
>${i.rest?e`<span class="ctl-card__skill-rest">${i.rest}</span>`:t}
|
|
4
4
|
</div>`:e`<div class="ctl-card__desc" title=${n}>${n}</div>`}function h(n,r){let i=r.openMenuJobId===n.id,o=d(n);return e`
|
|
@@ -223,4 +223,4 @@ import{a as e,n as t}from"./lit-xS7RrYW6.js";import{G as n,H as r,K as i,R as a,
|
|
|
223
223
|
</div>
|
|
224
224
|
</openclaw-modal-dialog>
|
|
225
225
|
`}export{w as renderCronTaskList};
|
|
226
|
-
//# sourceMappingURL=cron-task-list-
|
|
226
|
+
//# sourceMappingURL=cron-task-list-47yZC4F_.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,n as t}from"./lit-xS7RrYW6.js";import{a as n}from"./index-
|
|
1
|
+
import{a as e,n as t}from"./lit-xS7RrYW6.js";import{a as n}from"./index-DZ9XVD38.js";function r(r){let i=r.status&&typeof r.status==`object`?r.status.securityAudit:null,a=(i==null?void 0:i.summary)??null,o=(a==null?void 0:a.critical)??0,s=(a==null?void 0:a.warn)??0,c=(a==null?void 0:a.info)??0,l=o>0?`danger`:s>0?`warn`:`success`,u=o>0?`${String(o)} 个严重问题`:s>0?`${String(s)} 个警告`:`无严重问题`;return e`
|
|
2
2
|
<section class="grid">
|
|
3
3
|
<div class="card">
|
|
4
4
|
<div class="row" style="justify-content: space-between;">
|
|
@@ -93,4 +93,4 @@ ${n(t.payload)}</pre
|
|
|
93
93
|
`}
|
|
94
94
|
</section>
|
|
95
95
|
`}export{r as renderDebug};
|
|
96
|
-
//# sourceMappingURL=debug-
|
|
96
|
+
//# sourceMappingURL=debug-BkVmAx6w.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,n as t}from"./lit-xS7RrYW6.js";import{R as n}from"./index-
|
|
1
|
+
import{a as e,n as t}from"./lit-xS7RrYW6.js";import{R as n}from"./index-DZ9XVD38.js";function r(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function i(e){let t=Date.now()-e,n=Math.floor(t/6e4);if(n<1)return`刚刚`;if(n<60)return`${n} 分钟前`;let r=Math.floor(n/60);if(r<24)return`${r} 小时前`;let i=Math.floor(r/24);if(i<7)return`${i} 天前`;let a=new Date(e);return`${a.getMonth()+1}/${a.getDate()}`}function a(e){let t=e.lastIndexOf(`.`),n=t>=0?e.slice(t+1).toLowerCase():``;return[`png`,`jpg`,`jpeg`,`gif`,`webp`,`svg`,`ico`,`bmp`].includes(n)?`filespace__file-icon--image`:[`ts`,`tsx`,`js`,`jsx`].includes(n)?`filespace__file-icon--js`:[`py`].includes(n)?`filespace__file-icon--py`:[`md`,`txt`].includes(n)?`filespace__file-icon--doc`:[`json`,`yaml`,`yml`,`toml`].includes(n)?`filespace__file-icon--config`:[`csv`,`xlsx`,`xls`].includes(n)?`filespace__file-icon--csv`:[`rs`,`go`,`sh`,`bash`,`zsh`].includes(n)?`filespace__file-icon--code`:`filespace__file-icon--default`}function o(e){let t=e.lastIndexOf(`.`),r=t>=0?e.slice(t+1).toLowerCase():``;return[`png`,`jpg`,`jpeg`,`gif`,`webp`,`svg`,`ico`,`bmp`].includes(r)?n.image:[`ts`,`tsx`,`js`,`jsx`,`py`,`rs`,`go`,`sh`,`bash`,`json`,`yaml`,`yml`,`toml`].includes(r)?n.fileCode:n.fileText}function s(e,t){let n=e??[],r=[];for(let e of n){let n=t.length>0&&e.sessionLabel.toLowerCase().includes(t),i=e=>e.name.toLowerCase().includes(t)||e.path.toLowerCase().includes(t),a=!t||n?e.outputFiles:e.outputFiles.filter(i),o=!t||n?e.refFiles:e.refFiles.filter(i),s=a.length+o.length;s>0&&r.push({...e,outputFiles:a,refFiles:o,total:s})}return r}function c(c){let{loading:l,error:u,data:d,search:f,collapsed:p,connected:m}=c,h=f.trim().toLowerCase(),g=s(d,h),_=g.reduce((e,t)=>e+t.total,0),v=(n,s)=>{let l=a(s.name),u=o(s.name),d=s.size==null?null:r(s.size),f=s.updatedAtMs==null?null:i(s.updatedAtMs);return e`
|
|
2
2
|
<div
|
|
3
3
|
class="filespace__file"
|
|
4
4
|
@click=${()=>c.onOpenFile(n.agentId,s.path)}
|
|
@@ -113,4 +113,4 @@ import{a as e,n as t}from"./lit-xS7RrYW6.js";import{R as n}from"./index-BK0f0HoK
|
|
|
113
113
|
`}</div>
|
|
114
114
|
</div>
|
|
115
115
|
`}export{c as renderFileSpace};
|
|
116
|
-
//# sourceMappingURL=filespace-
|
|
116
|
+
//# sourceMappingURL=filespace-BCO0sWG5.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/channels.cn-
|
|
2
|
-
import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c,u as l}from"./lit-xS7RrYW6.js";import{i as u,n as d,r as f,t as p}from"./store-Cf_1pKfx.js";import{n as m,r as h,t as g}from"./string-coerce-OVejwecW.js";import{n as _,r as v,t as y}from"./directive-Dk4hInuL.js";var b=Object.create,x=Object.defineProperty,S=Object.getOwnPropertyDescriptor,C=Object.getOwnPropertyNames,ee=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty,T=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),E=(e,t)=>{let n={};for(var r in e)x(n,r,{get:e[r],enumerable:!0});return t||x(n,Symbol.toStringTag,{value:`Module`}),n},D=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=C(t),a=0,o=i.length,s;a<o;a++)s=i[a],!w.call(e,s)&&s!==n&&x(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=S(t,s))||r.enumerable});return e},te=(e,t,n)=>(n=e==null?{}:b(ee(e)),D(t||!e||!e.__esModule?x(n,`default`,{value:e,enumerable:!0}):n,e));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})(),typeof Array.prototype.toSorted!=`function`&&Object.defineProperty(Array.prototype,`toSorted`,{value:function(e){return[...this].sort(e)},writable:!0,configurable:!0}),typeof Array.prototype.toReversed!=`function`&&Object.defineProperty(Array.prototype,`toReversed`,{value:function(){return[...this].reverse()},writable:!0,configurable:!0}),typeof Array.prototype.toSpliced!=`function`&&Object.defineProperty(Array.prototype,`toSpliced`,{value:function(e,t,...n){let r=[...this];return t===void 0?r.splice(e):r.splice(e,t,...n),r},writable:!0,configurable:!0}),typeof Array.prototype.with!=`function`&&Object.defineProperty(Array.prototype,`with`,{value:function(e,t){let n=[...this],r=e<0?n.length+e:e;if(r<0||r>=n.length)throw RangeError(`Invalid index`);return n[r]=t,n},writable:!0,configurable:!0});var ne={attribute:!0,type:String,converter:r,reflect:!1,hasChanged:t},re=(e=ne,t,n)=>{let{kind:r,metadata:i}=n,a=globalThis.litPropertyMetadata.get(i);if(a===void 0&&globalThis.litPropertyMetadata.set(i,a=new Map),r===`setter`&&((e=Object.create(e)).wrapped=!0),a.set(n.name,e),r===`accessor`){let{name:r}=n;return{set(n){let i=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,i,e,!0,n)},init(t){return t!==void 0&&this.C(r,void 0,e,t),t}}}if(r===`setter`){let{name:r}=n;return function(n){let i=this[r];t.call(this,n),this.requestUpdate(r,i,e,!0,n)}}throw Error(`Unsupported decorator location: `+r)};function O(e){return(t,n)=>typeof n==`object`?re(e,t,n):((e,t,n)=>{let r=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}function k(e){return O({...e,state:!0,attribute:!1})}var A=(e,t,n)=>(n.configurable=!0,n.enumerable=!0,Reflect.decorate&&typeof t!=`object`&&Object.defineProperty(e,t,n),n);function j(e,t){return(n,r,i)=>{let a=t=>{var n;return((n=t.renderRoot)==null?void 0:n.querySelector(e))??null};if(t){let{get:e,set:t}=typeof r==`object`?n:i??(()=>{let e=Symbol();return{get(){return this[e]},set(t){this[e]=t}}})();return A(n,r,{get(){let n=e.call(this);return n===void 0&&(n=a(this),(n!==null||this.hasUpdated)&&t.call(this,n)),n}})}return A(n,r,{get(){return a(this)}})}}var M=e=>u(`/api/sealclaw/api-keys`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)}),N=()=>u(`/api/sealclaw/api-keys`),ie=e=>u(`/api/sealclaw/api-keys/${e}`,{method:`DELETE`}),ae=e=>u(`/api/sealclaw/v1/models`,e?{headers:{Authorization:`Bearer ${e}`,token:e}}:void 0);function oe(e){return e?/[\r\n]/.test(e)?null:e:null}function P(e){var t,n;return oe(h((t=e.hello)==null||(t=t.auth)==null?void 0:t.deviceToken)??null)??oe(h((n=e.settings)==null?void 0:n.token)??null)??oe(h(e.password)??null)??null}function F(e){let t=P(e);return t?`Bearer ${t}`:null}function se(e){var t,n;let r=new Set,i=[];for(let a of[h((t=e.hello)==null||(t=t.auth)==null?void 0:t.deviceToken),h((n=e.settings)==null?void 0:n.token),h(e.password)]){let e=oe(a??null);e&&!r.has(e)&&(r.add(e),i.push(e))}return i}var I={AUTH_REQUIRED:`AUTH_REQUIRED`,AUTH_UNAUTHORIZED:`AUTH_UNAUTHORIZED`,AUTH_TOKEN_MISSING:`AUTH_TOKEN_MISSING`,AUTH_TOKEN_MISMATCH:`AUTH_TOKEN_MISMATCH`,AUTH_TOKEN_NOT_CONFIGURED:`AUTH_TOKEN_NOT_CONFIGURED`,AUTH_PASSWORD_MISSING:`AUTH_PASSWORD_MISSING`,AUTH_PASSWORD_MISMATCH:`AUTH_PASSWORD_MISMATCH`,AUTH_PASSWORD_NOT_CONFIGURED:`AUTH_PASSWORD_NOT_CONFIGURED`,AUTH_BOOTSTRAP_TOKEN_INVALID:`AUTH_BOOTSTRAP_TOKEN_INVALID`,AUTH_DEVICE_TOKEN_MISMATCH:`AUTH_DEVICE_TOKEN_MISMATCH`,AUTH_RATE_LIMITED:`AUTH_RATE_LIMITED`,AUTH_TAILSCALE_IDENTITY_MISSING:`AUTH_TAILSCALE_IDENTITY_MISSING`,AUTH_TAILSCALE_PROXY_MISSING:`AUTH_TAILSCALE_PROXY_MISSING`,AUTH_TAILSCALE_WHOIS_FAILED:`AUTH_TAILSCALE_WHOIS_FAILED`,AUTH_TAILSCALE_IDENTITY_MISMATCH:`AUTH_TAILSCALE_IDENTITY_MISMATCH`,CONTROL_UI_ORIGIN_NOT_ALLOWED:`CONTROL_UI_ORIGIN_NOT_ALLOWED`,CONTROL_UI_DEVICE_IDENTITY_REQUIRED:`CONTROL_UI_DEVICE_IDENTITY_REQUIRED`,DEVICE_IDENTITY_REQUIRED:`DEVICE_IDENTITY_REQUIRED`,DEVICE_AUTH_INVALID:`DEVICE_AUTH_INVALID`,DEVICE_AUTH_DEVICE_ID_MISMATCH:`DEVICE_AUTH_DEVICE_ID_MISMATCH`,DEVICE_AUTH_SIGNATURE_EXPIRED:`DEVICE_AUTH_SIGNATURE_EXPIRED`,DEVICE_AUTH_NONCE_REQUIRED:`DEVICE_AUTH_NONCE_REQUIRED`,DEVICE_AUTH_NONCE_MISMATCH:`DEVICE_AUTH_NONCE_MISMATCH`,DEVICE_AUTH_SIGNATURE_INVALID:`DEVICE_AUTH_SIGNATURE_INVALID`,DEVICE_AUTH_PUBLIC_KEY_INVALID:`DEVICE_AUTH_PUBLIC_KEY_INVALID`,PAIRING_REQUIRED:`PAIRING_REQUIRED`},ce={NOT_PAIRED:`not-paired`,ROLE_UPGRADE:`role-upgrade`,SCOPE_UPGRADE:`scope-upgrade`,METADATA_UPGRADE:`metadata-upgrade`},le=new Set([`retry_with_device_token`,`update_auth_configuration`,`update_auth_credentials`,`wait_then_retry`,`review_auth_configuration`]),L=new Set([`not-paired`,`role-upgrade`,`scope-upgrade`,`metadata-upgrade`]),ue=/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/,de={"not-paired":{requirement:`device is not approved yet`,remediationHint:`Approve this device from the pending pairing requests.`,recoveryTitle:`Gateway pairing approval required.`},"role-upgrade":{requirement:`device is asking for a higher role than currently approved`,remediationHint:`Review the requested role upgrade, then approve the pending request.`,recoveryTitle:`Gateway role upgrade approval required.`},"scope-upgrade":{requirement:`device is asking for more scopes than currently approved`,remediationHint:`Review the requested scopes, then approve the pending upgrade.`,recoveryTitle:`Gateway scope upgrade approval required.`},"metadata-upgrade":{requirement:`device identity changed and must be re-approved`,remediationHint:`Review the refreshed device details, then approve the pending request.`,recoveryTitle:`Gateway device refresh approval required.`}},fe={"not-paired":`device pairing required`,"role-upgrade":`role upgrade pending approval`,"scope-upgrade":`scope upgrade pending approval`,"metadata-upgrade":`device metadata change pending approval`};function pe(e){if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e.code;return typeof t==`string`&&t.trim().length>0?t:null}function R(e){if(!e||typeof e!=`object`||Array.isArray(e))return{};let t=e,n=typeof t.canRetryWithDeviceToken==`boolean`?t.canRetryWithDeviceToken:void 0,r=h(t.recommendedNextStep)??``;return{canRetryWithDeviceToken:n,recommendedNextStep:le.has(r)?r:void 0}}function z(e){let t=h(e)??``;return L.has(t)?t:void 0}function me(e){let t=h(e);return t&&ue.test(t)?t:void 0}function he(e){if(!Array.isArray(e))return;let t=e.map(e=>h(e)).filter(e=>!!e);return t.length>0?t:[]}function B(e){return{code:I.PAIRING_REQUIRED,...e.reason?{reason:e.reason}:{},...e.requestId?{requestId:e.requestId}:{},...e.remediationHint?{remediationHint:e.remediationHint}:{},...e.deviceId?{deviceId:e.deviceId}:{},...e.requestedRole?{requestedRole:e.requestedRole}:{},...e.requestedScopes?{requestedScopes:e.requestedScopes}:{},...e.approvedRoles?{approvedRoles:e.approvedRoles}:{},...e.approvedScopes?{approvedScopes:e.approvedScopes}:{}}}function ge(e){return e?de[e].requirement:`device approval is required`}function _e(e){return e?de[e].remediationHint:`Approve the pending device request before retrying.`}function V(e){if(pe(e)!==I.PAIRING_REQUIRED||!e||typeof e!=`object`||Array.isArray(e))return null;let t=e,n=z(t.reason);return B({reason:n,requestId:me(t.requestId),remediationHint:h(t.remediationHint)??_e(n),deviceId:h(t.deviceId),requestedRole:h(t.requestedRole),requestedScopes:he(t.requestedScopes),approvedRoles:he(t.approvedRoles),approvedScopes:he(t.approvedScopes)})}function ve(e){var t;let n=h(e);if(!n)return null;let r=n.trim().toLowerCase(),i;for(let[e,t]of Object.entries(fe))if(r.includes(t)){i=e;break}if(!i&&r.includes(`pairing required`)&&(i=ce.NOT_PAIRED),!i)return null;let a=me((t=n.match(/\(requestId:\s*([^\s)]+)\)/i))==null?void 0:t[1]);return{...a?{requestId:a}:{},reason:i}}function ye(e){let t=V(e),n=fe[(t==null?void 0:t.reason)??ce.NOT_PAIRED];return t!=null&&t.requestId?`${n} (requestId: ${t.requestId})`:n}function be(e){return pe(e.details)===I.PAIRING_REQUIRED?ye(e.details):h(e.message)??`gateway request failed`}function xe(e){let t=e.scopes.join(`,`),n=e.token??``;return[`v2`,e.deviceId,e.clientId,e.clientMode,e.role,t,String(e.signedAtMs),n,e.nonce].join(`|`)}var Se={WEBCHAT_UI:`webchat-ui`,CONTROL_UI:`openclaw-control-ui`,TUI:`openclaw-tui`,WEBCHAT:`webchat`,CLI:`cli`,GATEWAY_CLIENT:`gateway-client`,MACOS_APP:`openclaw-macos`,IOS_APP:`openclaw-ios`,ANDROID_APP:`openclaw-android`,NODE_HOST:`node-host`,TEST:`test`,FINGERPRINT:`fingerprint`,PROBE:`openclaw-probe`},Ce=Se,we={WEBCHAT:`webchat`,CLI:`cli`,UI:`ui`,BACKEND:`backend`,NODE:`node`,PROBE:`probe`,TEST:`test`};new Set(Object.values(Se)),new Set(Object.values(we));var Te=100,Ee=2e3;function De(e){return typeof e==`object`&&!!e&&e.reason===`startup-sidecars`}function Oe(e){if(!e||typeof e!=`object`)return!1;let t=e;return(t.gatewayCode??t.code)===`UNAVAILABLE`&&t.retryable===!0&&De(t.details)}function ke(e){if(!Oe(e))return null;let t=e.retryAfterMs;return Math.min(Math.max(Math.floor(typeof t==`number`&&Number.isFinite(t)?t:500),Te),Ee)}function Ae(e){return e.trim()}function je(e){if(!Array.isArray(e))return[];let t=new Set;for(let n of e){let e=n.trim();e&&t.add(e)}return t.has(`operator.admin`)?(t.add(`operator.read`),t.add(`operator.write`)):t.has(`operator.write`)&&t.add(`operator.read`),[...t].toSorted()}function Me(e){let t=e.adapter.readStore();if(!t||t.deviceId!==e.deviceId)return null;let n=Ae(e.role),r=t.tokens[n];return!r||typeof r.token!=`string`?null:r}function Ne(e){let t=Ae(e.role),n=e.adapter.readStore(),r={version:1,deviceId:e.deviceId,tokens:n&&n.deviceId===e.deviceId&&n.tokens?{...n.tokens}:{}},i={token:e.token,role:t,scopes:je(e.scopes),updatedAtMs:Date.now()};return r.tokens[t]=i,e.adapter.writeStore(r),i}function Pe(e){let t=e.adapter.readStore();if(!t||t.deviceId!==e.deviceId)return;let n=Ae(e.role);if(!t.tokens[n])return;let r={version:1,deviceId:t.deviceId,tokens:{...t.tokens}};delete r.tokens[n],e.adapter.writeStore(r)}function Fe(e){return!!e&&typeof e.getItem==`function`&&typeof e.setItem==`function`}function Ie(e){var t;let n=Object.getOwnPropertyDescriptor(globalThis,e);if(typeof process<`u`&&(t={})!=null&&t.VITEST)return n&&!n.get&&Fe(n.value)?n.value:null;if(typeof window<`u`&&typeof document<`u`)try{let t=window[e];return Fe(t)?t:null}catch{return null}return n&&!n.get&&Fe(n.value)?n.value:null}function Le(){return Ie(`localStorage`)}function Re(){return Ie(`sessionStorage`)}var ze=`openclaw.device.auth.v1`;function Be(){try{var e;let t=(e=Le())==null?void 0:e.getItem(ze);if(!t)return null;let n=JSON.parse(t);return!n||n.version!==1||!n.deviceId||typeof n.deviceId!=`string`||!n.tokens||typeof n.tokens!=`object`?null:n}catch{return null}}function Ve(e){try{var t;(t=Le())==null||t.setItem(ze,JSON.stringify(e))}catch{}}function He(e){return Me({adapter:{readStore:Be,writeStore:Ve},deviceId:e.deviceId,role:e.role})}function Ue(e){return Ne({adapter:{readStore:Be,writeStore:Ve},deviceId:e.deviceId,role:e.role,token:e.token,scopes:e.scopes})}function We(e){Pe({adapter:{readStore:Be,writeStore:Ve},deviceId:e.deviceId,role:e.role})}function Ge(e){"@babel/helpers - typeof";return Ge=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Ge(e)}function Ke(e,t){if(Ge(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Ge(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function qe(e){var t=Ke(e,`string`);return Ge(t)==`symbol`?t:t+``}function Je(e,t,n){return(t=qe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ye=Object.freeze({p:57896044618658097711785492504343953926634992332820282019728792003956564819949n,n:7237005577332262213973186563042994240857116359379907606001950938285454250989n,h:8n,a:57896044618658097711785492504343953926634992332820282019728792003956564819948n,d:37095705934669439343138083508754565189542113879843219016388785533085940283555n,Gx:15112221349535400772501151409588531511454012693041857206046113283949847762202n,Gy:46316835694926478169428394003475163141307993866256225615783033603165251855960n}),{p:Xe,n:Ze,Gx:Qe,Gy:$e,a:et,d:tt,h:nt}=Ye,rt=32,it=(...e)=>{`captureStackTrace`in Error&&typeof Error.captureStackTrace==`function`&&Error.captureStackTrace(...e)},at=(e=``)=>{let t=Error(e);throw it(t,at),t},ot=e=>typeof e==`bigint`,st=e=>typeof e==`string`,ct=e=>e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`&&`BYTES_PER_ELEMENT`in e&&e.BYTES_PER_ELEMENT===1,lt=(e,t,n=``)=>{let r=ct(e),i=e==null?void 0:e.length,a=t!==void 0;if(!r||a&&i!==t){let o=n&&`"${n}" `,s=a?` of length ${t}`:``,c=r?`length=${i}`:`type=${typeof e}`,l=o+`expected Uint8Array`+s+`, got `+c;throw r?RangeError(l):TypeError(l)}return e},ut=e=>new Uint8Array(e),dt=e=>Uint8Array.from(e),ft=(e,t)=>e.toString(16).padStart(t,`0`),pt=e=>Array.from(lt(e)).map(e=>ft(e,2)).join(``),mt={_0:48,_9:57,A:65,F:70,a:97,f:102},ht=e=>{if(e>=mt._0&&e<=mt._9)return e-mt._0;if(e>=mt.A&&e<=mt.F)return e-(mt.A-10);if(e>=mt.a&&e<=mt.f)return e-(mt.a-10)},gt=e=>{let t=`hex invalid`;if(!st(e))return at(t);let n=e.length,r=n/2;if(n%2)return at(t);let i=ut(r);for(let n=0,a=0;n<r;n++,a+=2){let r=ht(e.charCodeAt(a)),o=ht(e.charCodeAt(a+1));if(r===void 0||o===void 0)return at(t);i[n]=r*16+o}return i},_t=()=>{var e;return(e=globalThis)==null?void 0:e.crypto},vt=()=>{var e;return((e=_t())==null?void 0:e.subtle)??at(`crypto.subtle must be defined, consider polyfill`)},yt=(...e)=>{let t=0;for(let n of e)t+=lt(n).length;let n=ut(t),r=0;return e.forEach(e=>{n.set(e,r),r+=e.length}),n},bt=(e=rt)=>_t().getRandomValues(ut(e)),xt=BigInt,St=(e,t,n,r=`bad number: out of range`)=>{if(!ot(e))throw TypeError(r);if(t<=e&&e<n)return e;throw RangeError(r)},Ct=(e,t=Xe)=>{let n=e%t;return n>=0n?n:t+n},wt=(1n<<255n)-1n,H=e=>{e<0n&&at(`negative coordinate`);let t=(e>>255n)*19n+(e&wt);return t=(t>>255n)*19n+(t&wt),t%Xe},Tt=e=>Ct(e,Ze),Et=(e,t)=>{(e===0n||t<=0n)&&at(`no inverse n=`+e+` mod=`+t);let n=Ct(e,t),r=t,i=0n,a=1n,o=1n,s=0n;for(;n!==0n;){let e=r/n,t=r%n,c=i-o*e,l=a-s*e;r=n,n=t,i=o,a=s,o=c,s=l}return r===1n?Ct(i,t):at(`no inverse`)},Dt=e=>{let t=Xt[e];return typeof t!=`function`&&at(`hashes.`+e+` not set`),t},Ot=e=>lt(e,64,`digest`),kt=e=>e instanceof jt?e:at(`Point expected`),At=2n**256n,jt=class e{constructor(e,t,n,r){Je(this,`X`,void 0),Je(this,`Y`,void 0),Je(this,`Z`,void 0),Je(this,`T`,void 0);let i=At;this.X=St(e,0n,i),this.Y=St(t,0n,i),this.Z=St(n,1n,i),this.T=St(r,0n,i),Object.freeze(this)}static CURVE(){return Ye}static fromAffine(t){return new e(t.x,t.y,1n,H(t.x*t.y))}static fromBytes(t,n=!1){let r=tt,i=dt(lt(t,rt)),a=t[31];i[31]=a&-129;let o=Ft(i);St(o,0n,n?At:Xe);let s=H(o*o),{isValid:c,value:l}=zt(Ct(s-1n),H(r*s+1n));c||at(`bad point: y not sqrt`);let u=(l&1n)==1n,d=(a&128)!=0;return!n&&l===0n&&d&&at(`bad point: x==0, isLastByteOdd`),d!==u&&(l=Ct(-l)),new e(l,o,1n,H(l*o))}static fromHex(t,n){return e.fromBytes(gt(t),n)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}assertValidity(){let e=et,t=tt,n=this;if(n.is0())return at(`bad point: ZERO`);let{X:r,Y:i,Z:a,T:o}=n,s=H(r*r),c=H(i*i),l=H(a*a),u=H(l*l);return H(l*(H(s*e)+c))===Ct(u+H(t*H(s*c)))?H(r*i)===H(a*o)?this:at(`bad point: equation left != right (2)`):at(`bad point: equation left != right (1)`)}equals(e){let{X:t,Y:n,Z:r}=this,{X:i,Y:a,Z:o}=kt(e),s=H(t*o),c=H(i*r),l=H(n*o),u=H(a*r);return s===c&&l===u}is0(){return this.equals(Nt)}negate(){return new e(Ct(-this.X),this.Y,this.Z,Ct(-this.T))}double(){let{X:t,Y:n,Z:r}=this,i=et,a=H(t*t),o=H(n*n),s=H(2n*r*r),c=H(i*a),l=Ct(t+n),u=Ct(H(l*l)-a-o),d=Ct(c+o),f=Ct(d-s),p=Ct(c-o),m=H(u*f),h=H(d*p),g=H(u*p);return new e(m,h,H(f*d),g)}add(t){let{X:n,Y:r,Z:i,T:a}=this,{X:o,Y:s,Z:c,T:l}=kt(t),u=et,d=tt,f=H(n*o),p=H(r*s),m=H(H(a*d)*l),h=H(i*c),g=Ct(H(Ct(n+r)*Ct(o+s))-f-p),_=Ct(h-m),v=Ct(h+m),y=Ct(p-H(u*f)),b=H(g*_),x=H(v*y),S=H(g*y);return new e(b,x,H(_*v),S)}subtract(e){return this.add(kt(e).negate())}multiply(e,t=!0){if(!t&&e===0n||(St(e,1n,Ze),!t&&this.is0()))return Nt;if(e===1n)return this;if(this.equals(Mt))return an(e).p;let n=Nt,r=Mt;for(let i=this;e>0n;i=i.double(),e>>=1n)e&1n?n=n.add(i):t&&(r=r.add(i));return n}multiplyUnsafe(e){return this.multiply(e,!1)}toAffine(){let{X:e,Y:t,Z:n}=this;if(this.equals(Nt))return{x:0n,y:1n};let r=Et(n,Xe);return H(n*r)!==1n&&at(`invalid inverse`),{x:H(e*r),y:H(t*r)}}toBytes(){let{x:e,y:t}=this.toAffine(),n=Pt(t);return n[31]|=e&1n?128:0,n}toHex(){return pt(this.toBytes())}clearCofactor(){return this.multiply(xt(nt),!1)}isSmallOrder(){return this.clearCofactor().is0()}isTorsionFree(){let e=this.multiply(Ze/2n,!1).double();return Ze%2n&&(e=e.add(this)),e.is0()}};Je(jt,`BASE`,void 0),Je(jt,`ZERO`,void 0);var Mt=new jt(Qe,$e,1n,Ct(Qe*$e)),Nt=new jt(0n,1n,1n,0n);jt.BASE=Mt,jt.ZERO=Nt;var Pt=e=>gt(ft(St(e,0n,At),64)).reverse(),Ft=e=>xt(`0x`+pt(dt(lt(e)).reverse())),It=(e,t)=>{let n=e;for(;t-- >0n;)n=H(n*n);return n},Lt=e=>{let t=H(H(e*e)*e),n=H(It(H(It(t,2n)*t),1n)*e),r=H(It(n,5n)*n),i=H(It(r,10n)*r),a=H(It(i,20n)*i),o=H(It(a,40n)*a);return{pow_p_5_8:H(It(H(It(H(It(H(It(o,80n)*o),80n)*o),10n)*r),2n)*e),b2:t}},Rt=19681161376707505956807079304988542015446066515923890162744021073123829784752n,zt=(e,t)=>{let n=H(t*H(t*t)),r=Lt(H(e*H(H(n*n)*t))).pow_p_5_8,i=H(e*H(n*r)),a=H(t*H(i*i)),o=i,s=H(i*Rt),c=a===e,l=a===Ct(-e),u=a===Ct(-e*Rt);return c&&(i=o),(l||u)&&(i=s),(Ct(i)&1n)==1n&&(i=Ct(-i)),{isValid:c||l,value:i}},Bt=e=>Tt(Ft(e)),Vt=(...e)=>Promise.resolve(Dt(`sha512Async`)(yt(...e))).then(Ot),Ht=(...e)=>Ot(Dt(`sha512`)(yt(...e))),Ut=e=>{let t=dt(e),n=t.slice(0,32);n[0]&=248,n[31]&=127,n[31]|=64;let r=t.slice(32,64),i=Bt(n),a=Mt.multiply(i);return{head:n,prefix:r,scalar:i,point:a,pointBytes:a.toBytes()}},Wt=e=>Vt(lt(e,rt)).then(Ut),Gt=e=>Ut(Ht(lt(e,rt))),Kt=e=>Wt(e).then(e=>e.pointBytes),qt=e=>Vt(e.hashable).then(e.finish),Jt=(e,t,n)=>{let{pointBytes:r,scalar:i}=e,a=Bt(t),o=Mt.multiply(a).toBytes();return{hashable:yt(o,r,n),finish:e=>lt(yt(o,Pt(Tt(a+Bt(e)*i))),64)}},Yt=async(e,t)=>{let n=lt(e),r=await Wt(t);return qt(Jt(r,await Vt(r.prefix,n),n))},Xt={sha512Async:async e=>{let t=vt(),n=yt(e);return ut(await t.digest(`SHA-512`,n.buffer))},sha512:void 0},Zt=Object.freeze({getExtendedPublicKeyAsync:Wt,getExtendedPublicKey:Gt,randomSecretKey:e=>(e=e===void 0?bt(rt):e,lt(e,rt))}),Qt=8,$t=Math.ceil(256/Qt)+1,en=2**(Qt-1),tn=()=>{let e=[],t=Mt,n=t;for(let r=0;r<$t;r++){n=t,e.push(n);for(let r=1;r<en;r++)n=n.add(t),e.push(n);t=n.double()}return e},nn=void 0,rn=(e,t)=>{let n=t.negate();return e?n:t},an=e=>{let t=nn||(nn=tn()),n=Nt,r=Mt,i=2**Qt,a=i,o=xt(i-1),s=xt(Qt);for(let i=0;i<$t;i++){let c=Number(e&o);e>>=s,c>en&&(c-=a,e+=1n);let l=i*en,u=l,d=l+Math.abs(c)-1,f=i%2!=0,p=c<0;c===0?r=r.add(rn(f,t[u])):n=n.add(rn(p,t[d]))}return e!==0n&&at(`invalid wnaf`),{p:n,f:r}},on=`openclaw-device-identity-v1`;function sn(e){let t=``;for(let n of e)t+=String.fromCharCode(n);return btoa(t).replaceAll(`+`,`-`).replaceAll(`/`,`_`).replace(/=+$/g,``)}function cn(e){let t=e.replaceAll(`-`,`+`).replaceAll(`_`,`/`),n=t+`=`.repeat((4-t.length%4)%4),r=atob(n),i=new Uint8Array(r.length);for(let e=0;e<r.length;e+=1)i[e]=r.charCodeAt(e);return i}function ln(e){return Array.from(e).map(e=>e.toString(16).padStart(2,`0`)).join(``)}async function un(e){let t=await crypto.subtle.digest(`SHA-256`,e.slice().buffer);return ln(new Uint8Array(t))}async function dn(){let e=Zt.randomSecretKey(),t=await Kt(e);return{deviceId:await un(t),publicKey:sn(t),privateKey:sn(e)}}async function fn(){let e=Le();try{let t=e==null?void 0:e.getItem(on);if(t){let n=JSON.parse(t);if((n==null?void 0:n.version)===1&&typeof n.deviceId==`string`&&typeof n.publicKey==`string`&&typeof n.privateKey==`string`){let t=await un(cn(n.publicKey));if(t!==n.deviceId){let r={...n,deviceId:t};return e==null||e.setItem(on,JSON.stringify(r)),{deviceId:t,publicKey:n.publicKey,privateKey:n.privateKey}}return{deviceId:n.deviceId,publicKey:n.publicKey,privateKey:n.privateKey}}}}catch{}let t=await dn(),n={version:1,deviceId:t.deviceId,publicKey:t.publicKey,privateKey:t.privateKey,createdAtMs:Date.now()};return e==null||e.setItem(on,JSON.stringify(n)),t}async function pn(e,t){let n=cn(e);return sn(await Yt(new TextEncoder().encode(t),n))}var mn=!1;function hn(e){e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=``;for(let n=0;n<e.length;n++)t+=e[n].toString(16).padStart(2,`0`);return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}function gn(){mn||(mn=!0,console.warn(`[uuid] crypto API missing; refusing insecure UUID generation`))}function _n(e=globalThis.crypto){if(e&&typeof e.randomUUID==`function`)return e.randomUUID();if(e&&typeof e.getRandomValues==`function`){let t=new Uint8Array(16);return e.getRandomValues(t),hn(t)}throw gn(),Error(`Web Crypto is required for UUID generation`)}var vn=class extends Error{constructor(e){super(be({message:e.message,details:e.details})),this.name=`GatewayRequestError`,this.gatewayCode=e.code,this.details=e.details,this.retryable=e.retryable===!0,this.retryAfterMs=e.retryAfterMs}};function yn(e){return pe(e==null?void 0:e.details)}function bn(e){if(!e)return!1;let t=yn(e);return t===I.AUTH_TOKEN_MISSING||t===I.AUTH_BOOTSTRAP_TOKEN_INVALID||t===I.AUTH_PASSWORD_MISSING||t===I.AUTH_PASSWORD_MISMATCH||t===I.AUTH_RATE_LIMITED||t===I.AUTH_DEVICE_TOKEN_MISMATCH||t===I.PAIRING_REQUIRED||t===I.CONTROL_UI_DEVICE_IDENTITY_REQUIRED||t===I.DEVICE_IDENTITY_REQUIRED}function xn(e){try{let t=new URL(e,window.location.href),n=t.hostname.trim().toLowerCase(),r=n===`localhost`||n===`::1`||n===`[::1]`||n===`127.0.0.1`,i=n.startsWith(`127.`);if(r||i)return!0;let a=new URL(window.location.href);return t.host===a.host}catch{return!1}}var Sn=`operator`,Cn=[`operator.admin`,`operator.read`,`operator.write`,`operator.approvals`,`operator.pairing`],wn=4008,Tn=4013;function En(e){let t=e.authToken;if(t||e.authPassword)return{token:t,deviceToken:e.authDeviceToken??e.resolvedDeviceToken,password:e.authPassword}}async function Dn(e){let{deviceIdentity:t}=e;if(!t)return;let n=Date.now(),r=e.connectNonce??``,i=xe({deviceId:t.deviceId,clientId:e.client.id,clientMode:e.client.mode,role:e.role,scopes:e.scopes,signedAtMs:n,token:e.authToken??null,nonce:r}),a=await pn(t.privateKey,i);return{id:t.deviceId,publicKey:t.publicKey,signature:a,signedAt:n,nonce:r}}function On(e){return!e.deviceTokenRetryBudgetUsed&&!e.authDeviceToken&&!!e.explicitGatewayToken&&!!e.deviceIdentity&&!!e.storedToken&&e.canRetryWithDeviceTokenHint&&xn(e.url)}var kn=class{constructor(e){this.opts=e,this.ws=null,this.pending=new Map,this.closed=!1,this.lastSeq=null,this.connectNonce=null,this.connectSent=!1,this.connectTimer=null,this.connectGeneration=0,this.backoffMs=800,this.pendingDeviceTokenRetry=!1,this.deviceTokenRetryBudgetUsed=!1,this.pendingStartupReconnectDelayMs=null,this.eventListeners=new Set}start(){this.closed=!1,this.connect()}stop(){var e;this.closed=!0,this.clearConnectTimer(),(e=this.ws)==null||e.close(),this.ws=null,this.pendingConnectError=void 0,this.pendingDeviceTokenRetry=!1,this.deviceTokenRetryBudgetUsed=!1,this.pendingStartupReconnectDelayMs=null,this.flushPending(Error(`gateway client stopped`))}get connected(){var e;return((e=this.ws)==null?void 0:e.readyState)===WebSocket.OPEN}connect(){if(this.closed)return;let e=new WebSocket(this.opts.url),t=++this.connectGeneration;this.ws=e,e.addEventListener(`open`,()=>this.queueConnect(e,t)),e.addEventListener(`message`,n=>{this.isActiveSocket(e,t)&&this.handleMessage(e,t,String(n.data??``))}),e.addEventListener(`close`,t=>{var n,r;if(this.ws!==e)return;let i=t.reason??``,a=this.pendingConnectError;if(this.pendingConnectError=void 0,this.ws=null,this.pendingStartupReconnectDelayMs!==null){this.flushPending(Error(`gateway closed (${t.code}): ${i}`)),this.scheduleReconnect();return}this.flushPending(Error(`gateway closed (${t.code}): ${i}`)),(n=(r=this.opts).onClose)==null||n.call(r,{code:t.code,reason:i,error:a}),!(yn(a)===I.AUTH_TOKEN_MISMATCH&&this.deviceTokenRetryBudgetUsed&&!this.pendingDeviceTokenRetry)&&(bn(a)||this.scheduleReconnect())}),e.addEventListener(`error`,()=>{})}scheduleReconnect(){if(this.closed)return;let e=this.pendingStartupReconnectDelayMs;this.pendingStartupReconnectDelayMs=null;let t=e??this.backoffMs;e===null&&(this.backoffMs=Math.min(this.backoffMs*1.7,15e3)),this.clearConnectTimer(),this.connectTimer=window.setTimeout(()=>{this.connectTimer=null,this.connect()},t)}flushPending(e){for(let[t,n]of this.pending)this.emitRequestTiming(t,n,!1,`CLIENT_CLOSED`),n.reject(e);this.pending.clear()}nowMs(){return typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now()}emitRequestTiming(e,t,n,r){let i=this.nowMs();try{var a,o;(a=(o=this.opts).onRequestTiming)==null||a.call(o,{id:e,method:t.method,ok:n,durationMs:Math.max(0,i-t.startedAtMs),startedAtMs:t.startedAtMs,endedAtMs:i,errorCode:r})}catch(e){console.error(`[gateway] request timing handler error:`,e)}}buildConnectClient(){return{id:this.opts.clientName??Ce.CONTROL_UI,version:this.opts.clientVersion??`control-ui`,platform:this.opts.platform??navigator.platform??`web`,mode:this.opts.mode??we.WEBCHAT,instanceId:this.opts.instanceId}}buildConnectParams(e){return{minProtocol:3,maxProtocol:3,client:e.client,role:e.role,scopes:e.scopes,device:e.device,caps:[`tool-events`],auth:e.auth,userAgent:navigator.userAgent,locale:navigator.language}}async buildConnectPlan(e){var t,n;let r=Sn,i=[...Cn],a=this.buildConnectClient(),o=((t=this.opts.token)==null?void 0:t.trim())||void 0,s=((n=this.opts.password)==null?void 0:n.trim())||void 0,c=typeof crypto<`u`&&!!crypto.subtle,l=null,u={authToken:o,authPassword:s,canFallbackToShared:!1};return c&&(l=await fn(),u=this.selectConnectAuth({role:r,deviceId:l.deviceId})),{role:r,scopes:i,client:a,explicitGatewayToken:o,selectedAuth:u,auth:En(u),deviceIdentity:l,device:await Dn({deviceIdentity:l,client:a,role:r,scopes:i,authToken:u.authToken,connectNonce:e})}}handleConnectHello(e,t,n,r){var i,a,o;this.isActiveSocket(n,r)&&(this.pendingDeviceTokenRetry=!1,this.deviceTokenRetryBudgetUsed=!1,this.pendingStartupReconnectDelayMs=null,!(e==null||(i=e.auth)==null)&&i.deviceToken&&t.deviceIdentity&&Ue({deviceId:t.deviceIdentity.deviceId,role:e.auth.role??t.role,token:e.auth.deviceToken,scopes:e.auth.scopes??[]}),this.backoffMs=800,(a=(o=this.opts).onHello)==null||a.call(o,e))}handleConnectFailure(e,t,n,r){if(!this.isActiveSocket(n,r))return;let i=e instanceof vn?yn(e):null,a=e instanceof vn?R(e.details):{},o=a.recommendedNextStep===`retry_with_device_token`,s=a.canRetryWithDeviceToken===!0||o||i===I.AUTH_TOKEN_MISMATCH;On({deviceTokenRetryBudgetUsed:this.deviceTokenRetryBudgetUsed,authDeviceToken:t.selectedAuth.authDeviceToken,explicitGatewayToken:t.explicitGatewayToken,deviceIdentity:t.deviceIdentity,storedToken:t.selectedAuth.storedToken,canRetryWithDeviceTokenHint:s,url:this.opts.url})&&(this.pendingDeviceTokenRetry=!0,this.deviceTokenRetryBudgetUsed=!0),e instanceof vn?this.pendingConnectError={code:e.gatewayCode,message:e.message,details:e.details,retryable:e.retryable,retryAfterMs:e.retryAfterMs}:this.pendingConnectError=void 0,t.selectedAuth.storedToken&&(t.selectedAuth.resolvedDeviceToken===t.selectedAuth.storedToken||t.selectedAuth.authDeviceToken===t.selectedAuth.storedToken)&&t.deviceIdentity&&i===I.AUTH_DEVICE_TOKEN_MISMATCH&&We({deviceId:t.deviceIdentity.deviceId,role:t.role});let c=ke(e);if(c!==null&&(this.pendingStartupReconnectDelayMs=c),Oe(e)){n.close(Tn,`gateway starting`);return}n.close(wn,`connect failed`)}isActiveSocket(e,t){return!this.closed&&this.ws===e&&this.connectGeneration===t}async sendConnect(e,t){if(!this.isActiveSocket(e,t)||e.readyState!==WebSocket.OPEN||this.connectSent)return;this.connectSent=!0,this.clearConnectTimer();let n=await this.buildConnectPlan(this.connectNonce);!this.isActiveSocket(e,t)||e.readyState!==WebSocket.OPEN||(this.pendingDeviceTokenRetry&&n.selectedAuth.authDeviceToken&&(this.pendingDeviceTokenRetry=!1),this.requestOnSocket(e,`connect`,this.buildConnectParams(n)).then(r=>this.handleConnectHello(r,n,e,t)).catch(r=>this.handleConnectFailure(r,n,e,t)))}handleMessage(e,t,n){let r;try{r=JSON.parse(n)}catch{return}let i=r;if(i.type===`event`){let n=r;if(n.event===`connect.challenge`){let r=n.payload,i=r&&typeof r.nonce==`string`?r.nonce:null;i&&(this.connectNonce=i,this.sendConnect(e,t));return}let i=typeof n.seq==`number`?n.seq:null;if(i!==null){if(this.lastSeq!==null&&i>this.lastSeq+1){var a,o;(a=(o=this.opts).onGap)==null||a.call(o,{expected:this.lastSeq+1,received:i})}this.lastSeq=i}try{var s,c;(s=(c=this.opts).onEvent)==null||s.call(c,n);for(let e of this.eventListeners)e(n)}catch(e){console.error(`[gateway] event handler error:`,e)}return}if(i.type===`res`){let e=r,t=this.pending.get(e.id);if(!t)return;if(this.pending.delete(e.id),e.ok)this.emitRequestTiming(e.id,t,!0),t.resolve(e.payload);else{var l,u,d,f,p,m;this.emitRequestTiming(e.id,t,!1,(l=e.error)==null?void 0:l.code),t.reject(new vn({code:((u=e.error)==null?void 0:u.code)??`UNAVAILABLE`,message:((d=e.error)==null?void 0:d.message)??`request failed`,details:(f=e.error)==null?void 0:f.details,retryable:(p=e.error)==null?void 0:p.retryable,retryAfterMs:(m=e.error)==null?void 0:m.retryAfterMs}))}return}}selectConnectAuth(e){var t,n;let r=((t=this.opts.token)==null?void 0:t.trim())||void 0,i=((n=this.opts.password)==null?void 0:n.trim())||void 0,a=He({deviceId:e.deviceId,role:e.role}),o=(a==null?void 0:a.scopes)??[],s=e.role!==Sn||o.includes(`operator.read`)||o.includes(`operator.write`)||o.includes(`operator.admin`)?a==null?void 0:a.token:void 0,c=this.pendingDeviceTokenRetry&&!!r&&!!s&&xn(this.opts.url),l=r||i?void 0:s??void 0;return{authToken:r??l,authDeviceToken:c?s??void 0:void 0,authPassword:i,resolvedDeviceToken:l,storedToken:s??void 0,canFallbackToShared:!!(s&&r)}}request(e,t){return!this.ws||this.ws.readyState!==WebSocket.OPEN?Promise.reject(Error(`gateway not connected`)):this.requestOnSocket(this.ws,e,t)}requestOnSocket(e,t,n){if(this.ws!==e||e.readyState!==WebSocket.OPEN)return Promise.reject(Error(`gateway not connected`));let r=_n(),i={type:`req`,id:r,method:t,params:n},a=this.nowMs(),o=new Promise((e,n)=>{this.pending.set(r,{resolve:t=>e(t),reject:n,method:t,startedAtMs:a})});return e.send(JSON.stringify(i)),o}addEventListener(e){return this.eventListeners.add(e),()=>{this.eventListeners.delete(e)}}queueConnect(e,t){this.isActiveSocket(e,t)&&(this.connectNonce=null,this.connectSent=!1,this.clearConnectTimer(),this.connectTimer=window.setTimeout(()=>{this.connectTimer=null,this.sendConnect(e,t)},750))}clearConnectTimer(){this.connectTimer!==null&&(window.clearTimeout(this.connectTimer),this.connectTimer=null)}};function An(e){return e instanceof vn?yn(e)===I.AUTH_UNAUTHORIZED?!0:e.message.includes(`missing scope: operator.read`):!1}function jn(e){return`This connection is missing operator.read, so ${e} cannot be loaded yet.`}async function Mn(e,t){if(!(!e.client||!e.connected)&&!e.channelsLoading){e.channelsLoading=!0,e.channelsError=null;try{e.channelsSnapshot=await e.client.request(`channels.status`,{probe:t,timeoutMs:8e3}),e.channelsLastSuccess=Date.now()}catch(t){An(t)?(e.channelsSnapshot=null,e.channelsError=jn(`channel status`)):e.channelsError=String(t)}finally{e.channelsLoading=!1}}}async function Nn(e,t){if(!(!e.client||!e.connected||e.whatsappBusy)){e.whatsappBusy=!0;try{let n=await e.client.request(`web.login.start`,{force:t,timeoutMs:3e4});e.whatsappLoginMessage=n.message??null,e.whatsappLoginQrDataUrl=n.qrDataUrl??null,e.whatsappLoginConnected=typeof n.connected==`boolean`?n.connected:null}catch(t){e.whatsappLoginMessage=String(t),e.whatsappLoginQrDataUrl=null,e.whatsappLoginConnected=null}finally{e.whatsappBusy=!1}}}async function Pn(e){if(!(!e.client||!e.connected||e.whatsappBusy)){e.whatsappBusy=!0;try{let t=await e.client.request(`web.login.wait`,{timeoutMs:12e4,currentQrDataUrl:e.whatsappLoginQrDataUrl??void 0});e.whatsappLoginMessage=t.message??null,e.whatsappLoginConnected=t.connected??null,t.qrDataUrl?e.whatsappLoginQrDataUrl=t.qrDataUrl:t.connected&&(e.whatsappLoginQrDataUrl=null)}catch(t){e.whatsappLoginMessage=String(t),e.whatsappLoginConnected=null}finally{e.whatsappBusy=!1}}}async function Fn(e){if(!(!e.client||!e.connected||e.whatsappBusy)){e.whatsappBusy=!0;try{await e.client.request(`channels.logout`,{channel:`whatsapp`}),e.whatsappLoginMessage=`Logged out.`,e.whatsappLoginQrDataUrl=null,e.whatsappLoginConnected=null}catch(t){e.whatsappLoginMessage=String(t)}finally{e.whatsappBusy=!1}}}function In(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.prototype.toString.call(e)===`[object Object]`}var Ln=new Set([`__proto__`,`prototype`,`constructor`]);function Rn(e){return Ln.has(e)}function zn(e){return In(e)?typeof e.id==`string`&&e.id.length>0:!1}function Bn(e,t,n){if(!e.every(zn))return;let r=[...e],i=new Map;for(let[e,t]of r.entries()){if(!zn(t))return;i.set(t.id,e)}for(let e of t){if(!zn(e)){r.push(structuredClone(e));continue}let t=i.get(e.id);if(t===void 0){r.push(structuredClone(e)),i.set(e.id,r.length-1);continue}r[t]=Vn(r[t],e,n)}return r}function Vn(e,t,n={}){if(!In(t))return t;let r=In(e)?{...e}:{};for(let[e,i]of Object.entries(t))if(!Rn(e)){if(i===null){delete r[e];continue}if(n.mergeObjectArraysById&&Array.isArray(r[e])&&Array.isArray(i)){let t=Bn(r[e],i,n);if(t){r[e]=t;continue}}if(In(i)){let t=r[e];r[e]=Vn(In(t)?t:{},i,n);continue}r[e]=i}return r}function Hn(e){if(e)return Array.isArray(e.type)?e.type.find(e=>e!==`null`)??e.type[0]:e.type}function Un(e){if(!e)return``;if(e.default!==void 0)return e.default;switch(Hn(e)){case`object`:return{};case`array`:return[];case`boolean`:return!1;case`number`:case`integer`:return 0;case`string`:return``;default:return``}}function Wn(e){return e.filter(e=>typeof e==`string`).join(`.`)}function Gn(e,t){let n=t[Wn(e)];if(n)return n;let r=e.map(String);for(let[e,n]of Object.entries(t)){if(!e.includes(`*`))continue;let t=e.split(`.`);if(t.length!==r.length)continue;let i=!0;for(let e=0;e<r.length;e+=1)if(t[e]!==`*`&&t[e]!==r[e]){i=!1;break}if(i)return n}}function Kn(e){return e.replace(/_/g,` `).replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/\s+/g,` `).replace(/^./,e=>e.toUpperCase())}var qn=[`maxtokens`,`maxoutputtokens`,`maxinputtokens`,`maxcompletiontokens`,`contexttokens`,`totaltokens`,`tokencount`,`tokenlimit`,`tokenbudget`,`passwordfile`],Jn=[/token$/i,/password/i,/secret/i,/api.?key/i,/serviceaccount(?:ref)?$/i],Yn=/^\$\{[^}]*\}$/,Xn=`[redacted - click reveal to view]`,Zn=64,Qn=2e4;function $n(){return{visited:0}}function er(e,t){return!(t>Zn||(e.visited+=1,e.visited>Qn))}function tr(e){return Yn.test(e.trim())}function nr(e){let t=g(e);return!qn.some(e=>t.endsWith(e))&&Jn.some(t=>t.test(e))}function rr(e){return typeof e==`string`?e.trim().length>0&&!tr(e):e!=null}function ir(e){return(e==null?void 0:e.sensitive)??!1}function ar(e,t,n){return or(e,t,n,$n(),0)}function or(e,t,n,r,i){if(!er(r,i))return!0;let a=Wn(t);return(ir(Gn(t,n))||nr(a))&&rr(e)?!0:Array.isArray(e)?e.some((e,a)=>or(e,[...t,a],n,r,i+1)):e&&typeof e==`object`?Object.entries(e).some(([e,a])=>or(a,[...t,e],n,r,i+1)):!1}function sr(e,t,n){return cr(e,t,n,$n(),0)}function cr(e,t,n,r,i){if(!er(r,i))return 1;if(e==null)return 0;let a=Wn(t);return(ir(Gn(t,n))||nr(a))&&rr(e)?1:Array.isArray(e)?e.reduce((e,a,o)=>e+cr(a,[...t,o],n,r,i+1),0):e&&typeof e==`object`?Object.entries(e).reduce((e,[a,o])=>e+cr(o,[...t,a],n,r,i+1),0):0}function lr(e,t){let n=e.trim();if(n===``)return;let r=Number(n);return!Number.isFinite(r)||t&&!Number.isInteger(r)?e:r}function ur(e){let t=e.trim();return t===`true`?!0:t===`false`?!1:e}function dr(e,t){if(e==null)return e;if(t.allOf&&t.allOf.length>0){let n=e;for(let e of t.allOf)n=dr(n,e);return n}let n=Hn(t);if(t.anyOf||t.oneOf){let n=(t.anyOf??t.oneOf??[]).filter(e=>!(e.type===`null`||Array.isArray(e.type)&&e.type.includes(`null`)));if(n.length===1)return dr(e,n[0]);if(typeof e==`string`)for(let t of n){let n=Hn(t);if(n===`number`||n===`integer`){let t=lr(e,n===`integer`);if(t===void 0||typeof t==`number`)return t}if(n===`boolean`){let t=ur(e);if(typeof t==`boolean`)return t}}for(let t of n){let n=Hn(t);if(n===`object`&&typeof e==`object`&&!Array.isArray(e)||n===`array`&&Array.isArray(e))return dr(e,t)}return e}if(n===`number`||n===`integer`){if(typeof e==`string`){let t=lr(e,n===`integer`);if(t===void 0||typeof t==`number`)return t}return e}if(n===`boolean`){if(typeof e==`string`){let t=ur(e);if(typeof t==`boolean`)return t}return e}if(n===`object`){if(typeof e!=`object`||Array.isArray(e))return e;let n=e,r=t.properties??{},i=t.additionalProperties&&typeof t.additionalProperties==`object`?t.additionalProperties:null,a={};for(let[e,t]of Object.entries(n)){let n=r[e]??i,o=n?dr(t,n):t;o!==void 0&&(a[e]=o)}return a}if(n===`array`){if(!Array.isArray(e))return e;if(Array.isArray(t.items)){let n=t.items;return e.map((e,t)=>{let r=t<n.length?n[t]:void 0;return r?dr(e,r):e})}let n=t.items;return n?e.map(e=>dr(e,n)).filter(e=>e!==void 0):e}return e}function fr(e){return structuredClone(e)}function pr(e){return`${JSON.stringify(e,null,2).trimEnd()}\n`}var mr=new Set([`__proto__`,`prototype`,`constructor`]);function hr(e){return typeof e==`string`&&mr.has(e)}function gr(e,t,n){if(t.length===0||t.some(hr))return null;let r=e;for(let e=0;e<t.length-1;e+=1){let i=t[e],a=t[e+1];if(typeof i==`number`){if(!Array.isArray(r))return null;if(r[i]==null){if(!n)return null;r[i]=typeof a==`number`?[]:{}}r=r[i];continue}if(typeof r!=`object`||!r)return null;let o=r;if(o[i]==null){if(!n)return null;o[i]=typeof a==`number`?[]:{}}r=o[i]}return{current:r,lastKey:t[t.length-1]}}function _r(e,t,n){let r=gr(e,t,!0);if(r){if(typeof r.lastKey==`number`){Array.isArray(r.current)&&(r.current[r.lastKey]=n);return}typeof r.current==`object`&&r.current!=null&&(r.current[r.lastKey]=n)}}function vr(e,t){let n=gr(e,t,!1);if(n){if(typeof n.lastKey==`number`){Array.isArray(n.current)&&n.current.splice(n.lastKey,1);return}typeof n.current==`object`&&n.current!=null&&delete n.current[n.lastKey]}}async function yr(e,t={}){if(!(!e.client||!e.connected)){e.configLoading=!0,e.lastError=null;try{Sr(e,await e.client.request(`config.get`,{}),t)}catch(t){e.lastError=String(t)}finally{e.configLoading=!1}}}async function br(e){if(!(!e.client||!e.connected)&&!e.configSchemaLoading){e.configSchemaLoading=!0;try{xr(e,await e.client.request(`config.schema`,{}))}catch(t){e.lastError=String(t)}finally{e.configSchemaLoading=!1}}}function xr(e,t){e.configSchema=t.schema??null,e.configUiHints=t.uiHints??{},e.configSchemaVersion=t.version??null}function Sr(e,t,n={}){var r;let i=e.configFormDirty&&n.discardPendingChanges!==!0,a=e.configDraftBaseHash??((r=e.configSnapshot)==null?void 0:r.hash)??null;e.configSnapshot=t,typeof t.raw!=`string`&&e.configFormMode===`raw`&&(e.configFormMode=`form`);let o=typeof t.raw==`string`?t.raw:t.config&&typeof t.config==`object`?pr(t.config):e.configRaw;!i||e.configFormMode===`raw`?e.configRaw=o:e.configForm?e.configRaw=pr(e.configForm):e.configRaw=o,e.configValid=typeof t.valid==`boolean`?t.valid:null,e.configIssues=Array.isArray(t.issues)?t.issues:[],i?e.configDraftBaseHash=a:(e.configForm=fr(t.config??{}),e.configFormOriginal=fr(t.config??{}),e.configRawOriginal=o,e.configFormDirty=!1,e.configDraftBaseHash=t.hash??null)}function Cr(e){return!e||typeof e!=`object`||Array.isArray(e)?null:e}function wr(e){var t;if(e.configFormMode===`raw`&&typeof((t=e.configSnapshot)==null?void 0:t.raw)!=`string`)throw Error(`Raw config editing is unavailable for this snapshot. Switch to Form mode.`);if(e.configFormMode!==`form`||!e.configForm)return e.configRaw;let n=Cr(e.configSchema);return pr(n?dr(e.configForm,n):e.configForm)}function Tr(e){let t=(e.status??`error`).trim()||`error`,n=(e.reason??`unexpected-error`).trim()||`unexpected-error`;return{tone:t===`skipped`?`warn`:`danger`,text:`Update ${t}: ${n}. ${{dirty:`Commit or stash changes, then retry.`,"no-upstream":`Set an upstream branch, then retry.`,"not-git-install":"Not a git checkout. Run `openclaw update` from the CLI for a global reinstall.","not-openclaw-root":`Run the update from a 玺虾 checkout or use the CLI global reinstall path.`,"deps-install-failed":`Dependency install failed. Fix the install error and retry.`,"build-failed":`Build failed. Fix the build error and retry.`,"ui-build-failed":`The control UI rebuild failed. Fix the UI build error and retry.`,"global-install-failed":`The global package install did not verify on disk. Retry or reinstall from the CLI.`,"restart-disabled":"The update was not applied because gateway restarts are disabled. Enable restarts in config, then retry — or run `openclaw update` from the CLI.","restart-unavailable":`This global install cannot be safely replaced while restarts are disabled and no supervisor is present.`,"restart-unhealthy":`The replacement process never became healthy. The previous process stayed up so you can recover.`,"doctor-failed":"Doctor repair failed. Run `openclaw doctor --non-interactive` and retry."}[n]??`See the gateway logs for the exact failure and retry once the cause is fixed.`}`}}async function Er(e,t,n,r={}){if(!e.client||!e.connected)return!1;e[n]=!0,e.lastError=null;try{var i;let n=wr(e),a=e.configDraftBaseHash??((i=e.configSnapshot)==null?void 0:i.hash);return a?(await e.client.request(t,{raw:n,baseHash:a,...r}),e.configFormDirty=!1,e.configDraftBaseHash=null,await yr(e),!0):(e.lastError=`Config hash missing; reload and retry.`,!1)}catch(t){return e.lastError=String(t),!1}finally{e[n]=!1}}function Dr(e,t){var n;let r=fr(e.configFormOriginal??((n=e.configSnapshot)==null?void 0:n.config)??{}),i=pr(t),a=pr(r);e.configForm=t,e.configRaw=i,e.configFormDirty=i!==a}async function Or(e){return Er(e,`config.set`,`configSaving`)}async function kr(e){return Er(e,`config.apply`,`configApplying`,{sessionKey:e.applySessionKey})}async function Ar(e){if(!(!e.client||!e.connected)){e.updateRunning=!0,e.lastError=null,e.updateStatusBanner=null;try{var t,n;let i=await e.client.request(`update.run`,{sessionKey:e.applySessionKey}),a=((t=i.result)==null?void 0:t.status)??(i.ok===!0?`ok`:`error`);if(a===`ok`&&i.ok===!0){var r;e.pendingUpdateExpectedVersion=((r=i.result)==null||(r=r.after)==null?void 0:r.version)??null;return}e.pendingUpdateExpectedVersion=null,e.updateStatusBanner=Tr({status:a,reason:(n=i.result)==null?void 0:n.reason})}catch(t){e.lastError=String(t),e.pendingUpdateExpectedVersion=null}finally{e.updateRunning=!1}}}function jr(e,t){var n;let r=fr(e.configForm??((n=e.configSnapshot)==null?void 0:n.config)??{});t(r),Dr(e,r)}function Mr(e,t,n){jr(e,e=>_r(e,t,n))}function Nr(e,t){var n,r;let i=(n=e.configSnapshot)!=null&&n.config&&typeof e.configSnapshot.config==`object`&&!Array.isArray(e.configSnapshot.config)?e.configSnapshot.config:null,a=e.configForm??i;if(!a||!e.configForm&&!((r=e.configSnapshot)!=null&&r.hash))return;let o=Vn(fr(a),t);!o||typeof o!=`object`||Array.isArray(o)||Dr(e,fr(o))}function Pr(e){var t,n,r;e.configForm=fr(e.configFormOriginal??((t=e.configSnapshot)==null?void 0:t.config)??{}),e.configRaw=e.configRawOriginal??pr(e.configFormOriginal??((n=e.configSnapshot)==null?void 0:n.config)??{}),e.configFormDirty=!1,e.configDraftBaseHash=((r=e.configSnapshot)==null?void 0:r.hash)??null}function Fr(e,t){jr(e,e=>vr(e,t))}function Ir(e,t){var n;let r=t.trim();if(!r)return-1;let i=e==null||(n=e.agents)==null?void 0:n.list;return Array.isArray(i)?i.findIndex(e=>e&&typeof e==`object`&&`id`in e&&e.id===r):-1}function Lr(e,t){var n,r;let i=t.trim();if(!i)return-1;let a=e.configForm??((n=e.configSnapshot)==null?void 0:n.config),o=Ir(a,i);if(o>=0)return o;let s=a==null||(r=a.agents)==null?void 0:r.list,c=Array.isArray(s)?s.length:0;return Mr(e,[`agents`,`list`,c,`id`],i),c}function Rr(e,t){var n;let r=t.trim();if(!r)return!1;let i=Ir(e.configForm??((n=e.configSnapshot)==null?void 0:n.config),r);return i<0?!1:(jr(e,e=>{var t;let n=e==null||(t=e.agents)==null?void 0:t.list;if(Array.isArray(n))for(let e=0;e<n.length;e++){let t=n[e];if(!t||typeof t!=`object`||Array.isArray(t))continue;let r=t;e===i?r.default=!0:delete r.default}}),!0)}async function zr(e){if(!(!e.client||!e.connected))try{await e.client.request(`config.openFile`,{})}catch{var t;let n=(t=e.configSnapshot)==null?void 0:t.path;if(n)try{await navigator.clipboard.writeText(n)}catch{}}}function Br(e){let{values:t,original:n}=e;return t.name!==n.name||t.displayName!==n.displayName||t.about!==n.about||t.picture!==n.picture||t.banner!==n.banner||t.website!==n.website||t.nip05!==n.nip05||t.lud16!==n.lud16}function Vr(t){let{state:n,callbacks:r,accountId:a}=t,o=Br(n),s=(t,a,o={})=>{let{type:s=`text`,placeholder:c,maxLength:l,help:u}=o,d=n.values[t]??``,f=n.fieldErrors[t],p=`nostr-profile-${t}`;return s===`textarea`?e`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/channels.cn-C_H6e9d6.js","assets/lit-xS7RrYW6.js","assets/agents-CAmTjL2H.js","assets/directive-Dk4hInuL.js","assets/string-coerce-OVejwecW.js","assets/channel-config-extras-B1l5nZ9H.js","assets/skills-shared-D4QYNbRK.js","assets/channels-1cjrTMwB.js","assets/cron-BtOWAQd-.js","assets/cron-task-list-47yZC4F_.js","assets/debug-BkVmAx6w.js","assets/instances-6i8ma6iW.js","assets/logs-COq7j13X.js","assets/nodes-Du49WHjP.js","assets/sessions-BmEME1Ct.js","assets/skills-B_7WeHCK.js","assets/skill-center-DNcOO6Ju.js","assets/filespace-BCO0sWG5.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c,u as l}from"./lit-xS7RrYW6.js";import{i as u,n as d,r as f,t as p}from"./store-DLzVZn7l.js";import{n as m,r as h,t as g}from"./string-coerce-OVejwecW.js";import{n as _,r as v,t as y}from"./directive-Dk4hInuL.js";var b=Object.create,x=Object.defineProperty,S=Object.getOwnPropertyDescriptor,C=Object.getOwnPropertyNames,ee=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty,T=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),E=(e,t)=>{let n={};for(var r in e)x(n,r,{get:e[r],enumerable:!0});return t||x(n,Symbol.toStringTag,{value:`Module`}),n},D=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=C(t),a=0,o=i.length,s;a<o;a++)s=i[a],!w.call(e,s)&&s!==n&&x(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=S(t,s))||r.enumerable});return e},te=(e,t,n)=>(n=e==null?{}:b(ee(e)),D(t||!e||!e.__esModule?x(n,`default`,{value:e,enumerable:!0}):n,e));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})(),typeof Array.prototype.toSorted!=`function`&&Object.defineProperty(Array.prototype,`toSorted`,{value:function(e){return[...this].sort(e)},writable:!0,configurable:!0}),typeof Array.prototype.toReversed!=`function`&&Object.defineProperty(Array.prototype,`toReversed`,{value:function(){return[...this].reverse()},writable:!0,configurable:!0}),typeof Array.prototype.toSpliced!=`function`&&Object.defineProperty(Array.prototype,`toSpliced`,{value:function(e,t,...n){let r=[...this];return t===void 0?r.splice(e):r.splice(e,t,...n),r},writable:!0,configurable:!0}),typeof Array.prototype.with!=`function`&&Object.defineProperty(Array.prototype,`with`,{value:function(e,t){let n=[...this],r=e<0?n.length+e:e;if(r<0||r>=n.length)throw RangeError(`Invalid index`);return n[r]=t,n},writable:!0,configurable:!0});var ne={attribute:!0,type:String,converter:r,reflect:!1,hasChanged:t},re=(e=ne,t,n)=>{let{kind:r,metadata:i}=n,a=globalThis.litPropertyMetadata.get(i);if(a===void 0&&globalThis.litPropertyMetadata.set(i,a=new Map),r===`setter`&&((e=Object.create(e)).wrapped=!0),a.set(n.name,e),r===`accessor`){let{name:r}=n;return{set(n){let i=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,i,e,!0,n)},init(t){return t!==void 0&&this.C(r,void 0,e,t),t}}}if(r===`setter`){let{name:r}=n;return function(n){let i=this[r];t.call(this,n),this.requestUpdate(r,i,e,!0,n)}}throw Error(`Unsupported decorator location: `+r)};function O(e){return(t,n)=>typeof n==`object`?re(e,t,n):((e,t,n)=>{let r=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}function k(e){return O({...e,state:!0,attribute:!1})}var A=(e,t,n)=>(n.configurable=!0,n.enumerable=!0,Reflect.decorate&&typeof t!=`object`&&Object.defineProperty(e,t,n),n);function j(e,t){return(n,r,i)=>{let a=t=>{var n;return((n=t.renderRoot)==null?void 0:n.querySelector(e))??null};if(t){let{get:e,set:t}=typeof r==`object`?n:i??(()=>{let e=Symbol();return{get(){return this[e]},set(t){this[e]=t}}})();return A(n,r,{get(){let n=e.call(this);return n===void 0&&(n=a(this),(n!==null||this.hasUpdated)&&t.call(this,n)),n}})}return A(n,r,{get(){return a(this)}})}}var M=e=>u(`/api/sealclaw/api-keys`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)}),N=()=>u(`/api/sealclaw/api-keys`),ie=e=>u(`/api/sealclaw/api-keys/${e}`,{method:`DELETE`}),ae=e=>u(`/api/sealclaw/v1/models`,e?{headers:{Authorization:`Bearer ${e}`,token:e}}:void 0);function oe(e){return e?/[\r\n]/.test(e)?null:e:null}function P(e){var t,n;return oe(h((t=e.hello)==null||(t=t.auth)==null?void 0:t.deviceToken)??null)??oe(h((n=e.settings)==null?void 0:n.token)??null)??oe(h(e.password)??null)??null}function F(e){let t=P(e);return t?`Bearer ${t}`:null}function se(e){var t,n;let r=new Set,i=[];for(let a of[h((t=e.hello)==null||(t=t.auth)==null?void 0:t.deviceToken),h((n=e.settings)==null?void 0:n.token),h(e.password)]){let e=oe(a??null);e&&!r.has(e)&&(r.add(e),i.push(e))}return i}var I={AUTH_REQUIRED:`AUTH_REQUIRED`,AUTH_UNAUTHORIZED:`AUTH_UNAUTHORIZED`,AUTH_TOKEN_MISSING:`AUTH_TOKEN_MISSING`,AUTH_TOKEN_MISMATCH:`AUTH_TOKEN_MISMATCH`,AUTH_TOKEN_NOT_CONFIGURED:`AUTH_TOKEN_NOT_CONFIGURED`,AUTH_PASSWORD_MISSING:`AUTH_PASSWORD_MISSING`,AUTH_PASSWORD_MISMATCH:`AUTH_PASSWORD_MISMATCH`,AUTH_PASSWORD_NOT_CONFIGURED:`AUTH_PASSWORD_NOT_CONFIGURED`,AUTH_BOOTSTRAP_TOKEN_INVALID:`AUTH_BOOTSTRAP_TOKEN_INVALID`,AUTH_DEVICE_TOKEN_MISMATCH:`AUTH_DEVICE_TOKEN_MISMATCH`,AUTH_RATE_LIMITED:`AUTH_RATE_LIMITED`,AUTH_TAILSCALE_IDENTITY_MISSING:`AUTH_TAILSCALE_IDENTITY_MISSING`,AUTH_TAILSCALE_PROXY_MISSING:`AUTH_TAILSCALE_PROXY_MISSING`,AUTH_TAILSCALE_WHOIS_FAILED:`AUTH_TAILSCALE_WHOIS_FAILED`,AUTH_TAILSCALE_IDENTITY_MISMATCH:`AUTH_TAILSCALE_IDENTITY_MISMATCH`,CONTROL_UI_ORIGIN_NOT_ALLOWED:`CONTROL_UI_ORIGIN_NOT_ALLOWED`,CONTROL_UI_DEVICE_IDENTITY_REQUIRED:`CONTROL_UI_DEVICE_IDENTITY_REQUIRED`,DEVICE_IDENTITY_REQUIRED:`DEVICE_IDENTITY_REQUIRED`,DEVICE_AUTH_INVALID:`DEVICE_AUTH_INVALID`,DEVICE_AUTH_DEVICE_ID_MISMATCH:`DEVICE_AUTH_DEVICE_ID_MISMATCH`,DEVICE_AUTH_SIGNATURE_EXPIRED:`DEVICE_AUTH_SIGNATURE_EXPIRED`,DEVICE_AUTH_NONCE_REQUIRED:`DEVICE_AUTH_NONCE_REQUIRED`,DEVICE_AUTH_NONCE_MISMATCH:`DEVICE_AUTH_NONCE_MISMATCH`,DEVICE_AUTH_SIGNATURE_INVALID:`DEVICE_AUTH_SIGNATURE_INVALID`,DEVICE_AUTH_PUBLIC_KEY_INVALID:`DEVICE_AUTH_PUBLIC_KEY_INVALID`,PAIRING_REQUIRED:`PAIRING_REQUIRED`},ce={NOT_PAIRED:`not-paired`,ROLE_UPGRADE:`role-upgrade`,SCOPE_UPGRADE:`scope-upgrade`,METADATA_UPGRADE:`metadata-upgrade`},le=new Set([`retry_with_device_token`,`update_auth_configuration`,`update_auth_credentials`,`wait_then_retry`,`review_auth_configuration`]),L=new Set([`not-paired`,`role-upgrade`,`scope-upgrade`,`metadata-upgrade`]),ue=/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/,de={"not-paired":{requirement:`device is not approved yet`,remediationHint:`Approve this device from the pending pairing requests.`,recoveryTitle:`Gateway pairing approval required.`},"role-upgrade":{requirement:`device is asking for a higher role than currently approved`,remediationHint:`Review the requested role upgrade, then approve the pending request.`,recoveryTitle:`Gateway role upgrade approval required.`},"scope-upgrade":{requirement:`device is asking for more scopes than currently approved`,remediationHint:`Review the requested scopes, then approve the pending upgrade.`,recoveryTitle:`Gateway scope upgrade approval required.`},"metadata-upgrade":{requirement:`device identity changed and must be re-approved`,remediationHint:`Review the refreshed device details, then approve the pending request.`,recoveryTitle:`Gateway device refresh approval required.`}},fe={"not-paired":`device pairing required`,"role-upgrade":`role upgrade pending approval`,"scope-upgrade":`scope upgrade pending approval`,"metadata-upgrade":`device metadata change pending approval`};function pe(e){if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e.code;return typeof t==`string`&&t.trim().length>0?t:null}function R(e){if(!e||typeof e!=`object`||Array.isArray(e))return{};let t=e,n=typeof t.canRetryWithDeviceToken==`boolean`?t.canRetryWithDeviceToken:void 0,r=h(t.recommendedNextStep)??``;return{canRetryWithDeviceToken:n,recommendedNextStep:le.has(r)?r:void 0}}function z(e){let t=h(e)??``;return L.has(t)?t:void 0}function me(e){let t=h(e);return t&&ue.test(t)?t:void 0}function he(e){if(!Array.isArray(e))return;let t=e.map(e=>h(e)).filter(e=>!!e);return t.length>0?t:[]}function B(e){return{code:I.PAIRING_REQUIRED,...e.reason?{reason:e.reason}:{},...e.requestId?{requestId:e.requestId}:{},...e.remediationHint?{remediationHint:e.remediationHint}:{},...e.deviceId?{deviceId:e.deviceId}:{},...e.requestedRole?{requestedRole:e.requestedRole}:{},...e.requestedScopes?{requestedScopes:e.requestedScopes}:{},...e.approvedRoles?{approvedRoles:e.approvedRoles}:{},...e.approvedScopes?{approvedScopes:e.approvedScopes}:{}}}function ge(e){return e?de[e].requirement:`device approval is required`}function _e(e){return e?de[e].remediationHint:`Approve the pending device request before retrying.`}function V(e){if(pe(e)!==I.PAIRING_REQUIRED||!e||typeof e!=`object`||Array.isArray(e))return null;let t=e,n=z(t.reason);return B({reason:n,requestId:me(t.requestId),remediationHint:h(t.remediationHint)??_e(n),deviceId:h(t.deviceId),requestedRole:h(t.requestedRole),requestedScopes:he(t.requestedScopes),approvedRoles:he(t.approvedRoles),approvedScopes:he(t.approvedScopes)})}function ve(e){var t;let n=h(e);if(!n)return null;let r=n.trim().toLowerCase(),i;for(let[e,t]of Object.entries(fe))if(r.includes(t)){i=e;break}if(!i&&r.includes(`pairing required`)&&(i=ce.NOT_PAIRED),!i)return null;let a=me((t=n.match(/\(requestId:\s*([^\s)]+)\)/i))==null?void 0:t[1]);return{...a?{requestId:a}:{},reason:i}}function ye(e){let t=V(e),n=fe[(t==null?void 0:t.reason)??ce.NOT_PAIRED];return t!=null&&t.requestId?`${n} (requestId: ${t.requestId})`:n}function be(e){return pe(e.details)===I.PAIRING_REQUIRED?ye(e.details):h(e.message)??`gateway request failed`}function xe(e){let t=e.scopes.join(`,`),n=e.token??``;return[`v2`,e.deviceId,e.clientId,e.clientMode,e.role,t,String(e.signedAtMs),n,e.nonce].join(`|`)}var Se={WEBCHAT_UI:`webchat-ui`,CONTROL_UI:`openclaw-control-ui`,TUI:`openclaw-tui`,WEBCHAT:`webchat`,CLI:`cli`,GATEWAY_CLIENT:`gateway-client`,MACOS_APP:`openclaw-macos`,IOS_APP:`openclaw-ios`,ANDROID_APP:`openclaw-android`,NODE_HOST:`node-host`,TEST:`test`,FINGERPRINT:`fingerprint`,PROBE:`openclaw-probe`},Ce=Se,we={WEBCHAT:`webchat`,CLI:`cli`,UI:`ui`,BACKEND:`backend`,NODE:`node`,PROBE:`probe`,TEST:`test`};new Set(Object.values(Se)),new Set(Object.values(we));var Te=100,Ee=2e3;function De(e){return typeof e==`object`&&!!e&&e.reason===`startup-sidecars`}function Oe(e){if(!e||typeof e!=`object`)return!1;let t=e;return(t.gatewayCode??t.code)===`UNAVAILABLE`&&t.retryable===!0&&De(t.details)}function ke(e){if(!Oe(e))return null;let t=e.retryAfterMs;return Math.min(Math.max(Math.floor(typeof t==`number`&&Number.isFinite(t)?t:500),Te),Ee)}function Ae(e){return e.trim()}function je(e){if(!Array.isArray(e))return[];let t=new Set;for(let n of e){let e=n.trim();e&&t.add(e)}return t.has(`operator.admin`)?(t.add(`operator.read`),t.add(`operator.write`)):t.has(`operator.write`)&&t.add(`operator.read`),[...t].toSorted()}function Me(e){let t=e.adapter.readStore();if(!t||t.deviceId!==e.deviceId)return null;let n=Ae(e.role),r=t.tokens[n];return!r||typeof r.token!=`string`?null:r}function Ne(e){let t=Ae(e.role),n=e.adapter.readStore(),r={version:1,deviceId:e.deviceId,tokens:n&&n.deviceId===e.deviceId&&n.tokens?{...n.tokens}:{}},i={token:e.token,role:t,scopes:je(e.scopes),updatedAtMs:Date.now()};return r.tokens[t]=i,e.adapter.writeStore(r),i}function Pe(e){let t=e.adapter.readStore();if(!t||t.deviceId!==e.deviceId)return;let n=Ae(e.role);if(!t.tokens[n])return;let r={version:1,deviceId:t.deviceId,tokens:{...t.tokens}};delete r.tokens[n],e.adapter.writeStore(r)}function Fe(e){return!!e&&typeof e.getItem==`function`&&typeof e.setItem==`function`}function Ie(e){var t;let n=Object.getOwnPropertyDescriptor(globalThis,e);if(typeof process<`u`&&(t={})!=null&&t.VITEST)return n&&!n.get&&Fe(n.value)?n.value:null;if(typeof window<`u`&&typeof document<`u`)try{let t=window[e];return Fe(t)?t:null}catch{return null}return n&&!n.get&&Fe(n.value)?n.value:null}function Le(){return Ie(`localStorage`)}function Re(){return Ie(`sessionStorage`)}var ze=`openclaw.device.auth.v1`;function Be(){try{var e;let t=(e=Le())==null?void 0:e.getItem(ze);if(!t)return null;let n=JSON.parse(t);return!n||n.version!==1||!n.deviceId||typeof n.deviceId!=`string`||!n.tokens||typeof n.tokens!=`object`?null:n}catch{return null}}function Ve(e){try{var t;(t=Le())==null||t.setItem(ze,JSON.stringify(e))}catch{}}function He(e){return Me({adapter:{readStore:Be,writeStore:Ve},deviceId:e.deviceId,role:e.role})}function Ue(e){return Ne({adapter:{readStore:Be,writeStore:Ve},deviceId:e.deviceId,role:e.role,token:e.token,scopes:e.scopes})}function We(e){Pe({adapter:{readStore:Be,writeStore:Ve},deviceId:e.deviceId,role:e.role})}function Ge(e){"@babel/helpers - typeof";return Ge=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Ge(e)}function Ke(e,t){if(Ge(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Ge(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function qe(e){var t=Ke(e,`string`);return Ge(t)==`symbol`?t:t+``}function Je(e,t,n){return(t=qe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ye=Object.freeze({p:57896044618658097711785492504343953926634992332820282019728792003956564819949n,n:7237005577332262213973186563042994240857116359379907606001950938285454250989n,h:8n,a:57896044618658097711785492504343953926634992332820282019728792003956564819948n,d:37095705934669439343138083508754565189542113879843219016388785533085940283555n,Gx:15112221349535400772501151409588531511454012693041857206046113283949847762202n,Gy:46316835694926478169428394003475163141307993866256225615783033603165251855960n}),{p:Xe,n:Ze,Gx:Qe,Gy:$e,a:et,d:tt,h:nt}=Ye,rt=32,it=(...e)=>{`captureStackTrace`in Error&&typeof Error.captureStackTrace==`function`&&Error.captureStackTrace(...e)},at=(e=``)=>{let t=Error(e);throw it(t,at),t},ot=e=>typeof e==`bigint`,st=e=>typeof e==`string`,ct=e=>e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`&&`BYTES_PER_ELEMENT`in e&&e.BYTES_PER_ELEMENT===1,lt=(e,t,n=``)=>{let r=ct(e),i=e==null?void 0:e.length,a=t!==void 0;if(!r||a&&i!==t){let o=n&&`"${n}" `,s=a?` of length ${t}`:``,c=r?`length=${i}`:`type=${typeof e}`,l=o+`expected Uint8Array`+s+`, got `+c;throw r?RangeError(l):TypeError(l)}return e},ut=e=>new Uint8Array(e),dt=e=>Uint8Array.from(e),ft=(e,t)=>e.toString(16).padStart(t,`0`),pt=e=>Array.from(lt(e)).map(e=>ft(e,2)).join(``),mt={_0:48,_9:57,A:65,F:70,a:97,f:102},ht=e=>{if(e>=mt._0&&e<=mt._9)return e-mt._0;if(e>=mt.A&&e<=mt.F)return e-(mt.A-10);if(e>=mt.a&&e<=mt.f)return e-(mt.a-10)},gt=e=>{let t=`hex invalid`;if(!st(e))return at(t);let n=e.length,r=n/2;if(n%2)return at(t);let i=ut(r);for(let n=0,a=0;n<r;n++,a+=2){let r=ht(e.charCodeAt(a)),o=ht(e.charCodeAt(a+1));if(r===void 0||o===void 0)return at(t);i[n]=r*16+o}return i},_t=()=>{var e;return(e=globalThis)==null?void 0:e.crypto},vt=()=>{var e;return((e=_t())==null?void 0:e.subtle)??at(`crypto.subtle must be defined, consider polyfill`)},yt=(...e)=>{let t=0;for(let n of e)t+=lt(n).length;let n=ut(t),r=0;return e.forEach(e=>{n.set(e,r),r+=e.length}),n},bt=(e=rt)=>_t().getRandomValues(ut(e)),xt=BigInt,St=(e,t,n,r=`bad number: out of range`)=>{if(!ot(e))throw TypeError(r);if(t<=e&&e<n)return e;throw RangeError(r)},Ct=(e,t=Xe)=>{let n=e%t;return n>=0n?n:t+n},wt=(1n<<255n)-1n,H=e=>{e<0n&&at(`negative coordinate`);let t=(e>>255n)*19n+(e&wt);return t=(t>>255n)*19n+(t&wt),t%Xe},Tt=e=>Ct(e,Ze),Et=(e,t)=>{(e===0n||t<=0n)&&at(`no inverse n=`+e+` mod=`+t);let n=Ct(e,t),r=t,i=0n,a=1n,o=1n,s=0n;for(;n!==0n;){let e=r/n,t=r%n,c=i-o*e,l=a-s*e;r=n,n=t,i=o,a=s,o=c,s=l}return r===1n?Ct(i,t):at(`no inverse`)},Dt=e=>{let t=Xt[e];return typeof t!=`function`&&at(`hashes.`+e+` not set`),t},Ot=e=>lt(e,64,`digest`),kt=e=>e instanceof jt?e:at(`Point expected`),At=2n**256n,jt=class e{constructor(e,t,n,r){Je(this,`X`,void 0),Je(this,`Y`,void 0),Je(this,`Z`,void 0),Je(this,`T`,void 0);let i=At;this.X=St(e,0n,i),this.Y=St(t,0n,i),this.Z=St(n,1n,i),this.T=St(r,0n,i),Object.freeze(this)}static CURVE(){return Ye}static fromAffine(t){return new e(t.x,t.y,1n,H(t.x*t.y))}static fromBytes(t,n=!1){let r=tt,i=dt(lt(t,rt)),a=t[31];i[31]=a&-129;let o=Ft(i);St(o,0n,n?At:Xe);let s=H(o*o),{isValid:c,value:l}=zt(Ct(s-1n),H(r*s+1n));c||at(`bad point: y not sqrt`);let u=(l&1n)==1n,d=(a&128)!=0;return!n&&l===0n&&d&&at(`bad point: x==0, isLastByteOdd`),d!==u&&(l=Ct(-l)),new e(l,o,1n,H(l*o))}static fromHex(t,n){return e.fromBytes(gt(t),n)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}assertValidity(){let e=et,t=tt,n=this;if(n.is0())return at(`bad point: ZERO`);let{X:r,Y:i,Z:a,T:o}=n,s=H(r*r),c=H(i*i),l=H(a*a),u=H(l*l);return H(l*(H(s*e)+c))===Ct(u+H(t*H(s*c)))?H(r*i)===H(a*o)?this:at(`bad point: equation left != right (2)`):at(`bad point: equation left != right (1)`)}equals(e){let{X:t,Y:n,Z:r}=this,{X:i,Y:a,Z:o}=kt(e),s=H(t*o),c=H(i*r),l=H(n*o),u=H(a*r);return s===c&&l===u}is0(){return this.equals(Nt)}negate(){return new e(Ct(-this.X),this.Y,this.Z,Ct(-this.T))}double(){let{X:t,Y:n,Z:r}=this,i=et,a=H(t*t),o=H(n*n),s=H(2n*r*r),c=H(i*a),l=Ct(t+n),u=Ct(H(l*l)-a-o),d=Ct(c+o),f=Ct(d-s),p=Ct(c-o),m=H(u*f),h=H(d*p),g=H(u*p);return new e(m,h,H(f*d),g)}add(t){let{X:n,Y:r,Z:i,T:a}=this,{X:o,Y:s,Z:c,T:l}=kt(t),u=et,d=tt,f=H(n*o),p=H(r*s),m=H(H(a*d)*l),h=H(i*c),g=Ct(H(Ct(n+r)*Ct(o+s))-f-p),_=Ct(h-m),v=Ct(h+m),y=Ct(p-H(u*f)),b=H(g*_),x=H(v*y),S=H(g*y);return new e(b,x,H(_*v),S)}subtract(e){return this.add(kt(e).negate())}multiply(e,t=!0){if(!t&&e===0n||(St(e,1n,Ze),!t&&this.is0()))return Nt;if(e===1n)return this;if(this.equals(Mt))return an(e).p;let n=Nt,r=Mt;for(let i=this;e>0n;i=i.double(),e>>=1n)e&1n?n=n.add(i):t&&(r=r.add(i));return n}multiplyUnsafe(e){return this.multiply(e,!1)}toAffine(){let{X:e,Y:t,Z:n}=this;if(this.equals(Nt))return{x:0n,y:1n};let r=Et(n,Xe);return H(n*r)!==1n&&at(`invalid inverse`),{x:H(e*r),y:H(t*r)}}toBytes(){let{x:e,y:t}=this.toAffine(),n=Pt(t);return n[31]|=e&1n?128:0,n}toHex(){return pt(this.toBytes())}clearCofactor(){return this.multiply(xt(nt),!1)}isSmallOrder(){return this.clearCofactor().is0()}isTorsionFree(){let e=this.multiply(Ze/2n,!1).double();return Ze%2n&&(e=e.add(this)),e.is0()}};Je(jt,`BASE`,void 0),Je(jt,`ZERO`,void 0);var Mt=new jt(Qe,$e,1n,Ct(Qe*$e)),Nt=new jt(0n,1n,1n,0n);jt.BASE=Mt,jt.ZERO=Nt;var Pt=e=>gt(ft(St(e,0n,At),64)).reverse(),Ft=e=>xt(`0x`+pt(dt(lt(e)).reverse())),It=(e,t)=>{let n=e;for(;t-- >0n;)n=H(n*n);return n},Lt=e=>{let t=H(H(e*e)*e),n=H(It(H(It(t,2n)*t),1n)*e),r=H(It(n,5n)*n),i=H(It(r,10n)*r),a=H(It(i,20n)*i),o=H(It(a,40n)*a);return{pow_p_5_8:H(It(H(It(H(It(H(It(o,80n)*o),80n)*o),10n)*r),2n)*e),b2:t}},Rt=19681161376707505956807079304988542015446066515923890162744021073123829784752n,zt=(e,t)=>{let n=H(t*H(t*t)),r=Lt(H(e*H(H(n*n)*t))).pow_p_5_8,i=H(e*H(n*r)),a=H(t*H(i*i)),o=i,s=H(i*Rt),c=a===e,l=a===Ct(-e),u=a===Ct(-e*Rt);return c&&(i=o),(l||u)&&(i=s),(Ct(i)&1n)==1n&&(i=Ct(-i)),{isValid:c||l,value:i}},Bt=e=>Tt(Ft(e)),Vt=(...e)=>Promise.resolve(Dt(`sha512Async`)(yt(...e))).then(Ot),Ht=(...e)=>Ot(Dt(`sha512`)(yt(...e))),Ut=e=>{let t=dt(e),n=t.slice(0,32);n[0]&=248,n[31]&=127,n[31]|=64;let r=t.slice(32,64),i=Bt(n),a=Mt.multiply(i);return{head:n,prefix:r,scalar:i,point:a,pointBytes:a.toBytes()}},Wt=e=>Vt(lt(e,rt)).then(Ut),Gt=e=>Ut(Ht(lt(e,rt))),Kt=e=>Wt(e).then(e=>e.pointBytes),qt=e=>Vt(e.hashable).then(e.finish),Jt=(e,t,n)=>{let{pointBytes:r,scalar:i}=e,a=Bt(t),o=Mt.multiply(a).toBytes();return{hashable:yt(o,r,n),finish:e=>lt(yt(o,Pt(Tt(a+Bt(e)*i))),64)}},Yt=async(e,t)=>{let n=lt(e),r=await Wt(t);return qt(Jt(r,await Vt(r.prefix,n),n))},Xt={sha512Async:async e=>{let t=vt(),n=yt(e);return ut(await t.digest(`SHA-512`,n.buffer))},sha512:void 0},Zt=Object.freeze({getExtendedPublicKeyAsync:Wt,getExtendedPublicKey:Gt,randomSecretKey:e=>(e=e===void 0?bt(rt):e,lt(e,rt))}),Qt=8,$t=Math.ceil(256/Qt)+1,en=2**(Qt-1),tn=()=>{let e=[],t=Mt,n=t;for(let r=0;r<$t;r++){n=t,e.push(n);for(let r=1;r<en;r++)n=n.add(t),e.push(n);t=n.double()}return e},nn=void 0,rn=(e,t)=>{let n=t.negate();return e?n:t},an=e=>{let t=nn||(nn=tn()),n=Nt,r=Mt,i=2**Qt,a=i,o=xt(i-1),s=xt(Qt);for(let i=0;i<$t;i++){let c=Number(e&o);e>>=s,c>en&&(c-=a,e+=1n);let l=i*en,u=l,d=l+Math.abs(c)-1,f=i%2!=0,p=c<0;c===0?r=r.add(rn(f,t[u])):n=n.add(rn(p,t[d]))}return e!==0n&&at(`invalid wnaf`),{p:n,f:r}},on=`openclaw-device-identity-v1`;function sn(e){let t=``;for(let n of e)t+=String.fromCharCode(n);return btoa(t).replaceAll(`+`,`-`).replaceAll(`/`,`_`).replace(/=+$/g,``)}function cn(e){let t=e.replaceAll(`-`,`+`).replaceAll(`_`,`/`),n=t+`=`.repeat((4-t.length%4)%4),r=atob(n),i=new Uint8Array(r.length);for(let e=0;e<r.length;e+=1)i[e]=r.charCodeAt(e);return i}function ln(e){return Array.from(e).map(e=>e.toString(16).padStart(2,`0`)).join(``)}async function un(e){let t=await crypto.subtle.digest(`SHA-256`,e.slice().buffer);return ln(new Uint8Array(t))}async function dn(){let e=Zt.randomSecretKey(),t=await Kt(e);return{deviceId:await un(t),publicKey:sn(t),privateKey:sn(e)}}async function fn(){let e=Le();try{let t=e==null?void 0:e.getItem(on);if(t){let n=JSON.parse(t);if((n==null?void 0:n.version)===1&&typeof n.deviceId==`string`&&typeof n.publicKey==`string`&&typeof n.privateKey==`string`){let t=await un(cn(n.publicKey));if(t!==n.deviceId){let r={...n,deviceId:t};return e==null||e.setItem(on,JSON.stringify(r)),{deviceId:t,publicKey:n.publicKey,privateKey:n.privateKey}}return{deviceId:n.deviceId,publicKey:n.publicKey,privateKey:n.privateKey}}}}catch{}let t=await dn(),n={version:1,deviceId:t.deviceId,publicKey:t.publicKey,privateKey:t.privateKey,createdAtMs:Date.now()};return e==null||e.setItem(on,JSON.stringify(n)),t}async function pn(e,t){let n=cn(e);return sn(await Yt(new TextEncoder().encode(t),n))}var mn=!1;function hn(e){e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=``;for(let n=0;n<e.length;n++)t+=e[n].toString(16).padStart(2,`0`);return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}function gn(){mn||(mn=!0,console.warn(`[uuid] crypto API missing; refusing insecure UUID generation`))}function _n(e=globalThis.crypto){if(e&&typeof e.randomUUID==`function`)return e.randomUUID();if(e&&typeof e.getRandomValues==`function`){let t=new Uint8Array(16);return e.getRandomValues(t),hn(t)}throw gn(),Error(`Web Crypto is required for UUID generation`)}var vn=class extends Error{constructor(e){super(be({message:e.message,details:e.details})),this.name=`GatewayRequestError`,this.gatewayCode=e.code,this.details=e.details,this.retryable=e.retryable===!0,this.retryAfterMs=e.retryAfterMs}};function yn(e){return pe(e==null?void 0:e.details)}function bn(e){if(!e)return!1;let t=yn(e);return t===I.AUTH_TOKEN_MISSING||t===I.AUTH_BOOTSTRAP_TOKEN_INVALID||t===I.AUTH_PASSWORD_MISSING||t===I.AUTH_PASSWORD_MISMATCH||t===I.AUTH_RATE_LIMITED||t===I.AUTH_DEVICE_TOKEN_MISMATCH||t===I.PAIRING_REQUIRED||t===I.CONTROL_UI_DEVICE_IDENTITY_REQUIRED||t===I.DEVICE_IDENTITY_REQUIRED}function xn(e){try{let t=new URL(e,window.location.href),n=t.hostname.trim().toLowerCase(),r=n===`localhost`||n===`::1`||n===`[::1]`||n===`127.0.0.1`,i=n.startsWith(`127.`);if(r||i)return!0;let a=new URL(window.location.href);return t.host===a.host}catch{return!1}}var Sn=`operator`,Cn=[`operator.admin`,`operator.read`,`operator.write`,`operator.approvals`,`operator.pairing`],wn=4008,Tn=4013;function En(e){let t=e.authToken;if(t||e.authPassword)return{token:t,deviceToken:e.authDeviceToken??e.resolvedDeviceToken,password:e.authPassword}}async function Dn(e){let{deviceIdentity:t}=e;if(!t)return;let n=Date.now(),r=e.connectNonce??``,i=xe({deviceId:t.deviceId,clientId:e.client.id,clientMode:e.client.mode,role:e.role,scopes:e.scopes,signedAtMs:n,token:e.authToken??null,nonce:r}),a=await pn(t.privateKey,i);return{id:t.deviceId,publicKey:t.publicKey,signature:a,signedAt:n,nonce:r}}function On(e){return!e.deviceTokenRetryBudgetUsed&&!e.authDeviceToken&&!!e.explicitGatewayToken&&!!e.deviceIdentity&&!!e.storedToken&&e.canRetryWithDeviceTokenHint&&xn(e.url)}var kn=class{constructor(e){this.opts=e,this.ws=null,this.pending=new Map,this.closed=!1,this.lastSeq=null,this.connectNonce=null,this.connectSent=!1,this.connectTimer=null,this.connectGeneration=0,this.backoffMs=800,this.pendingDeviceTokenRetry=!1,this.deviceTokenRetryBudgetUsed=!1,this.pendingStartupReconnectDelayMs=null,this.eventListeners=new Set}start(){this.closed=!1,this.connect()}stop(){var e;this.closed=!0,this.clearConnectTimer(),(e=this.ws)==null||e.close(),this.ws=null,this.pendingConnectError=void 0,this.pendingDeviceTokenRetry=!1,this.deviceTokenRetryBudgetUsed=!1,this.pendingStartupReconnectDelayMs=null,this.flushPending(Error(`gateway client stopped`))}get connected(){var e;return((e=this.ws)==null?void 0:e.readyState)===WebSocket.OPEN}connect(){if(this.closed)return;let e=new WebSocket(this.opts.url),t=++this.connectGeneration;this.ws=e,e.addEventListener(`open`,()=>this.queueConnect(e,t)),e.addEventListener(`message`,n=>{this.isActiveSocket(e,t)&&this.handleMessage(e,t,String(n.data??``))}),e.addEventListener(`close`,t=>{var n,r;if(this.ws!==e)return;let i=t.reason??``,a=this.pendingConnectError;if(this.pendingConnectError=void 0,this.ws=null,this.pendingStartupReconnectDelayMs!==null){this.flushPending(Error(`gateway closed (${t.code}): ${i}`)),this.scheduleReconnect();return}this.flushPending(Error(`gateway closed (${t.code}): ${i}`)),(n=(r=this.opts).onClose)==null||n.call(r,{code:t.code,reason:i,error:a}),!(yn(a)===I.AUTH_TOKEN_MISMATCH&&this.deviceTokenRetryBudgetUsed&&!this.pendingDeviceTokenRetry)&&(bn(a)||this.scheduleReconnect())}),e.addEventListener(`error`,()=>{})}scheduleReconnect(){if(this.closed)return;let e=this.pendingStartupReconnectDelayMs;this.pendingStartupReconnectDelayMs=null;let t=e??this.backoffMs;e===null&&(this.backoffMs=Math.min(this.backoffMs*1.7,15e3)),this.clearConnectTimer(),this.connectTimer=window.setTimeout(()=>{this.connectTimer=null,this.connect()},t)}flushPending(e){for(let[t,n]of this.pending)this.emitRequestTiming(t,n,!1,`CLIENT_CLOSED`),n.reject(e);this.pending.clear()}nowMs(){return typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now()}emitRequestTiming(e,t,n,r){let i=this.nowMs();try{var a,o;(a=(o=this.opts).onRequestTiming)==null||a.call(o,{id:e,method:t.method,ok:n,durationMs:Math.max(0,i-t.startedAtMs),startedAtMs:t.startedAtMs,endedAtMs:i,errorCode:r})}catch(e){console.error(`[gateway] request timing handler error:`,e)}}buildConnectClient(){return{id:this.opts.clientName??Ce.CONTROL_UI,version:this.opts.clientVersion??`control-ui`,platform:this.opts.platform??navigator.platform??`web`,mode:this.opts.mode??we.WEBCHAT,instanceId:this.opts.instanceId}}buildConnectParams(e){return{minProtocol:3,maxProtocol:3,client:e.client,role:e.role,scopes:e.scopes,device:e.device,caps:[`tool-events`],auth:e.auth,userAgent:navigator.userAgent,locale:navigator.language}}async buildConnectPlan(e){var t,n;let r=Sn,i=[...Cn],a=this.buildConnectClient(),o=((t=this.opts.token)==null?void 0:t.trim())||void 0,s=((n=this.opts.password)==null?void 0:n.trim())||void 0,c=typeof crypto<`u`&&!!crypto.subtle,l=null,u={authToken:o,authPassword:s,canFallbackToShared:!1};return c&&(l=await fn(),u=this.selectConnectAuth({role:r,deviceId:l.deviceId})),{role:r,scopes:i,client:a,explicitGatewayToken:o,selectedAuth:u,auth:En(u),deviceIdentity:l,device:await Dn({deviceIdentity:l,client:a,role:r,scopes:i,authToken:u.authToken,connectNonce:e})}}handleConnectHello(e,t,n,r){var i,a,o;this.isActiveSocket(n,r)&&(this.pendingDeviceTokenRetry=!1,this.deviceTokenRetryBudgetUsed=!1,this.pendingStartupReconnectDelayMs=null,!(e==null||(i=e.auth)==null)&&i.deviceToken&&t.deviceIdentity&&Ue({deviceId:t.deviceIdentity.deviceId,role:e.auth.role??t.role,token:e.auth.deviceToken,scopes:e.auth.scopes??[]}),this.backoffMs=800,(a=(o=this.opts).onHello)==null||a.call(o,e))}handleConnectFailure(e,t,n,r){if(!this.isActiveSocket(n,r))return;let i=e instanceof vn?yn(e):null,a=e instanceof vn?R(e.details):{},o=a.recommendedNextStep===`retry_with_device_token`,s=a.canRetryWithDeviceToken===!0||o||i===I.AUTH_TOKEN_MISMATCH;On({deviceTokenRetryBudgetUsed:this.deviceTokenRetryBudgetUsed,authDeviceToken:t.selectedAuth.authDeviceToken,explicitGatewayToken:t.explicitGatewayToken,deviceIdentity:t.deviceIdentity,storedToken:t.selectedAuth.storedToken,canRetryWithDeviceTokenHint:s,url:this.opts.url})&&(this.pendingDeviceTokenRetry=!0,this.deviceTokenRetryBudgetUsed=!0),e instanceof vn?this.pendingConnectError={code:e.gatewayCode,message:e.message,details:e.details,retryable:e.retryable,retryAfterMs:e.retryAfterMs}:this.pendingConnectError=void 0,t.selectedAuth.storedToken&&(t.selectedAuth.resolvedDeviceToken===t.selectedAuth.storedToken||t.selectedAuth.authDeviceToken===t.selectedAuth.storedToken)&&t.deviceIdentity&&i===I.AUTH_DEVICE_TOKEN_MISMATCH&&We({deviceId:t.deviceIdentity.deviceId,role:t.role});let c=ke(e);if(c!==null&&(this.pendingStartupReconnectDelayMs=c),Oe(e)){n.close(Tn,`gateway starting`);return}n.close(wn,`connect failed`)}isActiveSocket(e,t){return!this.closed&&this.ws===e&&this.connectGeneration===t}async sendConnect(e,t){if(!this.isActiveSocket(e,t)||e.readyState!==WebSocket.OPEN||this.connectSent)return;this.connectSent=!0,this.clearConnectTimer();let n=await this.buildConnectPlan(this.connectNonce);!this.isActiveSocket(e,t)||e.readyState!==WebSocket.OPEN||(this.pendingDeviceTokenRetry&&n.selectedAuth.authDeviceToken&&(this.pendingDeviceTokenRetry=!1),this.requestOnSocket(e,`connect`,this.buildConnectParams(n)).then(r=>this.handleConnectHello(r,n,e,t)).catch(r=>this.handleConnectFailure(r,n,e,t)))}handleMessage(e,t,n){let r;try{r=JSON.parse(n)}catch{return}let i=r;if(i.type===`event`){let n=r;if(n.event===`connect.challenge`){let r=n.payload,i=r&&typeof r.nonce==`string`?r.nonce:null;i&&(this.connectNonce=i,this.sendConnect(e,t));return}let i=typeof n.seq==`number`?n.seq:null;if(i!==null){if(this.lastSeq!==null&&i>this.lastSeq+1){var a,o;(a=(o=this.opts).onGap)==null||a.call(o,{expected:this.lastSeq+1,received:i})}this.lastSeq=i}try{var s,c;(s=(c=this.opts).onEvent)==null||s.call(c,n);for(let e of this.eventListeners)e(n)}catch(e){console.error(`[gateway] event handler error:`,e)}return}if(i.type===`res`){let e=r,t=this.pending.get(e.id);if(!t)return;if(this.pending.delete(e.id),e.ok)this.emitRequestTiming(e.id,t,!0),t.resolve(e.payload);else{var l,u,d,f,p,m;this.emitRequestTiming(e.id,t,!1,(l=e.error)==null?void 0:l.code),t.reject(new vn({code:((u=e.error)==null?void 0:u.code)??`UNAVAILABLE`,message:((d=e.error)==null?void 0:d.message)??`request failed`,details:(f=e.error)==null?void 0:f.details,retryable:(p=e.error)==null?void 0:p.retryable,retryAfterMs:(m=e.error)==null?void 0:m.retryAfterMs}))}return}}selectConnectAuth(e){var t,n;let r=((t=this.opts.token)==null?void 0:t.trim())||void 0,i=((n=this.opts.password)==null?void 0:n.trim())||void 0,a=He({deviceId:e.deviceId,role:e.role}),o=(a==null?void 0:a.scopes)??[],s=e.role!==Sn||o.includes(`operator.read`)||o.includes(`operator.write`)||o.includes(`operator.admin`)?a==null?void 0:a.token:void 0,c=this.pendingDeviceTokenRetry&&!!r&&!!s&&xn(this.opts.url),l=r||i?void 0:s??void 0;return{authToken:r??l,authDeviceToken:c?s??void 0:void 0,authPassword:i,resolvedDeviceToken:l,storedToken:s??void 0,canFallbackToShared:!!(s&&r)}}request(e,t){return!this.ws||this.ws.readyState!==WebSocket.OPEN?Promise.reject(Error(`gateway not connected`)):this.requestOnSocket(this.ws,e,t)}requestOnSocket(e,t,n){if(this.ws!==e||e.readyState!==WebSocket.OPEN)return Promise.reject(Error(`gateway not connected`));let r=_n(),i={type:`req`,id:r,method:t,params:n},a=this.nowMs(),o=new Promise((e,n)=>{this.pending.set(r,{resolve:t=>e(t),reject:n,method:t,startedAtMs:a})});return e.send(JSON.stringify(i)),o}addEventListener(e){return this.eventListeners.add(e),()=>{this.eventListeners.delete(e)}}queueConnect(e,t){this.isActiveSocket(e,t)&&(this.connectNonce=null,this.connectSent=!1,this.clearConnectTimer(),this.connectTimer=window.setTimeout(()=>{this.connectTimer=null,this.sendConnect(e,t)},750))}clearConnectTimer(){this.connectTimer!==null&&(window.clearTimeout(this.connectTimer),this.connectTimer=null)}};function An(e){return e instanceof vn?yn(e)===I.AUTH_UNAUTHORIZED?!0:e.message.includes(`missing scope: operator.read`):!1}function jn(e){return`This connection is missing operator.read, so ${e} cannot be loaded yet.`}async function Mn(e,t){if(!(!e.client||!e.connected)&&!e.channelsLoading){e.channelsLoading=!0,e.channelsError=null;try{e.channelsSnapshot=await e.client.request(`channels.status`,{probe:t,timeoutMs:8e3}),e.channelsLastSuccess=Date.now()}catch(t){An(t)?(e.channelsSnapshot=null,e.channelsError=jn(`channel status`)):e.channelsError=String(t)}finally{e.channelsLoading=!1}}}async function Nn(e,t){if(!(!e.client||!e.connected||e.whatsappBusy)){e.whatsappBusy=!0;try{let n=await e.client.request(`web.login.start`,{force:t,timeoutMs:3e4});e.whatsappLoginMessage=n.message??null,e.whatsappLoginQrDataUrl=n.qrDataUrl??null,e.whatsappLoginConnected=typeof n.connected==`boolean`?n.connected:null}catch(t){e.whatsappLoginMessage=String(t),e.whatsappLoginQrDataUrl=null,e.whatsappLoginConnected=null}finally{e.whatsappBusy=!1}}}async function Pn(e){if(!(!e.client||!e.connected||e.whatsappBusy)){e.whatsappBusy=!0;try{let t=await e.client.request(`web.login.wait`,{timeoutMs:12e4,currentQrDataUrl:e.whatsappLoginQrDataUrl??void 0});e.whatsappLoginMessage=t.message??null,e.whatsappLoginConnected=t.connected??null,t.qrDataUrl?e.whatsappLoginQrDataUrl=t.qrDataUrl:t.connected&&(e.whatsappLoginQrDataUrl=null)}catch(t){e.whatsappLoginMessage=String(t),e.whatsappLoginConnected=null}finally{e.whatsappBusy=!1}}}async function Fn(e){if(!(!e.client||!e.connected||e.whatsappBusy)){e.whatsappBusy=!0;try{await e.client.request(`channels.logout`,{channel:`whatsapp`}),e.whatsappLoginMessage=`Logged out.`,e.whatsappLoginQrDataUrl=null,e.whatsappLoginConnected=null}catch(t){e.whatsappLoginMessage=String(t)}finally{e.whatsappBusy=!1}}}function In(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.prototype.toString.call(e)===`[object Object]`}var Ln=new Set([`__proto__`,`prototype`,`constructor`]);function Rn(e){return Ln.has(e)}function zn(e){return In(e)?typeof e.id==`string`&&e.id.length>0:!1}function Bn(e,t,n){if(!e.every(zn))return;let r=[...e],i=new Map;for(let[e,t]of r.entries()){if(!zn(t))return;i.set(t.id,e)}for(let e of t){if(!zn(e)){r.push(structuredClone(e));continue}let t=i.get(e.id);if(t===void 0){r.push(structuredClone(e)),i.set(e.id,r.length-1);continue}r[t]=Vn(r[t],e,n)}return r}function Vn(e,t,n={}){if(!In(t))return t;let r=In(e)?{...e}:{};for(let[e,i]of Object.entries(t))if(!Rn(e)){if(i===null){delete r[e];continue}if(n.mergeObjectArraysById&&Array.isArray(r[e])&&Array.isArray(i)){let t=Bn(r[e],i,n);if(t){r[e]=t;continue}}if(In(i)){let t=r[e];r[e]=Vn(In(t)?t:{},i,n);continue}r[e]=i}return r}function Hn(e){if(e)return Array.isArray(e.type)?e.type.find(e=>e!==`null`)??e.type[0]:e.type}function Un(e){if(!e)return``;if(e.default!==void 0)return e.default;switch(Hn(e)){case`object`:return{};case`array`:return[];case`boolean`:return!1;case`number`:case`integer`:return 0;case`string`:return``;default:return``}}function Wn(e){return e.filter(e=>typeof e==`string`).join(`.`)}function Gn(e,t){let n=t[Wn(e)];if(n)return n;let r=e.map(String);for(let[e,n]of Object.entries(t)){if(!e.includes(`*`))continue;let t=e.split(`.`);if(t.length!==r.length)continue;let i=!0;for(let e=0;e<r.length;e+=1)if(t[e]!==`*`&&t[e]!==r[e]){i=!1;break}if(i)return n}}function Kn(e){return e.replace(/_/g,` `).replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/\s+/g,` `).replace(/^./,e=>e.toUpperCase())}var qn=[`maxtokens`,`maxoutputtokens`,`maxinputtokens`,`maxcompletiontokens`,`contexttokens`,`totaltokens`,`tokencount`,`tokenlimit`,`tokenbudget`,`passwordfile`],Jn=[/token$/i,/password/i,/secret/i,/api.?key/i,/serviceaccount(?:ref)?$/i],Yn=/^\$\{[^}]*\}$/,Xn=`[redacted - click reveal to view]`,Zn=64,Qn=2e4;function $n(){return{visited:0}}function er(e,t){return!(t>Zn||(e.visited+=1,e.visited>Qn))}function tr(e){return Yn.test(e.trim())}function nr(e){let t=g(e);return!qn.some(e=>t.endsWith(e))&&Jn.some(t=>t.test(e))}function rr(e){return typeof e==`string`?e.trim().length>0&&!tr(e):e!=null}function ir(e){return(e==null?void 0:e.sensitive)??!1}function ar(e,t,n){return or(e,t,n,$n(),0)}function or(e,t,n,r,i){if(!er(r,i))return!0;let a=Wn(t);return(ir(Gn(t,n))||nr(a))&&rr(e)?!0:Array.isArray(e)?e.some((e,a)=>or(e,[...t,a],n,r,i+1)):e&&typeof e==`object`?Object.entries(e).some(([e,a])=>or(a,[...t,e],n,r,i+1)):!1}function sr(e,t,n){return cr(e,t,n,$n(),0)}function cr(e,t,n,r,i){if(!er(r,i))return 1;if(e==null)return 0;let a=Wn(t);return(ir(Gn(t,n))||nr(a))&&rr(e)?1:Array.isArray(e)?e.reduce((e,a,o)=>e+cr(a,[...t,o],n,r,i+1),0):e&&typeof e==`object`?Object.entries(e).reduce((e,[a,o])=>e+cr(o,[...t,a],n,r,i+1),0):0}function lr(e,t){let n=e.trim();if(n===``)return;let r=Number(n);return!Number.isFinite(r)||t&&!Number.isInteger(r)?e:r}function ur(e){let t=e.trim();return t===`true`?!0:t===`false`?!1:e}function dr(e,t){if(e==null)return e;if(t.allOf&&t.allOf.length>0){let n=e;for(let e of t.allOf)n=dr(n,e);return n}let n=Hn(t);if(t.anyOf||t.oneOf){let n=(t.anyOf??t.oneOf??[]).filter(e=>!(e.type===`null`||Array.isArray(e.type)&&e.type.includes(`null`)));if(n.length===1)return dr(e,n[0]);if(typeof e==`string`)for(let t of n){let n=Hn(t);if(n===`number`||n===`integer`){let t=lr(e,n===`integer`);if(t===void 0||typeof t==`number`)return t}if(n===`boolean`){let t=ur(e);if(typeof t==`boolean`)return t}}for(let t of n){let n=Hn(t);if(n===`object`&&typeof e==`object`&&!Array.isArray(e)||n===`array`&&Array.isArray(e))return dr(e,t)}return e}if(n===`number`||n===`integer`){if(typeof e==`string`){let t=lr(e,n===`integer`);if(t===void 0||typeof t==`number`)return t}return e}if(n===`boolean`){if(typeof e==`string`){let t=ur(e);if(typeof t==`boolean`)return t}return e}if(n===`object`){if(typeof e!=`object`||Array.isArray(e))return e;let n=e,r=t.properties??{},i=t.additionalProperties&&typeof t.additionalProperties==`object`?t.additionalProperties:null,a={};for(let[e,t]of Object.entries(n)){let n=r[e]??i,o=n?dr(t,n):t;o!==void 0&&(a[e]=o)}return a}if(n===`array`){if(!Array.isArray(e))return e;if(Array.isArray(t.items)){let n=t.items;return e.map((e,t)=>{let r=t<n.length?n[t]:void 0;return r?dr(e,r):e})}let n=t.items;return n?e.map(e=>dr(e,n)).filter(e=>e!==void 0):e}return e}function fr(e){return structuredClone(e)}function pr(e){return`${JSON.stringify(e,null,2).trimEnd()}\n`}var mr=new Set([`__proto__`,`prototype`,`constructor`]);function hr(e){return typeof e==`string`&&mr.has(e)}function gr(e,t,n){if(t.length===0||t.some(hr))return null;let r=e;for(let e=0;e<t.length-1;e+=1){let i=t[e],a=t[e+1];if(typeof i==`number`){if(!Array.isArray(r))return null;if(r[i]==null){if(!n)return null;r[i]=typeof a==`number`?[]:{}}r=r[i];continue}if(typeof r!=`object`||!r)return null;let o=r;if(o[i]==null){if(!n)return null;o[i]=typeof a==`number`?[]:{}}r=o[i]}return{current:r,lastKey:t[t.length-1]}}function _r(e,t,n){let r=gr(e,t,!0);if(r){if(typeof r.lastKey==`number`){Array.isArray(r.current)&&(r.current[r.lastKey]=n);return}typeof r.current==`object`&&r.current!=null&&(r.current[r.lastKey]=n)}}function vr(e,t){let n=gr(e,t,!1);if(n){if(typeof n.lastKey==`number`){Array.isArray(n.current)&&n.current.splice(n.lastKey,1);return}typeof n.current==`object`&&n.current!=null&&delete n.current[n.lastKey]}}async function yr(e,t={}){if(!(!e.client||!e.connected)){e.configLoading=!0,e.lastError=null;try{Sr(e,await e.client.request(`config.get`,{}),t)}catch(t){e.lastError=String(t)}finally{e.configLoading=!1}}}async function br(e){if(!(!e.client||!e.connected)&&!e.configSchemaLoading){e.configSchemaLoading=!0;try{xr(e,await e.client.request(`config.schema`,{}))}catch(t){e.lastError=String(t)}finally{e.configSchemaLoading=!1}}}function xr(e,t){e.configSchema=t.schema??null,e.configUiHints=t.uiHints??{},e.configSchemaVersion=t.version??null}function Sr(e,t,n={}){var r;let i=e.configFormDirty&&n.discardPendingChanges!==!0,a=e.configDraftBaseHash??((r=e.configSnapshot)==null?void 0:r.hash)??null;e.configSnapshot=t,typeof t.raw!=`string`&&e.configFormMode===`raw`&&(e.configFormMode=`form`);let o=typeof t.raw==`string`?t.raw:t.config&&typeof t.config==`object`?pr(t.config):e.configRaw;!i||e.configFormMode===`raw`?e.configRaw=o:e.configForm?e.configRaw=pr(e.configForm):e.configRaw=o,e.configValid=typeof t.valid==`boolean`?t.valid:null,e.configIssues=Array.isArray(t.issues)?t.issues:[],i?e.configDraftBaseHash=a:(e.configForm=fr(t.config??{}),e.configFormOriginal=fr(t.config??{}),e.configRawOriginal=o,e.configFormDirty=!1,e.configDraftBaseHash=t.hash??null)}function Cr(e){return!e||typeof e!=`object`||Array.isArray(e)?null:e}function wr(e){var t;if(e.configFormMode===`raw`&&typeof((t=e.configSnapshot)==null?void 0:t.raw)!=`string`)throw Error(`Raw config editing is unavailable for this snapshot. Switch to Form mode.`);if(e.configFormMode!==`form`||!e.configForm)return e.configRaw;let n=Cr(e.configSchema);return pr(n?dr(e.configForm,n):e.configForm)}function Tr(e){let t=(e.status??`error`).trim()||`error`,n=(e.reason??`unexpected-error`).trim()||`unexpected-error`;return{tone:t===`skipped`?`warn`:`danger`,text:`Update ${t}: ${n}. ${{dirty:`Commit or stash changes, then retry.`,"no-upstream":`Set an upstream branch, then retry.`,"not-git-install":"Not a git checkout. Run `openclaw update` from the CLI for a global reinstall.","not-openclaw-root":`Run the update from a 玺虾 checkout or use the CLI global reinstall path.`,"deps-install-failed":`Dependency install failed. Fix the install error and retry.`,"build-failed":`Build failed. Fix the build error and retry.`,"ui-build-failed":`The control UI rebuild failed. Fix the UI build error and retry.`,"global-install-failed":`The global package install did not verify on disk. Retry or reinstall from the CLI.`,"restart-disabled":"The update was not applied because gateway restarts are disabled. Enable restarts in config, then retry — or run `openclaw update` from the CLI.","restart-unavailable":`This global install cannot be safely replaced while restarts are disabled and no supervisor is present.`,"restart-unhealthy":`The replacement process never became healthy. The previous process stayed up so you can recover.`,"doctor-failed":"Doctor repair failed. Run `openclaw doctor --non-interactive` and retry."}[n]??`See the gateway logs for the exact failure and retry once the cause is fixed.`}`}}async function Er(e,t,n,r={}){if(!e.client||!e.connected)return!1;e[n]=!0,e.lastError=null;try{var i;let n=wr(e),a=e.configDraftBaseHash??((i=e.configSnapshot)==null?void 0:i.hash);return a?(await e.client.request(t,{raw:n,baseHash:a,...r}),e.configFormDirty=!1,e.configDraftBaseHash=null,await yr(e),!0):(e.lastError=`Config hash missing; reload and retry.`,!1)}catch(t){return e.lastError=String(t),!1}finally{e[n]=!1}}function Dr(e,t){var n;let r=fr(e.configFormOriginal??((n=e.configSnapshot)==null?void 0:n.config)??{}),i=pr(t),a=pr(r);e.configForm=t,e.configRaw=i,e.configFormDirty=i!==a}async function Or(e){return Er(e,`config.set`,`configSaving`)}async function kr(e){return Er(e,`config.apply`,`configApplying`,{sessionKey:e.applySessionKey})}async function Ar(e){if(!(!e.client||!e.connected)){e.updateRunning=!0,e.lastError=null,e.updateStatusBanner=null;try{var t,n;let i=await e.client.request(`update.run`,{sessionKey:e.applySessionKey}),a=((t=i.result)==null?void 0:t.status)??(i.ok===!0?`ok`:`error`);if(a===`ok`&&i.ok===!0){var r;e.pendingUpdateExpectedVersion=((r=i.result)==null||(r=r.after)==null?void 0:r.version)??null;return}e.pendingUpdateExpectedVersion=null,e.updateStatusBanner=Tr({status:a,reason:(n=i.result)==null?void 0:n.reason})}catch(t){e.lastError=String(t),e.pendingUpdateExpectedVersion=null}finally{e.updateRunning=!1}}}function jr(e,t){var n;let r=fr(e.configForm??((n=e.configSnapshot)==null?void 0:n.config)??{});t(r),Dr(e,r)}function Mr(e,t,n){jr(e,e=>_r(e,t,n))}function Nr(e,t){var n,r;let i=(n=e.configSnapshot)!=null&&n.config&&typeof e.configSnapshot.config==`object`&&!Array.isArray(e.configSnapshot.config)?e.configSnapshot.config:null,a=e.configForm??i;if(!a||!e.configForm&&!((r=e.configSnapshot)!=null&&r.hash))return;let o=Vn(fr(a),t);!o||typeof o!=`object`||Array.isArray(o)||Dr(e,fr(o))}function Pr(e){var t,n,r;e.configForm=fr(e.configFormOriginal??((t=e.configSnapshot)==null?void 0:t.config)??{}),e.configRaw=e.configRawOriginal??pr(e.configFormOriginal??((n=e.configSnapshot)==null?void 0:n.config)??{}),e.configFormDirty=!1,e.configDraftBaseHash=((r=e.configSnapshot)==null?void 0:r.hash)??null}function Fr(e,t){jr(e,e=>vr(e,t))}function Ir(e,t){var n;let r=t.trim();if(!r)return-1;let i=e==null||(n=e.agents)==null?void 0:n.list;return Array.isArray(i)?i.findIndex(e=>e&&typeof e==`object`&&`id`in e&&e.id===r):-1}function Lr(e,t){var n,r;let i=t.trim();if(!i)return-1;let a=e.configForm??((n=e.configSnapshot)==null?void 0:n.config),o=Ir(a,i);if(o>=0)return o;let s=a==null||(r=a.agents)==null?void 0:r.list,c=Array.isArray(s)?s.length:0;return Mr(e,[`agents`,`list`,c,`id`],i),c}function Rr(e,t){var n;let r=t.trim();if(!r)return!1;let i=Ir(e.configForm??((n=e.configSnapshot)==null?void 0:n.config),r);return i<0?!1:(jr(e,e=>{var t;let n=e==null||(t=e.agents)==null?void 0:t.list;if(Array.isArray(n))for(let e=0;e<n.length;e++){let t=n[e];if(!t||typeof t!=`object`||Array.isArray(t))continue;let r=t;e===i?r.default=!0:delete r.default}}),!0)}async function zr(e){if(!(!e.client||!e.connected))try{await e.client.request(`config.openFile`,{})}catch{var t;let n=(t=e.configSnapshot)==null?void 0:t.path;if(n)try{await navigator.clipboard.writeText(n)}catch{}}}function Br(e){let{values:t,original:n}=e;return t.name!==n.name||t.displayName!==n.displayName||t.about!==n.about||t.picture!==n.picture||t.banner!==n.banner||t.website!==n.website||t.nip05!==n.nip05||t.lud16!==n.lud16}function Vr(t){let{state:n,callbacks:r,accountId:a}=t,o=Br(n),s=(t,a,o={})=>{let{type:s=`text`,placeholder:c,maxLength:l,help:u}=o,d=n.values[t]??``,f=n.fieldErrors[t],p=`nostr-profile-${t}`;return s===`textarea`?e`
|
|
3
3
|
<div class="form-field" style="margin-bottom: 12px;">
|
|
4
4
|
<label for="${p}" style="display: block; margin-bottom: 4px; font-weight: 500;">
|
|
5
5
|
${a}
|
|
@@ -3581,7 +3581,7 @@ ${t.outputText}</pre
|
|
|
3581
3581
|
title=${`消息渠道`}
|
|
3582
3582
|
aria-label=${`消息渠道(微信/企业微信/飞书/钉钉)`}
|
|
3583
3583
|
aria-pressed=${r}
|
|
3584
|
-
@click=${()=>{let e=t.activePanelId!==`cnChannels`;t.activePanelId=e?`cnChannels`:null,e&&!t.cnChannelsData&&SW(async()=>{let{loadCnChannels:e}=await import(`./channels.cn-
|
|
3584
|
+
@click=${()=>{let e=t.activePanelId!==`cnChannels`;t.activePanelId=e?`cnChannels`:null,e&&!t.cnChannelsData&&SW(async()=>{let{loadCnChannels:e}=await import(`./channels.cn-C_H6e9d6.js`);return{loadCnChannels:e}},__vite__mapDeps([0,1])).then(({loadCnChannels:e})=>{e(t,n)}),n==null||n()}}
|
|
3585
3585
|
>
|
|
3586
3586
|
${U.messageSquare}
|
|
3587
3587
|
</button>
|
|
@@ -4772,7 +4772,7 @@ ${t.outputText}</pre
|
|
|
4772
4772
|
</div>
|
|
4773
4773
|
</div>
|
|
4774
4774
|
`)}
|
|
4775
|
-
`,t)}function mK(e,t,n){let r=++dK;uK=[...uK,{id:r,message:e,description:n==null?void 0:n.description,type:t}],pK(),window.setTimeout(()=>{uK=uK.filter(e=>e.id!==r),pK()},(n==null?void 0:n.duration)??3200)}var hK={success:(e,t)=>mK(e,`success`,t),error:(e,t)=>mK(e,`error`,t),info:(e,t)=>mK(e,`info`,t),warning:(e,t)=>mK(e,`warning`,t)},gK=()=>u(`/api/sealclaw/client/sync`,{method:`POST`}),_K=(e,t)=>u(`/api/sealclaw/client/skills/${e}/download`,{method:`GET`,params:{token:t}});function vK(e){e==null||e()}async function yK(e,t){let n=e.storeSkills!==null&&e.storeSkills!==void 0;e.skillStoreOpen=!0,n||(e.storeSkillsLoading=!0),vK(t);try{let t=await f({page:1,size:50});e.storeSkills=(t==null?void 0:t.data)??[]}catch{e.storeSkills||(e.storeSkills=[])}finally{e.storeSkillsLoading=!1,vK(t)}}function bK(e,t){e.skillStoreOpen=!1,e.storeItemError=null,vK(t)}async function xK(e,t,n){e.storeItemLoading=t.name,e.storeItemError=null,vK(n);try{var r,i;let o=await gK(),s=((o==null||(r=o.data)==null?void 0:r.skills)??[]).find(e=>e.skillId===t.id);if(!s){var a;await p(t.id,{type:`FREE`});let e=await gK();s=e==null||(a=e.data)==null||(a=a.skills)==null?void 0:a.find(e=>e.skillId===t.id)}if(!s){let t=`获取技能授权失败`;return e.storeItemError=t,vK(n),{ok:!1,error:t}}let c=await _K(s.skillId,s.downloadToken),l=c==null||(i=c.data)==null?void 0:i.url;if(!l){let t=`获取下载链接失败`;return e.storeItemError=t,vK(n),{ok:!1,error:t}}return{ok:!0,url:l}}catch(t){let r=t instanceof Error?t.message:String(t);return e.storeItemError=r,vK(n),{ok:!1,error:r}}finally{e.storeItemLoading=null,vK(n)}}var SK=`canvas-from-session`;function CK(e){return`/${SK} ${e}`.trim()}var wK=844;async function TK(){let e=await f({page:1,size:50});return((e==null?void 0:e.data)??[]).find(e=>e.name===SK)||{id:wK,name:SK}}function EK(e,t){var n;if(!((n=e.skillsReport)==null||(n=n.skills)==null)&&n.some(e=>e.name===`canvas-from-session`)){e.handleSendChat(CK(e.sessionKey)),t==null||t();return}e.storeItemLoading||(e.storeItemLoading=SK,t==null||t(),hK.info(`正在安装「生成画布」技能…`),(async()=>{try{let n=await TK(),r=await xK(e,n,t);if(!r.ok||!r.url||!e.client){hK.error(r.error??`安装失败,请重试`);return}e.storeItemLoading=SK,t==null||t(),await e.client.request(`skills.install`,{source:`url`,url:r.url,name:n.name,storeExtra:n,force:!0}),await Zv(e,{}),hK.success(`「生成画布」技能已就绪`),e.handleSendChat(CK(e.sessionKey))}catch(e){hK.error(e instanceof Error?e.message:`安装失败,请重试`)}finally{e.storeItemLoading=null,t==null||t()}})())}async function DK(e){if(!(!e.client||!e.connected||e.fileSpaceLoading)){e.fileSpaceLoading=!0,e.fileSpaceError=null;try{var t;let n=(((t=e.sessionsResult)==null?void 0:t.sessions)??[]).filter(e=>!e.spawnedBy&&!e.archived);e.fileSpaceData=(await Promise.all(n.map(async t=>{let n=ua(t.key),r=t.sessionId,i=t.displayName??t.label??t.key,a=await e.client.request(`workspace.output.list`,{agentId:n,...r?{sessionId:r}:{}}).then(e=>{var t;return(e==null||(t=e.files)==null?void 0:t.filter(e=>!e.isDir))??[]}).catch(()=>[]),o=await e.client.request(`chat.attachments.list`,{sessionKey:t.key}).then(e=>(e==null?void 0:e.files)??[]).catch(()=>[]);return{sessionKey:t.key,sessionLabel:i,agentId:n,outputFiles:a,refFiles:o}}))).filter(e=>e.outputFiles.length>0||e.refFiles.length>0)}catch(t){e.fileSpaceError=String(t)}finally{e.fileSpaceLoading=!1}}}var OK=e=>u(`/api/sealclaw/share/${encodeURIComponent(e)}`,{method:`GET`}),kK=e=>u(`/api/sealclaw/share/${encodeURIComponent(e)}/claim`,{method:`POST`}),AK=e=>u(`/api/sealclaw/share/my`,{method:`GET`,params:e}),jK=e=>u(`/api/sealclaw/enterprise/skills`,{method:`GET`,params:e}),MK=e=>u(`/api/sealclaw/enterprise/skills/${e}/install`,{method:`POST`}),NK=E({claimImportShare:()=>YK,closeImportDialog:()=>KK,closePublishDialog:()=>eq,closeShareDialog:()=>WK,confirmShareSkill:()=>UK,installEnterpriseSkillAction:()=>QK,loadEnterpriseSkills:()=>ZK,loadMySharesForMatching:()=>VK,loadSkillCenterCategories:()=>IK,loadSkillCenterSkills:()=>LK,loadSyncVersionMap:()=>FK,nextPatchVersion:()=>BK,openImportDialog:()=>GK,openPublishDialog:()=>$K,openShareDialog:()=>HK,previewImportShare:()=>JK,publishSkillAction:()=>tq,uninstallSkillCenterItem:()=>zK,updateSyncSkill:()=>XK,useSkillCenterItem:()=>RK});function PK(e){e==null||e()}async function FK(e,t){if(!e.syncVersionMapLoaded){e.syncVersionMapLoaded=!0;try{var n;let t=await gK(),r=(t==null||(n=t.data)==null?void 0:n.skills)??[],i=new Map,a=new Map;for(let e of r)e.name&&e.version&&i.set(e.name,e.version),e.skillId&&e.version&&a.set(e.skillId,e.version);e.syncVersionMap=i,e.syncVersionByIdMap=a}catch{e.syncVersionMapLoaded=!1}PK(t)}}async function IK(e,t){if(!(e.skillCenterCategories||e.skillCenterCategoriesLoading)){e.skillCenterCategoriesLoading=!0,PK(t);try{let t=await d();e.skillCenterCategories=(t==null?void 0:t.data)??[]}catch{e.skillCenterCategories=[]}finally{e.skillCenterCategoriesLoading=!1,PK(t)}}}async function LK(e,t){e.storeSkillsLoading=!0,e.storeSkills=null,PK(t);try{let t=await f({page:1,size:100});e.storeSkills=(t==null?void 0:t.data)??[]}catch{e.storeSkills=[]}finally{e.storeSkillsLoading=!1,PK(t)}}async function RK(e,t,n){e.skillCenterItemBusy=t.name,e.skillCenterItemError=null,PK(n);try{var r,i;let o=await gK(),s=((o==null||(r=o.data)==null?void 0:r.skills)??[]).find(e=>e.skillId===t.id);if(!s){var a;await p(t.id,{type:`FREE`});let e=await gK();s=e==null||(a=e.data)==null||(a=a.skills)==null?void 0:a.find(e=>e.skillId===t.id)}if(!s){let t=`获取技能授权失败`;return e.skillCenterItemError=t,PK(n),{ok:!1,error:t}}let c=await _K(s.skillId,s.downloadToken),l=c==null||(i=c.data)==null?void 0:i.url;if(!l){let t=`获取下载链接失败`;return e.skillCenterItemError=t,PK(n),{ok:!1,error:t}}return{ok:!0,url:l}}catch(t){let r=t instanceof Error?t.message:String(t);return e.skillCenterItemError=r,PK(n),{ok:!1,error:r}}finally{e.skillCenterItemBusy=null,PK(n)}}async function zK(e,t,n){if(e.client){e.skillCenterItemBusy=t,e.skillCenterItemError=null,PK(n);try{await e.client.request(`skills.uninstall`,{name:t})}catch(t){e.skillCenterItemError=t instanceof Error?t.message:String(t)}finally{e.skillCenterItemBusy=null,PK(n)}}}function BK(e){let t=e.split(`.`);if(t.length!==3)return`1.0.0`;let[n,r,i]=t.map(Number);return[n,r,i].some(e=>!Number.isFinite(e))?`1.0.0`:`${n}.${r}.${i+1}`}async function VK(e,t){if(!e.mySharesLoaded){try{var n;let t=await AK({page:1,size:200});e.mySharesForMatching=(t==null||(n=t.data)==null?void 0:n.data)??[]}catch{}e.mySharesLoaded=!0,PK(t)}}async function HK(e,t,n){e.mySharesLoaded=!1,await VK(e,n);let r=e.mySharesForMatching.find(e=>e.skillName===t&&e.status===1);e.shareDialogSkill=t,e.shareDialogError=null,e.shareDialogResult=null,r?(e.shareDialogPhase=`view`,e.shareDialogExisting=r,e.shareDialogVersion=r.version?BK(r.version):`1.0.0`):(e.shareDialogPhase=`confirm`,e.shareDialogExisting=null,e.shareDialogVersion=`1.0.0`),PK(n)}async function UK(e,t){if(!(!e.client||!e.shareDialogSkill)){e.shareDialogPhase=`loading`,e.shareDialogError=null,PK(t);try{var n,r,i;let a=typeof localStorage<`u`?localStorage.getItem(`jwt`)??void 0:void 0,o=(n=e.skillsReport)==null||(n=n.skills)==null?void 0:n.find(t=>t.name===e.shareDialogSkill),s=(o==null||(r=o.storeExtra)==null?void 0:r.skillId)??((i=e.shareDialogExisting)==null?void 0:i.skillId),c=await e.client.request(`skills.share`,{name:e.shareDialogSkill,version:e.shareDialogVersion,title:e.shareDialogSkill,skillId:s,token:a,apiBase:`https://gatewaytest.sealseek.cn/api/sealclaw`});if(c!=null&&c.shareUrl){e.shareDialogPhase=`success`,e.shareDialogResult={shareCode:c.shareCode,shareUrl:c.shareUrl};let n=e.shareDialogSkill;e.mySharesForMatching=[{shareCode:c.shareCode,skillName:n,skillTitle:n,skillId:0,version:e.shareDialogVersion,status:1,claimedCount:0},...e.mySharesForMatching.filter(e=>!(e.skillName===n&&e.status===1))],e.mySharesLoaded=!1,VK(e,t),e.enterpriseSkillsLoaded=!1,ZK(e,void 0,t),e.syncVersionMapLoaded=!1,FK(e,t)}else e.shareDialogError=`分享失败:服务端未返回分享链接`,e.shareDialogPhase=e.shareDialogExisting?`view`:`confirm`}catch(t){e.shareDialogError=t instanceof Error?t.message:String(t),e.shareDialogPhase=e.shareDialogExisting?`view`:`confirm`}PK(t)}}function WK(e,t){e.shareDialogSkill=null,e.shareDialogResult=null,e.shareDialogError=null,e.shareDialogExisting=null,PK(t)}function GK(e,t){e.importDialogOpen=!0,e.importShareCode=``,e.importPreview=null,e.importPreviewLoading=!1,e.importClaimLoading=!1,e.importClaimResult=null,e.importError=null,PK(t)}function KK(e,t){e.importDialogOpen=!1,PK(t)}function qK(e){var t;let n=(e??``).trim();return n?n.includes(`/s/`)?((t=n.split(`/s/`).pop())==null?void 0:t.trim())??``:n:``}async function JK(e,t,n){let r=qK(t);if(!r){e.importError=`请先输入分享码或链接`,PK(n);return}e.importShareCode=r,e.importPreviewLoading=!0,e.importPreview=null,e.importClaimResult=null,e.importError=null,PK(n);try{let t=await OK(r);e.importPreview=(t==null?void 0:t.data)??null}catch(t){e.importError=t instanceof Error?t.message:String(t)}finally{e.importPreviewLoading=!1,PK(n)}}async function YK(e,t){if(!e.importShareCode)return{ok:!1};e.importClaimLoading=!0,e.importClaimResult=null,e.importError=null,PK(t);try{var n,r,i,a;await kK(e.importShareCode);let t=((n=await gK())==null||(n=n.data)==null?void 0:n.skills)??[],o=(r=e.importPreview)==null?void 0:r.skillId,s=o==null?t.at(-1):t.find(e=>e.skillId===o);if(!s)return e.importClaimResult=`领取成功!技能正在同步,请稍后在技能中心刷新。`,{ok:!1};let c=(i=await _K(s.skillId,s.downloadToken))==null||(i=i.data)==null?void 0:i.url;return c?{ok:!0,url:c,name:s.name,version:s.version,authorUuid:(a=e.importPreview)==null?void 0:a.authorUuid,skillId:s.skillId}:(e.importError=`获取下载链接失败`,{ok:!1})}catch(t){return e.importError=t instanceof Error?t.message:String(t),{ok:!1}}finally{e.importClaimLoading=!1,PK(t)}}async function XK(e,t,n){if(e.client){e.skillCenterItemBusy=t,PK(n);try{var r,i,a;let n=(r=e.skillsReport)==null||(r=r.skills)==null?void 0:r.find(e=>e.name===t),o=(n==null?void 0:n.storeExtra)??{},s=o.skillId,c=await gK(),l=(c==null||(i=c.data)==null?void 0:i.skills)??[],u=s?l.find(e=>e.skillId===s):l.find(e=>e.name===t);if(!u){e.skillCenterItemError=`未找到该技能的服务端记录`;return}let d=await _K(u.skillId,u.downloadToken),f=d==null||(a=d.data)==null?void 0:a.url;if(!f){e.skillCenterItemError=`获取下载链接失败`;return}await e.client.request(`skills.install`,{source:`url`,url:f,name:u.name,force:!0,storeExtra:{...o,currentVersion:u.version,skillId:u.skillId}})}catch(t){e.skillCenterItemError=t instanceof Error?t.message:String(t)}finally{e.skillCenterItemBusy=null,PK(n)}}}async function ZK(e,t,n){if(!(e.enterpriseSkillsLoaded&&t===void 0)){e.enterpriseSkillsLoading=!0,PK(n);try{var r;let n=await jK({keyword:t,page:1,size:50});e.enterpriseSkills=(n==null||(r=n.data)==null?void 0:r.data)??[]}catch{}e.enterpriseSkillsLoaded=!0,e.enterpriseSkillsLoading=!1,PK(n)}}async function QK(e,t,n){let r=e.enterpriseSkills.find(e=>e.skillId===t);if(r){var i,a;let t=(i=e.skillsReport)==null||(i=i.skills)==null?void 0:i.find(e=>e.name===r.name),o=t==null||(a=t.storeExtra)==null?void 0:a.source;if(t&&o&&o!==`enterprise`){e.enterpriseError=`本地已有同名技能「${r.name}」(来源:${o===`share`?`分享`:`商店`}),请先卸载后再安装`,PK(n);return}}e.enterpriseInstallLoading=t,e.enterpriseError=null,PK(n);try{var o;await MK(t);let n=await gK(),i=((n==null||(o=n.data)==null?void 0:o.skills)??[]).find(e=>e.skillId===t);if(i&&e.client){var s;let n=await _K(i.skillId,i.downloadToken),a=n==null||(s=n.data)==null?void 0:s.url;if(a){await e.client.request(`skills.install`,{source:`url`,url:a,name:i.name,force:!0,storeExtra:{currentVersion:i.version,source:`enterprise`,authorUuid:r==null?void 0:r.authorUuid,skillId:t}});let n=e.enterpriseSkills.find(e=>e.skillId===t);n&&(n.owned=!0)}}}catch(t){e.enterpriseError=t instanceof Error?t.message:String(t)}finally{e.enterpriseInstallLoading=null,PK(n)}}function $K(e,t,n){let r=e.enterpriseSkills.find(e=>e.name===t);e.publishDialogOpen=!0,e.publishingSkill=t,e.publishTarget=r?`enterprise`:null,e.publishLoading=!1,e.publishError=null,e.publishSuccess=null,PK(n)}function eq(e,t){e.publishDialogOpen=!1,e.publishingSkill=null,e.publishTarget=null,e.publishLoading=!1,e.publishError=null,e.publishSuccess=null,PK(t)}async function tq(e,t){if(!(!e.client||!e.publishingSkill||!e.publishTarget)){e.publishLoading=!0,e.publishError=null,e.publishSuccess=null,PK(t);try{let i=typeof localStorage<`u`?localStorage.getItem(`jwt`)??void 0:void 0;if(e.publishTarget===`enterprise`){var n,r;let a=(n=e.skillsReport)==null||(n=n.skills)==null?void 0:n.find(t=>t.name===e.publishingSkill),o=a==null||(r=a.storeExtra)==null?void 0:r.skillId,s=o?e.enterpriseSkills.find(e=>e.skillId===o):e.enterpriseSkills.find(t=>t.name===e.publishingSkill),c=(s==null?void 0:s.latestVersion)??(s==null?void 0:s.version);await e.client.request(`skills.publishEnterprise`,{name:e.publishingSkill,skillId:s==null?void 0:s.skillId,version:c?BK(c):void 0,token:i,apiBase:`https://gatewaytest.sealseek.cn/api/sealclaw`}),e.publishSuccess=`发布成功,企业成员可在企业技能中安装。`,e.enterpriseSkillsLoaded=!1,ZK(e,void 0,t),e.syncVersionMapLoaded=!1,FK(e,t),e.mySharesLoaded=!1,VK(e,t)}else e.publishError=`公开商店发布暂未开放`}catch(t){e.publishError=t instanceof Error?t.message:String(t)}finally{e.publishLoading=!1,PK(t)}}}async function nq(e,t){if(!(!e.client||!e.connected||e.fileTreeRefLoading)){e.fileTreeRefLoading=!0;try{let n=await e.client.request(`chat.attachments.list`,{sessionKey:t});e.fileTreeRefFiles=(n==null?void 0:n.files)??[]}catch{e.fileTreeRefFiles=[]}finally{e.fileTreeRefLoading=!1}}}async function rq(e,t,n){if(!(!e.client||!e.connected||e.fileTreeLoading)){e.fileTreeLoading=!0,e.fileTreeError=null;try{let r=await e.client.request(`workspace.output.list`,{agentId:t,...n?{sessionId:n}:{}});r&&(e.fileTreeResult=r,e.fileTreeSessionId=n)}catch(t){e.fileTreeError=String(t)}finally{e.fileTreeLoading=!1}}}async function iq(e,t,n,r){if(!(!e.client||!e.connected)&&!e.fileTreeDirLoading.includes(n)){e.fileTreeDirLoading=[...e.fileTreeDirLoading,n];try{let i=await e.client.request(`workspace.output.list`,{agentId:t,subPath:r});i&&(e.fileTreeDirChildren={...e.fileTreeDirChildren,[n]:i.files})}catch{}finally{e.fileTreeDirLoading=e.fileTreeDirLoading.filter(e=>e!==n)}}}var aq,oq=class extends c{constructor(...e){super(...e),this.splitRatio=.6,this.minRatio=.4,this.maxRatio=.7,this.label=`Resize split view`,this.orientation=`vertical`,this.isDragging=!1,this.startPos=0,this.startRatio=0,this.activePointerId=null,this.handlePointerDown=e=>{e.button===0&&(this.isDragging=!0,this.startPos=this.orientation===`horizontal`?e.clientY:e.clientX,this.startRatio=this.splitRatio,this.classList.add(`dragging`),this.focus(),this.capturePointer(e.pointerId),document.addEventListener(`pointermove`,this.handlePointerMove),document.addEventListener(`pointerup`,this.handlePointerUp),document.addEventListener(`pointercancel`,this.handlePointerUp),e.preventDefault())},this.handlePointerMove=e=>{if(!this.isDragging)return;let t=this.parentElement;if(!t)return;let n=t.getBoundingClientRect(),r=this.orientation===`horizontal`,i=r?n.height:n.width;if(i<=0)return;let a=(r?e.clientY:e.clientX)-this.startPos;this.emitResize(this.startRatio+a/i)},this.handlePointerUp=()=>{this.stopDragging()},this.handleKeyDown=e=>{let t=e.shiftKey?.05:.02,n=null,r=this.orientation===`horizontal`?`ArrowUp`:`ArrowLeft`,i=this.orientation===`horizontal`?`ArrowDown`:`ArrowRight`;e.key===r?n=this.splitRatio-t:e.key===i?n=this.splitRatio+t:e.key===`Home`?n=this.minRatio:e.key===`End`&&(n=this.maxRatio),n!=null&&(e.preventDefault(),this.emitResize(n))}}render(){return this.orientation===`horizontal`?e`<span class="line"></span><span class="grabber"></span>`:i}connectedCallback(){super.connectedCallback(),this.setStaticAccessibilityAttributes(),this.addEventListener(`pointerdown`,this.handlePointerDown),this.addEventListener(`keydown`,this.handleKeyDown)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`pointerdown`,this.handlePointerDown),this.removeEventListener(`keydown`,this.handleKeyDown),this.stopDragging()}updated(){this.setAttribute(`aria-valuemin`,String(this.toAriaValue(this.minRatio))),this.setAttribute(`aria-valuemax`,String(this.toAriaValue(this.maxRatio))),this.setAttribute(`aria-valuenow`,String(this.toAriaValue(this.splitRatio))),this.setAttribute(`aria-orientation`,this.orientation),this.setAttribute(`data-orientation`,this.orientation),this.label?this.setAttribute(`aria-label`,this.label):this.removeAttribute(`aria-label`)}stopDragging(){this.isDragging&&(this.isDragging=!1,this.classList.remove(`dragging`),this.releaseActivePointer(),document.removeEventListener(`pointermove`,this.handlePointerMove),document.removeEventListener(`pointerup`,this.handlePointerUp),document.removeEventListener(`pointercancel`,this.handlePointerUp))}emitResize(e){let t=this.clampRatio(e);this.dispatchEvent(new CustomEvent(`resize`,{detail:{splitRatio:t},bubbles:!0,composed:!0}))}clampRatio(e){return Math.max(this.minRatio,Math.min(this.maxRatio,e))}toAriaValue(e){return Math.round(e*100)}setStaticAccessibilityAttributes(){this.setAttribute(`role`,`separator`),this.setAttribute(`tabindex`,`0`)}capturePointer(e){typeof this.setPointerCapture==`function`&&(this.setPointerCapture(e),this.activePointerId=e)}releaseActivePointer(){let e=this.activePointerId;this.activePointerId=null,!(e==null||typeof this.releasePointerCapture!=`function`)&&(typeof this.hasPointerCapture==`function`&&!this.hasPointerCapture(e)||this.releasePointerCapture(e))}};aq=oq,aq.styles=l`
|
|
4775
|
+
`,t)}function mK(e,t,n){let r=++dK;uK=[...uK,{id:r,message:e,description:n==null?void 0:n.description,type:t}],pK(),window.setTimeout(()=>{uK=uK.filter(e=>e.id!==r),pK()},(n==null?void 0:n.duration)??3200)}var hK={success:(e,t)=>mK(e,`success`,t),error:(e,t)=>mK(e,`error`,t),info:(e,t)=>mK(e,`info`,t),warning:(e,t)=>mK(e,`warning`,t)},gK=()=>u(`/api/sealclaw/client/sync`,{method:`POST`}),_K=(e,t)=>u(`/api/sealclaw/client/skills/${e}/download`,{method:`GET`,params:{token:t}});function vK(e){e==null||e()}async function yK(e,t){let n=e.storeSkills!==null&&e.storeSkills!==void 0;e.skillStoreOpen=!0,n||(e.storeSkillsLoading=!0),vK(t);try{let t=await f({page:1,size:50});e.storeSkills=(t==null?void 0:t.data)??[]}catch{e.storeSkills||(e.storeSkills=[])}finally{e.storeSkillsLoading=!1,vK(t)}}function bK(e,t){e.skillStoreOpen=!1,e.storeItemError=null,vK(t)}async function xK(e,t,n){e.storeItemLoading=t.name,e.storeItemError=null,vK(n);try{var r,i;let o=await gK(),s=((o==null||(r=o.data)==null?void 0:r.skills)??[]).find(e=>e.skillId===t.id);if(!s){var a;await p(t.id,{type:`FREE`});let e=await gK();s=e==null||(a=e.data)==null||(a=a.skills)==null?void 0:a.find(e=>e.skillId===t.id)}if(!s){let t=`获取技能授权失败`;return e.storeItemError=t,vK(n),{ok:!1,error:t}}let c=await _K(s.skillId,s.downloadToken),l=c==null||(i=c.data)==null?void 0:i.url;if(!l){let t=`获取下载链接失败`;return e.storeItemError=t,vK(n),{ok:!1,error:t}}return{ok:!0,url:l}}catch(t){let r=t instanceof Error?t.message:String(t);return e.storeItemError=r,vK(n),{ok:!1,error:r}}finally{e.storeItemLoading=null,vK(n)}}var SK=`canvas-from-session`;function CK(e){return`/${SK} ${e}`.trim()}var wK=844;async function TK(){let e=await f({page:1,size:50});return((e==null?void 0:e.data)??[]).find(e=>e.name===SK)||{id:wK,name:SK}}function EK(e,t){var n;if(!((n=e.skillsReport)==null||(n=n.skills)==null)&&n.some(e=>e.name===`canvas-from-session`)){e.handleSendChat(CK(e.sessionKey)),t==null||t();return}e.storeItemLoading||(e.storeItemLoading=SK,t==null||t(),hK.info(`正在安装「生成画布」技能…`),(async()=>{try{let n=await TK(),r=await xK(e,n,t);if(!r.ok||!r.url||!e.client){hK.error(r.error??`安装失败,请重试`);return}e.storeItemLoading=SK,t==null||t(),await e.client.request(`skills.install`,{source:`url`,url:r.url,name:n.name,storeExtra:n,force:!0}),await Zv(e,{}),hK.success(`「生成画布」技能已就绪`),e.handleSendChat(CK(e.sessionKey))}catch(e){hK.error(e instanceof Error?e.message:`安装失败,请重试`)}finally{e.storeItemLoading=null,t==null||t()}})())}async function DK(e){if(!(!e.client||!e.connected||e.fileSpaceLoading)){e.fileSpaceLoading=!0,e.fileSpaceError=null;try{var t;let n=(((t=e.sessionsResult)==null?void 0:t.sessions)??[]).filter(e=>!e.spawnedBy&&!e.archived);e.fileSpaceData=(await Promise.all(n.map(async t=>{let n=ua(t.key),r=t.sessionId,i=t.displayName??t.label??t.key,a=await e.client.request(`workspace.output.list`,{agentId:n,...r?{sessionId:r}:{}}).then(e=>{var t;return(e==null||(t=e.files)==null?void 0:t.filter(e=>!e.isDir))??[]}).catch(()=>[]),o=await e.client.request(`chat.attachments.list`,{sessionKey:t.key}).then(e=>(e==null?void 0:e.files)??[]).catch(()=>[]);return{sessionKey:t.key,sessionLabel:i,agentId:n,outputFiles:a,refFiles:o}}))).filter(e=>e.outputFiles.length>0||e.refFiles.length>0)}catch(t){e.fileSpaceError=String(t)}finally{e.fileSpaceLoading=!1}}}var OK=e=>u(`/api/sealclaw/share/${encodeURIComponent(e)}`,{method:`GET`}),kK=e=>u(`/api/sealclaw/share/${encodeURIComponent(e)}/claim`,{method:`POST`}),AK=e=>u(`/api/sealclaw/share/my`,{method:`GET`,params:e}),jK=e=>u(`/api/sealclaw/enterprise/skills`,{method:`GET`,params:e}),MK=e=>u(`/api/sealclaw/enterprise/skills/${e}/install`,{method:`POST`}),NK=E({claimImportShare:()=>YK,closeImportDialog:()=>KK,closePublishDialog:()=>eq,closeShareDialog:()=>WK,confirmShareSkill:()=>UK,installEnterpriseSkillAction:()=>QK,loadEnterpriseSkills:()=>ZK,loadMySharesForMatching:()=>VK,loadSkillCenterCategories:()=>IK,loadSkillCenterSkills:()=>LK,loadSyncVersionMap:()=>FK,nextPatchVersion:()=>BK,openImportDialog:()=>GK,openPublishDialog:()=>$K,openShareDialog:()=>HK,previewImportShare:()=>JK,publishSkillAction:()=>tq,uninstallSkillCenterItem:()=>zK,updateSyncSkill:()=>XK,useSkillCenterItem:()=>RK});function PK(e){e==null||e()}async function FK(e,t){if(!e.syncVersionMapLoaded){e.syncVersionMapLoaded=!0;try{var n;let t=await gK(),r=(t==null||(n=t.data)==null?void 0:n.skills)??[],i=new Map,a=new Map;for(let e of r)e.name&&e.version&&i.set(e.name,e.version),e.skillId&&e.version&&a.set(e.skillId,e.version);e.syncVersionMap=i,e.syncVersionByIdMap=a}catch{e.syncVersionMapLoaded=!1}PK(t)}}async function IK(e,t){if(!(e.skillCenterCategories||e.skillCenterCategoriesLoading)){e.skillCenterCategoriesLoading=!0,PK(t);try{let t=await d();e.skillCenterCategories=(t==null?void 0:t.data)??[]}catch{e.skillCenterCategories=[]}finally{e.skillCenterCategoriesLoading=!1,PK(t)}}}async function LK(e,t){e.storeSkillsLoading=!0,e.storeSkills=null,PK(t);try{let t=await f({page:1,size:100});e.storeSkills=(t==null?void 0:t.data)??[]}catch{e.storeSkills=[]}finally{e.storeSkillsLoading=!1,PK(t)}}async function RK(e,t,n){e.skillCenterItemBusy=t.name,e.skillCenterItemError=null,PK(n);try{var r,i;let o=await gK(),s=((o==null||(r=o.data)==null?void 0:r.skills)??[]).find(e=>e.skillId===t.id);if(!s){var a;await p(t.id,{type:`FREE`});let e=await gK();s=e==null||(a=e.data)==null||(a=a.skills)==null?void 0:a.find(e=>e.skillId===t.id)}if(!s){let t=`获取技能授权失败`;return e.skillCenterItemError=t,PK(n),{ok:!1,error:t}}let c=await _K(s.skillId,s.downloadToken),l=c==null||(i=c.data)==null?void 0:i.url;if(!l){let t=`获取下载链接失败`;return e.skillCenterItemError=t,PK(n),{ok:!1,error:t}}return{ok:!0,url:l}}catch(t){let r=t instanceof Error?t.message:String(t);return e.skillCenterItemError=r,PK(n),{ok:!1,error:r}}finally{e.skillCenterItemBusy=null,PK(n)}}async function zK(e,t,n){if(e.client){e.skillCenterItemBusy=t,e.skillCenterItemError=null,PK(n);try{await e.client.request(`skills.uninstall`,{name:t})}catch(t){e.skillCenterItemError=t instanceof Error?t.message:String(t)}finally{e.skillCenterItemBusy=null,PK(n)}}}function BK(e){let t=e.split(`.`);if(t.length!==3)return`1.0.0`;let[n,r,i]=t.map(Number);return[n,r,i].some(e=>!Number.isFinite(e))?`1.0.0`:`${n}.${r}.${i+1}`}async function VK(e,t){if(!e.mySharesLoaded){try{var n;let t=await AK({page:1,size:200});e.mySharesForMatching=(t==null||(n=t.data)==null?void 0:n.data)??[]}catch{}e.mySharesLoaded=!0,PK(t)}}async function HK(e,t,n){e.mySharesLoaded=!1,await VK(e,n);let r=e.mySharesForMatching.find(e=>e.skillName===t&&e.status===1);e.shareDialogSkill=t,e.shareDialogError=null,e.shareDialogResult=null,r?(e.shareDialogPhase=`view`,e.shareDialogExisting=r,e.shareDialogVersion=r.version?BK(r.version):`1.0.0`):(e.shareDialogPhase=`confirm`,e.shareDialogExisting=null,e.shareDialogVersion=`1.0.0`),PK(n)}async function UK(e,t){if(!(!e.client||!e.shareDialogSkill)){e.shareDialogPhase=`loading`,e.shareDialogError=null,PK(t);try{var n,r,i;let a=typeof localStorage<`u`?localStorage.getItem(`jwt`)??void 0:void 0,o=(n=e.skillsReport)==null||(n=n.skills)==null?void 0:n.find(t=>t.name===e.shareDialogSkill),s=(o==null||(r=o.storeExtra)==null?void 0:r.skillId)??((i=e.shareDialogExisting)==null?void 0:i.skillId),c=await e.client.request(`skills.share`,{name:e.shareDialogSkill,version:e.shareDialogVersion,title:e.shareDialogSkill,skillId:s,token:a,apiBase:`https://gateway.sealseek.cn/api/sealclaw`});if(c!=null&&c.shareUrl){e.shareDialogPhase=`success`,e.shareDialogResult={shareCode:c.shareCode,shareUrl:c.shareUrl};let n=e.shareDialogSkill;e.mySharesForMatching=[{shareCode:c.shareCode,skillName:n,skillTitle:n,skillId:0,version:e.shareDialogVersion,status:1,claimedCount:0},...e.mySharesForMatching.filter(e=>!(e.skillName===n&&e.status===1))],e.mySharesLoaded=!1,VK(e,t),e.enterpriseSkillsLoaded=!1,ZK(e,void 0,t),e.syncVersionMapLoaded=!1,FK(e,t)}else e.shareDialogError=`分享失败:服务端未返回分享链接`,e.shareDialogPhase=e.shareDialogExisting?`view`:`confirm`}catch(t){e.shareDialogError=t instanceof Error?t.message:String(t),e.shareDialogPhase=e.shareDialogExisting?`view`:`confirm`}PK(t)}}function WK(e,t){e.shareDialogSkill=null,e.shareDialogResult=null,e.shareDialogError=null,e.shareDialogExisting=null,PK(t)}function GK(e,t){e.importDialogOpen=!0,e.importShareCode=``,e.importPreview=null,e.importPreviewLoading=!1,e.importClaimLoading=!1,e.importClaimResult=null,e.importError=null,PK(t)}function KK(e,t){e.importDialogOpen=!1,PK(t)}function qK(e){var t;let n=(e??``).trim();return n?n.includes(`/s/`)?((t=n.split(`/s/`).pop())==null?void 0:t.trim())??``:n:``}async function JK(e,t,n){let r=qK(t);if(!r){e.importError=`请先输入分享码或链接`,PK(n);return}e.importShareCode=r,e.importPreviewLoading=!0,e.importPreview=null,e.importClaimResult=null,e.importError=null,PK(n);try{let t=await OK(r);e.importPreview=(t==null?void 0:t.data)??null}catch(t){e.importError=t instanceof Error?t.message:String(t)}finally{e.importPreviewLoading=!1,PK(n)}}async function YK(e,t){if(!e.importShareCode)return{ok:!1};e.importClaimLoading=!0,e.importClaimResult=null,e.importError=null,PK(t);try{var n,r,i,a;await kK(e.importShareCode);let t=((n=await gK())==null||(n=n.data)==null?void 0:n.skills)??[],o=(r=e.importPreview)==null?void 0:r.skillId,s=o==null?t.at(-1):t.find(e=>e.skillId===o);if(!s)return e.importClaimResult=`领取成功!技能正在同步,请稍后在技能中心刷新。`,{ok:!1};let c=(i=await _K(s.skillId,s.downloadToken))==null||(i=i.data)==null?void 0:i.url;return c?{ok:!0,url:c,name:s.name,version:s.version,authorUuid:(a=e.importPreview)==null?void 0:a.authorUuid,skillId:s.skillId}:(e.importError=`获取下载链接失败`,{ok:!1})}catch(t){return e.importError=t instanceof Error?t.message:String(t),{ok:!1}}finally{e.importClaimLoading=!1,PK(t)}}async function XK(e,t,n){if(e.client){e.skillCenterItemBusy=t,PK(n);try{var r,i,a;let n=(r=e.skillsReport)==null||(r=r.skills)==null?void 0:r.find(e=>e.name===t),o=(n==null?void 0:n.storeExtra)??{},s=o.skillId,c=await gK(),l=(c==null||(i=c.data)==null?void 0:i.skills)??[],u=s?l.find(e=>e.skillId===s):l.find(e=>e.name===t);if(!u){e.skillCenterItemError=`未找到该技能的服务端记录`;return}let d=await _K(u.skillId,u.downloadToken),f=d==null||(a=d.data)==null?void 0:a.url;if(!f){e.skillCenterItemError=`获取下载链接失败`;return}await e.client.request(`skills.install`,{source:`url`,url:f,name:u.name,force:!0,storeExtra:{...o,currentVersion:u.version,skillId:u.skillId}})}catch(t){e.skillCenterItemError=t instanceof Error?t.message:String(t)}finally{e.skillCenterItemBusy=null,PK(n)}}}async function ZK(e,t,n){if(!(e.enterpriseSkillsLoaded&&t===void 0)){e.enterpriseSkillsLoading=!0,PK(n);try{var r;let n=await jK({keyword:t,page:1,size:50});e.enterpriseSkills=(n==null||(r=n.data)==null?void 0:r.data)??[]}catch{}e.enterpriseSkillsLoaded=!0,e.enterpriseSkillsLoading=!1,PK(n)}}async function QK(e,t,n){let r=e.enterpriseSkills.find(e=>e.skillId===t);if(r){var i,a;let t=(i=e.skillsReport)==null||(i=i.skills)==null?void 0:i.find(e=>e.name===r.name),o=t==null||(a=t.storeExtra)==null?void 0:a.source;if(t&&o&&o!==`enterprise`){e.enterpriseError=`本地已有同名技能「${r.name}」(来源:${o===`share`?`分享`:`商店`}),请先卸载后再安装`,PK(n);return}}e.enterpriseInstallLoading=t,e.enterpriseError=null,PK(n);try{var o;await MK(t);let n=await gK(),i=((n==null||(o=n.data)==null?void 0:o.skills)??[]).find(e=>e.skillId===t);if(i&&e.client){var s;let n=await _K(i.skillId,i.downloadToken),a=n==null||(s=n.data)==null?void 0:s.url;if(a){await e.client.request(`skills.install`,{source:`url`,url:a,name:i.name,force:!0,storeExtra:{currentVersion:i.version,source:`enterprise`,authorUuid:r==null?void 0:r.authorUuid,skillId:t}});let n=e.enterpriseSkills.find(e=>e.skillId===t);n&&(n.owned=!0)}}}catch(t){e.enterpriseError=t instanceof Error?t.message:String(t)}finally{e.enterpriseInstallLoading=null,PK(n)}}function $K(e,t,n){let r=e.enterpriseSkills.find(e=>e.name===t);e.publishDialogOpen=!0,e.publishingSkill=t,e.publishTarget=r?`enterprise`:null,e.publishLoading=!1,e.publishError=null,e.publishSuccess=null,PK(n)}function eq(e,t){e.publishDialogOpen=!1,e.publishingSkill=null,e.publishTarget=null,e.publishLoading=!1,e.publishError=null,e.publishSuccess=null,PK(t)}async function tq(e,t){if(!(!e.client||!e.publishingSkill||!e.publishTarget)){e.publishLoading=!0,e.publishError=null,e.publishSuccess=null,PK(t);try{let i=typeof localStorage<`u`?localStorage.getItem(`jwt`)??void 0:void 0;if(e.publishTarget===`enterprise`){var n,r;let a=(n=e.skillsReport)==null||(n=n.skills)==null?void 0:n.find(t=>t.name===e.publishingSkill),o=a==null||(r=a.storeExtra)==null?void 0:r.skillId,s=o?e.enterpriseSkills.find(e=>e.skillId===o):e.enterpriseSkills.find(t=>t.name===e.publishingSkill),c=(s==null?void 0:s.latestVersion)??(s==null?void 0:s.version);await e.client.request(`skills.publishEnterprise`,{name:e.publishingSkill,skillId:s==null?void 0:s.skillId,version:c?BK(c):void 0,token:i,apiBase:`https://gateway.sealseek.cn/api/sealclaw`}),e.publishSuccess=`发布成功,企业成员可在企业技能中安装。`,e.enterpriseSkillsLoaded=!1,ZK(e,void 0,t),e.syncVersionMapLoaded=!1,FK(e,t),e.mySharesLoaded=!1,VK(e,t)}else e.publishError=`公开商店发布暂未开放`}catch(t){e.publishError=t instanceof Error?t.message:String(t)}finally{e.publishLoading=!1,PK(t)}}}async function nq(e,t){if(!(!e.client||!e.connected||e.fileTreeRefLoading)){e.fileTreeRefLoading=!0;try{let n=await e.client.request(`chat.attachments.list`,{sessionKey:t});e.fileTreeRefFiles=(n==null?void 0:n.files)??[]}catch{e.fileTreeRefFiles=[]}finally{e.fileTreeRefLoading=!1}}}async function rq(e,t,n){if(!(!e.client||!e.connected||e.fileTreeLoading)){e.fileTreeLoading=!0,e.fileTreeError=null;try{let r=await e.client.request(`workspace.output.list`,{agentId:t,...n?{sessionId:n}:{}});r&&(e.fileTreeResult=r,e.fileTreeSessionId=n)}catch(t){e.fileTreeError=String(t)}finally{e.fileTreeLoading=!1}}}async function iq(e,t,n,r){if(!(!e.client||!e.connected)&&!e.fileTreeDirLoading.includes(n)){e.fileTreeDirLoading=[...e.fileTreeDirLoading,n];try{let i=await e.client.request(`workspace.output.list`,{agentId:t,subPath:r});i&&(e.fileTreeDirChildren={...e.fileTreeDirChildren,[n]:i.files})}catch{}finally{e.fileTreeDirLoading=e.fileTreeDirLoading.filter(e=>e!==n)}}}var aq,oq=class extends c{constructor(...e){super(...e),this.splitRatio=.6,this.minRatio=.4,this.maxRatio=.7,this.label=`Resize split view`,this.orientation=`vertical`,this.isDragging=!1,this.startPos=0,this.startRatio=0,this.activePointerId=null,this.handlePointerDown=e=>{e.button===0&&(this.isDragging=!0,this.startPos=this.orientation===`horizontal`?e.clientY:e.clientX,this.startRatio=this.splitRatio,this.classList.add(`dragging`),this.focus(),this.capturePointer(e.pointerId),document.addEventListener(`pointermove`,this.handlePointerMove),document.addEventListener(`pointerup`,this.handlePointerUp),document.addEventListener(`pointercancel`,this.handlePointerUp),e.preventDefault())},this.handlePointerMove=e=>{if(!this.isDragging)return;let t=this.parentElement;if(!t)return;let n=t.getBoundingClientRect(),r=this.orientation===`horizontal`,i=r?n.height:n.width;if(i<=0)return;let a=(r?e.clientY:e.clientX)-this.startPos;this.emitResize(this.startRatio+a/i)},this.handlePointerUp=()=>{this.stopDragging()},this.handleKeyDown=e=>{let t=e.shiftKey?.05:.02,n=null,r=this.orientation===`horizontal`?`ArrowUp`:`ArrowLeft`,i=this.orientation===`horizontal`?`ArrowDown`:`ArrowRight`;e.key===r?n=this.splitRatio-t:e.key===i?n=this.splitRatio+t:e.key===`Home`?n=this.minRatio:e.key===`End`&&(n=this.maxRatio),n!=null&&(e.preventDefault(),this.emitResize(n))}}render(){return this.orientation===`horizontal`?e`<span class="line"></span><span class="grabber"></span>`:i}connectedCallback(){super.connectedCallback(),this.setStaticAccessibilityAttributes(),this.addEventListener(`pointerdown`,this.handlePointerDown),this.addEventListener(`keydown`,this.handleKeyDown)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`pointerdown`,this.handlePointerDown),this.removeEventListener(`keydown`,this.handleKeyDown),this.stopDragging()}updated(){this.setAttribute(`aria-valuemin`,String(this.toAriaValue(this.minRatio))),this.setAttribute(`aria-valuemax`,String(this.toAriaValue(this.maxRatio))),this.setAttribute(`aria-valuenow`,String(this.toAriaValue(this.splitRatio))),this.setAttribute(`aria-orientation`,this.orientation),this.setAttribute(`data-orientation`,this.orientation),this.label?this.setAttribute(`aria-label`,this.label):this.removeAttribute(`aria-label`)}stopDragging(){this.isDragging&&(this.isDragging=!1,this.classList.remove(`dragging`),this.releaseActivePointer(),document.removeEventListener(`pointermove`,this.handlePointerMove),document.removeEventListener(`pointerup`,this.handlePointerUp),document.removeEventListener(`pointercancel`,this.handlePointerUp))}emitResize(e){let t=this.clampRatio(e);this.dispatchEvent(new CustomEvent(`resize`,{detail:{splitRatio:t},bubbles:!0,composed:!0}))}clampRatio(e){return Math.max(this.minRatio,Math.min(this.maxRatio,e))}toAriaValue(e){return Math.round(e*100)}setStaticAccessibilityAttributes(){this.setAttribute(`role`,`separator`),this.setAttribute(`tabindex`,`0`)}capturePointer(e){typeof this.setPointerCapture==`function`&&(this.setPointerCapture(e),this.activePointerId=e)}releaseActivePointer(){let e=this.activePointerId;this.activePointerId=null,!(e==null||typeof this.releasePointerCapture!=`function`)&&(typeof this.hasPointerCapture==`function`&&!this.hasPointerCapture(e)||this.releasePointerCapture(e))}};aq=oq,aq.styles=l`
|
|
4776
4776
|
:host {
|
|
4777
4777
|
flex-shrink: 0;
|
|
4778
4778
|
position: relative;
|
|
@@ -8322,7 +8322,7 @@ ${t.outputText}</pre
|
|
|
8322
8322
|
</div>
|
|
8323
8323
|
`:i}
|
|
8324
8324
|
</div>
|
|
8325
|
-
`}var SQ=!1;window.toggleProModeSwitch=()=>{var e;SQ=!SQ;let t=document.querySelector(`openclaw-app`);t==null||(e=t.requestUpdate)==null||e.call(t)};function CQ(){let e=typeof localStorage<`u`?localStorage.getItem(`jwt`):null;if(!e)return null;try{let t=e.split(`.`);if(t.length<2)return null;let n=t[1].replace(/-/g,`+`).replace(/_/g,`/`);for(;n.length%4;)n+=`=`;return JSON.parse(atob(n)).companyUuid||null}catch{return null}}function wQ(){let e=typeof localStorage<`u`?localStorage.getItem(`jwt`):null;if(!e)return null;try{let t=e.split(`.`);if(t.length<2)return null;let n=t[1].replace(/-/g,`+`).replace(/_/g,`/`);for(;n.length%4;)n+=`=`;return JSON.parse(atob(n)).userUuid||null}catch{return null}}var TQ=sq(()=>SW(()=>import(`./agents-VWd8R17e.js`),__vite__mapDeps([2,1,3,4,5,6])),pQ),EQ=sq(()=>SW(()=>import(`./channels-CFaY00i-.js`),__vite__mapDeps([7,1,5])),pQ),DQ=sq(()=>SW(()=>import(`./cron-BgkWQdD4.js`),__vite__mapDeps([8,1])),pQ),OQ=sq(()=>SW(()=>import(`./cron-task-list-BI0vwEbN.js`),__vite__mapDeps([9,1])),pQ),kQ=sq(()=>SW(()=>import(`./debug-ktScbDsU.js`),__vite__mapDeps([10,1])),pQ),AQ=sq(()=>SW(()=>import(`./instances-DqQQ9pjz.js`),__vite__mapDeps([11,1])),pQ),jQ=sq(()=>SW(()=>import(`./logs-COq7j13X.js`),__vite__mapDeps([12,1,4])),pQ),MQ=sq(()=>SW(()=>import(`./nodes-DUnqUD1a.js`),__vite__mapDeps([13,1,4])),pQ),NQ=sq(()=>SW(()=>import(`./sessions-CMPXW9x2.js`),__vite__mapDeps([14,1,4])),pQ),PQ=sq(()=>SW(()=>import(`./skills-K02WMIMn.js`),__vite__mapDeps([15,1,4,6])),pQ),FQ=sq(()=>SW(()=>import(`./skill-center-DyXm1Zam.js`),__vite__mapDeps([16,1])),pQ),IQ=sq(()=>SW(()=>import(`./filespace-BQjTE0C_.js`),__vite__mapDeps([17,1])),pQ),LQ=sq(()=>SW(()=>import(`./channels.cn-B7UxGaDR.js`),__vite__mapDeps([0,1])),pQ);function RQ(e,t){let n=Object.entries(e),r=Object.entries(t);return n.length===r.length&&n.every(([e,n])=>t[e]===n)}function zQ(e){return typeof e!=`number`||!Number.isFinite(e)?null:new Date(e).toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`})}function BQ(e){if(!(e!=null&&e.phases))return null;let t;for(let n of Object.values(e.phases))!n.enabled||typeof n.nextRunAtMs!=`number`||(t===void 0||n.nextRunAtMs<t)&&(t=n.nextRunAtMs);return zQ(t)}var VQ=null,HQ=`openclaw:control-ui:update-banner-dismissed:v1`,UQ=[`off`,`minimal`,`low`,`medium`,`high`],WQ=[`UTC`,`America/Los_Angeles`,`America/Denver`,`America/Chicago`,`America/New_York`,`Europe/London`,`Europe/Berlin`,`Asia/Tokyo`];function GQ(e){return/^https?:\/\//i.test(e.trim())}function KQ(e){return typeof e==`string`?e.trim():``}function qQ(e){let t=new Set,n=[];for(let r of e){let e=r.trim();if(!e)continue;let i=e.toLowerCase();t.has(i)||(t.add(i),n.push(e))}return n}function JQ(){try{var e;let t=(e=Le())==null?void 0:e.getItem(HQ);if(!t)return null;let n=JSON.parse(t);return!n||typeof n.latestVersion!=`string`?null:{latestVersion:n.latestVersion,channel:typeof n.channel==`string`?n.channel:null,dismissedAtMs:typeof n.dismissedAtMs==`number`?n.dismissedAtMs:Date.now()}}catch{return null}}function YQ(e){let t=JQ();if(!t)return!1;let n=e,r=n&&typeof n.latestVersion==`string`?n.latestVersion:null,i=n&&typeof n.channel==`string`?n.channel:null;return!!(r&&t.latestVersion===r&&t.channel===i)}function XQ(e){let t=e,n=t&&typeof t.latestVersion==`string`?t.latestVersion:null;if(!n)return;let r={latestVersion:n,channel:t&&typeof t.channel==`string`?t.channel:null,dismissedAtMs:Date.now()};try{var i;(i=Le())==null||i.setItem(HQ,JSON.stringify(r))}catch{}}var ZQ=[`channels`,`messages`,`broadcast`,`__notifications__`,`talk`,`audio`],QQ=[`__appearance__`,`ui`,`wizard`],$Q=[`commands`,`hooks`,`bindings`,`cron`,`approvals`,`plugins`],e$=[`gateway`,`web`,`browser`,`nodeHost`,`canvasHost`,`discovery`,`media`,`acp`,`mcp`],t$=[`agents`,`models`,`skills`,`tools`,`memory`,`session`],n$=new Set([...ZQ,...QQ,...$Q,...e$,...t$]);function r$(e,t){return e&&n$.has(e)?{activeSection:null,activeSubsection:null}:{activeSection:e,activeSubsection:t}}function i$(e,t,n){return e&&!n.includes(e)?{activeSection:null,activeSubsection:null}:{activeSection:e,activeSubsection:t}}function a$(e){var t,n;let r=((t=e.agentsList)==null?void 0:t.agents)??[],i=oa(e.sessionKey),a=(i==null?void 0:i.agentId)??((n=e.agentsList)==null?void 0:n.defaultId)??`main`,o=r.find(e=>e.id===a),s=o==null?void 0:o.identity,c=(s==null?void 0:s.avatarUrl)??(s==null?void 0:s.avatar);if(c&&Om(c))return c}function o$(e){if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e.ui;if(!t||typeof t!=`object`||Array.isArray(t))return null;let n=t.assistant;return!n||typeof n!=`object`||Array.isArray(n)?null:h(n.avatar)??null}function s$(e,t){let n=Gp(e??``),r=encodeURIComponent(t);return n?`${n}/avatar/${r}`:`/avatar/${r}`}var c$=[{id:`telegram`,label:`Telegram`},{id:`discord`,label:`Discord`},{id:`slack`,label:`Slack`},{id:`whatsapp`,label:`WhatsApp`},{id:`signal`,label:`Signal`},{id:`imessage`,label:`iMessage`}];function l$(e){let t=e.trim();return t?t.split(/[-_]+/).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `):`Unknown`}function u$(e){var t;let n=e.configForm??((t=e.configSnapshot)==null?void 0:t.config);if(!n||typeof n!=`object`)return[];let r=`channels`in n&&n.channels&&typeof n.channels==`object`?n.channels:{},i=Object.keys(r).filter(e=>e.trim().length>0),a=i.length>0?i.toSorted((e,t)=>e.localeCompare(t)):c$.map(({id:e})=>e),o=new Map(c$.map(({id:e,label:t})=>[e,t])),s=[];for(let e of a){let t=r[e],n=typeof t==`object`&&!!t&&Object.keys(t).length>0;s.push({id:e,label:o.get(e)??l$(e),connected:n,detail:n?`Configured`:void 0})}return s}function d$(e){var t;let n=e.configForm??((t=e.configSnapshot)==null?void 0:t.config);if(!n||typeof n!=`object`)return 0;let r=n.mcp;if(!r||typeof r!=`object`)return 0;let i=`servers`in r&&r.servers&&typeof r.servers==`object`?r.servers:{};return Object.keys(i).length}function f$(e){var t;let n=e.configForm??((t=e.configSnapshot)==null?void 0:t.config);if(!n||typeof n!=`object`)return{gatewayAuth:`unknown`,execPolicy:`unknown`,deviceAuth:!1};let r=n,i=`gateway`in r&&r.gateway&&typeof r.gateway==`object`?r.gateway:null,a=i&&`auth`in i&&i.auth&&typeof i.auth==`object`?i.auth:null,o=`unknown`;a&&(o=(typeof a.mode==`string`?a.mode.trim():``)||(a.password?`password`:a.token?`token`:a.trustedProxy?`trusted-proxy`:`none`));let s=r.agents,c=`allowlist`;if(s&&typeof s==`object`){let e=s.defaults;if(e&&typeof e==`object`){let t=e.exec;if(t&&typeof t==`object`){let e=t.security;typeof e==`string`&&(c=e)}}}let l=!0;if(i){let e=`controlUi`in i&&i.controlUi&&typeof i.controlUi==`object`?i.controlUi:null;(e==null?void 0:e.dangerouslyDisableDeviceAuth)===!0&&(l=!1)}return{gatewayAuth:o,execPolicy:c,deviceAuth:l}}function p$(e){var t;return(t=e.sessionsResult)==null||(t=t.sessions)==null?void 0:t.find(t=>t.key===e.sessionKey)}function m$(e,t){return JY({open:e.cronQuickCreateOpen,step:e.cronQuickCreateStep,draft:e.cronQuickCreateDraft??zY(),onDraftChange:n=>{e.cronQuickCreateDraft={...e.cronQuickCreateDraft??zY(),...n},t==null||t()},onStepChange:n=>{e.cronQuickCreateStep=n,t==null||t()},onCreate:()=>{let n=VY(e.cronQuickCreateDraft??zY());e.cronEditingJobId=null,e.cronForm={...eg,...n},t==null||t(),(async()=>{if(await A_(e),e.cronError||l_(e.cronFieldErrors)){t==null||t();return}e.cronQuickCreateOpen=!1,e.cronQuickCreateStep=`what`,e.cronQuickCreateDraft=null,t==null||t()})()},onCancel:()=>{e.cronQuickCreateOpen=!1,e.cronQuickCreateStep=`what`,e.cronQuickCreateDraft=null,t==null||t()}})}function h$(e){var t,n,r;return{storeSkills:e.storeSkills,storeSkillsLoading:e.storeSkillsLoading,storeItemLoading:e.storeItemLoading,installedSkillNames:new Set(((t=e.skillsReport)==null||(t=t.skills)==null?void 0:t.filter(e=>e.extra!==void 0).map(e=>e.name))??[]),customInstalledSkills:((n=e.skillsReport)==null||(n=n.skills)==null?void 0:n.filter(e=>e.extra===void 0&&(e.source===`openclaw-workspace`||e.source===`openclaw-extra`)))??[],storeSkillLabels:new Map((((r=e.skillsReport)==null?void 0:r.skills)??[]).filter(e=>e.storeExtra).map(e=>{var t;return[e.name.toLowerCase().replace(/-/g,`_`),((t=e.storeExtra)==null?void 0:t.title)??e.name]})),recommendedSkills:[]}}function g$(e,t){var n;let r=(((n=e.sessionsResult)==null?void 0:n.sessions)??[]).filter(e=>!zs(e.key)).map(e=>({key:e.key,label:e.label??e.displayName??e.subject??``}));return hX({open:e.cronTaskDialogOpen,mode:e.cronTaskDialogMode,form:e.cronForm,fieldErrors:e.cronFieldErrors,busy:e.cronBusy,canSubmit:!l_(e.cronFieldErrors),sessions:r,sessionQuery:e.cronTaskSessionQuery,onSessionQueryChange:n=>{e.cronTaskSessionQuery=n,t==null||t()},onFormChange:n=>{e.cronForm=s_({...e.cronForm,...n});let r=c_(e.cronForm),i=new Set([...Object.keys(e.cronFieldErrors),...Object.keys(n)]);e.cronFieldErrors=Object.fromEntries(Object.entries(r).filter(([e])=>i.has(e))),t==null||t()},onSubmit:()=>{(async()=>{if(!await O_(e)){t==null||t();return}await A_(e)&&(e.cronTaskDialogOpen=!1,e.skillDropdownOpen=!1),t==null||t()})()},onCancel:()=>{e.cronTaskDialogOpen=!1,e.skillDropdownOpen=!1,B_(e),t==null||t()},onOpenAdvanced:()=>{e.cronTaskDialogOpen=!1,e.cronFormCollapsed=!1,e.setTab(`cron`),t==null||t()},proMode:e.settings.proMode,skills:h$(e),skillDropdownOpen:e.skillDropdownOpen,onToggleSkillDropdown:n=>{e.skillDropdownOpen=n,n&&(!e.skillsReport&&!e.skillsLoading&&Zv(e,{}),!e.storeSkills&&!e.storeSkillsLoading&&LK(e,t??(()=>{}))),t==null||t()},onNavigateToSkillCenter:()=>{e.cronTaskDialogOpen=!1,e.skillDropdownOpen=!1,e.setTab(`skillcenter`),t==null||t()},onInstallAndUseSkill:n=>{xK(e,n,t).then(async r=>{if(!r.ok||!r.url||!e.client)return;e.storeItemLoading=n.name,t==null||t();try{await e.client.request(`skills.install`,{source:`url`,url:r.url,name:n.name,storeExtra:n,force:!0}),await Zv(e,{})}catch{}e.storeItemLoading=null;let i=e.cronForm.payloadText,a=i.startsWith(`/`)?i.slice(i.search(/\s/u)+1||i.length).trimStart():i;e.cronForm=s_({...e.cronForm,payloadText:`/${n.name} ${a}`,payloadKind:`agentTurn`}),e.skillDropdownOpen=!1,t==null||t()})}})}function _$(e,t,n){let r=[...t].sort((e,t)=>e.createdAtMs-t.createdAtMs);return{basePath:e.basePath??``,view:e.cronTasksView,loading:e.cronLoading,loaded:e.cronJobsLoaded,error:e.cronError,busy:e.cronBusy,jobs:r,jobsTotal:e.cronJobsTotal,jobsHasMore:e.cronJobsHasMore,jobsLoadingMore:e.cronJobsLoadingMore,openMenuJobId:e.cronTaskMenuJobId,runs:e.cronRuns,runsLoadingMore:e.cronRunsLoadingMore,runsHasMore:e.cronRunsHasMore,historyJobFilter:e.cronTaskHistoryJobFilter,historyDateFilter:e.cronTaskHistoryDateFilter,skills:h$(e),onViewChange:t=>{e.cronTasksView=t,t===`history`&&(I_(e,{cronRunsScope:`all`}),P_(e,null)),n==null||n()},onRefresh:()=>e.loadCron(),onNew:()=>{e.cronEditingJobId=null,e.cronForm={...eg,sessionTarget:`isolated`,deliveryMode:`none`},e.cronFieldErrors={},e.cronTaskSessionQuery=``,e.cronTaskDialogMode=`create`,e.cronTaskDialogOpen=!0,n==null||n()},onToggle:(t,n)=>j_(e,t,n),onRun:t=>M_(e,t,`force`),onEdit:t=>{L_(e,t),e.cronTaskSessionQuery=``,e.cronTaskDialogMode=`edit`,e.cronTaskDialogOpen=!0,n==null||n()},onAdvanced:t=>{L_(e,t),e.cronFormCollapsed=!1,e.setTab(`cron`)},onViewHistory:t=>{e.cronTasksView=`history`,e.cronTaskHistoryJobFilter=t.id,I_(e,{cronRunsScope:`job`}),P_(e,t.id)},onGoToSession:t=>{var r;let i=((r=t.resultSessionKey)==null?void 0:r.trim())||t.sessionKey;i&&(async()=>{if(!await k_(e,i)){n==null||n();return}RW(e,i),e.setTab(`chat`)})()},onRemove:t=>N_(e,t),deleteConfirmJobId:e.cronTaskDeleteConfirmJobId,onRequestRemove:t=>{e.cronTaskDeleteConfirmJobId=t.id,n==null||n()},onCancelRemove:()=>{e.cronTaskDeleteConfirmJobId=null,n==null||n()},onOpenMenu:t=>{e.cronTaskMenuJobId=t,n==null||n(),t&&document.addEventListener(`click`,()=>{e.cronTaskMenuJobId!==null&&(e.cronTaskMenuJobId=null,n==null||n())},{once:!0})},onLoadMoreJobs:()=>p_(e,{append:!0}),onLoadMoreRuns:()=>F_(e),onHistoryJobFilterChange:t=>{e.cronTaskHistoryJobFilter=t,t?(I_(e,{cronRunsScope:`job`}),P_(e,t)):(I_(e,{cronRunsScope:`all`}),P_(e,null))},onHistoryDateFilterChange:t=>{e.cronTaskHistoryDateFilter=t,n==null||n()},onNavigateToChat:(t,r)=>{(async()=>{if(!await k_(e,t)){n==null||n();return}RW(e,t),e.setTab(`chat`),e.pendingChatScrollMessageId=(r==null?void 0:r.trim())||null})()},proMode:e.settings.proMode}}function v$(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function y$(e){let t=e.lastIndexOf(`.`),n=t>=0?e.slice(t+1).toLowerCase():``;return[`png`,`jpg`,`jpeg`,`gif`,`webp`,`svg`,`ico`,`bmp`].includes(n)?{iconClass:`file-tree-panel__item-icon--image`,icon:U.image,ext:n}:[`ts`,`tsx`,`js`,`jsx`,`py`,`rs`,`go`,`sh`,`json`,`yaml`,`yml`,`toml`].includes(n)?{iconClass:`file-tree-panel__item-icon--code`,icon:U.fileCode,ext:n}:[`md`,`txt`,`pdf`,`docx`,`csv`].includes(n)?{iconClass:`file-tree-panel__item-icon--doc`,icon:U.fileText,ext:n}:{iconClass:`file-tree-panel__item-icon--default`,icon:U.fileText,ext:n}}function b$(e){var t;let n=new Map;for(let r of((t=e.sessionsResult)==null?void 0:t.sessions)??[])r.sessionId&&n.set(r.sessionId,r.displayName??r.label??r.key);return n}function x$(t,n,r,a,o,s){let c=o*16;return a.map(a=>{if(a.isDir){let l=t.fileTreeExpandedDirs.includes(a.path),u=t.fileTreeDirLoading.includes(a.path),d=t.fileTreeDirChildren[a.path];return e`
|
|
8325
|
+
`}var SQ=!1;window.toggleProModeSwitch=()=>{var e;SQ=!SQ;let t=document.querySelector(`openclaw-app`);t==null||(e=t.requestUpdate)==null||e.call(t)};function CQ(){let e=typeof localStorage<`u`?localStorage.getItem(`jwt`):null;if(!e)return null;try{let t=e.split(`.`);if(t.length<2)return null;let n=t[1].replace(/-/g,`+`).replace(/_/g,`/`);for(;n.length%4;)n+=`=`;return JSON.parse(atob(n)).companyUuid||null}catch{return null}}function wQ(){let e=typeof localStorage<`u`?localStorage.getItem(`jwt`):null;if(!e)return null;try{let t=e.split(`.`);if(t.length<2)return null;let n=t[1].replace(/-/g,`+`).replace(/_/g,`/`);for(;n.length%4;)n+=`=`;return JSON.parse(atob(n)).userUuid||null}catch{return null}}var TQ=sq(()=>SW(()=>import(`./agents-CAmTjL2H.js`),__vite__mapDeps([2,1,3,4,5,6])),pQ),EQ=sq(()=>SW(()=>import(`./channels-1cjrTMwB.js`),__vite__mapDeps([7,1,5])),pQ),DQ=sq(()=>SW(()=>import(`./cron-BtOWAQd-.js`),__vite__mapDeps([8,1])),pQ),OQ=sq(()=>SW(()=>import(`./cron-task-list-47yZC4F_.js`),__vite__mapDeps([9,1])),pQ),kQ=sq(()=>SW(()=>import(`./debug-BkVmAx6w.js`),__vite__mapDeps([10,1])),pQ),AQ=sq(()=>SW(()=>import(`./instances-6i8ma6iW.js`),__vite__mapDeps([11,1])),pQ),jQ=sq(()=>SW(()=>import(`./logs-COq7j13X.js`),__vite__mapDeps([12,1,4])),pQ),MQ=sq(()=>SW(()=>import(`./nodes-Du49WHjP.js`),__vite__mapDeps([13,1,4])),pQ),NQ=sq(()=>SW(()=>import(`./sessions-BmEME1Ct.js`),__vite__mapDeps([14,1,4])),pQ),PQ=sq(()=>SW(()=>import(`./skills-B_7WeHCK.js`),__vite__mapDeps([15,1,4,6])),pQ),FQ=sq(()=>SW(()=>import(`./skill-center-DNcOO6Ju.js`),__vite__mapDeps([16,1])),pQ),IQ=sq(()=>SW(()=>import(`./filespace-BCO0sWG5.js`),__vite__mapDeps([17,1])),pQ),LQ=sq(()=>SW(()=>import(`./channels.cn-C_H6e9d6.js`),__vite__mapDeps([0,1])),pQ);function RQ(e,t){let n=Object.entries(e),r=Object.entries(t);return n.length===r.length&&n.every(([e,n])=>t[e]===n)}function zQ(e){return typeof e!=`number`||!Number.isFinite(e)?null:new Date(e).toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`})}function BQ(e){if(!(e!=null&&e.phases))return null;let t;for(let n of Object.values(e.phases))!n.enabled||typeof n.nextRunAtMs!=`number`||(t===void 0||n.nextRunAtMs<t)&&(t=n.nextRunAtMs);return zQ(t)}var VQ=null,HQ=`openclaw:control-ui:update-banner-dismissed:v1`,UQ=[`off`,`minimal`,`low`,`medium`,`high`],WQ=[`UTC`,`America/Los_Angeles`,`America/Denver`,`America/Chicago`,`America/New_York`,`Europe/London`,`Europe/Berlin`,`Asia/Tokyo`];function GQ(e){return/^https?:\/\//i.test(e.trim())}function KQ(e){return typeof e==`string`?e.trim():``}function qQ(e){let t=new Set,n=[];for(let r of e){let e=r.trim();if(!e)continue;let i=e.toLowerCase();t.has(i)||(t.add(i),n.push(e))}return n}function JQ(){try{var e;let t=(e=Le())==null?void 0:e.getItem(HQ);if(!t)return null;let n=JSON.parse(t);return!n||typeof n.latestVersion!=`string`?null:{latestVersion:n.latestVersion,channel:typeof n.channel==`string`?n.channel:null,dismissedAtMs:typeof n.dismissedAtMs==`number`?n.dismissedAtMs:Date.now()}}catch{return null}}function YQ(e){let t=JQ();if(!t)return!1;let n=e,r=n&&typeof n.latestVersion==`string`?n.latestVersion:null,i=n&&typeof n.channel==`string`?n.channel:null;return!!(r&&t.latestVersion===r&&t.channel===i)}function XQ(e){let t=e,n=t&&typeof t.latestVersion==`string`?t.latestVersion:null;if(!n)return;let r={latestVersion:n,channel:t&&typeof t.channel==`string`?t.channel:null,dismissedAtMs:Date.now()};try{var i;(i=Le())==null||i.setItem(HQ,JSON.stringify(r))}catch{}}var ZQ=[`channels`,`messages`,`broadcast`,`__notifications__`,`talk`,`audio`],QQ=[`__appearance__`,`ui`,`wizard`],$Q=[`commands`,`hooks`,`bindings`,`cron`,`approvals`,`plugins`],e$=[`gateway`,`web`,`browser`,`nodeHost`,`canvasHost`,`discovery`,`media`,`acp`,`mcp`],t$=[`agents`,`models`,`skills`,`tools`,`memory`,`session`],n$=new Set([...ZQ,...QQ,...$Q,...e$,...t$]);function r$(e,t){return e&&n$.has(e)?{activeSection:null,activeSubsection:null}:{activeSection:e,activeSubsection:t}}function i$(e,t,n){return e&&!n.includes(e)?{activeSection:null,activeSubsection:null}:{activeSection:e,activeSubsection:t}}function a$(e){var t,n;let r=((t=e.agentsList)==null?void 0:t.agents)??[],i=oa(e.sessionKey),a=(i==null?void 0:i.agentId)??((n=e.agentsList)==null?void 0:n.defaultId)??`main`,o=r.find(e=>e.id===a),s=o==null?void 0:o.identity,c=(s==null?void 0:s.avatarUrl)??(s==null?void 0:s.avatar);if(c&&Om(c))return c}function o$(e){if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e.ui;if(!t||typeof t!=`object`||Array.isArray(t))return null;let n=t.assistant;return!n||typeof n!=`object`||Array.isArray(n)?null:h(n.avatar)??null}function s$(e,t){let n=Gp(e??``),r=encodeURIComponent(t);return n?`${n}/avatar/${r}`:`/avatar/${r}`}var c$=[{id:`telegram`,label:`Telegram`},{id:`discord`,label:`Discord`},{id:`slack`,label:`Slack`},{id:`whatsapp`,label:`WhatsApp`},{id:`signal`,label:`Signal`},{id:`imessage`,label:`iMessage`}];function l$(e){let t=e.trim();return t?t.split(/[-_]+/).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `):`Unknown`}function u$(e){var t;let n=e.configForm??((t=e.configSnapshot)==null?void 0:t.config);if(!n||typeof n!=`object`)return[];let r=`channels`in n&&n.channels&&typeof n.channels==`object`?n.channels:{},i=Object.keys(r).filter(e=>e.trim().length>0),a=i.length>0?i.toSorted((e,t)=>e.localeCompare(t)):c$.map(({id:e})=>e),o=new Map(c$.map(({id:e,label:t})=>[e,t])),s=[];for(let e of a){let t=r[e],n=typeof t==`object`&&!!t&&Object.keys(t).length>0;s.push({id:e,label:o.get(e)??l$(e),connected:n,detail:n?`Configured`:void 0})}return s}function d$(e){var t;let n=e.configForm??((t=e.configSnapshot)==null?void 0:t.config);if(!n||typeof n!=`object`)return 0;let r=n.mcp;if(!r||typeof r!=`object`)return 0;let i=`servers`in r&&r.servers&&typeof r.servers==`object`?r.servers:{};return Object.keys(i).length}function f$(e){var t;let n=e.configForm??((t=e.configSnapshot)==null?void 0:t.config);if(!n||typeof n!=`object`)return{gatewayAuth:`unknown`,execPolicy:`unknown`,deviceAuth:!1};let r=n,i=`gateway`in r&&r.gateway&&typeof r.gateway==`object`?r.gateway:null,a=i&&`auth`in i&&i.auth&&typeof i.auth==`object`?i.auth:null,o=`unknown`;a&&(o=(typeof a.mode==`string`?a.mode.trim():``)||(a.password?`password`:a.token?`token`:a.trustedProxy?`trusted-proxy`:`none`));let s=r.agents,c=`allowlist`;if(s&&typeof s==`object`){let e=s.defaults;if(e&&typeof e==`object`){let t=e.exec;if(t&&typeof t==`object`){let e=t.security;typeof e==`string`&&(c=e)}}}let l=!0;if(i){let e=`controlUi`in i&&i.controlUi&&typeof i.controlUi==`object`?i.controlUi:null;(e==null?void 0:e.dangerouslyDisableDeviceAuth)===!0&&(l=!1)}return{gatewayAuth:o,execPolicy:c,deviceAuth:l}}function p$(e){var t;return(t=e.sessionsResult)==null||(t=t.sessions)==null?void 0:t.find(t=>t.key===e.sessionKey)}function m$(e,t){return JY({open:e.cronQuickCreateOpen,step:e.cronQuickCreateStep,draft:e.cronQuickCreateDraft??zY(),onDraftChange:n=>{e.cronQuickCreateDraft={...e.cronQuickCreateDraft??zY(),...n},t==null||t()},onStepChange:n=>{e.cronQuickCreateStep=n,t==null||t()},onCreate:()=>{let n=VY(e.cronQuickCreateDraft??zY());e.cronEditingJobId=null,e.cronForm={...eg,...n},t==null||t(),(async()=>{if(await A_(e),e.cronError||l_(e.cronFieldErrors)){t==null||t();return}e.cronQuickCreateOpen=!1,e.cronQuickCreateStep=`what`,e.cronQuickCreateDraft=null,t==null||t()})()},onCancel:()=>{e.cronQuickCreateOpen=!1,e.cronQuickCreateStep=`what`,e.cronQuickCreateDraft=null,t==null||t()}})}function h$(e){var t,n,r;return{storeSkills:e.storeSkills,storeSkillsLoading:e.storeSkillsLoading,storeItemLoading:e.storeItemLoading,installedSkillNames:new Set(((t=e.skillsReport)==null||(t=t.skills)==null?void 0:t.filter(e=>e.extra!==void 0).map(e=>e.name))??[]),customInstalledSkills:((n=e.skillsReport)==null||(n=n.skills)==null?void 0:n.filter(e=>e.extra===void 0&&(e.source===`openclaw-workspace`||e.source===`openclaw-extra`)))??[],storeSkillLabels:new Map((((r=e.skillsReport)==null?void 0:r.skills)??[]).filter(e=>e.storeExtra).map(e=>{var t;return[e.name.toLowerCase().replace(/-/g,`_`),((t=e.storeExtra)==null?void 0:t.title)??e.name]})),recommendedSkills:[]}}function g$(e,t){var n;let r=(((n=e.sessionsResult)==null?void 0:n.sessions)??[]).filter(e=>!zs(e.key)).map(e=>({key:e.key,label:e.label??e.displayName??e.subject??``}));return hX({open:e.cronTaskDialogOpen,mode:e.cronTaskDialogMode,form:e.cronForm,fieldErrors:e.cronFieldErrors,busy:e.cronBusy,canSubmit:!l_(e.cronFieldErrors),sessions:r,sessionQuery:e.cronTaskSessionQuery,onSessionQueryChange:n=>{e.cronTaskSessionQuery=n,t==null||t()},onFormChange:n=>{e.cronForm=s_({...e.cronForm,...n});let r=c_(e.cronForm),i=new Set([...Object.keys(e.cronFieldErrors),...Object.keys(n)]);e.cronFieldErrors=Object.fromEntries(Object.entries(r).filter(([e])=>i.has(e))),t==null||t()},onSubmit:()=>{(async()=>{if(!await O_(e)){t==null||t();return}await A_(e)&&(e.cronTaskDialogOpen=!1,e.skillDropdownOpen=!1),t==null||t()})()},onCancel:()=>{e.cronTaskDialogOpen=!1,e.skillDropdownOpen=!1,B_(e),t==null||t()},onOpenAdvanced:()=>{e.cronTaskDialogOpen=!1,e.cronFormCollapsed=!1,e.setTab(`cron`),t==null||t()},proMode:e.settings.proMode,skills:h$(e),skillDropdownOpen:e.skillDropdownOpen,onToggleSkillDropdown:n=>{e.skillDropdownOpen=n,n&&(!e.skillsReport&&!e.skillsLoading&&Zv(e,{}),!e.storeSkills&&!e.storeSkillsLoading&&LK(e,t??(()=>{}))),t==null||t()},onNavigateToSkillCenter:()=>{e.cronTaskDialogOpen=!1,e.skillDropdownOpen=!1,e.setTab(`skillcenter`),t==null||t()},onInstallAndUseSkill:n=>{xK(e,n,t).then(async r=>{if(!r.ok||!r.url||!e.client)return;e.storeItemLoading=n.name,t==null||t();try{await e.client.request(`skills.install`,{source:`url`,url:r.url,name:n.name,storeExtra:n,force:!0}),await Zv(e,{})}catch{}e.storeItemLoading=null;let i=e.cronForm.payloadText,a=i.startsWith(`/`)?i.slice(i.search(/\s/u)+1||i.length).trimStart():i;e.cronForm=s_({...e.cronForm,payloadText:`/${n.name} ${a}`,payloadKind:`agentTurn`}),e.skillDropdownOpen=!1,t==null||t()})}})}function _$(e,t,n){let r=[...t].sort((e,t)=>e.createdAtMs-t.createdAtMs);return{basePath:e.basePath??``,view:e.cronTasksView,loading:e.cronLoading,loaded:e.cronJobsLoaded,error:e.cronError,busy:e.cronBusy,jobs:r,jobsTotal:e.cronJobsTotal,jobsHasMore:e.cronJobsHasMore,jobsLoadingMore:e.cronJobsLoadingMore,openMenuJobId:e.cronTaskMenuJobId,runs:e.cronRuns,runsLoadingMore:e.cronRunsLoadingMore,runsHasMore:e.cronRunsHasMore,historyJobFilter:e.cronTaskHistoryJobFilter,historyDateFilter:e.cronTaskHistoryDateFilter,skills:h$(e),onViewChange:t=>{e.cronTasksView=t,t===`history`&&(I_(e,{cronRunsScope:`all`}),P_(e,null)),n==null||n()},onRefresh:()=>e.loadCron(),onNew:()=>{e.cronEditingJobId=null,e.cronForm={...eg,sessionTarget:`isolated`,deliveryMode:`none`},e.cronFieldErrors={},e.cronTaskSessionQuery=``,e.cronTaskDialogMode=`create`,e.cronTaskDialogOpen=!0,n==null||n()},onToggle:(t,n)=>j_(e,t,n),onRun:t=>M_(e,t,`force`),onEdit:t=>{L_(e,t),e.cronTaskSessionQuery=``,e.cronTaskDialogMode=`edit`,e.cronTaskDialogOpen=!0,n==null||n()},onAdvanced:t=>{L_(e,t),e.cronFormCollapsed=!1,e.setTab(`cron`)},onViewHistory:t=>{e.cronTasksView=`history`,e.cronTaskHistoryJobFilter=t.id,I_(e,{cronRunsScope:`job`}),P_(e,t.id)},onGoToSession:t=>{var r;let i=((r=t.resultSessionKey)==null?void 0:r.trim())||t.sessionKey;i&&(async()=>{if(!await k_(e,i)){n==null||n();return}RW(e,i),e.setTab(`chat`)})()},onRemove:t=>N_(e,t),deleteConfirmJobId:e.cronTaskDeleteConfirmJobId,onRequestRemove:t=>{e.cronTaskDeleteConfirmJobId=t.id,n==null||n()},onCancelRemove:()=>{e.cronTaskDeleteConfirmJobId=null,n==null||n()},onOpenMenu:t=>{e.cronTaskMenuJobId=t,n==null||n(),t&&document.addEventListener(`click`,()=>{e.cronTaskMenuJobId!==null&&(e.cronTaskMenuJobId=null,n==null||n())},{once:!0})},onLoadMoreJobs:()=>p_(e,{append:!0}),onLoadMoreRuns:()=>F_(e),onHistoryJobFilterChange:t=>{e.cronTaskHistoryJobFilter=t,t?(I_(e,{cronRunsScope:`job`}),P_(e,t)):(I_(e,{cronRunsScope:`all`}),P_(e,null))},onHistoryDateFilterChange:t=>{e.cronTaskHistoryDateFilter=t,n==null||n()},onNavigateToChat:(t,r)=>{(async()=>{if(!await k_(e,t)){n==null||n();return}RW(e,t),e.setTab(`chat`),e.pendingChatScrollMessageId=(r==null?void 0:r.trim())||null})()},proMode:e.settings.proMode}}function v$(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function y$(e){let t=e.lastIndexOf(`.`),n=t>=0?e.slice(t+1).toLowerCase():``;return[`png`,`jpg`,`jpeg`,`gif`,`webp`,`svg`,`ico`,`bmp`].includes(n)?{iconClass:`file-tree-panel__item-icon--image`,icon:U.image,ext:n}:[`ts`,`tsx`,`js`,`jsx`,`py`,`rs`,`go`,`sh`,`json`,`yaml`,`yml`,`toml`].includes(n)?{iconClass:`file-tree-panel__item-icon--code`,icon:U.fileCode,ext:n}:[`md`,`txt`,`pdf`,`docx`,`csv`].includes(n)?{iconClass:`file-tree-panel__item-icon--doc`,icon:U.fileText,ext:n}:{iconClass:`file-tree-panel__item-icon--default`,icon:U.fileText,ext:n}}function b$(e){var t;let n=new Map;for(let r of((t=e.sessionsResult)==null?void 0:t.sessions)??[])r.sessionId&&n.set(r.sessionId,r.displayName??r.label??r.key);return n}function x$(t,n,r,a,o,s){let c=o*16;return a.map(a=>{if(a.isDir){let l=t.fileTreeExpandedDirs.includes(a.path),u=t.fileTreeDirLoading.includes(a.path),d=t.fileTreeDirChildren[a.path];return e`
|
|
8326
8326
|
<li
|
|
8327
8327
|
class="file-tree-panel__item file-tree-panel__item--dir"
|
|
8328
8328
|
style="padding-left: ${10+c}px"
|
|
@@ -8809,5 +8809,5 @@ ${t.outputText}</pre
|
|
|
8809
8809
|
|
|
8810
8810
|
`).trim()}function G$(e){return new Promise((t,n)=>{var r,i;if((r=e.signal)!=null&&r.aborted){n(new DOMException(`OpenClaw tool call aborted`,`AbortError`));return}let a=window.setTimeout(()=>{c(),n(Error(`OpenClaw tool call timed out`))},e.timeoutMs),o=()=>{c(),n(new DOMException(`OpenClaw tool call aborted`,`AbortError`))};(i=e.signal)==null||i.addEventListener(`abort`,o,{once:!0});let s=()=>void 0;s=e.client.addEventListener(r=>{if(r.event!==`chat`)return;let i=r.payload;!i||i.runId!==e.runId||(i.state===`final`?(c(),t(W$(i.message)||`OpenClaw finished with no text.`)):i.state===`aborted`?(c(),n(new DOMException(i.errorMessage??`OpenClaw tool call aborted`,`AbortError`))):i.state===`error`&&(c(),n(Error(i.errorMessage??`OpenClaw tool call failed`))))});function c(){var t;window.clearTimeout(a),(t=e.signal)==null||t.removeEventListener(`abort`,o),s()}})}async function K$(e){var t,n,r,i;let{ctx:a,callId:o,submit:s}=e;(t=(n=a.callbacks).onStatus)==null||t.call(n,`thinking`);let c,l=!1,u=()=>{l=!0,c&&a.client.request(`chat.abort`,{sessionKey:a.sessionKey,runId:c})};if(!((r=e.signal)!=null&&r.aborted)){(i=e.signal)==null||i.addEventListener(`abort`,u,{once:!0});try{var d;let t=typeof e.args==`string`?JSON.parse(e.args||`{}`):e.args??{},n=await a.client.request(`talk.client.toolCall`,{sessionKey:a.sessionKey,callId:o,name:B$,args:t,...e.relaySessionId?{relaySessionId:e.relaySessionId}:{}});if(c=n.runId??n.idempotencyKey,!c)throw Error(`OpenClaw realtime tool call did not return a run id`);if((d=e.signal)!=null&&d.aborted){u();return}s(o,{result:await G$({client:a.client,runId:c,timeoutMs:12e4,signal:e.signal})})}catch(t){var f;if(l||(f=e.signal)!=null&&f.aborted||q$(t))return;s(o,{error:t instanceof Error?t.message:String(t)})}finally{var p,m;if((p=e.signal)==null||p.removeEventListener(`abort`,u),!l&&!((m=e.signal)!=null&&m.aborted)){var h,g;(h=(g=a.callbacks).onStatus)==null||h.call(g,`listening`)}}}}function q$(e){return typeof DOMException<`u`&&e instanceof DOMException&&e.name===`AbortError`}var J$=.02,Y$=.08,X$=2,Z$=class{constructor(e,t){this.session=e,this.ctx=t,this.media=null,this.inputContext=null,this.outputContext=null,this.inputSource=null,this.inputProcessor=null,this.unsubscribe=null,this.playhead=0,this.closed=!1,this.sources=new Set,this.consultAbortControllers=new Set,this.cancelRequestedForPlayback=!1,this.speechFramesDuringPlayback=0}async start(){var e;if(!((e=navigator.mediaDevices)!=null&&e.getUserMedia))throw Error(`Realtime Talk requires browser microphone access`);if(this.session.audio.inputEncoding!==`pcm16`||this.session.audio.outputEncoding!==`pcm16`)throw Error(`Gateway-relay realtime Talk currently requires PCM16 audio`);this.closed=!1,this.unsubscribe=this.ctx.client.addEventListener(e=>{e.event===`talk.event`&&this.handleRelayEvent(e.payload)}),this.media=await navigator.mediaDevices.getUserMedia({audio:{autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0}}),this.inputContext=new AudioContext({sampleRate:this.session.audio.inputSampleRateHz}),this.outputContext=new AudioContext({sampleRate:this.session.audio.outputSampleRateHz}),this.startMicrophonePump()}stop(){var e,t,n,r,i,a;this.closed=!0,(e=this.unsubscribe)==null||e.call(this),this.unsubscribe=null,(t=this.inputProcessor)==null||t.disconnect(),this.inputProcessor=null,(n=this.inputSource)==null||n.disconnect(),this.inputSource=null,this.abortConsults(),(r=this.media)==null||r.getTracks().forEach(e=>e.stop()),this.media=null,this.stopOutput(),(i=this.inputContext)==null||i.close(),this.inputContext=null,(a=this.outputContext)==null||a.close(),this.outputContext=null,this.ctx.client.request(`talk.session.close`,{sessionId:this.session.relaySessionId})}startMicrophonePump(){!this.media||!this.inputContext||(this.inputSource=this.inputContext.createMediaStreamSource(this.media),this.inputProcessor=this.inputContext.createScriptProcessor(4096,1,1),this.inputProcessor.onaudioprocess=e=>{var t;if(this.closed)return;let n=e.inputBuffer.getChannelData(0),r=R$(n);this.detectBargeInSpeech(n)&&this.cancelOutputForBargeIn(),this.ctx.client.request(`talk.session.appendAudio`,{sessionId:this.session.relaySessionId,audioBase64:I$(r),timestamp:Math.round((((t=this.inputContext)==null?void 0:t.currentTime)??0)*1e3)})},this.inputSource.connect(this.inputProcessor),this.inputProcessor.connect(this.inputContext.destination))}handleRelayEvent(e){if(!(e.relaySessionId!==this.session.relaySessionId||this.closed)){if(e.talkEvent){var t,n;(t=(n=this.ctx.callbacks).onTalkEvent)==null||t.call(n,e.talkEvent)}switch(e.type){case`ready`:var r,i;(r=(i=this.ctx.callbacks).onStatus)==null||r.call(i,`listening`);return;case`audio`:e.audioBase64&&(this.cancelRequestedForPlayback=!1,this.speechFramesDuringPlayback=0,this.playPcm16(e.audioBase64));return;case`clear`:this.stopOutput();return;case`mark`:this.scheduleMarkAck();return;case`transcript`:if(e.role&&e.text){var a,o;(a=(o=this.ctx.callbacks).onTranscript)==null||a.call(o,{role:e.role,text:e.text,final:e.final??!1})}return;case`toolCall`:this.handleToolCall(e);return;case`error`:var s,c;(s=(c=this.ctx.callbacks).onStatus)==null||s.call(c,`error`,e.message??`Realtime relay failed`);return;case`close`:if(this.abortConsults(),!this.closed){var l,u;(l=(u=this.ctx.callbacks).onStatus)==null||l.call(u,e.reason===`error`?`error`:`idle`,e.reason===`error`?`Realtime relay closed`:void 0)}return;default:return}}}playPcm16(e){if(!this.outputContext)return;let t=z$(L$(e));if(t.length===0)return;let n=this.outputContext.createBuffer(1,t.length,this.session.audio.outputSampleRateHz);n.getChannelData(0).set(t);let r=this.outputContext.createBufferSource();this.sources.add(r),r.addEventListener(`ended`,()=>this.sources.delete(r)),r.buffer=n,r.connect(this.outputContext.destination);let i=Math.max(this.outputContext.currentTime,this.playhead);r.start(i),this.playhead=i+n.duration}stopOutput(){var e;for(let e of this.sources)try{e.stop()}catch{}this.sources.clear(),this.playhead=((e=this.outputContext)==null?void 0:e.currentTime)??0,this.speechFramesDuringPlayback=0}scheduleMarkAck(){var e,t;let n=Math.max(0,Math.ceil(((this.playhead||((e=this.outputContext)==null?void 0:e.currentTime)||0)-(((t=this.outputContext)==null?void 0:t.currentTime)??0))*1e3));window.setTimeout(()=>{this.closed},n)}async handleToolCall(e){var t,n;let r=(t=e.callId)==null?void 0:t.trim(),i=(n=e.name)==null?void 0:n.trim();if(!r||!i)return;if(i!==`openclaw_agent_consult`){this.submitToolResult(r,{error:`Tool "${i}" not available in browser Talk`});return}let a=new AbortController;this.consultAbortControllers.add(a);try{await K$({ctx:this.ctx,callId:r,args:e.args??{},relaySessionId:this.session.relaySessionId,signal:a.signal,submit:(e,t)=>this.submitToolResult(e,t)})}finally{this.consultAbortControllers.delete(a)}}submitToolResult(e,t){this.ctx.client.request(`talk.session.submitToolResult`,{sessionId:this.session.relaySessionId,callId:e,result:t})}cancelOutputForBargeIn(){this.sources.size===0||this.cancelRequestedForPlayback||(this.cancelRequestedForPlayback=!0,this.stopOutput(),this.ctx.client.request(`talk.session.cancelOutput`,{sessionId:this.session.relaySessionId,reason:`barge-in`}))}abortConsults(){for(let e of this.consultAbortControllers)e.abort();this.consultAbortControllers.clear()}detectBargeInSpeech(e){if(this.sources.size===0||this.cancelRequestedForPlayback||e.length===0)return this.speechFramesDuringPlayback=0,!1;let t=0,n=0;for(let r of e)n=Math.max(n,Math.abs(r)),t+=r*r;return Math.sqrt(t/e.length)>=J$&&n>=Y$?this.speechFramesDuringPlayback+=1:this.speechFramesDuringPlayback=0,this.speechFramesDuringPlayback>=X$}},Q$=`generativelanguage.googleapis.com`,$$=/^\/ws\/google\.ai\.generativelanguage\.v[0-9a-z]+\.GenerativeService\.BidiGenerateContent(?:Constrained)?$/;function e1(e){let t;try{t=new URL(e.websocketUrl)}catch{throw Error(`Invalid Google Live WebSocket URL`)}if(t.protocol!==`wss:`)throw Error(`Google Live WebSocket URL must use wss://`);if(t.hostname.toLowerCase()!==Q$)throw Error(`Untrusted Google Live WebSocket host`);if(t.username||t.password)throw Error(`Google Live WebSocket URL must not include credentials`);if(!$$.test(t.pathname))throw Error(`Untrusted Google Live WebSocket path`);return t.search=``,t.searchParams.set(`access_token`,e.clientSecret),t.toString()}var t1=class{constructor(e,t){this.session=e,this.ctx=t,this.ws=null,this.media=null,this.inputContext=null,this.outputContext=null,this.inputSource=null,this.inputProcessor=null,this.playhead=0,this.closed=!1,this.pendingCalls=new Map,this.consultAbortControllers=new Set,this.sources=new Set,this.emitTalkEvent=V$(t,e)}async start(){var e;if(!((e=navigator.mediaDevices)!=null&&e.getUserMedia)||typeof WebSocket>`u`)throw Error(`Realtime Talk requires browser WebSocket and microphone access`);if(this.session.protocol!==`google-live-bidi`)throw Error(`Unsupported realtime WebSocket protocol: ${this.session.protocol}`);let t=e1(this.session);this.closed=!1,this.media=await navigator.mediaDevices.getUserMedia({audio:!0}),this.inputContext=new AudioContext({sampleRate:this.session.audio.inputSampleRateHz}),this.outputContext=new AudioContext({sampleRate:this.session.audio.outputSampleRateHz}),this.ws=new WebSocket(t),this.ws.binaryType=`arraybuffer`,this.ws.addEventListener(`open`,()=>{this.closed||(this.send(this.session.initialMessage??{setup:{}}),this.startMicrophonePump())}),this.ws.addEventListener(`message`,e=>{this.handleMessage(e.data)}),this.ws.addEventListener(`close`,()=>{if(!this.closed){var e,t;(e=(t=this.ctx.callbacks).onStatus)==null||e.call(t,`error`,`Realtime connection closed`)}}),this.ws.addEventListener(`error`,()=>{if(!this.closed){var e,t;(e=(t=this.ctx.callbacks).onStatus)==null||e.call(t,`error`,`Realtime connection failed`)}})}stop(){var e,t,n,r,i,a;this.closed||this.emitTalkEvent({type:`session.closed`,final:!0}),this.closed=!0;for(let e of this.consultAbortControllers)e.abort();this.consultAbortControllers.clear(),this.pendingCalls.clear(),(e=this.inputProcessor)==null||e.disconnect(),this.inputProcessor=null,(t=this.inputSource)==null||t.disconnect(),this.inputSource=null,(n=this.media)==null||n.getTracks().forEach(e=>e.stop()),this.media=null,this.stopOutput(),(r=this.inputContext)==null||r.close(),this.inputContext=null,(i=this.outputContext)==null||i.close(),this.outputContext=null,(a=this.ws)==null||a.close(),this.ws=null}startMicrophonePump(){this.closed||!this.media||!this.inputContext||(this.inputSource=this.inputContext.createMediaStreamSource(this.media),this.inputProcessor=this.inputContext.createScriptProcessor(4096,1,1),this.inputProcessor.onaudioprocess=e=>{var t,n;if(((t=this.ws)==null?void 0:t.readyState)!==WebSocket.OPEN)return;let r=R$(e.inputBuffer.getChannelData(0));this.send({realtimeInput:{audio:{data:I$(r),mimeType:`audio/pcm;rate=${((n=this.inputContext)==null?void 0:n.sampleRate)??16e3}`}}})},this.inputSource.connect(this.inputProcessor),this.inputProcessor.connect(this.inputContext.destination))}send(e){var t;!this.closed&&((t=this.ws)==null?void 0:t.readyState)===WebSocket.OPEN&&this.ws.send(JSON.stringify(e))}async handleMessage(e){var t,n,r,i;if(this.closed)return;let a;try{a=JSON.parse(await n1(e))}catch{return}if(this.closed)return;if(a.setupComplete){var o,s;(o=(s=this.ctx.callbacks).onStatus)==null||o.call(s,`listening`),this.emitTalkEvent({type:`session.ready`})}let c=a.serverContent;if(c!=null&&c.interrupted&&(this.stopOutput(),this.emitTalkEvent({type:`turn.cancelled`,final:!0,payload:{reason:`provider-interrupted`}})),!(c==null||(t=c.inputTranscription)==null)&&t.text){var l,u;(l=(u=this.ctx.callbacks).onTranscript)==null||l.call(u,{role:`user`,text:c.inputTranscription.text,final:c.inputTranscription.finished??!1}),this.emitTalkEvent({type:c.inputTranscription.finished?`transcript.done`:`transcript.delta`,final:c.inputTranscription.finished??!1,payload:{role:`user`,text:c.inputTranscription.text}})}if(!(c==null||(n=c.outputTranscription)==null)&&n.text){var d,f;(d=(f=this.ctx.callbacks).onTranscript)==null||d.call(f,{role:`assistant`,text:c.outputTranscription.text,final:c.outputTranscription.finished??!1}),this.emitTalkEvent({type:c.outputTranscription.finished?`output.text.done`:`output.text.delta`,final:c.outputTranscription.finished??!1,payload:{text:c.outputTranscription.text}})}for(let e of(c==null||(r=c.modelTurn)==null?void 0:r.parts)??[]){var p;if((p=e.inlineData)!=null&&p.data)this.emitTalkEvent({type:`output.audio.delta`,payload:{byteLength:L$(e.inlineData.data).byteLength,mimeType:e.inlineData.mimeType}}),this.playPcm16(e.inlineData.data);else if(!e.thought&&typeof e.text==`string`&&e.text.trim()){var m,h;(m=(h=this.ctx.callbacks).onTranscript)==null||m.call(h,{role:`assistant`,text:e.text,final:(c==null?void 0:c.turnComplete)??!1}),this.emitTalkEvent({type:c!=null&&c.turnComplete?`output.text.done`:`output.text.delta`,final:(c==null?void 0:c.turnComplete)??!1,payload:{text:e.text}})}}c!=null&&c.turnComplete&&this.emitTalkEvent({type:`turn.ended`,final:!0});for(let e of((i=a.toolCall)==null?void 0:i.functionCalls)??[])this.handleToolCall(e)}playPcm16(e){if(!this.outputContext)return;let t=z$(L$(e));if(t.length===0)return;let n=this.outputContext.createBuffer(1,t.length,this.session.audio.outputSampleRateHz);n.getChannelData(0).set(t);let r=this.outputContext.createBufferSource();this.sources.add(r),r.addEventListener(`ended`,()=>this.sources.delete(r)),r.buffer=n,r.connect(this.outputContext.destination);let i=Math.max(this.outputContext.currentTime,this.playhead);r.start(i),this.playhead=i+n.duration}stopOutput(){var e;for(let e of this.sources)try{e.stop()}catch{}this.sources.clear(),this.playhead=((e=this.outputContext)==null?void 0:e.currentTime)??0}async handleToolCall(e){var t,n;let r=(t=e.name)==null?void 0:t.trim(),i=(n=e.id)==null?void 0:n.trim();if(!r||!i||(this.pendingCalls.set(i,{name:r,args:e.args??{}}),this.emitTalkEvent({type:`tool.call`,callId:i,payload:{name:r,args:e.args??{}}}),r!==`openclaw_agent_consult`))return;let a=new AbortController;this.consultAbortControllers.add(a);try{await K$({ctx:this.createActiveContext(),callId:i,args:e.args??{},signal:a.signal,submit:(e,t)=>this.submitToolResult(e,t)})}finally{this.consultAbortControllers.delete(a)}}createActiveContext(){return{...this.ctx,callbacks:{onStatus:(e,t)=>{if(!this.closed){var n,r;(n=(r=this.ctx.callbacks).onStatus)==null||n.call(r,e,t)}},onTranscript:e=>{if(!this.closed){var t,n;(t=(n=this.ctx.callbacks).onTranscript)==null||t.call(n,e)}}}}}submitToolResult(e,t){let n=this.pendingCalls.get(e);n&&(this.pendingCalls.delete(e),this.send({toolResponse:{functionResponses:[{id:e,name:n.name,scheduling:`WHEN_IDLE`,response:t&&typeof t==`object`&&!Array.isArray(t)?t:{output:t}}]}}))}};async function n1(e){return typeof e==`string`?e:(typeof Blob<`u`&&e instanceof Blob&&(e=await e.arrayBuffer()),r1(e)?new TextDecoder().decode(new Uint8Array(e)):ArrayBuffer.isView(e)?new TextDecoder().decode(new Uint8Array(e.buffer,e.byteOffset,e.byteLength)):String(e))}function r1(e){return e instanceof ArrayBuffer||Object.prototype.toString.call(e)===`[object ArrayBuffer]`}var i1=class{constructor(e,t){this.session=e,this.ctx=t,this.peer=null,this.channel=null,this.media=null,this.audio=null,this.closed=!1,this.toolBuffers=new Map,this.consultAbortControllers=new Set,this.emitTalkEvent=V$(t,e)}async start(){var e;if(!((e=navigator.mediaDevices)!=null&&e.getUserMedia)||typeof RTCPeerConnection>`u`)throw Error(`Realtime Talk requires browser WebRTC and microphone access`);this.closed=!1,this.peer=new RTCPeerConnection,this.audio=document.createElement(`audio`),this.audio.autoplay=!0,this.audio.style.display=`none`,document.body.append(this.audio),this.peer.addEventListener(`track`,e=>{this.audio&&(this.audio.srcObject=e.streams[0])}),this.media=await navigator.mediaDevices.getUserMedia({audio:!0});for(let e of this.media.getAudioTracks())this.peer.addTrack(e,this.media);this.channel=this.peer.createDataChannel(`oai-events`),this.channel.addEventListener(`open`,()=>{var e,t;(e=(t=this.ctx.callbacks).onStatus)==null||e.call(t,`listening`),this.emitTalkEvent({type:`session.ready`})}),this.channel.addEventListener(`message`,e=>this.handleRealtimeEvent(e.data)),this.peer.addEventListener(`connectionstatechange`,()=>{var e,t;if(!this.closed&&(((e=this.peer)==null?void 0:e.connectionState)===`failed`||((t=this.peer)==null?void 0:t.connectionState)===`closed`)){var n,r;(n=(r=this.ctx.callbacks).onStatus)==null||n.call(r,`error`,`Realtime connection closed`)}});let t=await this.peer.createOffer();await this.peer.setLocalDescription(t);let n=await fetch(this.session.offerUrl??`https://api.openai.com/v1/realtime/calls`,{method:`POST`,body:t.sdp,headers:{...this.session.offerHeaders,Authorization:`Bearer ${this.session.clientSecret}`,"Content-Type":`application/sdp`}});if(!n.ok)throw Error(`Realtime WebRTC setup failed (${n.status})`);await this.peer.setRemoteDescription({type:`answer`,sdp:await n.text()})}stop(){var e,t,n,r;this.closed||this.emitTalkEvent({type:`session.closed`,final:!0}),this.closed=!0,(e=this.channel)==null||e.close(),this.channel=null,(t=this.peer)==null||t.close(),this.peer=null,(n=this.media)==null||n.getTracks().forEach(e=>e.stop()),this.media=null,(r=this.audio)==null||r.remove(),this.audio=null;for(let e of this.consultAbortControllers)e.abort();this.consultAbortControllers.clear(),this.toolBuffers.clear()}send(e){var t;((t=this.channel)==null?void 0:t.readyState)===`open`&&this.channel.send(JSON.stringify(e))}handleRealtimeEvent(e){if(this.closed)return;let t;try{t=JSON.parse(String(e))}catch{return}switch(t.type){case`conversation.item.input_audio_transcription.completed`:if(t.transcript){var n,r;(n=(r=this.ctx.callbacks).onTranscript)==null||n.call(r,{role:`user`,text:t.transcript,final:!0}),this.emitTalkEvent({type:`transcript.done`,final:!0,itemId:t.item_id,payload:{role:`user`,text:t.transcript}})}return;case`response.audio_transcript.done`:if(t.transcript){var i,a;(i=(a=this.ctx.callbacks).onTranscript)==null||i.call(a,{role:`assistant`,text:t.transcript,final:!0}),this.emitTalkEvent({type:`output.text.done`,final:!0,itemId:t.item_id,payload:{text:t.transcript}})}return;case`response.function_call_arguments.delta`:this.bufferToolDelta(t);return;case`response.function_call_arguments.done`:this.handleToolCall(t);return;case`input_audio_buffer.speech_started`:var o,s;(o=(s=this.ctx.callbacks).onStatus)==null||o.call(s,`listening`,`Speech detected`),this.emitTalkEvent({type:`turn.started`,payload:{source:t.type}});return;case`input_audio_buffer.speech_stopped`:var c,l;(c=(l=this.ctx.callbacks).onStatus)==null||c.call(l,`thinking`,`Processing speech`),this.emitTalkEvent({type:`input.audio.committed`,final:!0});return;case`response.created`:var u,d;(u=(d=this.ctx.callbacks).onStatus)==null||u.call(d,`thinking`,`Generating response`);return;case`response.done`:var f,p,m;(f=(p=this.ctx.callbacks).onStatus)==null||f.call(p,`listening`,this.extractResponseStatus(t)),this.emitTalkEvent({type:`turn.ended`,final:!0,payload:{status:((m=t.response)==null?void 0:m.status)??`completed`}});return;case`error`:var h,g;(h=(g=this.ctx.callbacks).onStatus)==null||h.call(g,`error`,this.extractErrorDetail(t.error)),this.emitTalkEvent({type:`session.error`,final:!0,payload:{message:this.extractErrorDetail(t.error)}});return;default:return}}extractResponseStatus(e){var t;let n=(t=e.response)==null?void 0:t.status;return n&&n!==`completed`?`Response ${n}`:void 0}extractErrorDetail(e){if(!e||typeof e!=`object`)return`Realtime provider error`;let t=e,n=typeof t.message==`string`?t.message.trim():``,r=typeof t.code==`string`?t.code.trim():``,i=typeof t.type==`string`?t.type.trim():``;return n||r||i||`Realtime provider error`}bufferToolDelta(e){let t=e.item_id??`unknown`,n=this.toolBuffers.get(t);if(n){n.args+=e.delta??``;return}this.toolBuffers.set(t,{name:e.name??``,callId:e.call_id??``,args:e.delta??``})}async handleToolCall(e){let t=e.item_id??`unknown`,n=this.toolBuffers.get(t);this.toolBuffers.delete(t);let r=(n==null?void 0:n.name)||e.name||``,i=(n==null?void 0:n.callId)||e.call_id||``;if(r!==`openclaw_agent_consult`||!i)return;this.emitTalkEvent({type:`tool.call`,callId:i,itemId:t,payload:{name:r,args:(n==null?void 0:n.args)||e.arguments||`{}`}});let a=new AbortController;this.consultAbortControllers.add(a);try{await K$({ctx:this.ctx,callId:i,args:(n==null?void 0:n.args)||e.arguments||`{}`,signal:a.signal,submit:(e,t)=>this.submitToolResult(e,t)})}finally{this.consultAbortControllers.delete(a)}}submitToolResult(e,t){this.send({type:`conversation.item.create`,item:{type:`function_call_output`,call_id:e,output:JSON.stringify(t)}}),this.send({type:`response.create`})}};function a1(e,t){let n=o1(e);if(n===`webrtc`)return new i1(e,t);if(n===`provider-websocket`)return new t1(e,t);if(n===`gateway-relay`)return new Z$(e,t);if(n===`managed-room`)throw Error(`Managed-room realtime Talk sessions are not available in this UI yet`);let r=e.transport??`unknown`;throw Error(`Unsupported realtime Talk transport: ${r}`)}function o1(e){return P$(e.transport)??`webrtc`}var s1=class{constructor(e,t,n={}){this.client=e,this.sessionKey=t,this.callbacks=n,this.transport=null,this.closed=!1}async start(){var e,t;this.closed=!1,(e=(t=this.callbacks).onStatus)==null||e.call(t,`connecting`);let n=await this.createSession();this.closed||(this.transport=a1(n,{client:this.client,sessionKey:this.sessionKey,callbacks:this.callbacks}),await this.transport.start())}async createSession(){try{return await this.client.request(`talk.client.create`,{sessionKey:this.sessionKey})}catch(e){try{return await this.client.request(`talk.session.create`,{sessionKey:this.sessionKey,mode:`realtime`,transport:`gateway-relay`,brain:`agent-consult`})}catch{throw e}}}stop(){var e,t,n;this.closed=!0,(e=(t=this.callbacks).onStatus)==null||e.call(t,`idle`),(n=this.transport)==null||n.stop(),this.transport=null}},c1=[`auto`],l1=1e6;function u1(e){let t=new Set(c1);return e.filter(e=>!t.has(e))}function d1(e){var t;let n=e==null||(t=e.models)==null||(t=t.providers)==null||(t=t.sealseek)==null?void 0:t.models;if(!Array.isArray(n))return[];let r=[];for(let e of n)if(e&&typeof e==`object`){let t=e.id;typeof t==`string`&&r.push(t)}return r}function f1(e,t){let n=new Set(t);return e.some(e=>!n.has(e))}function p1(e){let[t,...n]=e.models.filter(e=>/kimi|qwen/i.test(e.id)).map(e=>`sealseek/${e.id}`),r=[{id:`auto`,name:`自动`,input:[`text`,`image`],contextWindow:l1},...e.models.filter(e=>e.id!==`auto`).map(e=>({id:e.id,name:e.id,input:[`text`,`image`],contextWindow:l1}))];return JSON.stringify({agents:{defaults:{model:{primary:`sealseek/auto`},...t?{imageModel:{primary:t,...n.length?{fallbacks:n}:{}}}:{}}},models:{providers:{sealseek:{baseUrl:e.baseUrl,api:`openai-completions`,...e.apiKey?{apiKey:e.apiKey}:{},models:r}}}})}async function m1(e){let t=Math.max(1,e.maxAttempts??4),n;for(let r=0;r<t;r++){r>0&&await e.reload();try{await e.request(`config.patch`,{baseHash:e.getBaseHash(),raw:e.raw,...e.allowSizeDrop?{allowSizeDrop:!0}:{}});return}catch(e){n=e}}throw n}function h1(e){return e===`responses`?{api:`openai-responses`,reasoning:!0}:{api:`openai-completions`,reasoning:!1}}var g1=xm({}),_1=XE();function v1(){if(!window.location.search)return!1;let e=new URLSearchParams(window.location.search).get(`onboarding`);if(!e)return!1;let t=e.trim().toLowerCase();return t===`1`||t===`true`||t===`yes`||t===`on`}var $=class extends c{constructor(){super(),this.clientInstanceId=_n(),this.connectGeneration=0,this.settings=JE(),this.password=``,this.loginShowGatewayToken=!1,this.loginShowGatewayPassword=!1,this.tab=`chat`,this.onboarding=v1(),this.connected=!1,this.theme=this.settings.theme??`claw`,this.themeMode=this.settings.themeMode??`system`,this.themeResolved=`dark`,this.themeOrder=this.buildThemeOrder(this.theme),this.customThemeImportUrl=``,this.customThemeImportBusy=!1,this.customThemeImportMessage=null,this.customThemeImportExpanded=!1,this.customThemeImportFocusToken=0,this.customThemeImportSelectOnSuccess=!1,this.hello=null,this.lastError=null,this.lastErrorCode=null,this.eventLog=[],this.eventLogBuffer=[],this.toolStreamSyncTimer=null,this.sidebarCloseTimer=null,this.assistantName=g1.name,this.assistantAvatar=g1.avatar,this.assistantAvatarSource=g1.avatarSource??null,this.assistantAvatarStatus=g1.avatarStatus??null,this.assistantAvatarReason=g1.avatarReason??null,this.assistantAvatarUploadBusy=!1,this.assistantAvatarUploadError=null,this.assistantAgentId=g1.agentId??null,this.userName=_1.name,this.userAvatar=_1.avatar,this.localMediaPreviewRoots=[],this.embedSandboxMode=`scripts`,this.allowExternalEmbedUrls=!1,this.chatMessageMaxWidth=null,this.serverVersion=null,this.sessionKey=this.settings.sessionKey,this.currentSessionId=null,this.chatLoading=!0,this.chatSending=!1,this.chatMessage=``,this.chatMessages=[],this.chatToolMessages=[],this.chatStreamSegments=[],this.chatStream=null,this.chatStreamStartedAt=null,this.chatStreamTick=0,this.chatStreamLastDurationSec=null,this.chatStreamLastModel=null,this.chatStreamLastThinkingBlocks=null,this.chatStreamTickTimer=null,this.chatStreamRevealLen=0,this.chatStreamRevealReasoningLen=0,this.chatTypewriterTimer=null,this.chatPendingFinal=null,this.chatRunId=null,this.chatAbortingSessionKeys=new Set,this.chatSideResult=null,this.compactionStatus=null,this.fallbackStatus=null,this.chatAvatarUrl=null,this.chatAvatarSource=null,this.chatAvatarStatus=null,this.chatAvatarReason=null,this.chatThinkingLevel=null,this.chatModelOverrides={},this.chatModelsLoading=!1,this.chatModelCatalog=[],this.sessionSwitchNotice=null,this.sessionSwitchFlashKey=null,this.sessionSwitchNoticeSeq=0,this.sessionSwitchNoticeTimer=null,this.sessionSwitchFlashTimer=null,this.chatQueue=[],this.chatQueueBySession={},this.chatAttachments=[],this.realtimeTalkActive=!1,this.realtimeTalkStatus=`idle`,this.realtimeTalkDetail=null,this.realtimeTalkTranscript=null,this.skillStoreOpen=!1,this.storeSkills=null,this.storeSkillsLoading=!1,this.storeSkillsRegistry=new Map,this.storeItemLoading=null,this.storeItemError=null,this.realtimeTalkSession=null,this.chatManualRefreshInFlight=!1,this.chatHeaderControlsHidden=!1,this.chatMobileControlsOpen=!1,this.chatMobileControlsTrigger=null,this.navDrawerOpen=!1,this.chatLocalInputHistoryBySession={},this.chatInputHistorySessionKey=null,this.chatInputHistoryItems=null,this.chatInputHistoryIndex=-1,this.chatDraftBeforeHistory=null,this.chatDraftMode=!1,this.chatDraftParentSessionKey=null,this.sidebarOpen=!1,this.sidebarContent=null,this.sidebarError=null,this.sidebarEditingSessionKey=null,this.sidebarEditingSessionLabel=``,this.sidebarMoreMenuKey=null,this.sidebarMoreMenuPos=null,this.sidebarDeleteConfirmKey=null,this.sidebarDeleteLinkedJobs=null,this.sidebarDeleteLinkedJobsLoading=!1,this.sidebarDeleteInFlight=!1,this.sidebarDeleteError=null,this.sidebarCreatingGroup=!1,this.sidebarEditingGroupId=null,this.sidebarEditingGroupLabel=``,this.sidebarGroupMoreMenuId=null,this.sidebarDeleteGroupConfirmId=null,this.sidebarMoveMenuKey=null,this.sidebarGroupVersion=0,this.splitRatio=this.settings.splitRatio,this.nodesLoading=!1,this.nodes=[],this.devicesLoading=!1,this.devicesError=null,this.devicesList=null,this.execApprovalsLoading=!1,this.execApprovalsSaving=!1,this.execApprovalsDirty=!1,this.execApprovalsSnapshot=null,this.execApprovalsForm=null,this.execApprovalsSelectedAgent=null,this.execApprovalsTarget=`gateway`,this.execApprovalsTargetNodeId=null,this.execApprovalQueue=[],this.execApprovalBusy=!1,this.execApprovalError=null,this.pendingGatewayUrl=null,this.pendingGatewayToken=null,this.configLoading=!1,this.configRaw=`{
|
|
8811
8811
|
}
|
|
8812
|
-
`,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.dreamingStatusLoading=!1,this.dreamingStatusError=null,this.dreamingStatus=null,this.dreamingModeSaving=!1,this.dreamingRestartConfirmOpen=!1,this.dreamingRestartConfirmLoading=!1,this.dreamingPendingEnabled=null,this.dreamDiaryLoading=!1,this.dreamDiaryActionLoading=!1,this.dreamDiaryActionMessage=null,this.dreamDiaryActionArchivePath=null,this.dreamDiaryError=null,this.dreamDiaryPath=null,this.dreamDiaryContent=null,this.wikiImportInsightsLoading=!1,this.wikiImportInsightsError=null,this.wikiImportInsights=null,this.wikiMemoryPalaceLoading=!1,this.wikiMemoryPalaceError=null,this.wikiMemoryPalace=null,this.configFormDirty=!1,this.configSettingsMode=`quick`,this.configFormMode=`form`,this.configSearchQuery=``,this.configActiveSection=null,this.configActiveSubsection=null,this.pendingUpdateExpectedVersion=null,this.updateStatusBanner=null,this.communicationsFormMode=`form`,this.communicationsSearchQuery=``,this.communicationsActiveSection=null,this.communicationsActiveSubsection=null,this.appearanceFormMode=`form`,this.appearanceSearchQuery=``,this.appearanceActiveSection=null,this.appearanceActiveSubsection=null,this.automationFormMode=`form`,this.automationSearchQuery=``,this.automationActiveSection=null,this.automationActiveSubsection=null,this.infrastructureFormMode=`form`,this.infrastructureSearchQuery=``,this.infrastructureActiveSection=null,this.infrastructureActiveSubsection=null,this.aiAgentsFormMode=`form`,this.aiAgentsSearchQuery=``,this.aiAgentsActiveSection=null,this.aiAgentsActiveSubsection=null,this.channelsLoading=!1,this.channelsSnapshot=null,this.channelsError=null,this.channelsLastSuccess=null,this.whatsappLoginMessage=null,this.whatsappLoginQrDataUrl=null,this.whatsappLoginConnected=null,this.whatsappBusy=!1,this.nostrProfileFormState=null,this.nostrProfileAccountId=null,this.presenceLoading=!1,this.presenceEntries=[],this.presenceError=null,this.presenceStatus=null,this.agentsLoading=!1,this.agentsList=null,this.agentsError=null,this.agentsSelectedId=null,this.toolsCatalogLoading=!1,this.toolsCatalogError=null,this.toolsCatalogResult=null,this.toolsEffectiveLoading=!1,this.toolsEffectiveLoadingKey=null,this.toolsEffectiveResultKey=null,this.toolsEffectiveError=null,this.toolsEffectiveResult=null,this.agentsPanel=`files`,this.agentFilesLoading=!1,this.agentFilesError=null,this.agentFilesList=null,this.agentFileContents={},this.agentFileDrafts={},this.agentFileActive=null,this.agentFileSaving=!1,this.agentIdentityLoading=!1,this.agentIdentityError=null,this.agentIdentityById={},this.agentSkillsLoading=!1,this.agentSkillsError=null,this.agentSkillsReport=null,this.agentSkillsAgentId=null,this.sessionsLoading=!1,this.sessionsResult=null,this.sessionsError=null,this.contextWeight=null,this.contextWeightKey=null,this.contextWeightLoading=!1,this.sessionsFilterActive=$h.activeMinutes,this.sessionsFilterLimit=$h.limit,this.sessionsIncludeGlobal=!0,this.sessionsIncludeUnknown=!1,this.sessionsShowArchived=!1,this.sessionsFiltersCollapsed=!1,this.sessionsHideCron=!0,this.sessionsSearchQuery=``,this.sessionsSortColumn=`updated`,this.sessionsSortDir=`desc`,this.sessionsPage=0,this.sessionsPageSize=25,this.sessionsSelectedKeys=new Set,this.sessionsExpandedCheckpointKey=null,this.sessionsCheckpointItemsByKey={},this.sessionsCheckpointLoadingKey=null,this.sessionsCheckpointBusyKey=null,this.sessionsCheckpointErrorByKey={},this.usageLoading=!1,this.usageResult=null,this.usageCostSummary=null,this.usageError=null,this.usageStartDate=(()=>{let e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`})(),this.usageEndDate=(()=>{let e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`})(),this.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.activePanelId=null,this.sidebarStatusPopoverOpen=!1,this.fileTreeLoading=!1,this.fileTreeError=null,this.fileTreeResult=null,this.fileTreeSessionId=void 0,this.fileTreeExpandedDirs=[],this.fileTreeDirChildren={},this.fileTreeDirLoading=[],this.fileTreeRefFiles=null,this.fileTreeRefLoading=!1,this.fileTreeSplitRatio=this.settings.fileTreeSplitRatio,this.fileTreeOutputCollapsed=!1,this.fileTreeRefCollapsed=!1,this.cnChannelsLoading=!1,this.cnChannelsData=null,this.cnChannelsError=null,this.cnConnecting=null,this.cnQrcodeChannel=null,this.cnQrcodeImg=null,this.cnQrcodeToken=null,this.cnQrcodeLoading=!1,this.cnQrcodePollTimer=null,this.cnFeishuOpen=!1,this.cnFeishuSaving=!1,this.cnFeishuFormAppId=``,this.cnFeishuFormAppSecret=``,this.skillCenterTab=`center`,this.centerSegment=`store`,this.skillCenterCategory=null,this.skillCenterSearch=``,this.skillCenterCategories=null,this.skillCenterCategoriesLoading=!1,this.skillCenterItemBusy=null,this.skillCenterItemError=null,this.enterpriseSkills=[],this.enterpriseSkillsLoaded=!1,this.enterpriseSkillsLoading=!1,this.enterpriseInstallLoading=null,this.enterpriseError=null,this.publishDialogOpen=!1,this.publishTarget=null,this.publishingSkill=null,this.publishLoading=!1,this.publishError=null,this.publishSuccess=null,this.mySharesForMatching=[],this.mySharesLoaded=!1,this.syncVersionMap=new Map,this.syncVersionByIdMap=new Map,this.syncVersionMapLoaded=!1,this.shareDialogSkill=null,this.shareDialogPhase=`confirm`,this.shareDialogVersion=`1.0.0`,this.shareDialogResult=null,this.shareDialogError=null,this.shareDialogExisting=null,this.importDialogOpen=!1,this.importShareCode=``,this.importPreview=null,this.importPreviewLoading=!1,this.importClaimLoading=!1,this.importClaimResult=null,this.importError=null,this.skillPublishState=null,this.skillGroups=rQ(),this.skillGroupMap=iQ(),this.selectedSkillGroupId=null,this.creatingSkillGroup=!1,this.renamingSkillGroupId=null,this.deleteSkillGroupTarget=null,this.fileSpaceLoading=!1,this.fileSpaceError=null,this.fileSpaceData=null,this.fileSpaceSearch=``,this.fileSpaceCollapsed=[],this.usageQueryDebounceTimer=null,this.cronLoading=!1,this.cronJobsLoaded=!1,this.cronQuickCreateOpen=!1,this.cronQuickCreateStep=`what`,this.cronQuickCreateDraft=null,this.cronJobsLoadingMore=!1,this.cronJobs=[],this.cronResultSessionKeys=new Set,this.cronResultSessionJobs=new Map,this.cronJobsTotal=0,this.cronJobsHasMore=!1,this.cronJobsNextOffset=null,this.cronJobsLimit=50,this.cronJobsQuery=``,this.cronJobsEnabledFilter=`all`,this.cronJobsScheduleKindFilter=`all`,this.cronJobsLastStatusFilter=`all`,this.cronJobsSortBy=`nextRunAtMs`,this.cronJobsSortDir=`asc`,this.cronStatus=null,this.cronError=null,this.cronForm={...eg},this.cronFormCollapsed=!1,this.cronFieldErrors={},this.cronEditingJobId=null,this.cronRunsJobId=null,this.cronRunsLoadingMore=!1,this.cronRuns=[],this.cronRunsTotal=0,this.cronRunsHasMore=!1,this.cronRunsNextOffset=null,this.cronRunsLimit=50,this.cronRunsScope=`all`,this.cronRunsStatuses=[],this.cronRunsDeliveryStatuses=[],this.cronRunsStatusFilter=`all`,this.cronRunsQuery=``,this.cronRunsSortDir=`desc`,this.cronModelSuggestions=[],this.cronBusy=!1,this.cronTasksView=`list`,this.cronTaskDialogOpen=!1,this.cronTaskDialogMode=`create`,this.cronTaskMenuJobId=null,this.cronTaskDeleteConfirmJobId=null,this.cronTaskSessionQuery=``,this.skillDropdownOpen=!1,this.cronTaskHistoryJobFilter=``,this.cronTaskHistoryDateFilter=`7d`,this.updateAvailable=null,this.attentionItems=[],this.paletteOpen=!1,this.sessionSwitcherOpen=!1,this.paletteQuery=``,this.paletteActiveIndex=0,this.overviewShowGatewayToken=!1,this.overviewShowGatewayPassword=!1,this.overviewLogLines=[],this.overviewLogCursor=0,this.skillsLoading=!1,this.skillsReport=null,this.skillsError=null,this.skillsFilter=``,this.skillsStatusFilter=`all`,this.skillEdits={},this.skillsBusyKey=null,this.skillMessages={},this.skillsDetailKey=null,this.clawhubSearchQuery=``,this.clawhubSearchResults=null,this.clawhubSearchLoading=!1,this.clawhubSearchError=null,this.clawhubDetail=null,this.clawhubDetailSlug=null,this.clawhubDetailLoading=!1,this.clawhubDetailError=null,this.clawhubInstallSlug=null,this.clawhubInstallMessage=null,this.healthLoading=!1,this.healthResult=null,this.healthError=null,this.modelAuthStatusLoading=!1,this.modelAuthStatusResult=null,this.modelAuthStatusError=null,this.debugLoading=!1,this.debugStatus=null,this.debugHealth=null,this.debugModels=[],this.debugHeartbeat=null,this.debugCallMethod=``,this.debugCallParams=`{}`,this.debugCallResult=null,this.debugCallError=null,this.apiKeys=[],this.sealclawModels=[],this.webPushSupported=!1,this.webPushPermission=`unsupported`,this.webPushSubscribed=!1,this.webPushLoading=!1,this.logsLoading=!1,this.logsError=null,this.logsFile=null,this.logsEntries=[],this.logsFilterText=``,this.logsLevelFilters={...Qh},this.logsAutoFollow=!0,this.logsTruncated=!1,this.logsCursor=null,this.logsLastFetchAt=null,this.logsLimit=500,this.logsMaxBytes=25e4,this.logsAtBottom=!0,this.client=null,this.chatScrollFrame=null,this.chatScrollTimeout=null,this.chatLastScrollTop=0,this.chatHasAutoScrolled=!1,this.chatUserNearBottom=!0,this.chatStreamAutoFollow=!0,this.pendingChatScrollMessageId=null,this.chatDeepLinkScrollInFlight=!1,this.chatNewMessagesBelow=!1,this.chatTocActiveIndex=null,this.nodesPollInterval=null,this.logsPollInterval=null,this.debugPollInterval=null,this.logsScrollFrame=null,this.controlUiResponsivenessObserver=null,this.toolStreamById=new Map,this.toolStreamOrder=[],this.refreshSessionsAfterChat=new Set,this.chatSideResultTerminalRuns=new Set,this.basePath=``,this.popStateHandler=()=>EH(this),this.topbarObserver=null,this.globalKeydownHandler=e=>{(e.metaKey||e.ctrlKey)&&!e.shiftKey&&e.key===`k`&&(e.preventDefault(),this.paletteOpen=!this.paletteOpen,this.paletteOpen&&(this.paletteQuery=``,this.paletteActiveIndex=0))},this.navDrawerMediaQuery=null,this.navDrawerMediaHandler=e=>{!e.matches&&this.navDrawerOpen&&(this.navDrawerOpen=!1)},this.chatMobileControlsKeydownHandler=e=>{e.key!==`Escape`||!this.chatMobileControlsOpen||(e.preventDefault(),this.setChatMobileControlsOpen(!1,{restoreFocus:!0}))},this.chatMobileControlsPointerdownHandler=e=>{if(!this.chatMobileControlsOpen)return;let t=this.querySelector(`.chat-mobile-controls-wrapper`);t&&e.composedPath().includes(t)||this.setChatMobileControlsOpen(!1)},this.sealclawInitDone=!1}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.onSlashAction=async e=>{switch(e){case`new-session`:FW(this);break;case`toggle-focus`:this.applySettings({...this.settings,chatFocusMode:!this.settings.chatFocusMode});break;case`export`:vM(this.chatMessages,this.assistantName);break;case`refresh-tools-effective`:await ya(this);break}},document.addEventListener(`keydown`,this.globalKeydownHandler),document.addEventListener(`keydown`,this.chatMobileControlsKeydownHandler),document.addEventListener(`pointerdown`,this.chatMobileControlsPointerdownHandler),N$(),this.navDrawerMediaQuery=window.matchMedia(`(max-width: 1100px)`),this.navDrawerMediaQuery.addEventListener(`change`,this.navDrawerMediaHandler),IU(this),this.initWebPushState(),this.loadApiKeys()}firstUpdated(){LU(this)}disconnectedCallback(){document.removeEventListener(`keydown`,this.globalKeydownHandler),document.removeEventListener(`keydown`,this.chatMobileControlsKeydownHandler),document.removeEventListener(`pointerdown`,this.chatMobileControlsPointerdownHandler),this.navDrawerMediaQuery&&(this.navDrawerMediaQuery.removeEventListener(`change`,this.navDrawerMediaHandler),this.navDrawerMediaQuery=null),this.sessionSwitchNoticeTimer!==null&&(window.clearTimeout(this.sessionSwitchNoticeTimer),this.sessionSwitchNoticeTimer=null),this.sessionSwitchFlashTimer!==null&&(window.clearTimeout(this.sessionSwitchFlashTimer),this.sessionSwitchFlashTimer=null),this.chatMobileControlsTrigger=null,BU(this),super.disconnectedCallback()}updated(e){if(VU(this,e),this.pendingChatScrollMessageId&&!this.chatDeepLinkScrollInFlight&&this.tab===`chat`&&this.chatMessages.length>0){let e=this.pendingChatScrollMessageId;this.chatDeepLinkScrollInFlight=!0,hc(this,e).then(t=>{this.chatDeepLinkScrollInFlight=!1,t?(this.chatHasAutoScrolled=!0,this.chatStreamAutoFollow=!1,this.pendingChatScrollMessageId=null):this.pendingChatScrollMessageId===e&&(this.pendingChatScrollMessageId=null)})}if(e.has(`connected`)&&this.connected&&(BH(this),this.sealclawInitDone?Ih(this,{scheduleScroll:!1,force:!0}):(this.sealclawInitDone=!0,this.initCreateApiKey())),e.has(`tab`)&&this.tab!==`chat`&&this.chatMobileControlsOpen&&this.setChatMobileControlsOpen(!1),!e.has(`sessionKey`)||this.agentsPanel!==`tools`)return;let t=ua(this.sessionKey);if(this.agentsSelectedId&&this.agentsSelectedId===t){ga(this,{agentId:this.agentsSelectedId,sessionKey:this.sessionKey});return}this.toolsEffectiveResult=null,this.toolsEffectiveResultKey=null,this.toolsEffectiveError=null,this.toolsEffectiveLoading=!1,this.toolsEffectiveLoadingKey=null}connect(){OU(this)}handleChatScroll(e){vc(this,e)}handleLogsScroll(e){yc(this,e)}exportLogs(e,t){Sc(e,t)}resetToolStream(){Bc(this)}resetChatScroll(){bc(this)}scrollChatToTop(){xc(this)}scrollToBottom(e){bc(this),mc(this,!0,!!(e!=null&&e.smooth))}async loadAssistantIdentity(){await JH(this)}applySettings(e){rH(this,e)}applyLocalUserIdentity(e){iH(this,e)}setTab(e){e===`filespace`&&(this.fileSpaceData=null,this.fileSpaceError=null),fH(this,e),e!==`chat`&&(this.setChatMobileControlsOpen(!1),this.sidebarOpen&&this.handleCloseSidebar()),this.navDrawerOpen=!1}setChatMobileControlsOpen(e,t){if(e){this.chatMobileControlsTrigger=(t==null?void 0:t.trigger)??this.chatMobileControlsTrigger,this.chatMobileControlsOpen=!0;return}let n=t!=null&&t.restoreFocus?this.chatMobileControlsTrigger:null;this.chatMobileControlsOpen=!1,this.chatMobileControlsTrigger=null,!(!(n instanceof HTMLElement)||!n.isConnected)&&requestAnimationFrame(()=>{n.isConnected&&n.focus()})}setTheme(e,t){mH(this,e,t),this.themeOrder=this.buildThemeOrder(e)}setThemeMode(e,t){hH(this,e,t)}setCustomThemeImportUrl(e){var t;this.customThemeImportUrl=e,((t=this.customThemeImportMessage)==null?void 0:t.kind)===`error`&&(this.customThemeImportMessage=null)}openCustomThemeImport(){this.customThemeImportExpanded=!0,this.customThemeImportFocusToken+=1,this.settings.customTheme||(this.customThemeImportSelectOnSuccess=!0)}async importCustomTheme(){if(!this.customThemeImportBusy){this.customThemeImportExpanded=!0,this.customThemeImportBusy=!0,this.customThemeImportMessage=null;try{let e=await dE(this.customThemeImportUrl),t=this.theme===`custom`||!this.settings.customTheme||this.customThemeImportSelectOnSuccess;rH(this,{...this.settings,theme:t?`custom`:this.settings.theme,customTheme:e}),this.themeOrder=this.buildThemeOrder(t?`custom`:this.theme),this.customThemeImportUrl=``,this.customThemeImportSelectOnSuccess=!1,this.customThemeImportMessage={kind:`success`,text:`Imported ${e.label}.`}}catch(e){this.customThemeImportMessage={kind:`error`,text:e instanceof Error?e.message:`Failed to import tweakcn theme.`}}finally{this.customThemeImportBusy=!1}}}clearCustomTheme(){let e=this.theme===`custom`?`claw`:this.theme;this.customThemeImportExpanded=!0,this.customThemeImportSelectOnSuccess=!1,rH(this,{...this.settings,theme:e,customTheme:void 0}),this.themeOrder=this.buildThemeOrder(e),this.customThemeImportMessage={kind:`success`,text:`Cleared custom theme.`}}setBorderRadius(e){rH(this,{...this.settings,borderRadius:e}),this.requestUpdate()}switchSessionFromHistory(e){RW(this,e,{skipUrlSync:!0})}announceSessionSwitch(e,t){let n=++this.sessionSwitchNoticeSeq;this.sessionSwitchNoticeTimer!==null&&window.clearTimeout(this.sessionSwitchNoticeTimer),this.sessionSwitchFlashTimer!==null&&window.clearTimeout(this.sessionSwitchFlashTimer),this.sessionSwitchNotice={id:n,text:`已切换到 ${t}`},this.sessionSwitchFlashKey=e,this.sessionSwitchFlashTimer=window.setTimeout(()=>{var e;((e=this.sessionSwitchNotice)==null?void 0:e.id)===n&&(this.sessionSwitchFlashKey=null),this.sessionSwitchFlashTimer=null},200),this.sessionSwitchNoticeTimer=window.setTimeout(()=>{var e;((e=this.sessionSwitchNotice)==null?void 0:e.id)===n&&(this.sessionSwitchNotice=null),this.sessionSwitchNoticeTimer=null},2800)}buildThemeOrder(e){return[e,...[...hE].filter(t=>t!==e)]}async loadOverview(e){await NH(this,e)}async loadCron(){await zH(this)}async handleAbortChat(){await gh(this)}handleChatDraftChange(e){tu(this,e)}handleChatInputHistoryKey(e){return au(this,e)}resetChatInputHistoryNavigation(){eu(this)}removeQueuedMessage(e){Eh(this,e)}async handleSendChat(e,t){let n=(e??this.chatMessage).trim();await LW(this,n)&&await Oh(this,e,t)}async regenerateLastChat(){await Nh(this)}async toggleRealtimeTalk(){if(this.realtimeTalkSession)if(this.realtimeTalkStatus===`error`)this.realtimeTalkSession.stop(),this.realtimeTalkSession=null;else{this.realtimeTalkSession.stop(),this.realtimeTalkSession=null,this.realtimeTalkActive=!1,this.realtimeTalkStatus=`idle`,this.realtimeTalkDetail=null,this.realtimeTalkTranscript=null;return}if(!this.client||!this.connected){this.lastError=`Gateway not connected`;return}this.realtimeTalkActive=!0,this.realtimeTalkStatus=`connecting`,this.realtimeTalkDetail=null,this.realtimeTalkTranscript=null;let e=new s1(this.client,this.sessionKey,{onStatus:(e,t)=>{this.realtimeTalkStatus=e,this.realtimeTalkDetail=t??null,(e===`idle`||e===`error`)&&(this.realtimeTalkActive=e!==`idle`)},onTranscript:e=>{this.realtimeTalkTranscript=`${e.role===`user`?`你`:`万能玺虾`}: ${e.text}`}});this.realtimeTalkSession=e;try{await e.start()}catch(t){e.stop(),this.realtimeTalkSession===e&&(this.realtimeTalkSession=null),this.realtimeTalkActive=!1,this.realtimeTalkStatus=`error`,this.realtimeTalkDetail=t instanceof Error?t.message:String(t),this.lastError=this.realtimeTalkDetail}}async steerQueuedChatMessage(e){await wh(this,e)}async handleWhatsAppStart(e){await Ur(this,e)}async handleWhatsAppWait(){await Wr(this)}async handleWhatsAppLogout(){await Gr(this)}async handleChannelConfigSave(){await Kr(this)}async handleChannelConfigReload(){await qr(this)}handleNostrProfileEdit(e,t){Qr(this,e,t)}handleNostrProfileCancel(){$r(this)}handleNostrProfileFieldChange(e,t){ei(this,e,t)}async handleNostrProfileSave(){await ni(this)}async handleNostrProfileImport(){await ri(this)}handleNostrProfileToggleAdvanced(){ti(this)}async handleExecApprovalDecision(e,t){let n=rU(this.execApprovalQueue,t);if(!(!n||!this.client||this.execApprovalBusy)){this.execApprovalBusy=!0,this.execApprovalError=null;try{let t=n.kind===`plugin`?`plugin.approval.resolve`:`exec.approval.resolve`;await this.client.request(t,{id:n.id,decision:e}),this.execApprovalQueue=this.execApprovalQueue.filter(e=>e.id!==n.id)}catch(e){this.execApprovalError=`Approval failed: ${String(e)}`}finally{this.execApprovalBusy=!1}}}handleGatewayUrlConfirm(){var e;let t=this.pendingGatewayUrl;if(!t)return;let n=((e=this.pendingGatewayToken)==null?void 0:e.trim())||``;this.pendingGatewayUrl=null,this.pendingGatewayToken=null,rH(this,{...this.settings,gatewayUrl:t,token:n}),this.connect()}handleGatewayUrlCancel(){this.pendingGatewayUrl=null,this.pendingGatewayToken=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){let t=Math.max(.4,Math.min(.7,e));this.splitRatio=t,this.applySettings({...this.settings,splitRatio:t})}handleFileTreeSplitRatioChange(e){let t=Math.max(.2,Math.min(.8,e));this.fileTreeSplitRatio=t,this.applySettings({...this.settings,fileTreeSplitRatio:t})}getUserUuidFromJwt(){let e=localStorage.getItem(`jwt`)??``;if(!e)return``;try{let t=e.split(`.`);if(t.length<2)return``;let n=t[1].replace(/-/g,`+`).replace(/_/g,`/`);for(;n.length%4;)n+=`=`;return JSON.parse(atob(n)).userUuid||``}catch{return``}}async initCreateApiKey(){try{var e,t;let n=this.getUserUuidFromJwt();this.configSnapshot||await yr(this);let r=await M({name:`default`});if(!((e=r.data)!=null&&e.key)){let e=(await N()).data??[];for(let t of e)await ie(t.id);r=await M({name:`default`})}let i=(t=r.data)==null?void 0:t.key;if(!i)return;n&&localStorage.setItem(`sealclaw_user_uuid`,n),await this.loadSealclawModels(i)}catch(e){console.error(`[sealclaw] initCreateApiKey error:`,e)}}async loadSealclawModels(e){try{let t=(await ae(e)).data??[];if(this.sealclawModels=t,!this.client||!this.configSnapshot){console.warn(`[sealclaw] client or configSnapshot not ready`);return}if(t.length===0){console.warn(`[sealclaw] /models returned empty; keeping existing catalog`);return}let n=`https://gatewaytest.sealseek.cn/api/sealclaw/v1`,r=this.client,i=(e,t)=>r.request(e,t),a=()=>yr(this),o=()=>{var e;return(e=this.configSnapshot)==null?void 0:e.hash},s=u1(d1(this.configSnapshot.config)),c=t.map(e=>e.id),l=f1(s,c);if(l&&(await m1({request:i,reload:a,getBaseHash:o,raw:JSON.stringify({models:{providers:{sealseek:null}}}),allowSizeDrop:!0}),await a()),!this.configSnapshot)return;JSON.stringify({models:{providers:{sealseek:{baseUrl:n,api:`openai-completions`,...e?{apiKey:e}:{},models:t.map(e=>{let{api:t,reasoning:n}=h1(e.protocol);return{id:e.id,name:e.id,input:[`text`,`image`],api:t,reasoning:n}})}}}}),console.log(`[sealclaw] writing sealseek.json`,{baseUrl:n,modelCount:t.length,hasApiKey:!!e,replacedProvider:l}),await m1({request:i,reload:a,getBaseHash:o,raw:p1({baseUrl:n,apiKey:e,models:t})}),console.log(`[sealclaw] sealseek.json written`);let u=new Set(c);for(let e=0;e<10&&this.client;e++){let e=await zp(this.client),t=new Set(e.filter(e=>e.provider===`sealseek`).map(e=>e.id));if(t.size===u.size&&[...u].every(e=>t.has(e))){this.chatModelCatalog=e;break}await new Promise(e=>setTimeout(e,200))}await Ih(this,{scheduleScroll:!1,force:!0})}catch(e){console.error(`[sealclaw] config.patch failed`,e)}}async loadApiKeys(){try{let e=await N();e.data&&(this.apiKeys=e.data)}catch{}}async initWebPushState(){let e=`serviceWorker`in navigator&&`PushManager`in window&&`Notification`in window;if(this.webPushSupported=e,this.webPushPermission=e?Notification.permission:`unsupported`,e)try{let{getExistingSubscription:e}=await SW(async()=>{let{getExistingSubscription:e}=await import(`./push-subscription-BnLpzIye.js`);return{getExistingSubscription:e}},[]),t=await e();this.webPushSubscribed=t!==null}catch{}}async reconcileWebPushState(){if(this.client)try{var e,t;let{getExistingSubscription:n}=await SW(async()=>{let{getExistingSubscription:e}=await import(`./push-subscription-BnLpzIye.js`);return{getExistingSubscription:e}},[]),r=await n();if(!r)return;this.webPushSubscribed=!0;let i=r.toJSON();i.endpoint&&(e=i.keys)!=null&&e.p256dh&&(t=i.keys)!=null&&t.auth&&await this.client.request(`push.web.subscribe`,{endpoint:i.endpoint,keys:{p256dh:i.keys.p256dh,auth:i.keys.auth}})}catch{}}async handleWebPushSubscribe(){if(!(!this.client||this.webPushLoading)){this.webPushLoading=!0;try{let{subscribeToWebPush:e}=await SW(async()=>{let{subscribeToWebPush:e}=await import(`./push-subscription-BnLpzIye.js`);return{subscribeToWebPush:e}},[]);await e(this.client),this.webPushSubscribed=!0,this.webPushPermission=Notification.permission}catch(e){this.lastError=String(e)}finally{this.webPushLoading=!1,`Notification`in window&&(this.webPushPermission=Notification.permission)}}}async handleWebPushUnsubscribe(){if(!(!this.client||this.webPushLoading)){this.webPushLoading=!0;try{let{unsubscribeFromWebPush:e}=await SW(async()=>{let{unsubscribeFromWebPush:e}=await import(`./push-subscription-BnLpzIye.js`);return{unsubscribeFromWebPush:e}},[]);await e(this.client),this.webPushSubscribed=!1}catch(e){this.lastError=String(e)}finally{this.webPushLoading=!1}}}async handleWebPushTest(){if(this.client)try{let{sendTestWebPush:e}=await SW(async()=>{let{sendTestWebPush:e}=await import(`./push-subscription-BnLpzIye.js`);return{sendTestWebPush:e}},[]);await e(this.client)}catch(e){this.lastError=String(e)}}render(){return w$(this)}};Z([k()],$.prototype,`settings`,void 0),Z([k()],$.prototype,`password`,void 0),Z([k()],$.prototype,`loginShowGatewayToken`,void 0),Z([k()],$.prototype,`loginShowGatewayPassword`,void 0),Z([k()],$.prototype,`tab`,void 0),Z([k()],$.prototype,`onboarding`,void 0),Z([k()],$.prototype,`connected`,void 0),Z([k()],$.prototype,`theme`,void 0),Z([k()],$.prototype,`themeMode`,void 0),Z([k()],$.prototype,`themeResolved`,void 0),Z([k()],$.prototype,`themeOrder`,void 0),Z([k()],$.prototype,`customThemeImportUrl`,void 0),Z([k()],$.prototype,`customThemeImportBusy`,void 0),Z([k()],$.prototype,`customThemeImportMessage`,void 0),Z([k()],$.prototype,`customThemeImportExpanded`,void 0),Z([k()],$.prototype,`customThemeImportFocusToken`,void 0),Z([k()],$.prototype,`hello`,void 0),Z([k()],$.prototype,`lastError`,void 0),Z([k()],$.prototype,`lastErrorCode`,void 0),Z([k()],$.prototype,`eventLog`,void 0),Z([k()],$.prototype,`assistantName`,void 0),Z([k()],$.prototype,`assistantAvatar`,void 0),Z([k()],$.prototype,`assistantAvatarSource`,void 0),Z([k()],$.prototype,`assistantAvatarStatus`,void 0),Z([k()],$.prototype,`assistantAvatarReason`,void 0),Z([k()],$.prototype,`assistantAvatarUploadBusy`,void 0),Z([k()],$.prototype,`assistantAvatarUploadError`,void 0),Z([k()],$.prototype,`assistantAgentId`,void 0),Z([k()],$.prototype,`userName`,void 0),Z([k()],$.prototype,`userAvatar`,void 0),Z([k()],$.prototype,`localMediaPreviewRoots`,void 0),Z([k()],$.prototype,`embedSandboxMode`,void 0),Z([k()],$.prototype,`allowExternalEmbedUrls`,void 0),Z([k()],$.prototype,`chatMessageMaxWidth`,void 0),Z([k()],$.prototype,`serverVersion`,void 0),Z([k()],$.prototype,`sessionKey`,void 0),Z([k()],$.prototype,`chatLoading`,void 0),Z([k()],$.prototype,`chatSending`,void 0),Z([k()],$.prototype,`chatMessage`,void 0),Z([k()],$.prototype,`chatMessages`,void 0),Z([k()],$.prototype,`chatToolMessages`,void 0),Z([k()],$.prototype,`chatStreamSegments`,void 0),Z([k()],$.prototype,`chatStream`,void 0),Z([k()],$.prototype,`chatStreamStartedAt`,void 0),Z([k()],$.prototype,`chatStreamTick`,void 0),Z([k()],$.prototype,`chatStreamLastDurationSec`,void 0),Z([k()],$.prototype,`chatStreamLastModel`,void 0),Z([k()],$.prototype,`chatStreamLastThinkingBlocks`,void 0),Z([k()],$.prototype,`chatStreamRevealLen`,void 0),Z([k()],$.prototype,`chatStreamRevealReasoningLen`,void 0),Z([k()],$.prototype,`chatRunId`,void 0),Z([k()],$.prototype,`chatAbortingSessionKeys`,void 0),Z([k()],$.prototype,`chatSideResult`,void 0),Z([k()],$.prototype,`compactionStatus`,void 0),Z([k()],$.prototype,`fallbackStatus`,void 0),Z([k()],$.prototype,`chatAvatarUrl`,void 0),Z([k()],$.prototype,`chatAvatarSource`,void 0),Z([k()],$.prototype,`chatAvatarStatus`,void 0),Z([k()],$.prototype,`chatAvatarReason`,void 0),Z([k()],$.prototype,`chatThinkingLevel`,void 0),Z([k()],$.prototype,`chatModelOverrides`,void 0),Z([k()],$.prototype,`chatModelsLoading`,void 0),Z([k()],$.prototype,`chatModelCatalog`,void 0),Z([k()],$.prototype,`sessionSwitchNotice`,void 0),Z([k()],$.prototype,`sessionSwitchFlashKey`,void 0),Z([k()],$.prototype,`chatQueue`,void 0),Z([k()],$.prototype,`chatQueueBySession`,void 0),Z([k()],$.prototype,`chatAttachments`,void 0),Z([k()],$.prototype,`realtimeTalkActive`,void 0),Z([k()],$.prototype,`realtimeTalkStatus`,void 0),Z([k()],$.prototype,`realtimeTalkDetail`,void 0),Z([k()],$.prototype,`realtimeTalkTranscript`,void 0),Z([k()],$.prototype,`skillStoreOpen`,void 0),Z([k()],$.prototype,`storeSkills`,void 0),Z([k()],$.prototype,`storeSkillsLoading`,void 0),Z([k()],$.prototype,`storeItemLoading`,void 0),Z([k()],$.prototype,`storeItemError`,void 0),Z([k()],$.prototype,`chatManualRefreshInFlight`,void 0),Z([k()],$.prototype,`chatHeaderControlsHidden`,void 0),Z([k()],$.prototype,`chatMobileControlsOpen`,void 0),Z([k()],$.prototype,`navDrawerOpen`,void 0),Z([k()],$.prototype,`chatInputHistoryIndex`,void 0),Z([k()],$.prototype,`chatDraftMode`,void 0),Z([k()],$.prototype,`sidebarOpen`,void 0),Z([k()],$.prototype,`sidebarContent`,void 0),Z([k()],$.prototype,`sidebarError`,void 0),Z([k()],$.prototype,`sidebarEditingSessionKey`,void 0),Z([k()],$.prototype,`sidebarEditingSessionLabel`,void 0),Z([k()],$.prototype,`sidebarMoreMenuKey`,void 0),Z([k()],$.prototype,`sidebarMoreMenuPos`,void 0),Z([k()],$.prototype,`sidebarDeleteConfirmKey`,void 0),Z([k()],$.prototype,`sidebarDeleteLinkedJobs`,void 0),Z([k()],$.prototype,`sidebarDeleteLinkedJobsLoading`,void 0),Z([k()],$.prototype,`sidebarDeleteInFlight`,void 0),Z([k()],$.prototype,`sidebarDeleteError`,void 0),Z([k()],$.prototype,`sidebarCreatingGroup`,void 0),Z([k()],$.prototype,`sidebarEditingGroupId`,void 0),Z([k()],$.prototype,`sidebarEditingGroupLabel`,void 0),Z([k()],$.prototype,`sidebarGroupMoreMenuId`,void 0),Z([k()],$.prototype,`sidebarDeleteGroupConfirmId`,void 0),Z([k()],$.prototype,`sidebarMoveMenuKey`,void 0),Z([k()],$.prototype,`sidebarGroupVersion`,void 0),Z([k()],$.prototype,`splitRatio`,void 0),Z([k()],$.prototype,`nodesLoading`,void 0),Z([k()],$.prototype,`nodes`,void 0),Z([k()],$.prototype,`devicesLoading`,void 0),Z([k()],$.prototype,`devicesError`,void 0),Z([k()],$.prototype,`devicesList`,void 0),Z([k()],$.prototype,`execApprovalsLoading`,void 0),Z([k()],$.prototype,`execApprovalsSaving`,void 0),Z([k()],$.prototype,`execApprovalsDirty`,void 0),Z([k()],$.prototype,`execApprovalsSnapshot`,void 0),Z([k()],$.prototype,`execApprovalsForm`,void 0),Z([k()],$.prototype,`execApprovalsSelectedAgent`,void 0),Z([k()],$.prototype,`execApprovalsTarget`,void 0),Z([k()],$.prototype,`execApprovalsTargetNodeId`,void 0),Z([k()],$.prototype,`execApprovalQueue`,void 0),Z([k()],$.prototype,`execApprovalBusy`,void 0),Z([k()],$.prototype,`execApprovalError`,void 0),Z([k()],$.prototype,`pendingGatewayUrl`,void 0),Z([k()],$.prototype,`configLoading`,void 0),Z([k()],$.prototype,`configRaw`,void 0),Z([k()],$.prototype,`configRawOriginal`,void 0),Z([k()],$.prototype,`configValid`,void 0),Z([k()],$.prototype,`configIssues`,void 0),Z([k()],$.prototype,`configSaving`,void 0),Z([k()],$.prototype,`configApplying`,void 0),Z([k()],$.prototype,`updateRunning`,void 0),Z([k()],$.prototype,`applySessionKey`,void 0),Z([k()],$.prototype,`configSnapshot`,void 0),Z([k()],$.prototype,`configSchema`,void 0),Z([k()],$.prototype,`configSchemaVersion`,void 0),Z([k()],$.prototype,`configSchemaLoading`,void 0),Z([k()],$.prototype,`configUiHints`,void 0),Z([k()],$.prototype,`configForm`,void 0),Z([k()],$.prototype,`configFormOriginal`,void 0),Z([k()],$.prototype,`dreamingStatusLoading`,void 0),Z([k()],$.prototype,`dreamingStatusError`,void 0),Z([k()],$.prototype,`dreamingStatus`,void 0),Z([k()],$.prototype,`dreamingModeSaving`,void 0),Z([k()],$.prototype,`dreamingRestartConfirmOpen`,void 0),Z([k()],$.prototype,`dreamingRestartConfirmLoading`,void 0),Z([k()],$.prototype,`dreamingPendingEnabled`,void 0),Z([k()],$.prototype,`dreamDiaryLoading`,void 0),Z([k()],$.prototype,`dreamDiaryActionLoading`,void 0),Z([k()],$.prototype,`dreamDiaryActionMessage`,void 0),Z([k()],$.prototype,`dreamDiaryActionArchivePath`,void 0),Z([k()],$.prototype,`dreamDiaryError`,void 0),Z([k()],$.prototype,`dreamDiaryPath`,void 0),Z([k()],$.prototype,`dreamDiaryContent`,void 0),Z([k()],$.prototype,`wikiImportInsightsLoading`,void 0),Z([k()],$.prototype,`wikiImportInsightsError`,void 0),Z([k()],$.prototype,`wikiImportInsights`,void 0),Z([k()],$.prototype,`wikiMemoryPalaceLoading`,void 0),Z([k()],$.prototype,`wikiMemoryPalaceError`,void 0),Z([k()],$.prototype,`wikiMemoryPalace`,void 0),Z([k()],$.prototype,`configFormDirty`,void 0),Z([k()],$.prototype,`configSettingsMode`,void 0),Z([k()],$.prototype,`configFormMode`,void 0),Z([k()],$.prototype,`configSearchQuery`,void 0),Z([k()],$.prototype,`configActiveSection`,void 0),Z([k()],$.prototype,`configActiveSubsection`,void 0),Z([k()],$.prototype,`pendingUpdateExpectedVersion`,void 0),Z([k()],$.prototype,`updateStatusBanner`,void 0),Z([k()],$.prototype,`communicationsFormMode`,void 0),Z([k()],$.prototype,`communicationsSearchQuery`,void 0),Z([k()],$.prototype,`communicationsActiveSection`,void 0),Z([k()],$.prototype,`communicationsActiveSubsection`,void 0),Z([k()],$.prototype,`appearanceFormMode`,void 0),Z([k()],$.prototype,`appearanceSearchQuery`,void 0),Z([k()],$.prototype,`appearanceActiveSection`,void 0),Z([k()],$.prototype,`appearanceActiveSubsection`,void 0),Z([k()],$.prototype,`automationFormMode`,void 0),Z([k()],$.prototype,`automationSearchQuery`,void 0),Z([k()],$.prototype,`automationActiveSection`,void 0),Z([k()],$.prototype,`automationActiveSubsection`,void 0),Z([k()],$.prototype,`infrastructureFormMode`,void 0),Z([k()],$.prototype,`infrastructureSearchQuery`,void 0),Z([k()],$.prototype,`infrastructureActiveSection`,void 0),Z([k()],$.prototype,`infrastructureActiveSubsection`,void 0),Z([k()],$.prototype,`aiAgentsFormMode`,void 0),Z([k()],$.prototype,`aiAgentsSearchQuery`,void 0),Z([k()],$.prototype,`aiAgentsActiveSection`,void 0),Z([k()],$.prototype,`aiAgentsActiveSubsection`,void 0),Z([k()],$.prototype,`channelsLoading`,void 0),Z([k()],$.prototype,`channelsSnapshot`,void 0),Z([k()],$.prototype,`channelsError`,void 0),Z([k()],$.prototype,`channelsLastSuccess`,void 0),Z([k()],$.prototype,`whatsappLoginMessage`,void 0),Z([k()],$.prototype,`whatsappLoginQrDataUrl`,void 0),Z([k()],$.prototype,`whatsappLoginConnected`,void 0),Z([k()],$.prototype,`whatsappBusy`,void 0),Z([k()],$.prototype,`nostrProfileFormState`,void 0),Z([k()],$.prototype,`nostrProfileAccountId`,void 0),Z([k()],$.prototype,`presenceLoading`,void 0),Z([k()],$.prototype,`presenceEntries`,void 0),Z([k()],$.prototype,`presenceError`,void 0),Z([k()],$.prototype,`presenceStatus`,void 0),Z([k()],$.prototype,`agentsLoading`,void 0),Z([k()],$.prototype,`agentsList`,void 0),Z([k()],$.prototype,`agentsError`,void 0),Z([k()],$.prototype,`agentsSelectedId`,void 0),Z([k()],$.prototype,`toolsCatalogLoading`,void 0),Z([k()],$.prototype,`toolsCatalogError`,void 0),Z([k()],$.prototype,`toolsCatalogResult`,void 0),Z([k()],$.prototype,`toolsEffectiveLoading`,void 0),Z([k()],$.prototype,`toolsEffectiveLoadingKey`,void 0),Z([k()],$.prototype,`toolsEffectiveResultKey`,void 0),Z([k()],$.prototype,`toolsEffectiveError`,void 0),Z([k()],$.prototype,`toolsEffectiveResult`,void 0),Z([k()],$.prototype,`agentsPanel`,void 0),Z([k()],$.prototype,`agentFilesLoading`,void 0),Z([k()],$.prototype,`agentFilesError`,void 0),Z([k()],$.prototype,`agentFilesList`,void 0),Z([k()],$.prototype,`agentFileContents`,void 0),Z([k()],$.prototype,`agentFileDrafts`,void 0),Z([k()],$.prototype,`agentFileActive`,void 0),Z([k()],$.prototype,`agentFileSaving`,void 0),Z([k()],$.prototype,`agentIdentityLoading`,void 0),Z([k()],$.prototype,`agentIdentityError`,void 0),Z([k()],$.prototype,`agentIdentityById`,void 0),Z([k()],$.prototype,`agentSkillsLoading`,void 0),Z([k()],$.prototype,`agentSkillsError`,void 0),Z([k()],$.prototype,`agentSkillsReport`,void 0),Z([k()],$.prototype,`agentSkillsAgentId`,void 0),Z([k()],$.prototype,`sessionsLoading`,void 0),Z([k()],$.prototype,`sessionsResult`,void 0),Z([k()],$.prototype,`sessionsError`,void 0),Z([k()],$.prototype,`contextWeight`,void 0),Z([k()],$.prototype,`contextWeightKey`,void 0),Z([k()],$.prototype,`contextWeightLoading`,void 0),Z([k()],$.prototype,`sessionsFilterActive`,void 0),Z([k()],$.prototype,`sessionsFilterLimit`,void 0),Z([k()],$.prototype,`sessionsIncludeGlobal`,void 0),Z([k()],$.prototype,`sessionsIncludeUnknown`,void 0),Z([k()],$.prototype,`sessionsShowArchived`,void 0),Z([k()],$.prototype,`sessionsFiltersCollapsed`,void 0),Z([k()],$.prototype,`sessionsHideCron`,void 0),Z([k()],$.prototype,`sessionsSearchQuery`,void 0),Z([k()],$.prototype,`sessionsSortColumn`,void 0),Z([k()],$.prototype,`sessionsSortDir`,void 0),Z([k()],$.prototype,`sessionsPage`,void 0),Z([k()],$.prototype,`sessionsPageSize`,void 0),Z([k()],$.prototype,`sessionsSelectedKeys`,void 0),Z([k()],$.prototype,`sessionsExpandedCheckpointKey`,void 0),Z([k()],$.prototype,`sessionsCheckpointItemsByKey`,void 0),Z([k()],$.prototype,`sessionsCheckpointLoadingKey`,void 0),Z([k()],$.prototype,`sessionsCheckpointBusyKey`,void 0),Z([k()],$.prototype,`sessionsCheckpointErrorByKey`,void 0),Z([k()],$.prototype,`usageLoading`,void 0),Z([k()],$.prototype,`usageResult`,void 0),Z([k()],$.prototype,`usageCostSummary`,void 0),Z([k()],$.prototype,`usageError`,void 0),Z([k()],$.prototype,`usageStartDate`,void 0),Z([k()],$.prototype,`usageEndDate`,void 0),Z([k()],$.prototype,`usageSelectedSessions`,void 0),Z([k()],$.prototype,`usageSelectedDays`,void 0),Z([k()],$.prototype,`usageSelectedHours`,void 0),Z([k()],$.prototype,`usageChartMode`,void 0),Z([k()],$.prototype,`usageDailyChartMode`,void 0),Z([k()],$.prototype,`usageTimeSeriesMode`,void 0),Z([k()],$.prototype,`usageTimeSeriesBreakdownMode`,void 0),Z([k()],$.prototype,`usageTimeSeries`,void 0),Z([k()],$.prototype,`usageTimeSeriesLoading`,void 0),Z([k()],$.prototype,`usageTimeSeriesCursorStart`,void 0),Z([k()],$.prototype,`usageTimeSeriesCursorEnd`,void 0),Z([k()],$.prototype,`usageSessionLogs`,void 0),Z([k()],$.prototype,`usageSessionLogsLoading`,void 0),Z([k()],$.prototype,`usageSessionLogsExpanded`,void 0),Z([k()],$.prototype,`usageQuery`,void 0),Z([k()],$.prototype,`usageQueryDraft`,void 0),Z([k()],$.prototype,`usageSessionSort`,void 0),Z([k()],$.prototype,`usageSessionSortDir`,void 0),Z([k()],$.prototype,`usageRecentSessions`,void 0),Z([k()],$.prototype,`usageTimeZone`,void 0),Z([k()],$.prototype,`usageContextExpanded`,void 0),Z([k()],$.prototype,`usageHeaderPinned`,void 0),Z([k()],$.prototype,`usageSessionsTab`,void 0),Z([k()],$.prototype,`usageVisibleColumns`,void 0),Z([k()],$.prototype,`usageLogFilterRoles`,void 0),Z([k()],$.prototype,`usageLogFilterTools`,void 0),Z([k()],$.prototype,`usageLogFilterHasTools`,void 0),Z([k()],$.prototype,`usageLogFilterQuery`,void 0),Z([k()],$.prototype,`activePanelId`,void 0),Z([k()],$.prototype,`sidebarStatusPopoverOpen`,void 0),Z([k()],$.prototype,`fileTreeLoading`,void 0),Z([k()],$.prototype,`fileTreeError`,void 0),Z([k()],$.prototype,`fileTreeResult`,void 0),Z([k()],$.prototype,`fileTreeSessionId`,void 0),Z([k()],$.prototype,`fileTreeExpandedDirs`,void 0),Z([k()],$.prototype,`fileTreeDirChildren`,void 0),Z([k()],$.prototype,`fileTreeDirLoading`,void 0),Z([k()],$.prototype,`fileTreeRefFiles`,void 0),Z([k()],$.prototype,`fileTreeRefLoading`,void 0),Z([k()],$.prototype,`fileTreeSplitRatio`,void 0),Z([k()],$.prototype,`fileTreeOutputCollapsed`,void 0),Z([k()],$.prototype,`fileTreeRefCollapsed`,void 0),Z([k()],$.prototype,`cnChannelsLoading`,void 0),Z([k()],$.prototype,`cnChannelsData`,void 0),Z([k()],$.prototype,`cnChannelsError`,void 0),Z([k()],$.prototype,`cnConnecting`,void 0),Z([k()],$.prototype,`cnQrcodeChannel`,void 0),Z([k()],$.prototype,`cnQrcodeImg`,void 0),Z([k()],$.prototype,`cnQrcodeToken`,void 0),Z([k()],$.prototype,`cnQrcodeLoading`,void 0),Z([k()],$.prototype,`cnFeishuOpen`,void 0),Z([k()],$.prototype,`cnFeishuSaving`,void 0),Z([k()],$.prototype,`skillCenterTab`,void 0),Z([k()],$.prototype,`centerSegment`,void 0),Z([k()],$.prototype,`skillCenterCategory`,void 0),Z([k()],$.prototype,`skillCenterSearch`,void 0),Z([k()],$.prototype,`skillCenterCategories`,void 0),Z([k()],$.prototype,`skillCenterCategoriesLoading`,void 0),Z([k()],$.prototype,`skillCenterItemBusy`,void 0),Z([k()],$.prototype,`skillCenterItemError`,void 0),Z([k()],$.prototype,`enterpriseSkills`,void 0),Z([k()],$.prototype,`enterpriseSkillsLoading`,void 0),Z([k()],$.prototype,`enterpriseInstallLoading`,void 0),Z([k()],$.prototype,`enterpriseError`,void 0),Z([k()],$.prototype,`publishDialogOpen`,void 0),Z([k()],$.prototype,`publishTarget`,void 0),Z([k()],$.prototype,`publishingSkill`,void 0),Z([k()],$.prototype,`publishLoading`,void 0),Z([k()],$.prototype,`publishError`,void 0),Z([k()],$.prototype,`publishSuccess`,void 0),Z([k()],$.prototype,`mySharesForMatching`,void 0),Z([k()],$.prototype,`mySharesLoaded`,void 0),Z([k()],$.prototype,`syncVersionMap`,void 0),Z([k()],$.prototype,`syncVersionByIdMap`,void 0),Z([k()],$.prototype,`shareDialogSkill`,void 0),Z([k()],$.prototype,`shareDialogPhase`,void 0),Z([k()],$.prototype,`shareDialogVersion`,void 0),Z([k()],$.prototype,`shareDialogResult`,void 0),Z([k()],$.prototype,`shareDialogError`,void 0),Z([k()],$.prototype,`shareDialogExisting`,void 0),Z([k()],$.prototype,`importDialogOpen`,void 0),Z([k()],$.prototype,`importShareCode`,void 0),Z([k()],$.prototype,`importPreview`,void 0),Z([k()],$.prototype,`importPreviewLoading`,void 0),Z([k()],$.prototype,`importClaimLoading`,void 0),Z([k()],$.prototype,`importClaimResult`,void 0),Z([k()],$.prototype,`importError`,void 0),Z([k()],$.prototype,`skillPublishState`,void 0),Z([k()],$.prototype,`skillGroups`,void 0),Z([k()],$.prototype,`skillGroupMap`,void 0),Z([k()],$.prototype,`selectedSkillGroupId`,void 0),Z([k()],$.prototype,`creatingSkillGroup`,void 0),Z([k()],$.prototype,`renamingSkillGroupId`,void 0),Z([k()],$.prototype,`deleteSkillGroupTarget`,void 0),Z([k()],$.prototype,`fileSpaceLoading`,void 0),Z([k()],$.prototype,`fileSpaceError`,void 0),Z([k()],$.prototype,`fileSpaceData`,void 0),Z([k()],$.prototype,`fileSpaceSearch`,void 0),Z([k()],$.prototype,`fileSpaceCollapsed`,void 0),Z([k()],$.prototype,`cronLoading`,void 0),Z([k()],$.prototype,`cronJobsLoaded`,void 0),Z([k()],$.prototype,`cronQuickCreateOpen`,void 0),Z([k()],$.prototype,`cronQuickCreateStep`,void 0),Z([k()],$.prototype,`cronQuickCreateDraft`,void 0),Z([k()],$.prototype,`cronJobsLoadingMore`,void 0),Z([k()],$.prototype,`cronJobs`,void 0),Z([k()],$.prototype,`cronResultSessionKeys`,void 0),Z([k()],$.prototype,`cronResultSessionJobs`,void 0),Z([k()],$.prototype,`cronJobsTotal`,void 0),Z([k()],$.prototype,`cronJobsHasMore`,void 0),Z([k()],$.prototype,`cronJobsNextOffset`,void 0),Z([k()],$.prototype,`cronJobsLimit`,void 0),Z([k()],$.prototype,`cronJobsQuery`,void 0),Z([k()],$.prototype,`cronJobsEnabledFilter`,void 0),Z([k()],$.prototype,`cronJobsScheduleKindFilter`,void 0),Z([k()],$.prototype,`cronJobsLastStatusFilter`,void 0),Z([k()],$.prototype,`cronJobsSortBy`,void 0),Z([k()],$.prototype,`cronJobsSortDir`,void 0),Z([k()],$.prototype,`cronStatus`,void 0),Z([k()],$.prototype,`cronError`,void 0),Z([k()],$.prototype,`cronForm`,void 0),Z([k()],$.prototype,`cronFormCollapsed`,void 0),Z([k()],$.prototype,`cronFieldErrors`,void 0),Z([k()],$.prototype,`cronEditingJobId`,void 0),Z([k()],$.prototype,`cronRunsJobId`,void 0),Z([k()],$.prototype,`cronRunsLoadingMore`,void 0),Z([k()],$.prototype,`cronRuns`,void 0),Z([k()],$.prototype,`cronRunsTotal`,void 0),Z([k()],$.prototype,`cronRunsHasMore`,void 0),Z([k()],$.prototype,`cronRunsNextOffset`,void 0),Z([k()],$.prototype,`cronRunsLimit`,void 0),Z([k()],$.prototype,`cronRunsScope`,void 0),Z([k()],$.prototype,`cronRunsStatuses`,void 0),Z([k()],$.prototype,`cronRunsDeliveryStatuses`,void 0),Z([k()],$.prototype,`cronRunsStatusFilter`,void 0),Z([k()],$.prototype,`cronRunsQuery`,void 0),Z([k()],$.prototype,`cronRunsSortDir`,void 0),Z([k()],$.prototype,`cronModelSuggestions`,void 0),Z([k()],$.prototype,`cronBusy`,void 0),Z([k()],$.prototype,`cronTasksView`,void 0),Z([k()],$.prototype,`cronTaskDialogOpen`,void 0),Z([k()],$.prototype,`cronTaskDialogMode`,void 0),Z([k()],$.prototype,`cronTaskMenuJobId`,void 0),Z([k()],$.prototype,`cronTaskDeleteConfirmJobId`,void 0),Z([k()],$.prototype,`cronTaskSessionQuery`,void 0),Z([k()],$.prototype,`skillDropdownOpen`,void 0),Z([k()],$.prototype,`cronTaskHistoryJobFilter`,void 0),Z([k()],$.prototype,`cronTaskHistoryDateFilter`,void 0),Z([k()],$.prototype,`updateAvailable`,void 0),Z([k()],$.prototype,`attentionItems`,void 0),Z([k()],$.prototype,`paletteOpen`,void 0),Z([k()],$.prototype,`sessionSwitcherOpen`,void 0),Z([k()],$.prototype,`paletteQuery`,void 0),Z([k()],$.prototype,`paletteActiveIndex`,void 0),Z([k()],$.prototype,`overviewShowGatewayToken`,void 0),Z([k()],$.prototype,`overviewShowGatewayPassword`,void 0),Z([k()],$.prototype,`overviewLogLines`,void 0),Z([k()],$.prototype,`overviewLogCursor`,void 0),Z([k()],$.prototype,`skillsLoading`,void 0),Z([k()],$.prototype,`skillsReport`,void 0),Z([k()],$.prototype,`skillsError`,void 0),Z([k()],$.prototype,`skillsFilter`,void 0),Z([k()],$.prototype,`skillsStatusFilter`,void 0),Z([k()],$.prototype,`skillEdits`,void 0),Z([k()],$.prototype,`skillsBusyKey`,void 0),Z([k()],$.prototype,`skillMessages`,void 0),Z([k()],$.prototype,`skillsDetailKey`,void 0),Z([k()],$.prototype,`clawhubSearchQuery`,void 0),Z([k()],$.prototype,`clawhubSearchResults`,void 0),Z([k()],$.prototype,`clawhubSearchLoading`,void 0),Z([k()],$.prototype,`clawhubSearchError`,void 0),Z([k()],$.prototype,`clawhubDetail`,void 0),Z([k()],$.prototype,`clawhubDetailSlug`,void 0),Z([k()],$.prototype,`clawhubDetailLoading`,void 0),Z([k()],$.prototype,`clawhubDetailError`,void 0),Z([k()],$.prototype,`clawhubInstallSlug`,void 0),Z([k()],$.prototype,`clawhubInstallMessage`,void 0),Z([k()],$.prototype,`healthLoading`,void 0),Z([k()],$.prototype,`healthResult`,void 0),Z([k()],$.prototype,`healthError`,void 0),Z([k()],$.prototype,`modelAuthStatusLoading`,void 0),Z([k()],$.prototype,`modelAuthStatusResult`,void 0),Z([k()],$.prototype,`modelAuthStatusError`,void 0),Z([k()],$.prototype,`debugLoading`,void 0),Z([k()],$.prototype,`debugStatus`,void 0),Z([k()],$.prototype,`debugHealth`,void 0),Z([k()],$.prototype,`debugModels`,void 0),Z([k()],$.prototype,`debugHeartbeat`,void 0),Z([k()],$.prototype,`debugCallMethod`,void 0),Z([k()],$.prototype,`debugCallParams`,void 0),Z([k()],$.prototype,`debugCallResult`,void 0),Z([k()],$.prototype,`debugCallError`,void 0),Z([k()],$.prototype,`apiKeys`,void 0),Z([k()],$.prototype,`sealclawModels`,void 0),Z([k()],$.prototype,`webPushSupported`,void 0),Z([k()],$.prototype,`webPushPermission`,void 0),Z([k()],$.prototype,`webPushSubscribed`,void 0),Z([k()],$.prototype,`webPushLoading`,void 0),Z([k()],$.prototype,`logsLoading`,void 0),Z([k()],$.prototype,`logsError`,void 0),Z([k()],$.prototype,`logsFile`,void 0),Z([k()],$.prototype,`logsEntries`,void 0),Z([k()],$.prototype,`logsFilterText`,void 0),Z([k()],$.prototype,`logsLevelFilters`,void 0),Z([k()],$.prototype,`logsAutoFollow`,void 0),Z([k()],$.prototype,`logsTruncated`,void 0),Z([k()],$.prototype,`logsCursor`,void 0),Z([k()],$.prototype,`logsLastFetchAt`,void 0),Z([k()],$.prototype,`logsLimit`,void 0),Z([k()],$.prototype,`logsMaxBytes`,void 0),Z([k()],$.prototype,`logsAtBottom`,void 0),Z([k()],$.prototype,`chatNewMessagesBelow`,void 0),Z([k()],$.prototype,`chatTocActiveIndex`,void 0),customElements.get(`openclaw-app`)||customElements.define(`openclaw-app`,$);var y1=T((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=typeof window<`u`?window.proxy||window:{};e.qiankunWindow=t,e.renderWithQiankun=function(e){t!=null&&t.__POWERED_BY_QIANKUN__&&(window.moudleQiankunAppLifeCycles||(window.moudleQiankunAppLifeCycles={}),t.qiankunName&&(window.moudleQiankunAppLifeCycles[t.qiankunName]=e))}}))();function b1(){`serviceWorker`in navigator&&navigator.serviceWorker.register(`./sw.js`)}var x1=null;(0,y1.renderWithQiankun)({bootstrap(){return Promise.resolve()},mount(e){b1(),window.__OPENCLAW_CONTROL_UI_BASE_PATH__=`/sealclaw`;let t=(e==null?void 0:e.container)??document.body,n=t.querySelector(`openclaw-app`);return x1=n??document.createElement(`openclaw-app`),n||t.appendChild(x1),Promise.resolve()},unmount(){return x1==null||x1.remove(),x1=null,Promise.resolve()},update(){return Promise.resolve()}}),y1.qiankunWindow.__POWERED_BY_QIANKUN__||b1();export{Hm as A,jo as B,ih as C,zm as D,Zm as E,cm as F,ka as G,ko as H,qp as I,fi as J,Ti as K,hs as L,ah as M,Tm as N,Vm as O,wm as P,je as Q,U as R,rh as S,Um as T,Io as U,Ao as V,Aa as W,Hn as X,Vr as Y,Je as Z,r_ as _,MZ as a,$m as b,jZ as c,SW as d,eB as f,rD as g,FN as h,NZ as i,Wm as j,Gm as k,YJ as l,oR as m,FZ as n,AZ as o,fR as p,Ci as q,PZ as r,kZ as s,nQ as t,NJ as u,Lm as v,Em as w,Rm as x,Bm as y,ds as z};
|
|
8813
|
-
//# sourceMappingURL=index-
|
|
8812
|
+
`,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.dreamingStatusLoading=!1,this.dreamingStatusError=null,this.dreamingStatus=null,this.dreamingModeSaving=!1,this.dreamingRestartConfirmOpen=!1,this.dreamingRestartConfirmLoading=!1,this.dreamingPendingEnabled=null,this.dreamDiaryLoading=!1,this.dreamDiaryActionLoading=!1,this.dreamDiaryActionMessage=null,this.dreamDiaryActionArchivePath=null,this.dreamDiaryError=null,this.dreamDiaryPath=null,this.dreamDiaryContent=null,this.wikiImportInsightsLoading=!1,this.wikiImportInsightsError=null,this.wikiImportInsights=null,this.wikiMemoryPalaceLoading=!1,this.wikiMemoryPalaceError=null,this.wikiMemoryPalace=null,this.configFormDirty=!1,this.configSettingsMode=`quick`,this.configFormMode=`form`,this.configSearchQuery=``,this.configActiveSection=null,this.configActiveSubsection=null,this.pendingUpdateExpectedVersion=null,this.updateStatusBanner=null,this.communicationsFormMode=`form`,this.communicationsSearchQuery=``,this.communicationsActiveSection=null,this.communicationsActiveSubsection=null,this.appearanceFormMode=`form`,this.appearanceSearchQuery=``,this.appearanceActiveSection=null,this.appearanceActiveSubsection=null,this.automationFormMode=`form`,this.automationSearchQuery=``,this.automationActiveSection=null,this.automationActiveSubsection=null,this.infrastructureFormMode=`form`,this.infrastructureSearchQuery=``,this.infrastructureActiveSection=null,this.infrastructureActiveSubsection=null,this.aiAgentsFormMode=`form`,this.aiAgentsSearchQuery=``,this.aiAgentsActiveSection=null,this.aiAgentsActiveSubsection=null,this.channelsLoading=!1,this.channelsSnapshot=null,this.channelsError=null,this.channelsLastSuccess=null,this.whatsappLoginMessage=null,this.whatsappLoginQrDataUrl=null,this.whatsappLoginConnected=null,this.whatsappBusy=!1,this.nostrProfileFormState=null,this.nostrProfileAccountId=null,this.presenceLoading=!1,this.presenceEntries=[],this.presenceError=null,this.presenceStatus=null,this.agentsLoading=!1,this.agentsList=null,this.agentsError=null,this.agentsSelectedId=null,this.toolsCatalogLoading=!1,this.toolsCatalogError=null,this.toolsCatalogResult=null,this.toolsEffectiveLoading=!1,this.toolsEffectiveLoadingKey=null,this.toolsEffectiveResultKey=null,this.toolsEffectiveError=null,this.toolsEffectiveResult=null,this.agentsPanel=`files`,this.agentFilesLoading=!1,this.agentFilesError=null,this.agentFilesList=null,this.agentFileContents={},this.agentFileDrafts={},this.agentFileActive=null,this.agentFileSaving=!1,this.agentIdentityLoading=!1,this.agentIdentityError=null,this.agentIdentityById={},this.agentSkillsLoading=!1,this.agentSkillsError=null,this.agentSkillsReport=null,this.agentSkillsAgentId=null,this.sessionsLoading=!1,this.sessionsResult=null,this.sessionsError=null,this.contextWeight=null,this.contextWeightKey=null,this.contextWeightLoading=!1,this.sessionsFilterActive=$h.activeMinutes,this.sessionsFilterLimit=$h.limit,this.sessionsIncludeGlobal=!0,this.sessionsIncludeUnknown=!1,this.sessionsShowArchived=!1,this.sessionsFiltersCollapsed=!1,this.sessionsHideCron=!0,this.sessionsSearchQuery=``,this.sessionsSortColumn=`updated`,this.sessionsSortDir=`desc`,this.sessionsPage=0,this.sessionsPageSize=25,this.sessionsSelectedKeys=new Set,this.sessionsExpandedCheckpointKey=null,this.sessionsCheckpointItemsByKey={},this.sessionsCheckpointLoadingKey=null,this.sessionsCheckpointBusyKey=null,this.sessionsCheckpointErrorByKey={},this.usageLoading=!1,this.usageResult=null,this.usageCostSummary=null,this.usageError=null,this.usageStartDate=(()=>{let e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`})(),this.usageEndDate=(()=>{let e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`})(),this.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.activePanelId=null,this.sidebarStatusPopoverOpen=!1,this.fileTreeLoading=!1,this.fileTreeError=null,this.fileTreeResult=null,this.fileTreeSessionId=void 0,this.fileTreeExpandedDirs=[],this.fileTreeDirChildren={},this.fileTreeDirLoading=[],this.fileTreeRefFiles=null,this.fileTreeRefLoading=!1,this.fileTreeSplitRatio=this.settings.fileTreeSplitRatio,this.fileTreeOutputCollapsed=!1,this.fileTreeRefCollapsed=!1,this.cnChannelsLoading=!1,this.cnChannelsData=null,this.cnChannelsError=null,this.cnConnecting=null,this.cnQrcodeChannel=null,this.cnQrcodeImg=null,this.cnQrcodeToken=null,this.cnQrcodeLoading=!1,this.cnQrcodePollTimer=null,this.cnFeishuOpen=!1,this.cnFeishuSaving=!1,this.cnFeishuFormAppId=``,this.cnFeishuFormAppSecret=``,this.skillCenterTab=`center`,this.centerSegment=`store`,this.skillCenterCategory=null,this.skillCenterSearch=``,this.skillCenterCategories=null,this.skillCenterCategoriesLoading=!1,this.skillCenterItemBusy=null,this.skillCenterItemError=null,this.enterpriseSkills=[],this.enterpriseSkillsLoaded=!1,this.enterpriseSkillsLoading=!1,this.enterpriseInstallLoading=null,this.enterpriseError=null,this.publishDialogOpen=!1,this.publishTarget=null,this.publishingSkill=null,this.publishLoading=!1,this.publishError=null,this.publishSuccess=null,this.mySharesForMatching=[],this.mySharesLoaded=!1,this.syncVersionMap=new Map,this.syncVersionByIdMap=new Map,this.syncVersionMapLoaded=!1,this.shareDialogSkill=null,this.shareDialogPhase=`confirm`,this.shareDialogVersion=`1.0.0`,this.shareDialogResult=null,this.shareDialogError=null,this.shareDialogExisting=null,this.importDialogOpen=!1,this.importShareCode=``,this.importPreview=null,this.importPreviewLoading=!1,this.importClaimLoading=!1,this.importClaimResult=null,this.importError=null,this.skillPublishState=null,this.skillGroups=rQ(),this.skillGroupMap=iQ(),this.selectedSkillGroupId=null,this.creatingSkillGroup=!1,this.renamingSkillGroupId=null,this.deleteSkillGroupTarget=null,this.fileSpaceLoading=!1,this.fileSpaceError=null,this.fileSpaceData=null,this.fileSpaceSearch=``,this.fileSpaceCollapsed=[],this.usageQueryDebounceTimer=null,this.cronLoading=!1,this.cronJobsLoaded=!1,this.cronQuickCreateOpen=!1,this.cronQuickCreateStep=`what`,this.cronQuickCreateDraft=null,this.cronJobsLoadingMore=!1,this.cronJobs=[],this.cronResultSessionKeys=new Set,this.cronResultSessionJobs=new Map,this.cronJobsTotal=0,this.cronJobsHasMore=!1,this.cronJobsNextOffset=null,this.cronJobsLimit=50,this.cronJobsQuery=``,this.cronJobsEnabledFilter=`all`,this.cronJobsScheduleKindFilter=`all`,this.cronJobsLastStatusFilter=`all`,this.cronJobsSortBy=`nextRunAtMs`,this.cronJobsSortDir=`asc`,this.cronStatus=null,this.cronError=null,this.cronForm={...eg},this.cronFormCollapsed=!1,this.cronFieldErrors={},this.cronEditingJobId=null,this.cronRunsJobId=null,this.cronRunsLoadingMore=!1,this.cronRuns=[],this.cronRunsTotal=0,this.cronRunsHasMore=!1,this.cronRunsNextOffset=null,this.cronRunsLimit=50,this.cronRunsScope=`all`,this.cronRunsStatuses=[],this.cronRunsDeliveryStatuses=[],this.cronRunsStatusFilter=`all`,this.cronRunsQuery=``,this.cronRunsSortDir=`desc`,this.cronModelSuggestions=[],this.cronBusy=!1,this.cronTasksView=`list`,this.cronTaskDialogOpen=!1,this.cronTaskDialogMode=`create`,this.cronTaskMenuJobId=null,this.cronTaskDeleteConfirmJobId=null,this.cronTaskSessionQuery=``,this.skillDropdownOpen=!1,this.cronTaskHistoryJobFilter=``,this.cronTaskHistoryDateFilter=`7d`,this.updateAvailable=null,this.attentionItems=[],this.paletteOpen=!1,this.sessionSwitcherOpen=!1,this.paletteQuery=``,this.paletteActiveIndex=0,this.overviewShowGatewayToken=!1,this.overviewShowGatewayPassword=!1,this.overviewLogLines=[],this.overviewLogCursor=0,this.skillsLoading=!1,this.skillsReport=null,this.skillsError=null,this.skillsFilter=``,this.skillsStatusFilter=`all`,this.skillEdits={},this.skillsBusyKey=null,this.skillMessages={},this.skillsDetailKey=null,this.clawhubSearchQuery=``,this.clawhubSearchResults=null,this.clawhubSearchLoading=!1,this.clawhubSearchError=null,this.clawhubDetail=null,this.clawhubDetailSlug=null,this.clawhubDetailLoading=!1,this.clawhubDetailError=null,this.clawhubInstallSlug=null,this.clawhubInstallMessage=null,this.healthLoading=!1,this.healthResult=null,this.healthError=null,this.modelAuthStatusLoading=!1,this.modelAuthStatusResult=null,this.modelAuthStatusError=null,this.debugLoading=!1,this.debugStatus=null,this.debugHealth=null,this.debugModels=[],this.debugHeartbeat=null,this.debugCallMethod=``,this.debugCallParams=`{}`,this.debugCallResult=null,this.debugCallError=null,this.apiKeys=[],this.sealclawModels=[],this.webPushSupported=!1,this.webPushPermission=`unsupported`,this.webPushSubscribed=!1,this.webPushLoading=!1,this.logsLoading=!1,this.logsError=null,this.logsFile=null,this.logsEntries=[],this.logsFilterText=``,this.logsLevelFilters={...Qh},this.logsAutoFollow=!0,this.logsTruncated=!1,this.logsCursor=null,this.logsLastFetchAt=null,this.logsLimit=500,this.logsMaxBytes=25e4,this.logsAtBottom=!0,this.client=null,this.chatScrollFrame=null,this.chatScrollTimeout=null,this.chatLastScrollTop=0,this.chatHasAutoScrolled=!1,this.chatUserNearBottom=!0,this.chatStreamAutoFollow=!0,this.pendingChatScrollMessageId=null,this.chatDeepLinkScrollInFlight=!1,this.chatNewMessagesBelow=!1,this.chatTocActiveIndex=null,this.nodesPollInterval=null,this.logsPollInterval=null,this.debugPollInterval=null,this.logsScrollFrame=null,this.controlUiResponsivenessObserver=null,this.toolStreamById=new Map,this.toolStreamOrder=[],this.refreshSessionsAfterChat=new Set,this.chatSideResultTerminalRuns=new Set,this.basePath=``,this.popStateHandler=()=>EH(this),this.topbarObserver=null,this.globalKeydownHandler=e=>{(e.metaKey||e.ctrlKey)&&!e.shiftKey&&e.key===`k`&&(e.preventDefault(),this.paletteOpen=!this.paletteOpen,this.paletteOpen&&(this.paletteQuery=``,this.paletteActiveIndex=0))},this.navDrawerMediaQuery=null,this.navDrawerMediaHandler=e=>{!e.matches&&this.navDrawerOpen&&(this.navDrawerOpen=!1)},this.chatMobileControlsKeydownHandler=e=>{e.key!==`Escape`||!this.chatMobileControlsOpen||(e.preventDefault(),this.setChatMobileControlsOpen(!1,{restoreFocus:!0}))},this.chatMobileControlsPointerdownHandler=e=>{if(!this.chatMobileControlsOpen)return;let t=this.querySelector(`.chat-mobile-controls-wrapper`);t&&e.composedPath().includes(t)||this.setChatMobileControlsOpen(!1)},this.sealclawInitDone=!1}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.onSlashAction=async e=>{switch(e){case`new-session`:FW(this);break;case`toggle-focus`:this.applySettings({...this.settings,chatFocusMode:!this.settings.chatFocusMode});break;case`export`:vM(this.chatMessages,this.assistantName);break;case`refresh-tools-effective`:await ya(this);break}},document.addEventListener(`keydown`,this.globalKeydownHandler),document.addEventListener(`keydown`,this.chatMobileControlsKeydownHandler),document.addEventListener(`pointerdown`,this.chatMobileControlsPointerdownHandler),N$(),this.navDrawerMediaQuery=window.matchMedia(`(max-width: 1100px)`),this.navDrawerMediaQuery.addEventListener(`change`,this.navDrawerMediaHandler),IU(this),this.initWebPushState(),this.loadApiKeys()}firstUpdated(){LU(this)}disconnectedCallback(){document.removeEventListener(`keydown`,this.globalKeydownHandler),document.removeEventListener(`keydown`,this.chatMobileControlsKeydownHandler),document.removeEventListener(`pointerdown`,this.chatMobileControlsPointerdownHandler),this.navDrawerMediaQuery&&(this.navDrawerMediaQuery.removeEventListener(`change`,this.navDrawerMediaHandler),this.navDrawerMediaQuery=null),this.sessionSwitchNoticeTimer!==null&&(window.clearTimeout(this.sessionSwitchNoticeTimer),this.sessionSwitchNoticeTimer=null),this.sessionSwitchFlashTimer!==null&&(window.clearTimeout(this.sessionSwitchFlashTimer),this.sessionSwitchFlashTimer=null),this.chatMobileControlsTrigger=null,BU(this),super.disconnectedCallback()}updated(e){if(VU(this,e),this.pendingChatScrollMessageId&&!this.chatDeepLinkScrollInFlight&&this.tab===`chat`&&this.chatMessages.length>0){let e=this.pendingChatScrollMessageId;this.chatDeepLinkScrollInFlight=!0,hc(this,e).then(t=>{this.chatDeepLinkScrollInFlight=!1,t?(this.chatHasAutoScrolled=!0,this.chatStreamAutoFollow=!1,this.pendingChatScrollMessageId=null):this.pendingChatScrollMessageId===e&&(this.pendingChatScrollMessageId=null)})}if(e.has(`connected`)&&this.connected&&(BH(this),this.sealclawInitDone?Ih(this,{scheduleScroll:!1,force:!0}):(this.sealclawInitDone=!0,this.initCreateApiKey())),e.has(`tab`)&&this.tab!==`chat`&&this.chatMobileControlsOpen&&this.setChatMobileControlsOpen(!1),!e.has(`sessionKey`)||this.agentsPanel!==`tools`)return;let t=ua(this.sessionKey);if(this.agentsSelectedId&&this.agentsSelectedId===t){ga(this,{agentId:this.agentsSelectedId,sessionKey:this.sessionKey});return}this.toolsEffectiveResult=null,this.toolsEffectiveResultKey=null,this.toolsEffectiveError=null,this.toolsEffectiveLoading=!1,this.toolsEffectiveLoadingKey=null}connect(){OU(this)}handleChatScroll(e){vc(this,e)}handleLogsScroll(e){yc(this,e)}exportLogs(e,t){Sc(e,t)}resetToolStream(){Bc(this)}resetChatScroll(){bc(this)}scrollChatToTop(){xc(this)}scrollToBottom(e){bc(this),mc(this,!0,!!(e!=null&&e.smooth))}async loadAssistantIdentity(){await JH(this)}applySettings(e){rH(this,e)}applyLocalUserIdentity(e){iH(this,e)}setTab(e){e===`filespace`&&(this.fileSpaceData=null,this.fileSpaceError=null),fH(this,e),e!==`chat`&&(this.setChatMobileControlsOpen(!1),this.sidebarOpen&&this.handleCloseSidebar()),this.navDrawerOpen=!1}setChatMobileControlsOpen(e,t){if(e){this.chatMobileControlsTrigger=(t==null?void 0:t.trigger)??this.chatMobileControlsTrigger,this.chatMobileControlsOpen=!0;return}let n=t!=null&&t.restoreFocus?this.chatMobileControlsTrigger:null;this.chatMobileControlsOpen=!1,this.chatMobileControlsTrigger=null,!(!(n instanceof HTMLElement)||!n.isConnected)&&requestAnimationFrame(()=>{n.isConnected&&n.focus()})}setTheme(e,t){mH(this,e,t),this.themeOrder=this.buildThemeOrder(e)}setThemeMode(e,t){hH(this,e,t)}setCustomThemeImportUrl(e){var t;this.customThemeImportUrl=e,((t=this.customThemeImportMessage)==null?void 0:t.kind)===`error`&&(this.customThemeImportMessage=null)}openCustomThemeImport(){this.customThemeImportExpanded=!0,this.customThemeImportFocusToken+=1,this.settings.customTheme||(this.customThemeImportSelectOnSuccess=!0)}async importCustomTheme(){if(!this.customThemeImportBusy){this.customThemeImportExpanded=!0,this.customThemeImportBusy=!0,this.customThemeImportMessage=null;try{let e=await dE(this.customThemeImportUrl),t=this.theme===`custom`||!this.settings.customTheme||this.customThemeImportSelectOnSuccess;rH(this,{...this.settings,theme:t?`custom`:this.settings.theme,customTheme:e}),this.themeOrder=this.buildThemeOrder(t?`custom`:this.theme),this.customThemeImportUrl=``,this.customThemeImportSelectOnSuccess=!1,this.customThemeImportMessage={kind:`success`,text:`Imported ${e.label}.`}}catch(e){this.customThemeImportMessage={kind:`error`,text:e instanceof Error?e.message:`Failed to import tweakcn theme.`}}finally{this.customThemeImportBusy=!1}}}clearCustomTheme(){let e=this.theme===`custom`?`claw`:this.theme;this.customThemeImportExpanded=!0,this.customThemeImportSelectOnSuccess=!1,rH(this,{...this.settings,theme:e,customTheme:void 0}),this.themeOrder=this.buildThemeOrder(e),this.customThemeImportMessage={kind:`success`,text:`Cleared custom theme.`}}setBorderRadius(e){rH(this,{...this.settings,borderRadius:e}),this.requestUpdate()}switchSessionFromHistory(e){RW(this,e,{skipUrlSync:!0})}announceSessionSwitch(e,t){let n=++this.sessionSwitchNoticeSeq;this.sessionSwitchNoticeTimer!==null&&window.clearTimeout(this.sessionSwitchNoticeTimer),this.sessionSwitchFlashTimer!==null&&window.clearTimeout(this.sessionSwitchFlashTimer),this.sessionSwitchNotice={id:n,text:`已切换到 ${t}`},this.sessionSwitchFlashKey=e,this.sessionSwitchFlashTimer=window.setTimeout(()=>{var e;((e=this.sessionSwitchNotice)==null?void 0:e.id)===n&&(this.sessionSwitchFlashKey=null),this.sessionSwitchFlashTimer=null},200),this.sessionSwitchNoticeTimer=window.setTimeout(()=>{var e;((e=this.sessionSwitchNotice)==null?void 0:e.id)===n&&(this.sessionSwitchNotice=null),this.sessionSwitchNoticeTimer=null},2800)}buildThemeOrder(e){return[e,...[...hE].filter(t=>t!==e)]}async loadOverview(e){await NH(this,e)}async loadCron(){await zH(this)}async handleAbortChat(){await gh(this)}handleChatDraftChange(e){tu(this,e)}handleChatInputHistoryKey(e){return au(this,e)}resetChatInputHistoryNavigation(){eu(this)}removeQueuedMessage(e){Eh(this,e)}async handleSendChat(e,t){let n=(e??this.chatMessage).trim();await LW(this,n)&&await Oh(this,e,t)}async regenerateLastChat(){await Nh(this)}async toggleRealtimeTalk(){if(this.realtimeTalkSession)if(this.realtimeTalkStatus===`error`)this.realtimeTalkSession.stop(),this.realtimeTalkSession=null;else{this.realtimeTalkSession.stop(),this.realtimeTalkSession=null,this.realtimeTalkActive=!1,this.realtimeTalkStatus=`idle`,this.realtimeTalkDetail=null,this.realtimeTalkTranscript=null;return}if(!this.client||!this.connected){this.lastError=`Gateway not connected`;return}this.realtimeTalkActive=!0,this.realtimeTalkStatus=`connecting`,this.realtimeTalkDetail=null,this.realtimeTalkTranscript=null;let e=new s1(this.client,this.sessionKey,{onStatus:(e,t)=>{this.realtimeTalkStatus=e,this.realtimeTalkDetail=t??null,(e===`idle`||e===`error`)&&(this.realtimeTalkActive=e!==`idle`)},onTranscript:e=>{this.realtimeTalkTranscript=`${e.role===`user`?`你`:`万能玺虾`}: ${e.text}`}});this.realtimeTalkSession=e;try{await e.start()}catch(t){e.stop(),this.realtimeTalkSession===e&&(this.realtimeTalkSession=null),this.realtimeTalkActive=!1,this.realtimeTalkStatus=`error`,this.realtimeTalkDetail=t instanceof Error?t.message:String(t),this.lastError=this.realtimeTalkDetail}}async steerQueuedChatMessage(e){await wh(this,e)}async handleWhatsAppStart(e){await Ur(this,e)}async handleWhatsAppWait(){await Wr(this)}async handleWhatsAppLogout(){await Gr(this)}async handleChannelConfigSave(){await Kr(this)}async handleChannelConfigReload(){await qr(this)}handleNostrProfileEdit(e,t){Qr(this,e,t)}handleNostrProfileCancel(){$r(this)}handleNostrProfileFieldChange(e,t){ei(this,e,t)}async handleNostrProfileSave(){await ni(this)}async handleNostrProfileImport(){await ri(this)}handleNostrProfileToggleAdvanced(){ti(this)}async handleExecApprovalDecision(e,t){let n=rU(this.execApprovalQueue,t);if(!(!n||!this.client||this.execApprovalBusy)){this.execApprovalBusy=!0,this.execApprovalError=null;try{let t=n.kind===`plugin`?`plugin.approval.resolve`:`exec.approval.resolve`;await this.client.request(t,{id:n.id,decision:e}),this.execApprovalQueue=this.execApprovalQueue.filter(e=>e.id!==n.id)}catch(e){this.execApprovalError=`Approval failed: ${String(e)}`}finally{this.execApprovalBusy=!1}}}handleGatewayUrlConfirm(){var e;let t=this.pendingGatewayUrl;if(!t)return;let n=((e=this.pendingGatewayToken)==null?void 0:e.trim())||``;this.pendingGatewayUrl=null,this.pendingGatewayToken=null,rH(this,{...this.settings,gatewayUrl:t,token:n}),this.connect()}handleGatewayUrlCancel(){this.pendingGatewayUrl=null,this.pendingGatewayToken=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){let t=Math.max(.4,Math.min(.7,e));this.splitRatio=t,this.applySettings({...this.settings,splitRatio:t})}handleFileTreeSplitRatioChange(e){let t=Math.max(.2,Math.min(.8,e));this.fileTreeSplitRatio=t,this.applySettings({...this.settings,fileTreeSplitRatio:t})}getUserUuidFromJwt(){let e=localStorage.getItem(`jwt`)??``;if(!e)return``;try{let t=e.split(`.`);if(t.length<2)return``;let n=t[1].replace(/-/g,`+`).replace(/_/g,`/`);for(;n.length%4;)n+=`=`;return JSON.parse(atob(n)).userUuid||``}catch{return``}}async initCreateApiKey(){try{var e,t;let n=this.getUserUuidFromJwt();this.configSnapshot||await yr(this);let r=await M({name:`default`});if(!((e=r.data)!=null&&e.key)){let e=(await N()).data??[];for(let t of e)await ie(t.id);r=await M({name:`default`})}let i=(t=r.data)==null?void 0:t.key;if(!i)return;n&&localStorage.setItem(`sealclaw_user_uuid`,n),await this.loadSealclawModels(i)}catch(e){console.error(`[sealclaw] initCreateApiKey error:`,e)}}async loadSealclawModels(e){try{let t=(await ae(e)).data??[];if(this.sealclawModels=t,!this.client||!this.configSnapshot){console.warn(`[sealclaw] client or configSnapshot not ready`);return}if(t.length===0){console.warn(`[sealclaw] /models returned empty; keeping existing catalog`);return}let n=`https://gateway.sealseek.cn/api/sealclaw/v1`,r=this.client,i=(e,t)=>r.request(e,t),a=()=>yr(this),o=()=>{var e;return(e=this.configSnapshot)==null?void 0:e.hash},s=u1(d1(this.configSnapshot.config)),c=t.map(e=>e.id),l=f1(s,c);if(l&&(await m1({request:i,reload:a,getBaseHash:o,raw:JSON.stringify({models:{providers:{sealseek:null}}}),allowSizeDrop:!0}),await a()),!this.configSnapshot)return;JSON.stringify({models:{providers:{sealseek:{baseUrl:n,api:`openai-completions`,...e?{apiKey:e}:{},models:t.map(e=>{let{api:t,reasoning:n}=h1(e.protocol);return{id:e.id,name:e.id,input:[`text`,`image`],api:t,reasoning:n}})}}}}),console.log(`[sealclaw] writing sealseek.json`,{baseUrl:n,modelCount:t.length,hasApiKey:!!e,replacedProvider:l}),await m1({request:i,reload:a,getBaseHash:o,raw:p1({baseUrl:n,apiKey:e,models:t})}),console.log(`[sealclaw] sealseek.json written`);let u=new Set(c);for(let e=0;e<10&&this.client;e++){let e=await zp(this.client),t=new Set(e.filter(e=>e.provider===`sealseek`).map(e=>e.id));if(t.size===u.size&&[...u].every(e=>t.has(e))){this.chatModelCatalog=e;break}await new Promise(e=>setTimeout(e,200))}await Ih(this,{scheduleScroll:!1,force:!0})}catch(e){console.error(`[sealclaw] config.patch failed`,e)}}async loadApiKeys(){try{let e=await N();e.data&&(this.apiKeys=e.data)}catch{}}async initWebPushState(){let e=`serviceWorker`in navigator&&`PushManager`in window&&`Notification`in window;if(this.webPushSupported=e,this.webPushPermission=e?Notification.permission:`unsupported`,e)try{let{getExistingSubscription:e}=await SW(async()=>{let{getExistingSubscription:e}=await import(`./push-subscription-BnLpzIye.js`);return{getExistingSubscription:e}},[]),t=await e();this.webPushSubscribed=t!==null}catch{}}async reconcileWebPushState(){if(this.client)try{var e,t;let{getExistingSubscription:n}=await SW(async()=>{let{getExistingSubscription:e}=await import(`./push-subscription-BnLpzIye.js`);return{getExistingSubscription:e}},[]),r=await n();if(!r)return;this.webPushSubscribed=!0;let i=r.toJSON();i.endpoint&&(e=i.keys)!=null&&e.p256dh&&(t=i.keys)!=null&&t.auth&&await this.client.request(`push.web.subscribe`,{endpoint:i.endpoint,keys:{p256dh:i.keys.p256dh,auth:i.keys.auth}})}catch{}}async handleWebPushSubscribe(){if(!(!this.client||this.webPushLoading)){this.webPushLoading=!0;try{let{subscribeToWebPush:e}=await SW(async()=>{let{subscribeToWebPush:e}=await import(`./push-subscription-BnLpzIye.js`);return{subscribeToWebPush:e}},[]);await e(this.client),this.webPushSubscribed=!0,this.webPushPermission=Notification.permission}catch(e){this.lastError=String(e)}finally{this.webPushLoading=!1,`Notification`in window&&(this.webPushPermission=Notification.permission)}}}async handleWebPushUnsubscribe(){if(!(!this.client||this.webPushLoading)){this.webPushLoading=!0;try{let{unsubscribeFromWebPush:e}=await SW(async()=>{let{unsubscribeFromWebPush:e}=await import(`./push-subscription-BnLpzIye.js`);return{unsubscribeFromWebPush:e}},[]);await e(this.client),this.webPushSubscribed=!1}catch(e){this.lastError=String(e)}finally{this.webPushLoading=!1}}}async handleWebPushTest(){if(this.client)try{let{sendTestWebPush:e}=await SW(async()=>{let{sendTestWebPush:e}=await import(`./push-subscription-BnLpzIye.js`);return{sendTestWebPush:e}},[]);await e(this.client)}catch(e){this.lastError=String(e)}}render(){return w$(this)}};Z([k()],$.prototype,`settings`,void 0),Z([k()],$.prototype,`password`,void 0),Z([k()],$.prototype,`loginShowGatewayToken`,void 0),Z([k()],$.prototype,`loginShowGatewayPassword`,void 0),Z([k()],$.prototype,`tab`,void 0),Z([k()],$.prototype,`onboarding`,void 0),Z([k()],$.prototype,`connected`,void 0),Z([k()],$.prototype,`theme`,void 0),Z([k()],$.prototype,`themeMode`,void 0),Z([k()],$.prototype,`themeResolved`,void 0),Z([k()],$.prototype,`themeOrder`,void 0),Z([k()],$.prototype,`customThemeImportUrl`,void 0),Z([k()],$.prototype,`customThemeImportBusy`,void 0),Z([k()],$.prototype,`customThemeImportMessage`,void 0),Z([k()],$.prototype,`customThemeImportExpanded`,void 0),Z([k()],$.prototype,`customThemeImportFocusToken`,void 0),Z([k()],$.prototype,`hello`,void 0),Z([k()],$.prototype,`lastError`,void 0),Z([k()],$.prototype,`lastErrorCode`,void 0),Z([k()],$.prototype,`eventLog`,void 0),Z([k()],$.prototype,`assistantName`,void 0),Z([k()],$.prototype,`assistantAvatar`,void 0),Z([k()],$.prototype,`assistantAvatarSource`,void 0),Z([k()],$.prototype,`assistantAvatarStatus`,void 0),Z([k()],$.prototype,`assistantAvatarReason`,void 0),Z([k()],$.prototype,`assistantAvatarUploadBusy`,void 0),Z([k()],$.prototype,`assistantAvatarUploadError`,void 0),Z([k()],$.prototype,`assistantAgentId`,void 0),Z([k()],$.prototype,`userName`,void 0),Z([k()],$.prototype,`userAvatar`,void 0),Z([k()],$.prototype,`localMediaPreviewRoots`,void 0),Z([k()],$.prototype,`embedSandboxMode`,void 0),Z([k()],$.prototype,`allowExternalEmbedUrls`,void 0),Z([k()],$.prototype,`chatMessageMaxWidth`,void 0),Z([k()],$.prototype,`serverVersion`,void 0),Z([k()],$.prototype,`sessionKey`,void 0),Z([k()],$.prototype,`chatLoading`,void 0),Z([k()],$.prototype,`chatSending`,void 0),Z([k()],$.prototype,`chatMessage`,void 0),Z([k()],$.prototype,`chatMessages`,void 0),Z([k()],$.prototype,`chatToolMessages`,void 0),Z([k()],$.prototype,`chatStreamSegments`,void 0),Z([k()],$.prototype,`chatStream`,void 0),Z([k()],$.prototype,`chatStreamStartedAt`,void 0),Z([k()],$.prototype,`chatStreamTick`,void 0),Z([k()],$.prototype,`chatStreamLastDurationSec`,void 0),Z([k()],$.prototype,`chatStreamLastModel`,void 0),Z([k()],$.prototype,`chatStreamLastThinkingBlocks`,void 0),Z([k()],$.prototype,`chatStreamRevealLen`,void 0),Z([k()],$.prototype,`chatStreamRevealReasoningLen`,void 0),Z([k()],$.prototype,`chatRunId`,void 0),Z([k()],$.prototype,`chatAbortingSessionKeys`,void 0),Z([k()],$.prototype,`chatSideResult`,void 0),Z([k()],$.prototype,`compactionStatus`,void 0),Z([k()],$.prototype,`fallbackStatus`,void 0),Z([k()],$.prototype,`chatAvatarUrl`,void 0),Z([k()],$.prototype,`chatAvatarSource`,void 0),Z([k()],$.prototype,`chatAvatarStatus`,void 0),Z([k()],$.prototype,`chatAvatarReason`,void 0),Z([k()],$.prototype,`chatThinkingLevel`,void 0),Z([k()],$.prototype,`chatModelOverrides`,void 0),Z([k()],$.prototype,`chatModelsLoading`,void 0),Z([k()],$.prototype,`chatModelCatalog`,void 0),Z([k()],$.prototype,`sessionSwitchNotice`,void 0),Z([k()],$.prototype,`sessionSwitchFlashKey`,void 0),Z([k()],$.prototype,`chatQueue`,void 0),Z([k()],$.prototype,`chatQueueBySession`,void 0),Z([k()],$.prototype,`chatAttachments`,void 0),Z([k()],$.prototype,`realtimeTalkActive`,void 0),Z([k()],$.prototype,`realtimeTalkStatus`,void 0),Z([k()],$.prototype,`realtimeTalkDetail`,void 0),Z([k()],$.prototype,`realtimeTalkTranscript`,void 0),Z([k()],$.prototype,`skillStoreOpen`,void 0),Z([k()],$.prototype,`storeSkills`,void 0),Z([k()],$.prototype,`storeSkillsLoading`,void 0),Z([k()],$.prototype,`storeItemLoading`,void 0),Z([k()],$.prototype,`storeItemError`,void 0),Z([k()],$.prototype,`chatManualRefreshInFlight`,void 0),Z([k()],$.prototype,`chatHeaderControlsHidden`,void 0),Z([k()],$.prototype,`chatMobileControlsOpen`,void 0),Z([k()],$.prototype,`navDrawerOpen`,void 0),Z([k()],$.prototype,`chatInputHistoryIndex`,void 0),Z([k()],$.prototype,`chatDraftMode`,void 0),Z([k()],$.prototype,`sidebarOpen`,void 0),Z([k()],$.prototype,`sidebarContent`,void 0),Z([k()],$.prototype,`sidebarError`,void 0),Z([k()],$.prototype,`sidebarEditingSessionKey`,void 0),Z([k()],$.prototype,`sidebarEditingSessionLabel`,void 0),Z([k()],$.prototype,`sidebarMoreMenuKey`,void 0),Z([k()],$.prototype,`sidebarMoreMenuPos`,void 0),Z([k()],$.prototype,`sidebarDeleteConfirmKey`,void 0),Z([k()],$.prototype,`sidebarDeleteLinkedJobs`,void 0),Z([k()],$.prototype,`sidebarDeleteLinkedJobsLoading`,void 0),Z([k()],$.prototype,`sidebarDeleteInFlight`,void 0),Z([k()],$.prototype,`sidebarDeleteError`,void 0),Z([k()],$.prototype,`sidebarCreatingGroup`,void 0),Z([k()],$.prototype,`sidebarEditingGroupId`,void 0),Z([k()],$.prototype,`sidebarEditingGroupLabel`,void 0),Z([k()],$.prototype,`sidebarGroupMoreMenuId`,void 0),Z([k()],$.prototype,`sidebarDeleteGroupConfirmId`,void 0),Z([k()],$.prototype,`sidebarMoveMenuKey`,void 0),Z([k()],$.prototype,`sidebarGroupVersion`,void 0),Z([k()],$.prototype,`splitRatio`,void 0),Z([k()],$.prototype,`nodesLoading`,void 0),Z([k()],$.prototype,`nodes`,void 0),Z([k()],$.prototype,`devicesLoading`,void 0),Z([k()],$.prototype,`devicesError`,void 0),Z([k()],$.prototype,`devicesList`,void 0),Z([k()],$.prototype,`execApprovalsLoading`,void 0),Z([k()],$.prototype,`execApprovalsSaving`,void 0),Z([k()],$.prototype,`execApprovalsDirty`,void 0),Z([k()],$.prototype,`execApprovalsSnapshot`,void 0),Z([k()],$.prototype,`execApprovalsForm`,void 0),Z([k()],$.prototype,`execApprovalsSelectedAgent`,void 0),Z([k()],$.prototype,`execApprovalsTarget`,void 0),Z([k()],$.prototype,`execApprovalsTargetNodeId`,void 0),Z([k()],$.prototype,`execApprovalQueue`,void 0),Z([k()],$.prototype,`execApprovalBusy`,void 0),Z([k()],$.prototype,`execApprovalError`,void 0),Z([k()],$.prototype,`pendingGatewayUrl`,void 0),Z([k()],$.prototype,`configLoading`,void 0),Z([k()],$.prototype,`configRaw`,void 0),Z([k()],$.prototype,`configRawOriginal`,void 0),Z([k()],$.prototype,`configValid`,void 0),Z([k()],$.prototype,`configIssues`,void 0),Z([k()],$.prototype,`configSaving`,void 0),Z([k()],$.prototype,`configApplying`,void 0),Z([k()],$.prototype,`updateRunning`,void 0),Z([k()],$.prototype,`applySessionKey`,void 0),Z([k()],$.prototype,`configSnapshot`,void 0),Z([k()],$.prototype,`configSchema`,void 0),Z([k()],$.prototype,`configSchemaVersion`,void 0),Z([k()],$.prototype,`configSchemaLoading`,void 0),Z([k()],$.prototype,`configUiHints`,void 0),Z([k()],$.prototype,`configForm`,void 0),Z([k()],$.prototype,`configFormOriginal`,void 0),Z([k()],$.prototype,`dreamingStatusLoading`,void 0),Z([k()],$.prototype,`dreamingStatusError`,void 0),Z([k()],$.prototype,`dreamingStatus`,void 0),Z([k()],$.prototype,`dreamingModeSaving`,void 0),Z([k()],$.prototype,`dreamingRestartConfirmOpen`,void 0),Z([k()],$.prototype,`dreamingRestartConfirmLoading`,void 0),Z([k()],$.prototype,`dreamingPendingEnabled`,void 0),Z([k()],$.prototype,`dreamDiaryLoading`,void 0),Z([k()],$.prototype,`dreamDiaryActionLoading`,void 0),Z([k()],$.prototype,`dreamDiaryActionMessage`,void 0),Z([k()],$.prototype,`dreamDiaryActionArchivePath`,void 0),Z([k()],$.prototype,`dreamDiaryError`,void 0),Z([k()],$.prototype,`dreamDiaryPath`,void 0),Z([k()],$.prototype,`dreamDiaryContent`,void 0),Z([k()],$.prototype,`wikiImportInsightsLoading`,void 0),Z([k()],$.prototype,`wikiImportInsightsError`,void 0),Z([k()],$.prototype,`wikiImportInsights`,void 0),Z([k()],$.prototype,`wikiMemoryPalaceLoading`,void 0),Z([k()],$.prototype,`wikiMemoryPalaceError`,void 0),Z([k()],$.prototype,`wikiMemoryPalace`,void 0),Z([k()],$.prototype,`configFormDirty`,void 0),Z([k()],$.prototype,`configSettingsMode`,void 0),Z([k()],$.prototype,`configFormMode`,void 0),Z([k()],$.prototype,`configSearchQuery`,void 0),Z([k()],$.prototype,`configActiveSection`,void 0),Z([k()],$.prototype,`configActiveSubsection`,void 0),Z([k()],$.prototype,`pendingUpdateExpectedVersion`,void 0),Z([k()],$.prototype,`updateStatusBanner`,void 0),Z([k()],$.prototype,`communicationsFormMode`,void 0),Z([k()],$.prototype,`communicationsSearchQuery`,void 0),Z([k()],$.prototype,`communicationsActiveSection`,void 0),Z([k()],$.prototype,`communicationsActiveSubsection`,void 0),Z([k()],$.prototype,`appearanceFormMode`,void 0),Z([k()],$.prototype,`appearanceSearchQuery`,void 0),Z([k()],$.prototype,`appearanceActiveSection`,void 0),Z([k()],$.prototype,`appearanceActiveSubsection`,void 0),Z([k()],$.prototype,`automationFormMode`,void 0),Z([k()],$.prototype,`automationSearchQuery`,void 0),Z([k()],$.prototype,`automationActiveSection`,void 0),Z([k()],$.prototype,`automationActiveSubsection`,void 0),Z([k()],$.prototype,`infrastructureFormMode`,void 0),Z([k()],$.prototype,`infrastructureSearchQuery`,void 0),Z([k()],$.prototype,`infrastructureActiveSection`,void 0),Z([k()],$.prototype,`infrastructureActiveSubsection`,void 0),Z([k()],$.prototype,`aiAgentsFormMode`,void 0),Z([k()],$.prototype,`aiAgentsSearchQuery`,void 0),Z([k()],$.prototype,`aiAgentsActiveSection`,void 0),Z([k()],$.prototype,`aiAgentsActiveSubsection`,void 0),Z([k()],$.prototype,`channelsLoading`,void 0),Z([k()],$.prototype,`channelsSnapshot`,void 0),Z([k()],$.prototype,`channelsError`,void 0),Z([k()],$.prototype,`channelsLastSuccess`,void 0),Z([k()],$.prototype,`whatsappLoginMessage`,void 0),Z([k()],$.prototype,`whatsappLoginQrDataUrl`,void 0),Z([k()],$.prototype,`whatsappLoginConnected`,void 0),Z([k()],$.prototype,`whatsappBusy`,void 0),Z([k()],$.prototype,`nostrProfileFormState`,void 0),Z([k()],$.prototype,`nostrProfileAccountId`,void 0),Z([k()],$.prototype,`presenceLoading`,void 0),Z([k()],$.prototype,`presenceEntries`,void 0),Z([k()],$.prototype,`presenceError`,void 0),Z([k()],$.prototype,`presenceStatus`,void 0),Z([k()],$.prototype,`agentsLoading`,void 0),Z([k()],$.prototype,`agentsList`,void 0),Z([k()],$.prototype,`agentsError`,void 0),Z([k()],$.prototype,`agentsSelectedId`,void 0),Z([k()],$.prototype,`toolsCatalogLoading`,void 0),Z([k()],$.prototype,`toolsCatalogError`,void 0),Z([k()],$.prototype,`toolsCatalogResult`,void 0),Z([k()],$.prototype,`toolsEffectiveLoading`,void 0),Z([k()],$.prototype,`toolsEffectiveLoadingKey`,void 0),Z([k()],$.prototype,`toolsEffectiveResultKey`,void 0),Z([k()],$.prototype,`toolsEffectiveError`,void 0),Z([k()],$.prototype,`toolsEffectiveResult`,void 0),Z([k()],$.prototype,`agentsPanel`,void 0),Z([k()],$.prototype,`agentFilesLoading`,void 0),Z([k()],$.prototype,`agentFilesError`,void 0),Z([k()],$.prototype,`agentFilesList`,void 0),Z([k()],$.prototype,`agentFileContents`,void 0),Z([k()],$.prototype,`agentFileDrafts`,void 0),Z([k()],$.prototype,`agentFileActive`,void 0),Z([k()],$.prototype,`agentFileSaving`,void 0),Z([k()],$.prototype,`agentIdentityLoading`,void 0),Z([k()],$.prototype,`agentIdentityError`,void 0),Z([k()],$.prototype,`agentIdentityById`,void 0),Z([k()],$.prototype,`agentSkillsLoading`,void 0),Z([k()],$.prototype,`agentSkillsError`,void 0),Z([k()],$.prototype,`agentSkillsReport`,void 0),Z([k()],$.prototype,`agentSkillsAgentId`,void 0),Z([k()],$.prototype,`sessionsLoading`,void 0),Z([k()],$.prototype,`sessionsResult`,void 0),Z([k()],$.prototype,`sessionsError`,void 0),Z([k()],$.prototype,`contextWeight`,void 0),Z([k()],$.prototype,`contextWeightKey`,void 0),Z([k()],$.prototype,`contextWeightLoading`,void 0),Z([k()],$.prototype,`sessionsFilterActive`,void 0),Z([k()],$.prototype,`sessionsFilterLimit`,void 0),Z([k()],$.prototype,`sessionsIncludeGlobal`,void 0),Z([k()],$.prototype,`sessionsIncludeUnknown`,void 0),Z([k()],$.prototype,`sessionsShowArchived`,void 0),Z([k()],$.prototype,`sessionsFiltersCollapsed`,void 0),Z([k()],$.prototype,`sessionsHideCron`,void 0),Z([k()],$.prototype,`sessionsSearchQuery`,void 0),Z([k()],$.prototype,`sessionsSortColumn`,void 0),Z([k()],$.prototype,`sessionsSortDir`,void 0),Z([k()],$.prototype,`sessionsPage`,void 0),Z([k()],$.prototype,`sessionsPageSize`,void 0),Z([k()],$.prototype,`sessionsSelectedKeys`,void 0),Z([k()],$.prototype,`sessionsExpandedCheckpointKey`,void 0),Z([k()],$.prototype,`sessionsCheckpointItemsByKey`,void 0),Z([k()],$.prototype,`sessionsCheckpointLoadingKey`,void 0),Z([k()],$.prototype,`sessionsCheckpointBusyKey`,void 0),Z([k()],$.prototype,`sessionsCheckpointErrorByKey`,void 0),Z([k()],$.prototype,`usageLoading`,void 0),Z([k()],$.prototype,`usageResult`,void 0),Z([k()],$.prototype,`usageCostSummary`,void 0),Z([k()],$.prototype,`usageError`,void 0),Z([k()],$.prototype,`usageStartDate`,void 0),Z([k()],$.prototype,`usageEndDate`,void 0),Z([k()],$.prototype,`usageSelectedSessions`,void 0),Z([k()],$.prototype,`usageSelectedDays`,void 0),Z([k()],$.prototype,`usageSelectedHours`,void 0),Z([k()],$.prototype,`usageChartMode`,void 0),Z([k()],$.prototype,`usageDailyChartMode`,void 0),Z([k()],$.prototype,`usageTimeSeriesMode`,void 0),Z([k()],$.prototype,`usageTimeSeriesBreakdownMode`,void 0),Z([k()],$.prototype,`usageTimeSeries`,void 0),Z([k()],$.prototype,`usageTimeSeriesLoading`,void 0),Z([k()],$.prototype,`usageTimeSeriesCursorStart`,void 0),Z([k()],$.prototype,`usageTimeSeriesCursorEnd`,void 0),Z([k()],$.prototype,`usageSessionLogs`,void 0),Z([k()],$.prototype,`usageSessionLogsLoading`,void 0),Z([k()],$.prototype,`usageSessionLogsExpanded`,void 0),Z([k()],$.prototype,`usageQuery`,void 0),Z([k()],$.prototype,`usageQueryDraft`,void 0),Z([k()],$.prototype,`usageSessionSort`,void 0),Z([k()],$.prototype,`usageSessionSortDir`,void 0),Z([k()],$.prototype,`usageRecentSessions`,void 0),Z([k()],$.prototype,`usageTimeZone`,void 0),Z([k()],$.prototype,`usageContextExpanded`,void 0),Z([k()],$.prototype,`usageHeaderPinned`,void 0),Z([k()],$.prototype,`usageSessionsTab`,void 0),Z([k()],$.prototype,`usageVisibleColumns`,void 0),Z([k()],$.prototype,`usageLogFilterRoles`,void 0),Z([k()],$.prototype,`usageLogFilterTools`,void 0),Z([k()],$.prototype,`usageLogFilterHasTools`,void 0),Z([k()],$.prototype,`usageLogFilterQuery`,void 0),Z([k()],$.prototype,`activePanelId`,void 0),Z([k()],$.prototype,`sidebarStatusPopoverOpen`,void 0),Z([k()],$.prototype,`fileTreeLoading`,void 0),Z([k()],$.prototype,`fileTreeError`,void 0),Z([k()],$.prototype,`fileTreeResult`,void 0),Z([k()],$.prototype,`fileTreeSessionId`,void 0),Z([k()],$.prototype,`fileTreeExpandedDirs`,void 0),Z([k()],$.prototype,`fileTreeDirChildren`,void 0),Z([k()],$.prototype,`fileTreeDirLoading`,void 0),Z([k()],$.prototype,`fileTreeRefFiles`,void 0),Z([k()],$.prototype,`fileTreeRefLoading`,void 0),Z([k()],$.prototype,`fileTreeSplitRatio`,void 0),Z([k()],$.prototype,`fileTreeOutputCollapsed`,void 0),Z([k()],$.prototype,`fileTreeRefCollapsed`,void 0),Z([k()],$.prototype,`cnChannelsLoading`,void 0),Z([k()],$.prototype,`cnChannelsData`,void 0),Z([k()],$.prototype,`cnChannelsError`,void 0),Z([k()],$.prototype,`cnConnecting`,void 0),Z([k()],$.prototype,`cnQrcodeChannel`,void 0),Z([k()],$.prototype,`cnQrcodeImg`,void 0),Z([k()],$.prototype,`cnQrcodeToken`,void 0),Z([k()],$.prototype,`cnQrcodeLoading`,void 0),Z([k()],$.prototype,`cnFeishuOpen`,void 0),Z([k()],$.prototype,`cnFeishuSaving`,void 0),Z([k()],$.prototype,`skillCenterTab`,void 0),Z([k()],$.prototype,`centerSegment`,void 0),Z([k()],$.prototype,`skillCenterCategory`,void 0),Z([k()],$.prototype,`skillCenterSearch`,void 0),Z([k()],$.prototype,`skillCenterCategories`,void 0),Z([k()],$.prototype,`skillCenterCategoriesLoading`,void 0),Z([k()],$.prototype,`skillCenterItemBusy`,void 0),Z([k()],$.prototype,`skillCenterItemError`,void 0),Z([k()],$.prototype,`enterpriseSkills`,void 0),Z([k()],$.prototype,`enterpriseSkillsLoading`,void 0),Z([k()],$.prototype,`enterpriseInstallLoading`,void 0),Z([k()],$.prototype,`enterpriseError`,void 0),Z([k()],$.prototype,`publishDialogOpen`,void 0),Z([k()],$.prototype,`publishTarget`,void 0),Z([k()],$.prototype,`publishingSkill`,void 0),Z([k()],$.prototype,`publishLoading`,void 0),Z([k()],$.prototype,`publishError`,void 0),Z([k()],$.prototype,`publishSuccess`,void 0),Z([k()],$.prototype,`mySharesForMatching`,void 0),Z([k()],$.prototype,`mySharesLoaded`,void 0),Z([k()],$.prototype,`syncVersionMap`,void 0),Z([k()],$.prototype,`syncVersionByIdMap`,void 0),Z([k()],$.prototype,`shareDialogSkill`,void 0),Z([k()],$.prototype,`shareDialogPhase`,void 0),Z([k()],$.prototype,`shareDialogVersion`,void 0),Z([k()],$.prototype,`shareDialogResult`,void 0),Z([k()],$.prototype,`shareDialogError`,void 0),Z([k()],$.prototype,`shareDialogExisting`,void 0),Z([k()],$.prototype,`importDialogOpen`,void 0),Z([k()],$.prototype,`importShareCode`,void 0),Z([k()],$.prototype,`importPreview`,void 0),Z([k()],$.prototype,`importPreviewLoading`,void 0),Z([k()],$.prototype,`importClaimLoading`,void 0),Z([k()],$.prototype,`importClaimResult`,void 0),Z([k()],$.prototype,`importError`,void 0),Z([k()],$.prototype,`skillPublishState`,void 0),Z([k()],$.prototype,`skillGroups`,void 0),Z([k()],$.prototype,`skillGroupMap`,void 0),Z([k()],$.prototype,`selectedSkillGroupId`,void 0),Z([k()],$.prototype,`creatingSkillGroup`,void 0),Z([k()],$.prototype,`renamingSkillGroupId`,void 0),Z([k()],$.prototype,`deleteSkillGroupTarget`,void 0),Z([k()],$.prototype,`fileSpaceLoading`,void 0),Z([k()],$.prototype,`fileSpaceError`,void 0),Z([k()],$.prototype,`fileSpaceData`,void 0),Z([k()],$.prototype,`fileSpaceSearch`,void 0),Z([k()],$.prototype,`fileSpaceCollapsed`,void 0),Z([k()],$.prototype,`cronLoading`,void 0),Z([k()],$.prototype,`cronJobsLoaded`,void 0),Z([k()],$.prototype,`cronQuickCreateOpen`,void 0),Z([k()],$.prototype,`cronQuickCreateStep`,void 0),Z([k()],$.prototype,`cronQuickCreateDraft`,void 0),Z([k()],$.prototype,`cronJobsLoadingMore`,void 0),Z([k()],$.prototype,`cronJobs`,void 0),Z([k()],$.prototype,`cronResultSessionKeys`,void 0),Z([k()],$.prototype,`cronResultSessionJobs`,void 0),Z([k()],$.prototype,`cronJobsTotal`,void 0),Z([k()],$.prototype,`cronJobsHasMore`,void 0),Z([k()],$.prototype,`cronJobsNextOffset`,void 0),Z([k()],$.prototype,`cronJobsLimit`,void 0),Z([k()],$.prototype,`cronJobsQuery`,void 0),Z([k()],$.prototype,`cronJobsEnabledFilter`,void 0),Z([k()],$.prototype,`cronJobsScheduleKindFilter`,void 0),Z([k()],$.prototype,`cronJobsLastStatusFilter`,void 0),Z([k()],$.prototype,`cronJobsSortBy`,void 0),Z([k()],$.prototype,`cronJobsSortDir`,void 0),Z([k()],$.prototype,`cronStatus`,void 0),Z([k()],$.prototype,`cronError`,void 0),Z([k()],$.prototype,`cronForm`,void 0),Z([k()],$.prototype,`cronFormCollapsed`,void 0),Z([k()],$.prototype,`cronFieldErrors`,void 0),Z([k()],$.prototype,`cronEditingJobId`,void 0),Z([k()],$.prototype,`cronRunsJobId`,void 0),Z([k()],$.prototype,`cronRunsLoadingMore`,void 0),Z([k()],$.prototype,`cronRuns`,void 0),Z([k()],$.prototype,`cronRunsTotal`,void 0),Z([k()],$.prototype,`cronRunsHasMore`,void 0),Z([k()],$.prototype,`cronRunsNextOffset`,void 0),Z([k()],$.prototype,`cronRunsLimit`,void 0),Z([k()],$.prototype,`cronRunsScope`,void 0),Z([k()],$.prototype,`cronRunsStatuses`,void 0),Z([k()],$.prototype,`cronRunsDeliveryStatuses`,void 0),Z([k()],$.prototype,`cronRunsStatusFilter`,void 0),Z([k()],$.prototype,`cronRunsQuery`,void 0),Z([k()],$.prototype,`cronRunsSortDir`,void 0),Z([k()],$.prototype,`cronModelSuggestions`,void 0),Z([k()],$.prototype,`cronBusy`,void 0),Z([k()],$.prototype,`cronTasksView`,void 0),Z([k()],$.prototype,`cronTaskDialogOpen`,void 0),Z([k()],$.prototype,`cronTaskDialogMode`,void 0),Z([k()],$.prototype,`cronTaskMenuJobId`,void 0),Z([k()],$.prototype,`cronTaskDeleteConfirmJobId`,void 0),Z([k()],$.prototype,`cronTaskSessionQuery`,void 0),Z([k()],$.prototype,`skillDropdownOpen`,void 0),Z([k()],$.prototype,`cronTaskHistoryJobFilter`,void 0),Z([k()],$.prototype,`cronTaskHistoryDateFilter`,void 0),Z([k()],$.prototype,`updateAvailable`,void 0),Z([k()],$.prototype,`attentionItems`,void 0),Z([k()],$.prototype,`paletteOpen`,void 0),Z([k()],$.prototype,`sessionSwitcherOpen`,void 0),Z([k()],$.prototype,`paletteQuery`,void 0),Z([k()],$.prototype,`paletteActiveIndex`,void 0),Z([k()],$.prototype,`overviewShowGatewayToken`,void 0),Z([k()],$.prototype,`overviewShowGatewayPassword`,void 0),Z([k()],$.prototype,`overviewLogLines`,void 0),Z([k()],$.prototype,`overviewLogCursor`,void 0),Z([k()],$.prototype,`skillsLoading`,void 0),Z([k()],$.prototype,`skillsReport`,void 0),Z([k()],$.prototype,`skillsError`,void 0),Z([k()],$.prototype,`skillsFilter`,void 0),Z([k()],$.prototype,`skillsStatusFilter`,void 0),Z([k()],$.prototype,`skillEdits`,void 0),Z([k()],$.prototype,`skillsBusyKey`,void 0),Z([k()],$.prototype,`skillMessages`,void 0),Z([k()],$.prototype,`skillsDetailKey`,void 0),Z([k()],$.prototype,`clawhubSearchQuery`,void 0),Z([k()],$.prototype,`clawhubSearchResults`,void 0),Z([k()],$.prototype,`clawhubSearchLoading`,void 0),Z([k()],$.prototype,`clawhubSearchError`,void 0),Z([k()],$.prototype,`clawhubDetail`,void 0),Z([k()],$.prototype,`clawhubDetailSlug`,void 0),Z([k()],$.prototype,`clawhubDetailLoading`,void 0),Z([k()],$.prototype,`clawhubDetailError`,void 0),Z([k()],$.prototype,`clawhubInstallSlug`,void 0),Z([k()],$.prototype,`clawhubInstallMessage`,void 0),Z([k()],$.prototype,`healthLoading`,void 0),Z([k()],$.prototype,`healthResult`,void 0),Z([k()],$.prototype,`healthError`,void 0),Z([k()],$.prototype,`modelAuthStatusLoading`,void 0),Z([k()],$.prototype,`modelAuthStatusResult`,void 0),Z([k()],$.prototype,`modelAuthStatusError`,void 0),Z([k()],$.prototype,`debugLoading`,void 0),Z([k()],$.prototype,`debugStatus`,void 0),Z([k()],$.prototype,`debugHealth`,void 0),Z([k()],$.prototype,`debugModels`,void 0),Z([k()],$.prototype,`debugHeartbeat`,void 0),Z([k()],$.prototype,`debugCallMethod`,void 0),Z([k()],$.prototype,`debugCallParams`,void 0),Z([k()],$.prototype,`debugCallResult`,void 0),Z([k()],$.prototype,`debugCallError`,void 0),Z([k()],$.prototype,`apiKeys`,void 0),Z([k()],$.prototype,`sealclawModels`,void 0),Z([k()],$.prototype,`webPushSupported`,void 0),Z([k()],$.prototype,`webPushPermission`,void 0),Z([k()],$.prototype,`webPushSubscribed`,void 0),Z([k()],$.prototype,`webPushLoading`,void 0),Z([k()],$.prototype,`logsLoading`,void 0),Z([k()],$.prototype,`logsError`,void 0),Z([k()],$.prototype,`logsFile`,void 0),Z([k()],$.prototype,`logsEntries`,void 0),Z([k()],$.prototype,`logsFilterText`,void 0),Z([k()],$.prototype,`logsLevelFilters`,void 0),Z([k()],$.prototype,`logsAutoFollow`,void 0),Z([k()],$.prototype,`logsTruncated`,void 0),Z([k()],$.prototype,`logsCursor`,void 0),Z([k()],$.prototype,`logsLastFetchAt`,void 0),Z([k()],$.prototype,`logsLimit`,void 0),Z([k()],$.prototype,`logsMaxBytes`,void 0),Z([k()],$.prototype,`logsAtBottom`,void 0),Z([k()],$.prototype,`chatNewMessagesBelow`,void 0),Z([k()],$.prototype,`chatTocActiveIndex`,void 0),customElements.get(`openclaw-app`)||customElements.define(`openclaw-app`,$);var y1=T((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=typeof window<`u`?window.proxy||window:{};e.qiankunWindow=t,e.renderWithQiankun=function(e){t!=null&&t.__POWERED_BY_QIANKUN__&&(window.moudleQiankunAppLifeCycles||(window.moudleQiankunAppLifeCycles={}),t.qiankunName&&(window.moudleQiankunAppLifeCycles[t.qiankunName]=e))}}))();function b1(){`serviceWorker`in navigator&&navigator.serviceWorker.register(`./sw.js`)}var x1=null;(0,y1.renderWithQiankun)({bootstrap(){return Promise.resolve()},mount(e){b1(),window.__OPENCLAW_CONTROL_UI_BASE_PATH__=`/sealclaw`;let t=(e==null?void 0:e.container)??document.body,n=t.querySelector(`openclaw-app`);return x1=n??document.createElement(`openclaw-app`),n||t.appendChild(x1),Promise.resolve()},unmount(){return x1==null||x1.remove(),x1=null,Promise.resolve()},update(){return Promise.resolve()}}),y1.qiankunWindow.__POWERED_BY_QIANKUN__||b1();export{Hm as A,jo as B,ih as C,zm as D,Zm as E,cm as F,ka as G,ko as H,qp as I,fi as J,Ti as K,hs as L,ah as M,Tm as N,Vm as O,wm as P,je as Q,U as R,rh as S,Um as T,Io as U,Ao as V,Aa as W,Hn as X,Vr as Y,Je as Z,r_ as _,MZ as a,$m as b,jZ as c,SW as d,eB as f,rD as g,FN as h,NZ as i,Wm as j,Gm as k,YJ as l,oR as m,FZ as n,AZ as o,fR as p,Ci as q,PZ as r,kZ as s,nQ as t,NJ as u,Lm as v,Em as w,Rm as x,Bm as y,ds as z};
|
|
8813
|
+
//# sourceMappingURL=index-DZ9XVD38.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,n as t}from"./lit-xS7RrYW6.js";import{R as n,s as r}from"./index-
|
|
1
|
+
import{a as e,n as t}from"./lit-xS7RrYW6.js";import{R as n,s as r}from"./index-DZ9XVD38.js";var i=!1;function a(r){let a=!i;return e`
|
|
2
2
|
<section class="card">
|
|
3
3
|
<div class="row" style="justify-content: space-between;">
|
|
4
4
|
<div>
|
|
@@ -54,4 +54,4 @@ import{a as e,n as t}from"./lit-xS7RrYW6.js";import{R as n,s as r}from"./index-B
|
|
|
54
54
|
</div>
|
|
55
55
|
</div>
|
|
56
56
|
`}export{a as renderInstances};
|
|
57
|
-
//# sourceMappingURL=instances-
|
|
57
|
+
//# sourceMappingURL=instances-6i8ma6iW.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,n as t}from"./lit-xS7RrYW6.js";import{r as n}from"./string-coerce-OVejwecW.js";import{B as r,Q as i,V as a,W as o}from"./index-
|
|
1
|
+
import{a as e,n as t}from"./lit-xS7RrYW6.js";import{r as n}from"./string-coerce-OVejwecW.js";import{B as r,Q as i,V as a,W as o}from"./index-DZ9XVD38.js";function s(...e){let t=new Set;for(let n of e){if(!n)continue;if(Array.isArray(n)){for(let e of n){let n=e.trim();n&&t.add(n)}continue}let e=n.trim();e&&t.add(e)}return[...t].toSorted()}function c(e,t){let n=new Set(e);return t.every(e=>n.has(e))}function l(e){return{roles:s(e.roles,e.role),scopes:i(e.scopes)}}function u(e){let t=s(e.roles,e.role),n=Array.isArray(e.tokens)?e.tokens:e.tokens?Object.values(e.tokens):void 0;return{roles:n===void 0?t:s(n.filter(e=>!e.revokedAtMs).flatMap(e=>e.role??[])).filter(e=>t.includes(e)),scopes:i(e.scopes)}}function d(e,t){let n=l(e),r=t?u(t):null;return r?c(r.roles,n.roles)?c(r.scopes,n.scopes)?{kind:`re-approval`,requested:n,approved:r}:{kind:`scope-upgrade`,requested:n,approved:r}:{kind:`role-upgrade`,requested:n,approved:r}:{kind:`new-pairing`,requested:n,approved:null}}function f(e){let t=(e==null?void 0:e.agents)??{},r=Array.isArray(t.list)?t.list:[],i=[];return r.forEach((e,t)=>{if(!e||typeof e!=`object`)return;let r=e,a=n(r.id)??``;if(!a)return;let o=n(r.name),s=r.default===!0;i.push({id:a,name:o,isDefault:s,index:t,record:r})}),i}function p(e,t){let r=new Set(t),i=[];for(let t of e){if(!(Array.isArray(t.commands)?t.commands:[]).some(e=>r.has(String(e))))continue;let e=n(t.nodeId)??``;if(!e)continue;let a=n(t.displayName)??e;i.push({id:e,label:a===e?e:`${a} · ${e}`})}return i.sort((e,t)=>e.label.localeCompare(t.label)),i}var m=`__defaults__`,h=[{value:`deny`,label:`Deny`},{value:`allowlist`,label:`Allowlist`},{value:`full`,label:`Full`}],g=[{value:`off`,label:`Off`},{value:`on-miss`,label:`On miss`},{value:`always`,label:`Always`}];function _(e){return e===`allowlist`||e===`full`||e===`deny`?e:`deny`}function v(e){return e===`always`||e===`off`||e===`on-miss`?e:`on-miss`}function y(e){let t=(e==null?void 0:e.defaults)??{};return{security:_(t.security),ask:v(t.ask),askFallback:_(t.askFallback??`deny`),autoAllowSkills:t.autoAllowSkills??!1}}function b(e){return f(e).map(e=>({id:e.id,name:e.name,isDefault:e.isDefault}))}function x(e,t){let n=b(e),r=Object.keys((t==null?void 0:t.agents)??{}),i=new Map;n.forEach(e=>i.set(e.id,e)),r.forEach(e=>{i.has(e)||i.set(e,{id:e})});let a=Array.from(i.values());return a.length===0&&a.push({id:`main`,isDefault:!0}),a.sort((e,t)=>{var n,r;if(e.isDefault&&!t.isDefault)return-1;if(!e.isDefault&&t.isDefault)return 1;let i=(n=e.name)!=null&&n.trim()?e.name:e.id,a=(r=t.name)!=null&&r.trim()?t.name:t.id;return i.localeCompare(a)}),a}function S(e,t){return e===m?m:e&&t.some(t=>t.id===e)?e:m}function C(e){var t;let n=e.execApprovalsForm??((t=e.execApprovalsSnapshot)==null?void 0:t.file)??null,r=!!n,i=y(n),a=x(e.configForm,n),o=A(e.nodes),s=e.execApprovalsTarget,c=s===`node`&&e.execApprovalsTargetNodeId?e.execApprovalsTargetNodeId:null;s===`node`&&c&&!o.some(e=>e.id===c)&&(c=null);let l=S(e.execApprovalsSelectedAgent,a),u=l===m?null:((n==null?void 0:n.agents)??{})[l]??null,d=Array.isArray(u==null?void 0:u.allowlist)?u.allowlist??[]:[];return{ready:r,disabled:e.execApprovalsSaving||e.execApprovalsLoading,dirty:e.execApprovalsDirty,loading:e.execApprovalsLoading,saving:e.execApprovalsSaving,form:n,defaults:i,selectedScope:l,selectedAgent:u,agents:a,allowlist:d,target:s,targetNodeId:c,targetNodes:o,onSelectScope:e.onExecApprovalsSelectAgent,onSelectTarget:e.onExecApprovalsTargetChange,onPatch:e.onExecApprovalsPatch,onRemove:e.onExecApprovalsRemove,onLoad:e.onLoadExecApprovals,onSave:e.onSaveExecApprovals}}function w(n){let r=n.ready,i=n.target!==`node`||!!n.targetNodeId;return e`
|
|
2
2
|
<section class="card">
|
|
3
3
|
<div class="row" style="justify-content: space-between; align-items: center;">
|
|
4
4
|
<div>
|
|
@@ -433,4 +433,4 @@ import{a as e,n as t}from"./lit-xS7RrYW6.js";import{r as n}from"./string-coerce-
|
|
|
433
433
|
</div>
|
|
434
434
|
</div>
|
|
435
435
|
`}export{j as renderNodes};
|
|
436
|
-
//# sourceMappingURL=nodes-
|
|
436
|
+
//# sourceMappingURL=nodes-Du49WHjP.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,n as t}from"./lit-xS7RrYW6.js";import{r as n,t as r}from"./string-coerce-OVejwecW.js";import{I as i,L as a,O as o,R as s,U as c,W as l,c as u}from"./index-
|
|
1
|
+
import{a as e,n as t}from"./lit-xS7RrYW6.js";import{r as n,t as r}from"./string-coerce-OVejwecW.js";import{I as i,L as a,O as o,R as s,U as c,W as l,c as u}from"./index-DZ9XVD38.js";var d=[`off`,`minimal`,`low`,`medium`,`high`],f=[``,`off`,`on`,`full`],p=[``,`on`,`off`],m=[``,`off`,`on`,`stream`],h=[10,25,50,100];function g(e,t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]??null:null}function _(e){return a(e)??r(e)}function v(e){var t,n;let r=e.thinkingDefault?`默认(${e.thinkingDefault})`:`继承`,i=(t=e.thinkingLevels)!=null&&t.length?e.thinkingLevels:((n=e.thinkingOptions)!=null&&n.length?e.thinkingOptions:d).map(e=>({id:_(e),label:e}));return[{value:``,label:r},...i.map(e=>({value:_(e.id),label:e.label}))]}function y(e,t){return!t||e.includes(t)?[...e]:[...e,t]}function b(e,t){return!t||e.some(e=>e.value===t)?[...e]:[...e,{value:t,label:`${t}(自定义)`}]}function x(){return f.map(e=>({value:e,label:e===``?`继承`:e===`off`?`关闭(显式)`:e===`on`?`开启`:e===`full`?`完整`:e}))}var S={on:`开启`,off:`关闭`};function C(){return p.map(e=>({value:e,label:e===``?`继承`:S[e]??e}))}function w(e){return e||null}function T(e,t,n){let i=r(t);return i?e.filter(e=>{var t;let a=r(e.key),s=r(e.label),l=r(e.kind),u=r(e.displayName),d=r(o(e.agentRuntime));if(a.includes(i)||s.includes(i)||l.includes(i)||u.includes(i)||d.includes(i))return!0;let f=c(e.key);return(f?r((t=g(n,f.agentId))==null?void 0:t.name):``).includes(i)}):e}function E(e,t,n){let r=n===`asc`?1:-1;return[...e].toSorted((e,n)=>{let i=0;switch(t){case`key`:i=(e.key??``).localeCompare(n.key??``);break;case`kind`:i=(e.kind??``).localeCompare(n.kind??``);break;case`updated`:i=(e.updatedAt??0)-(n.updatedAt??0);break;case`tokens`:i=(e.totalTokens??e.inputTokens??e.outputTokens??0)-(n.totalTokens??n.inputTokens??n.outputTokens??0);break}return i*r})}function D(e,t,n){let r=t*n;return e.slice(r,r+n)}function O(e){let t=Number(e.trim());return Number.isFinite(t)&&t>0}function k(e){return r(e.searchQuery).length>0||O(e.activeMinutes)||O(e.limit)||!e.includeGlobal||!e.includeUnknown||!e.showArchived}function A(e){switch(e){case`manual`:return`手动`;case`auto-threshold`:return`自动阈值`;case`overflow-retry`:return`溢出重试`;case`timeout-retry`:return`超时重试`;default:return e}}function j(e){return typeof e.tokensBefore==`number`&&typeof e.tokensAfter==`number`&&Number.isFinite(e.tokensBefore)&&Number.isFinite(e.tokensAfter)?`${e.tokensBefore.toLocaleString()} → ${e.tokensAfter.toLocaleString()} 个 token`:typeof e.tokensBefore==`number`&&Number.isFinite(e.tokensBefore)?`之前 ${e.tokensBefore.toLocaleString()} 个 token`:`token 增量不可用`}function M(e){return e instanceof Element&&!!e.closest(`a, button, input, label, select, textarea`)}function N(t){return e`
|
|
2
2
|
<label class=${[`session-filter-check`,`session-filter-toggle`,t.extraClass??``,t.checked?`session-filter-check--active`:``].filter(Boolean).join(` `)} data-tooltip=${t.title}>
|
|
3
3
|
<input
|
|
4
4
|
name=${t.name}
|
|
@@ -362,4 +362,4 @@ import{a as e,n as t}from"./lit-xS7RrYW6.js";import{r as n,t as r}from"./string-
|
|
|
362
362
|
</div>
|
|
363
363
|
</td>
|
|
364
364
|
</tr>`]:[]]}export{P as renderSessions};
|
|
365
|
-
//# sourceMappingURL=sessions-
|
|
365
|
+
//# sourceMappingURL=sessions-BmEME1Ct.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,n as t}from"./lit-xS7RrYW6.js";import{K as n,R as r,t as i}from"./index-
|
|
1
|
+
import{a as e,n as t}from"./lit-xS7RrYW6.js";import{K as n,R as r,t as i}from"./index-DZ9XVD38.js";var a=null,o=null,s=new Set([`openclaw-workspace`,`openclaw-extra`]),c=new Set([`openclaw-workspace`,`openclaw-managed`]),l=null,u=null,d=!1,f=null,p=e`
|
|
2
2
|
<svg viewBox="0 0 24 24" aria-hidden="true">
|
|
3
3
|
<circle cx="9" cy="5" r="1" />
|
|
4
4
|
<circle cx="9" cy="12" r="1" />
|
|
@@ -720,4 +720,4 @@ import{a as e,n as t}from"./lit-xS7RrYW6.js";import{K as n,R as r,t as i}from"./
|
|
|
720
720
|
</div>
|
|
721
721
|
</openclaw-modal-dialog>
|
|
722
722
|
`}export{m as renderSkillCenter};
|
|
723
|
-
//# sourceMappingURL=skill-center-
|
|
723
|
+
//# sourceMappingURL=skill-center-DNcOO6Ju.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,n as t}from"./lit-xS7RrYW6.js";import{i as n,n as r}from"./store-
|
|
1
|
+
import{a as e,n as t}from"./lit-xS7RrYW6.js";import{i as n,n as r}from"./store-DLzVZn7l.js";import{K as i}from"./index-DZ9XVD38.js";var a=e=>{let t=new FormData;return t.append(`file`,e),n(`/api/sealclaw/publish/upload`,{method:`POST`,body:t})},o=e=>n(`/api/sealclaw/publish/submit`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)}),s=e=>n(`/api/sealclaw/publish/my`,{method:`GET`,params:e});function c(){return{name:``,title:``,description:``,categoryId:0,tags:``,version:`1.0.0`,changelog:``}}function l(){return{categories:[],myPublishes:[],myPublishesLoading:!1,uploading:!1,submitting:!1,uploadedOssKey:null,uploadedFileName:null,publishError:null,publishResult:null,showPublishForm:!1,form:c()}}function u(e,t,n){e.showPublishForm=t,t&&(e.publishError=null,e.publishResult=null),n==null||n()}function d(e,t,n,r){e.form={...e.form,[t]:n},r==null||r()}function f(e){e==null||e()}async function p(e,t){if(!(e.categories.length>0))try{let t=await r();e.categories=(t==null?void 0:t.data)??[]}catch{e.categories=[]}finally{f(t)}}async function m(e,t){e.myPublishesLoading=!0,f(t);try{var n;let t=await s({page:1,size:50});e.myPublishes=(t==null||(n=t.data)==null?void 0:n.data)??[]}catch(t){e.myPublishes=[],e.publishError=String(t)}finally{e.myPublishesLoading=!1,f(t)}}async function h(e,t,n){e.uploading=!0,e.publishError=null,e.publishResult=null,f(n);try{let n=await a(t);e.uploadedOssKey=(n==null?void 0:n.data)??null,e.uploadedFileName=t.name,e.uploadedOssKey||(e.publishError=`上传失败:服务端未返回文件标识`)}catch(t){e.uploadedOssKey=null,e.uploadedFileName=null,e.publishError=String(t)}finally{e.uploading=!1,f(n)}}async function g(e,t,n){if(e.publishError=null,e.publishResult=null,!e.uploadedOssKey)return e.publishError=`请先上传技能 zip 文件`,f(n),!1;if(!t.name.trim()||!t.title.trim())return e.publishError=`技能名与标题为必填`,f(n),!1;if(!t.categoryId)return e.publishError=`请选择分类`,f(n),!1;e.submitting=!0,f(n);try{var r,i,a;return await o({ossKey:e.uploadedOssKey,name:t.name.trim(),title:t.title.trim(),description:((r=t.description)==null?void 0:r.trim())||void 0,categoryId:t.categoryId,tags:((i=t.tags)==null?void 0:i.trim())||void 0,version:t.version.trim()||`1.0.0`,changelog:((a=t.changelog)==null?void 0:a.trim())||void 0,priceType:0}),e.publishResult=`已提交审核,等待运营审核通过后上架。`,e.uploadedOssKey=null,e.uploadedFileName=null,e.form=c(),e.showPublishForm=!1,await m(e,n),!0}catch(t){return e.publishError=String(t),!1}finally{e.submitting=!1,f(n)}}function _(e){switch(e){case 1:return{text:`已通过`,cls:`ssh__ver-status--ok`};case 2:return{text:`已驳回`,cls:`ssh__ver-status--err`};default:return{text:`审核中`,cls:`ssh__ver-status--warn`}}}function v(n){let{state:r}=n;return e`
|
|
2
2
|
<section class="ssh__section">
|
|
3
3
|
<div class="ssh__sub-head" style="margin-bottom:6px;">
|
|
4
4
|
<div class="ssh__head" style="margin-bottom:0;">
|
|
@@ -172,4 +172,4 @@ import{a as e,n as t}from"./lit-xS7RrYW6.js";import{i as n,n as r}from"./store-C
|
|
|
172
172
|
`)}
|
|
173
173
|
</div>
|
|
174
174
|
`}export{l as createInitialPublishState,p as loadCategories,m as loadMyPublishes,v as renderSkillPublishPanel,u as setPublishFormOpen,g as submitPublishAction,d as updatePublishForm,h as uploadSkillZip};
|
|
175
|
-
//# sourceMappingURL=skill-publish-
|
|
175
|
+
//# sourceMappingURL=skill-publish-CuICGNtU.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,n as t}from"./lit-xS7RrYW6.js";import{t as n}from"./string-coerce-OVejwecW.js";import{B as r,p as i,q as a}from"./index-
|
|
1
|
+
import{a as e,n as t}from"./lit-xS7RrYW6.js";import{t as n}from"./string-coerce-OVejwecW.js";import{B as r,p as i,q as a}from"./index-DZ9XVD38.js";import{i as o,n as s,r as c,t as l}from"./skills-shared-D4QYNbRK.js";function u(e){return e?i(e,window.location.href):null}function d(e){!(e instanceof HTMLDialogElement)||e.open||(e.isConnected?e.showModal():queueMicrotask(()=>{e.isConnected&&!e.open&&e.showModal()}))}var f=[{id:`all`,label:`All`},{id:`ready`,label:`Ready`},{id:`needs-setup`,label:`Needs Setup`},{id:`disabled`,label:`Disabled`}];function p(e,t){switch(t){case`all`:return!0;case`ready`:return!e.disabled&&e.eligible;case`needs-setup`:return!e.disabled&&!e.eligible;case`disabled`:return e.disabled}throw Error(`Unsupported skills status filter`)}function m(e){return e.disabled?`muted`:e.eligible?`ok`:`warn`}function h(r){var i;let a=((i=r.report)==null?void 0:i.skills)??[],s={all:a.length,ready:0,"needs-setup":0,disabled:0};for(let e of a)e.disabled?s.disabled++:e.eligible?s.ready++:s[`needs-setup`]++;let c=r.statusFilter===`all`?a:a.filter(e=>p(e,r.statusFilter)),l=n(r.filter),u=l?c.filter(e=>n([e.name,e.description,e.source].join(` `)).includes(l)):c,d=o(u),m=r.detailKey?a.find(e=>e.skillKey===r.detailKey)??null:null;return e`
|
|
2
2
|
<section class="card">
|
|
3
3
|
<div class="row" style="justify-content: space-between;">
|
|
4
4
|
<div>
|
|
@@ -311,4 +311,4 @@ import{a as e,n as t}from"./lit-xS7RrYW6.js";import{t as n}from"./string-coerce-
|
|
|
311
311
|
</div>
|
|
312
312
|
</dialog>
|
|
313
313
|
`}export{h as renderSkills};
|
|
314
|
-
//# sourceMappingURL=skills-
|
|
314
|
+
//# sourceMappingURL=skills-B_7WeHCK.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e=`https://gateway.sealseek.cn`,t=async(t,n)=>{if(n!=null&&n.params){let e=new URLSearchParams;for(let[t,r]of Object.entries(n.params))r!=null&&e.append(t,String(r));let r=e.toString();r&&(t+=`?${r}`)}t=e+t;let r=localStorage.getItem(`jwt`)??``,i=await fetch(t,{...n,headers:{Authorization:`Bearer ${r}`,token:r,...n==null?void 0:n.headers}});if(!i.ok){let e=await i.text().catch(()=>``);throw Error(`Request failed: ${i.status} ${i.statusText}${e?` - ${e}`:``}`)}return await i.json()},n=()=>t(`/api/sealclaw/store/categories`),r=e=>t(`/api/sealclaw/store/skills`,{method:`GET`,params:e}).then(e=>e.data),i=(e,n)=>t(`/api/sealclaw/store/skills/${e}/acquire`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(n)});export{t as i,n,r,i as t};
|
|
2
|
+
//# sourceMappingURL=store-DLzVZn7l.js.map
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
window.__OPENCLAW_CONTROL_UI_BASE_PATH__ = "/sealclaw";
|
|
71
71
|
}
|
|
72
72
|
</script>
|
|
73
|
-
<script crossorigin="">import('/sealclaw/assets/index-
|
|
73
|
+
<script crossorigin="">import('/sealclaw/assets/index-DZ9XVD38.js').finally(() => {
|
|
74
74
|
|
|
75
75
|
const qiankunLifeCycle = window.moudleQiankunAppLifeCycles && window.moudleQiankunAppLifeCycles['sealclaw-entry'];
|
|
76
76
|
if (qiankunLifeCycle) {
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
<link rel="modulepreload" crossorigin="" href="/sealclaw/assets/lit-xS7RrYW6.js">
|
|
85
85
|
<link rel="modulepreload" crossorigin="" href="/sealclaw/assets/directive-Dk4hInuL.js">
|
|
86
86
|
<link rel="modulepreload" crossorigin="" href="/sealclaw/assets/string-coerce-OVejwecW.js">
|
|
87
|
-
<link rel="modulepreload" crossorigin="" href="/sealclaw/assets/store-
|
|
87
|
+
<link rel="modulepreload" crossorigin="" href="/sealclaw/assets/store-DLzVZn7l.js">
|
|
88
88
|
<link rel="stylesheet" crossorigin="" href="/sealclaw/assets/index-CI1G9f4s.css">
|
|
89
89
|
</head>
|
|
90
90
|
<body>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
2026-07-
|
|
1
|
+
2026-07-01T14:04:46.132Z
|
|
@@ -912,29 +912,29 @@
|
|
|
912
912
|
"dist/control-ui-links-CxOxcKfV.js",
|
|
913
913
|
"dist/control-ui-shared-C3TlA7jG.js",
|
|
914
914
|
"dist/control-ui/apple-touch-icon.png",
|
|
915
|
-
"dist/control-ui/assets/agents-
|
|
915
|
+
"dist/control-ui/assets/agents-CAmTjL2H.js",
|
|
916
916
|
"dist/control-ui/assets/channel-config-extras-B1l5nZ9H.js",
|
|
917
|
-
"dist/control-ui/assets/channels-
|
|
918
|
-
"dist/control-ui/assets/channels.cn-
|
|
919
|
-
"dist/control-ui/assets/cron-
|
|
920
|
-
"dist/control-ui/assets/cron-task-list-
|
|
921
|
-
"dist/control-ui/assets/debug-
|
|
917
|
+
"dist/control-ui/assets/channels-1cjrTMwB.js",
|
|
918
|
+
"dist/control-ui/assets/channels.cn-C_H6e9d6.js",
|
|
919
|
+
"dist/control-ui/assets/cron-BtOWAQd-.js",
|
|
920
|
+
"dist/control-ui/assets/cron-task-list-47yZC4F_.js",
|
|
921
|
+
"dist/control-ui/assets/debug-BkVmAx6w.js",
|
|
922
922
|
"dist/control-ui/assets/directive-Dk4hInuL.js",
|
|
923
|
-
"dist/control-ui/assets/filespace-
|
|
924
|
-
"dist/control-ui/assets/index-BK0f0HoK.js",
|
|
923
|
+
"dist/control-ui/assets/filespace-BCO0sWG5.js",
|
|
925
924
|
"dist/control-ui/assets/index-CI1G9f4s.css",
|
|
926
|
-
"dist/control-ui/assets/
|
|
925
|
+
"dist/control-ui/assets/index-DZ9XVD38.js",
|
|
926
|
+
"dist/control-ui/assets/instances-6i8ma6iW.js",
|
|
927
927
|
"dist/control-ui/assets/lit-xS7RrYW6.js",
|
|
928
928
|
"dist/control-ui/assets/logs-COq7j13X.js",
|
|
929
|
-
"dist/control-ui/assets/nodes-
|
|
929
|
+
"dist/control-ui/assets/nodes-Du49WHjP.js",
|
|
930
930
|
"dist/control-ui/assets/preview-DRma0hW_.js",
|
|
931
931
|
"dist/control-ui/assets/push-subscription-BnLpzIye.js",
|
|
932
|
-
"dist/control-ui/assets/sessions-
|
|
933
|
-
"dist/control-ui/assets/skill-center-
|
|
934
|
-
"dist/control-ui/assets/skill-publish-
|
|
935
|
-
"dist/control-ui/assets/skills-
|
|
932
|
+
"dist/control-ui/assets/sessions-BmEME1Ct.js",
|
|
933
|
+
"dist/control-ui/assets/skill-center-DNcOO6Ju.js",
|
|
934
|
+
"dist/control-ui/assets/skill-publish-CuICGNtU.js",
|
|
935
|
+
"dist/control-ui/assets/skills-B_7WeHCK.js",
|
|
936
936
|
"dist/control-ui/assets/skills-shared-D4QYNbRK.js",
|
|
937
|
-
"dist/control-ui/assets/store-
|
|
937
|
+
"dist/control-ui/assets/store-DLzVZn7l.js",
|
|
938
938
|
"dist/control-ui/assets/string-coerce-OVejwecW.js",
|
|
939
939
|
"dist/control-ui/favicon-32.png",
|
|
940
940
|
"dist/control-ui/favicon.ico",
|
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var e=`https://gatewaytest.sealseek.cn`,t=async(t,n)=>{if(n!=null&&n.params){let e=new URLSearchParams;for(let[t,r]of Object.entries(n.params))r!=null&&e.append(t,String(r));let r=e.toString();r&&(t+=`?${r}`)}t=e+t;let r=localStorage.getItem(`jwt`)??``,i=await fetch(t,{...n,headers:{Authorization:`Bearer ${r}`,token:r,...n==null?void 0:n.headers}});if(!i.ok){let e=await i.text().catch(()=>``);throw Error(`Request failed: ${i.status} ${i.statusText}${e?` - ${e}`:``}`)}return await i.json()},n=()=>t(`/api/sealclaw/store/categories`),r=e=>t(`/api/sealclaw/store/skills`,{method:`GET`,params:e}).then(e=>e.data),i=(e,n)=>t(`/api/sealclaw/store/skills/${e}/acquire`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(n)});export{t as i,n,r,i as t};
|
|
2
|
-
//# sourceMappingURL=store-Cf_1pKfx.js.map
|