@gguf/pigbot 0.0.5 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1208 -10
- package/LICENSE +2 -2
- package/README.md +347 -37
- package/assets/chrome-extension/README.md +5 -5
- package/assets/chrome-extension/background.js +5 -5
- package/assets/chrome-extension/manifest.json +3 -3
- package/assets/chrome-extension/options.html +5 -5
- package/assets/chrome-extension/options.js +1 -1
- package/dist/acp/client.js +5 -5
- package/dist/acp/server.js +3 -3
- package/dist/acp/types.js +2 -2
- package/dist/agents/agent-paths.js +6 -6
- package/dist/agents/agent-scope.js +1 -1
- package/dist/agents/anthropic-payload-log.js +2 -2
- package/dist/agents/auth-profiles/doctor.js +1 -1
- package/dist/agents/auth-profiles/paths.js +3 -3
- package/dist/agents/bash-tools.exec.js +1 -1
- package/dist/agents/bash-tools.shared.js +2 -2
- package/dist/agents/cache-trace.js +5 -5
- package/dist/agents/channel-tools.js +31 -2
- package/dist/agents/cli-runner/helpers.js +3 -3
- package/dist/agents/cli-runner.js +3 -3
- package/dist/agents/context.js +4 -4
- package/dist/agents/docs-path.js +3 -3
- package/dist/agents/identity.js +1 -1
- package/dist/agents/live-auth-keys.js +2 -2
- package/dist/agents/memory-search.js +5 -0
- package/dist/agents/minimax-vlm.js +1 -1
- package/dist/agents/model-auth.js +2 -1
- package/dist/agents/model-catalog.js +4 -4
- package/dist/agents/model-selection.js +1 -1
- package/dist/agents/models-config.js +3 -3
- package/dist/agents/models-config.providers.js +40 -8
- package/dist/agents/{moltbot-tools.js → openclaw-tools.js} +1 -1
- package/dist/agents/pi-embedded-helpers/errors.js +20 -0
- package/dist/agents/pi-embedded-helpers/openai.js +1 -1
- package/dist/agents/pi-embedded-helpers.js +1 -1
- package/dist/agents/pi-embedded-runner/cache-ttl.js +1 -1
- package/dist/agents/pi-embedded-runner/compact.js +8 -8
- package/dist/agents/pi-embedded-runner/model.js +2 -2
- package/dist/agents/pi-embedded-runner/run/attempt.js +6 -6
- package/dist/agents/pi-embedded-runner/run.js +31 -5
- package/dist/agents/pi-embedded-runner/session-manager-cache.js +1 -1
- package/dist/agents/pi-embedded-runner/utils.js +1 -1
- package/dist/agents/pi-embedded-subscribe.raw-stream.js +2 -2
- package/dist/agents/pi-tools.js +5 -5
- package/dist/agents/pi-tools.read.js +2 -2
- package/dist/agents/sandbox/browser.js +16 -11
- package/dist/agents/sandbox/constants.js +7 -7
- package/dist/agents/sandbox/docker.js +17 -14
- package/dist/agents/sandbox/runtime-status.js +1 -1
- package/dist/agents/session-transcript-repair.js +1 -1
- package/dist/agents/session-write-lock.js +2 -2
- package/dist/agents/skills/bundled-dir.js +1 -1
- package/dist/agents/skills/config.js +2 -1
- package/dist/agents/skills/frontmatter.js +11 -3
- package/dist/agents/skills/workspace.js +6 -6
- package/dist/agents/synthetic-models.js +8 -0
- package/dist/agents/system-prompt.js +21 -21
- package/dist/agents/tool-images.js +1 -1
- package/dist/agents/tool-policy.js +2 -2
- package/dist/agents/tools/browser-tool.js +5 -5
- package/dist/agents/tools/image-tool.js +2 -2
- package/dist/agents/tools/memory-tool.js +1 -1
- package/dist/agents/tools/sessions-send-tool.js +2 -2
- package/dist/agents/tools/web-search.js +7 -7
- package/dist/agents/transcript-policy.js +2 -1
- package/dist/agents/workspace.js +3 -3
- package/dist/auto-reply/commands-registry.data.js +1 -1
- package/dist/auto-reply/reply/agent-runner-execution.js +1 -1
- package/dist/auto-reply/reply/bash-command.js +2 -2
- package/dist/auto-reply/reply/commands-context-report.js +2 -2
- package/dist/auto-reply/reply/commands-session.js +4 -4
- package/dist/auto-reply/reply/directive-handling.shared.js +1 -1
- package/dist/auto-reply/reply/dispatch-from-config.js +21 -0
- package/dist/auto-reply/reply/get-reply-inline-actions.js +2 -2
- package/dist/auto-reply/reply/get-reply.js +1 -1
- package/dist/auto-reply/reply/groups.js +1 -1
- package/dist/auto-reply/reply/mentions.js +3 -2
- package/dist/auto-reply/reply/normalize-reply.js +12 -4
- package/dist/auto-reply/reply/reply-dispatcher.js +8 -1
- package/dist/auto-reply/reply/reply-elevated.js +1 -1
- package/dist/auto-reply/reply/stage-sandbox-media.js +1 -1
- package/dist/auto-reply/status.js +2 -2
- package/dist/browser/chrome.js +13 -13
- package/dist/browser/chrome.profile-decoration.js +5 -5
- package/dist/browser/client-fetch.js +3 -3
- package/dist/browser/config.js +11 -11
- package/dist/browser/constants.js +3 -3
- package/dist/browser/control-service.js +1 -1
- package/dist/browser/extension-relay.js +3 -3
- package/dist/browser/profiles-service.js +2 -2
- package/dist/browser/profiles.js +1 -1
- package/dist/browser/pw-tools-core.downloads.js +1 -1
- package/dist/browser/pw-tools-core.interactions.js +5 -5
- package/dist/browser/pw-tools-core.responses.js +1 -1
- package/dist/browser/routes/agent.act.js +2 -2
- package/dist/browser/routes/agent.debug.js +1 -1
- package/dist/browser/server-context.js +9 -9
- package/dist/browser/server.js +2 -2
- package/dist/build-info.json +2 -2
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/canvas-host/a2ui/a2ui.bundle.js +24 -19
- package/dist/canvas-host/a2ui/index.html +28 -28
- package/dist/canvas-host/a2ui.js +14 -18
- package/dist/canvas-host/server.js +33 -35
- package/dist/channels/plugins/catalog.js +7 -7
- package/dist/channels/plugins/helpers.js +2 -2
- package/dist/channels/plugins/onboarding/imessage.js +1 -1
- package/dist/channels/plugins/onboarding/signal.js +2 -2
- package/dist/channels/plugins/onboarding/slack.js +5 -5
- package/dist/channels/plugins/onboarding/telegram.js +3 -3
- package/dist/channels/plugins/onboarding/whatsapp.js +4 -4
- package/dist/channels/plugins/pairing-message.js +1 -1
- package/dist/channels/plugins/status-issues/bluebubbles.js +1 -1
- package/dist/channels/plugins/status-issues/whatsapp.js +2 -2
- package/dist/channels/registry.js +1 -1
- package/dist/cli/acp-cli.js +2 -2
- package/dist/cli/argv.js +2 -2
- package/dist/cli/banner.js +10 -11
- package/dist/cli/browser-cli-actions-input/register.files-downloads.js +1 -1
- package/dist/cli/browser-cli-examples.js +29 -29
- package/dist/cli/browser-cli-extension.js +5 -5
- package/dist/cli/browser-cli-manage.js +4 -4
- package/dist/cli/browser-cli.js +3 -3
- package/dist/cli/channel-options.js +1 -1
- package/dist/cli/channels-cli.js +1 -1
- package/dist/cli/cli-name.js +4 -8
- package/dist/cli/command-format.js +3 -3
- package/dist/cli/config-cli.js +2 -2
- package/dist/cli/cron-cli/register.js +1 -1
- package/dist/cli/daemon-cli/install.js +2 -2
- package/dist/cli/daemon-cli/register.js +1 -1
- package/dist/cli/daemon-cli/shared.js +11 -13
- package/dist/cli/daemon-cli/status.gather.js +2 -5
- package/dist/cli/daemon-cli/status.print.js +9 -17
- package/dist/cli/directory-cli.js +1 -1
- package/dist/cli/dns-cli.js +20 -13
- package/dist/cli/docs-cli.js +2 -2
- package/dist/cli/exec-approvals-cli.js +2 -2
- package/dist/cli/gateway-cli/dev.js +7 -5
- package/dist/cli/gateway-cli/register.js +12 -6
- package/dist/cli/gateway-cli/run.js +15 -14
- package/dist/cli/gateway-cli/shared.js +5 -5
- package/dist/cli/hooks-cli.js +3 -3
- package/dist/cli/logs-cli.js +3 -3
- package/dist/cli/memory-cli.js +36 -5
- package/dist/cli/models-cli.js +1 -1
- package/dist/cli/node-cli/daemon.js +3 -3
- package/dist/cli/node-cli/register.js +1 -1
- package/dist/cli/nodes-cli/register.canvas.js +1 -1
- package/dist/cli/nodes-cli/register.js +1 -1
- package/dist/cli/nodes-screen.js +1 -1
- package/dist/cli/pairing-cli.js +3 -3
- package/dist/cli/plugin-registry.js +2 -2
- package/dist/cli/plugins-cli.js +3 -3
- package/dist/cli/profile.js +9 -9
- package/dist/cli/program/config-guard.js +1 -1
- package/dist/cli/program/help.js +14 -11
- package/dist/cli/program/preaction.js +1 -1
- package/dist/cli/program/register.agent.js +15 -12
- package/dist/cli/program/register.configure.js +1 -1
- package/dist/cli/program/register.maintenance.js +4 -4
- package/dist/cli/program/register.message.js +5 -5
- package/dist/cli/program/register.onboard.js +5 -3
- package/dist/cli/program/register.setup.js +3 -3
- package/dist/cli/program/register.status-health-sessions.js +13 -13
- package/dist/cli/program/register.subclis.js +7 -2
- package/dist/cli/route.js +1 -1
- package/dist/cli/run-main.js +3 -3
- package/dist/cli/sandbox-cli.js +19 -19
- package/dist/cli/security-cli.js +4 -4
- package/dist/cli/skills-cli.js +3 -3
- package/dist/cli/system-cli.js +1 -1
- package/dist/cli/tagline.js +11 -9
- package/dist/cli/tui-cli.js +1 -1
- package/dist/cli/update-cli.js +48 -45
- package/dist/cli/webhooks-cli.js +6 -6
- package/dist/commands/agent-via-gateway.js +1 -1
- package/dist/commands/agent.js +1 -1
- package/dist/commands/agents.command-shared.js +1 -1
- package/dist/commands/agents.commands.add.js +2 -2
- package/dist/commands/agents.commands.list.js +1 -1
- package/dist/commands/auth-choice-options.js +10 -0
- package/dist/commands/auth-choice.apply.api-providers.js +49 -1
- package/dist/commands/auth-choice.apply.openai.js +1 -1
- package/dist/commands/auth-choice.apply.plugin-provider.js +2 -2
- package/dist/commands/auth-choice.preferred-provider.js +1 -0
- package/dist/commands/channels/shared.js +1 -1
- package/dist/commands/channels/status.js +1 -1
- package/dist/commands/chutes-oauth.js +1 -1
- package/dist/commands/configure.channels.js +2 -2
- package/dist/commands/configure.gateway.js +1 -1
- package/dist/commands/configure.wizard.js +21 -21
- package/dist/commands/daemon-install-helpers.js +2 -2
- package/dist/commands/dashboard.js +2 -2
- package/dist/commands/docs.js +5 -5
- package/dist/commands/doctor-auth.js +5 -5
- package/dist/commands/doctor-config-flow.js +64 -7
- package/dist/commands/doctor-format.js +5 -5
- package/dist/commands/doctor-gateway-daemon-flow.js +7 -4
- package/dist/commands/doctor-gateway-services.js +72 -65
- package/dist/commands/doctor-platform-notes.js +51 -9
- package/dist/commands/doctor-sandbox.js +4 -4
- package/dist/commands/doctor-security.js +7 -7
- package/dist/commands/doctor-state-integrity.js +9 -7
- package/dist/commands/doctor-state-migrations.js +1 -1
- package/dist/commands/doctor-ui.js +2 -2
- package/dist/commands/doctor-update.js +5 -5
- package/dist/commands/doctor-workspace-status.js +2 -2
- package/dist/commands/doctor-workspace.js +5 -27
- package/dist/commands/doctor.js +11 -11
- package/dist/commands/gateway-status/helpers.js +2 -2
- package/dist/commands/gateway-status.js +9 -3
- package/dist/commands/health.js +2 -2
- package/dist/commands/models/auth.js +1 -1
- package/dist/commands/models/list.probe.js +2 -2
- package/dist/commands/models/list.registry.js +4 -4
- package/dist/commands/models/list.status-command.js +4 -4
- package/dist/commands/node-daemon-install-helpers.js +1 -1
- package/dist/commands/onboard-auth.config-core.js +65 -1
- package/dist/commands/onboard-auth.credentials.js +14 -2
- package/dist/commands/onboard-auth.js +2 -2
- package/dist/commands/onboard-channels.js +5 -5
- package/dist/commands/onboard-helpers.js +9 -8
- package/dist/commands/onboard-hooks.js +4 -4
- package/dist/commands/onboard-non-interactive/local/auth-choice.js +21 -1
- package/dist/commands/onboard-non-interactive/local.js +1 -1
- package/dist/commands/onboard-non-interactive/remote.js +1 -1
- package/dist/commands/onboard-non-interactive.js +1 -1
- package/dist/commands/onboard-remote.js +7 -3
- package/dist/commands/onboard-skills.js +2 -2
- package/dist/commands/onboard.js +3 -3
- package/dist/commands/onboarding/plugin-install.js +2 -2
- package/dist/commands/reset.js +3 -3
- package/dist/commands/sandbox-display.js +1 -1
- package/dist/commands/sandbox-explain.js +2 -2
- package/dist/commands/setup.js +9 -7
- package/dist/commands/signal-install.js +2 -2
- package/dist/commands/status-all/diagnosis.js +1 -1
- package/dist/commands/status-all/report-lines.js +1 -1
- package/dist/commands/status-all.js +5 -5
- package/dist/commands/status.command.js +9 -9
- package/dist/commands/status.gateway-probe.js +2 -2
- package/dist/commands/status.scan.js +2 -2
- package/dist/commands/status.update.js +3 -3
- package/dist/commands/uninstall.js +4 -4
- package/dist/compat/legacy-names.js +8 -6
- package/dist/config/config.js +1 -1
- package/dist/config/io.js +13 -14
- package/dist/config/paths.js +107 -33
- package/dist/config/schema.js +14 -12
- package/dist/config/sessions/store.js +1 -1
- package/dist/config/sessions/transcript.js +1 -1
- package/dist/config/types.js +1 -1
- package/dist/config/validation.js +2 -2
- package/dist/config/version.js +4 -4
- package/dist/config/zod-schema.agent-runtime.js +1 -0
- package/dist/config/zod-schema.js +3 -2
- package/dist/config/zod-schema.session.js +6 -1
- package/dist/control-ui/apple-touch-icon.png +0 -0
- package/dist/control-ui/assets/index-BKPyesll.css +1 -0
- package/dist/control-ui/assets/{index-CxLFx0Ae.js → index-DFDgq9AK.js} +397 -366
- package/dist/control-ui/assets/index-DFDgq9AK.js.map +1 -0
- package/dist/control-ui/favicon-32.png +0 -0
- package/dist/control-ui/favicon.svg +22 -0
- package/dist/control-ui/index.html +7 -5
- package/dist/daemon/constants.js +19 -25
- package/dist/daemon/inspect.js +64 -28
- package/dist/daemon/launchd.js +7 -7
- package/dist/daemon/node-service.js +14 -14
- package/dist/daemon/paths.js +3 -3
- package/dist/daemon/program-args.js +1 -1
- package/dist/daemon/schtasks.js +6 -6
- package/dist/daemon/service-env.js +25 -21
- package/dist/daemon/systemd-hints.js +1 -1
- package/dist/daemon/systemd-unit.js +1 -1
- package/dist/daemon/systemd.js +6 -6
- package/dist/discord/send.outbound.js +4 -4
- package/dist/discord/send.shared.js +32 -1
- package/dist/discord/targets.js +79 -0
- package/dist/entry.js +9 -8
- package/dist/gateway/auth.js +6 -3
- package/dist/gateway/call.js +3 -1
- package/dist/gateway/control-ui.js +4 -4
- package/dist/gateway/hooks.js +3 -1
- package/dist/gateway/http-utils.js +5 -3
- package/dist/gateway/openai-http.js +3 -3
- package/dist/gateway/openresponses-http.js +4 -4
- package/dist/gateway/protocol/client-info.js +5 -5
- package/dist/gateway/server/ws-connection/message-handler.js +1 -1
- package/dist/gateway/server-browser.js +2 -2
- package/dist/gateway/server-constants.js +2 -2
- package/dist/gateway/server-cron.js +1 -1
- package/dist/gateway/server-discovery-runtime.js +12 -4
- package/dist/gateway/server-discovery.js +7 -7
- package/dist/gateway/server-http.js +1 -1
- package/dist/gateway/server-methods/config.js +2 -2
- package/dist/gateway/server-methods/logs.js +1 -1
- package/dist/gateway/server-methods/update.js +2 -2
- package/dist/gateway/server-plugins.js +2 -2
- package/dist/gateway/server-reload-handlers.js +5 -5
- package/dist/gateway/server-runtime-config.js +3 -3
- package/dist/gateway/server-startup.js +6 -6
- package/dist/gateway/server.impl.js +8 -7
- package/dist/gateway/session-utils.fs.js +2 -1
- package/dist/gateway/test-helpers.mocks.js +8 -6
- package/dist/gateway/test-helpers.server.js +28 -28
- package/dist/gateway/tools-invoke-http.js +40 -4
- package/dist/hooks/bundled/boot-md/HOOK.md +3 -3
- package/dist/hooks/bundled/command-logger/HOOK.md +12 -12
- package/dist/hooks/bundled/command-logger/handler.js +2 -1
- package/dist/hooks/bundled/session-memory/HOOK.md +30 -7
- package/dist/hooks/bundled/session-memory/handler.js +19 -12
- package/dist/hooks/bundled/soul-evil/HOOK.md +5 -5
- package/dist/hooks/bundled-dir.js +2 -2
- package/dist/hooks/config.js +1 -1
- package/dist/hooks/frontmatter.js +11 -3
- package/dist/hooks/gmail-ops.js +1 -1
- package/dist/hooks/gmail-watcher.js +1 -1
- package/dist/hooks/hooks-status.js +2 -2
- package/dist/hooks/install.js +8 -8
- package/dist/hooks/internal-hooks.js +1 -1
- package/dist/hooks/llm-slug-generator.js +1 -1
- package/dist/hooks/loader.js +1 -1
- package/dist/hooks/plugin-hooks.js +2 -2
- package/dist/hooks/workspace.js +9 -9
- package/dist/imessage/monitor/monitor-provider.js +2 -2
- package/dist/index.js +4 -4
- package/dist/infra/bonjour-discovery.js +21 -17
- package/dist/infra/bonjour.js +10 -9
- package/dist/infra/device-identity.js +1 -1
- package/dist/infra/diagnostic-flags.js +1 -1
- package/dist/infra/dotenv.js +1 -1
- package/dist/infra/exec-approvals.js +2 -2
- package/dist/infra/gateway-lock.js +3 -2
- package/dist/infra/machine-name.js +1 -1
- package/dist/infra/{moltbot-root.js → openclaw-root.js} +2 -2
- package/dist/infra/outbound/outbound-session.js +18 -0
- package/dist/infra/outbound/targets.js +1 -1
- package/dist/infra/path-env.js +10 -9
- package/dist/infra/ports-format.js +3 -2
- package/dist/infra/ports.js +2 -2
- package/dist/infra/provider-usage.auth.js +33 -0
- package/dist/infra/provider-usage.fetch.claude.js +1 -1
- package/dist/infra/provider-usage.fetch.minimax.js +1 -1
- package/dist/infra/provider-usage.load.js +6 -0
- package/dist/infra/provider-usage.shared.js +2 -0
- package/dist/infra/restart-sentinel.js +1 -1
- package/dist/infra/restart.js +4 -4
- package/dist/infra/runtime-guard.js +2 -2
- package/dist/infra/shell-env.js +4 -4
- package/dist/infra/ssh-config.js +2 -1
- package/dist/infra/ssh-tunnel.js +8 -1
- package/dist/infra/state-migrations.js +165 -6
- package/dist/infra/system-presence.js +1 -1
- package/dist/infra/tailscale.js +1 -1
- package/dist/infra/tls/gateway.js +1 -1
- package/dist/infra/unhandled-rejections.js +56 -33
- package/dist/infra/update-check.js +1 -1
- package/dist/infra/update-global.js +21 -11
- package/dist/infra/update-runner.js +7 -7
- package/dist/infra/update-startup.js +3 -3
- package/dist/infra/voicewake.js +1 -1
- package/dist/infra/warnings.js +1 -1
- package/dist/infra/widearea-dns.js +31 -14
- package/dist/logging/logger.js +4 -4
- package/dist/macos/gateway-daemon.js +9 -6
- package/dist/macos/relay-smoke.js +1 -1
- package/dist/macos/relay.js +6 -6
- package/dist/media/host.js +1 -1
- package/dist/media/image-ops.js +3 -3
- package/dist/media/input-files.js +1 -1
- package/dist/media/mime.js +3 -0
- package/dist/media-understanding/apply.js +278 -1
- package/dist/media-understanding/attachments.js +1 -1
- package/dist/media-understanding/providers/image.js +2 -2
- package/dist/media-understanding/runner.js +1 -1
- package/dist/memory/batch-gemini.js +2 -2
- package/dist/memory/batch-openai.js +1 -1
- package/dist/memory/embeddings-gemini.js +1 -1
- package/dist/memory/embeddings.js +1 -1
- package/dist/memory/internal.js +49 -16
- package/dist/memory/manager-cache-key.js +1 -0
- package/dist/memory/manager.js +62 -10
- package/dist/memory/sync-memory-files.js +1 -1
- package/dist/node-host/runner.js +6 -6
- package/dist/pairing/pairing-messages.js +2 -2
- package/dist/plugins/bundled-dir.js +1 -1
- package/dist/plugins/cli.js +2 -2
- package/dist/plugins/config-state.js +60 -0
- package/dist/plugins/discovery.js +14 -12
- package/dist/plugins/install.js +8 -8
- package/dist/plugins/loader.js +4 -7
- package/dist/plugins/manifest-registry.js +4 -4
- package/dist/plugins/manifest.js +4 -7
- package/dist/plugins/providers.js +2 -2
- package/dist/plugins/registry.js +2 -2
- package/dist/plugins/runtime.js +1 -1
- package/dist/plugins/status.js +2 -2
- package/dist/plugins/tools.js +2 -2
- package/dist/plugins/update.js +3 -3
- package/dist/providers/qwen-portal-oauth.js +1 -1
- package/dist/routing/resolve-route.js +2 -0
- package/dist/routing/session-key.js +5 -0
- package/dist/security/audit-extra.js +2 -2
- package/dist/security/audit.js +7 -7
- package/dist/shared/text/reasoning-tags.js +44 -3
- package/dist/slack/monitor/commands.js +4 -3
- package/dist/slack/monitor/slash.js +62 -59
- package/dist/slack/monitor.test-helpers.js +1 -1
- package/dist/telegram/accounts.js +1 -1
- package/dist/telegram/bot/delivery.js +26 -3
- package/dist/telegram/bot/helpers.js +13 -2
- package/dist/telegram/bot-message-context.js +8 -4
- package/dist/telegram/bot-message-dispatch.js +36 -5
- package/dist/telegram/bot-native-commands.js +50 -11
- package/dist/telegram/bot.js +7 -5
- package/dist/telegram/download.js +1 -1
- package/dist/telegram/monitor.js +19 -1
- package/dist/telegram/network-config.js +2 -2
- package/dist/telegram/network-errors.js +4 -0
- package/dist/terminal/links.js +1 -1
- package/dist/tts/tts.js +12 -6
- package/dist/tui/gateway-chat.js +3 -3
- package/dist/tui/tui.js +1 -1
- package/dist/utils.js +12 -3
- package/dist/version.js +3 -3
- package/dist/web/active-listener.js +1 -1
- package/dist/web/auth-store.js +1 -1
- package/dist/web/auto-reply/monitor/broadcast.js +2 -0
- package/dist/web/auto-reply/monitor/process-message.js +1 -1
- package/dist/web/auto-reply/monitor.js +1 -1
- package/dist/web/login.js +1 -1
- package/dist/web/session.js +2 -2
- package/dist/wizard/onboarding.finalize.js +24 -21
- package/dist/wizard/onboarding.gateway-config.js +1 -1
- package/dist/wizard/onboarding.js +11 -11
- package/docs/CNAME +1 -1
- package/docs/_config.yml +3 -3
- package/docs/_layouts/default.html +9 -9
- package/docs/assets/openclaw-logo-text-dark.png +0 -0
- package/docs/assets/openclaw-logo-text.png +0 -0
- package/docs/assets/theme.js +1 -1
- package/docs/automation/auth-monitoring.md +7 -7
- package/docs/automation/cron-jobs.md +19 -19
- package/docs/automation/cron-vs-heartbeat.md +7 -7
- package/docs/automation/gmail-pubsub.md +25 -25
- package/docs/automation/poll.md +7 -7
- package/docs/automation/webhook.md +5 -5
- package/docs/bedrock.md +10 -10
- package/docs/brave-search.md +1 -1
- package/docs/broadcast-groups.md +6 -6
- package/docs/channels/bluebubbles.md +12 -12
- package/docs/channels/discord.md +15 -15
- package/docs/channels/googlechat.md +16 -16
- package/docs/channels/imessage.md +13 -13
- package/docs/channels/index.md +4 -4
- package/docs/channels/line.md +6 -6
- package/docs/channels/location.md +1 -1
- package/docs/channels/matrix.md +14 -14
- package/docs/channels/mattermost.md +8 -8
- package/docs/channels/msteams.md +26 -26
- package/docs/channels/nextcloud-talk.md +7 -7
- package/docs/channels/nostr.md +9 -9
- package/docs/channels/signal.md +9 -9
- package/docs/channels/slack.md +16 -16
- package/docs/channels/telegram.md +23 -23
- package/docs/channels/tlon.md +5 -5
- package/docs/channels/troubleshooting.md +2 -2
- package/docs/channels/twitch.md +14 -14
- package/docs/channels/whatsapp.md +26 -26
- package/docs/channels/zalo.md +8 -8
- package/docs/channels/zalouser.md +12 -12
- package/docs/cli/acp.md +24 -24
- package/docs/cli/agent.md +6 -6
- package/docs/cli/agents.md +12 -12
- package/docs/cli/approvals.md +14 -14
- package/docs/cli/browser.md +24 -24
- package/docs/cli/channels.md +21 -21
- package/docs/cli/config.md +15 -15
- package/docs/cli/configure.md +6 -6
- package/docs/cli/cron.md +5 -5
- package/docs/cli/dashboard.md +4 -4
- package/docs/cli/devices.md +13 -13
- package/docs/cli/directory.md +12 -12
- package/docs/cli/dns.md +5 -6
- package/docs/cli/docs.md +5 -5
- package/docs/cli/doctor.md +11 -11
- package/docs/cli/gateway.md +26 -26
- package/docs/cli/health.md +5 -5
- package/docs/cli/hooks.md +35 -35
- package/docs/cli/index.md +42 -42
- package/docs/cli/logs.md +6 -6
- package/docs/cli/memory.md +12 -11
- package/docs/cli/message.md +11 -11
- package/docs/cli/models.md +15 -15
- package/docs/cli/node.md +14 -14
- package/docs/cli/nodes.md +14 -14
- package/docs/cli/onboard.md +7 -7
- package/docs/cli/pairing.md +4 -4
- package/docs/cli/plugins.md +16 -16
- package/docs/cli/reset.md +5 -5
- package/docs/cli/sandbox.md +28 -28
- package/docs/cli/security.md +6 -6
- package/docs/cli/sessions.md +5 -5
- package/docs/cli/setup.md +6 -6
- package/docs/cli/skills.md +6 -6
- package/docs/cli/status.md +7 -7
- package/docs/cli/system.md +6 -6
- package/docs/cli/tui.md +5 -5
- package/docs/cli/uninstall.md +5 -5
- package/docs/cli/update.md +20 -20
- package/docs/cli/voicecall.md +9 -9
- package/docs/cli/webhooks.md +5 -5
- package/docs/concepts/agent-loop.md +5 -5
- package/docs/concepts/agent-workspace.md +27 -27
- package/docs/concepts/agent.md +12 -12
- package/docs/concepts/architecture.md +2 -2
- package/docs/concepts/channel-routing.md +5 -5
- package/docs/concepts/compaction.md +5 -5
- package/docs/concepts/context.md +6 -6
- package/docs/concepts/group-messages.md +7 -7
- package/docs/concepts/groups.md +5 -5
- package/docs/concepts/markdown-formatting.md +3 -3
- package/docs/concepts/memory.md +41 -19
- package/docs/concepts/messages.md +4 -4
- package/docs/concepts/model-failover.md +14 -14
- package/docs/concepts/model-providers.md +25 -24
- package/docs/concepts/models.md +27 -27
- package/docs/concepts/multi-agent.md +31 -31
- package/docs/concepts/oauth.md +22 -22
- package/docs/concepts/presence.md +2 -2
- package/docs/concepts/retry.md +1 -1
- package/docs/concepts/session-pruning.md +1 -1
- package/docs/concepts/session-tool.md +4 -4
- package/docs/concepts/session.md +18 -16
- package/docs/concepts/streaming.md +3 -3
- package/docs/concepts/system-prompt.md +11 -11
- package/docs/concepts/timezone.md +2 -2
- package/docs/concepts/typebox.md +3 -3
- package/docs/concepts/typing-indicators.md +2 -2
- package/docs/concepts/usage-tracking.md +3 -3
- package/docs/date-time.md +2 -2
- package/docs/debug/node-issue.md +6 -6
- package/docs/debugging.md +18 -18
- package/docs/diagnostics/flags.md +7 -7
- package/docs/docs.json +21 -5
- package/docs/environment.md +7 -7
- package/docs/experiments/plans/cron-add-hardening.md +1 -1
- package/docs/experiments/plans/openresponses-gateway.md +2 -2
- package/docs/experiments/research/memory.md +12 -12
- package/docs/gateway/authentication.md +22 -22
- package/docs/gateway/background-process.md +2 -2
- package/docs/gateway/bonjour.md +25 -25
- package/docs/gateway/bridge-protocol.md +2 -2
- package/docs/gateway/cli-backends.md +12 -12
- package/docs/gateway/configuration-examples.md +26 -25
- package/docs/gateway/configuration.md +155 -153
- package/docs/gateway/discovery.md +10 -10
- package/docs/gateway/doctor.md +27 -27
- package/docs/gateway/gateway-lock.md +1 -1
- package/docs/gateway/health.md +11 -11
- package/docs/gateway/heartbeat.md +5 -5
- package/docs/gateway/index.md +63 -63
- package/docs/gateway/local-models.md +2 -2
- package/docs/gateway/logging.md +8 -8
- package/docs/gateway/multiple-gateways.md +24 -24
- package/docs/gateway/openai-http-api.md +12 -12
- package/docs/gateway/openresponses-http-api.md +12 -12
- package/docs/gateway/pairing.md +9 -9
- package/docs/gateway/protocol.md +4 -4
- package/docs/gateway/remote-gateway-readme.md +10 -10
- package/docs/gateway/remote.md +4 -4
- package/docs/gateway/sandbox-vs-tool-policy-vs-elevated.md +7 -7
- package/docs/gateway/sandboxing.md +6 -6
- package/docs/gateway/security/formal-verification.md +67 -14
- package/docs/gateway/security/index.md +56 -59
- package/docs/gateway/tailscale.md +10 -10
- package/docs/gateway/tools-invoke-http-api.md +5 -5
- package/docs/gateway/troubleshooting.md +112 -112
- package/docs/help/faq.md +338 -338
- package/docs/help/troubleshooting.md +16 -16
- package/docs/hooks/soul-evil.md +2 -2
- package/docs/hooks.md +62 -62
- package/docs/index.md +45 -36
- package/docs/install/ansible.md +35 -35
- package/docs/install/development-channels.md +10 -10
- package/docs/install/docker.md +45 -45
- package/docs/install/index.md +33 -33
- package/docs/install/installer.md +24 -24
- package/docs/install/migrating.md +36 -36
- package/docs/install/nix.md +18 -18
- package/docs/install/node.md +4 -4
- package/docs/install/uninstall.md +29 -29
- package/docs/install/updating.md +51 -51
- package/docs/logging.md +59 -59
- package/docs/multi-agent-sandbox-tools.md +15 -15
- package/docs/network.md +1 -1
- package/docs/nodes/audio.md +2 -2
- package/docs/nodes/camera.md +18 -18
- package/docs/nodes/images.md +4 -4
- package/docs/nodes/index.md +57 -57
- package/docs/nodes/location-command.md +2 -2
- package/docs/nodes/media-understanding.md +5 -5
- package/docs/nodes/talk.md +1 -1
- package/docs/nodes/voicewake.md +3 -3
- package/docs/northflank.mdx +9 -9
- package/docs/perplexity.md +2 -2
- package/docs/platforms/android.md +14 -14
- package/docs/platforms/digitalocean.md +26 -26
- package/docs/platforms/exe-dev.md +68 -130
- package/docs/platforms/fly.md +33 -33
- package/docs/platforms/gcp.md +58 -58
- package/docs/platforms/hetzner.md +45 -45
- package/docs/platforms/index.md +8 -8
- package/docs/platforms/ios.md +13 -13
- package/docs/platforms/linux.md +11 -11
- package/docs/platforms/mac/bundled-gateway.md +14 -14
- package/docs/platforms/mac/canvas.md +14 -14
- package/docs/platforms/mac/child-process.md +5 -5
- package/docs/platforms/mac/dev-setup.md +10 -10
- package/docs/platforms/mac/health.md +2 -2
- package/docs/platforms/mac/icon.md +1 -1
- package/docs/platforms/mac/logging.md +4 -4
- package/docs/platforms/mac/menu-bar.md +1 -1
- package/docs/platforms/mac/peekaboo.md +9 -9
- package/docs/platforms/mac/permissions.md +1 -1
- package/docs/platforms/mac/release.md +18 -18
- package/docs/platforms/mac/remote.md +14 -14
- package/docs/platforms/mac/signing.md +7 -7
- package/docs/platforms/mac/skills.md +4 -4
- package/docs/platforms/mac/webchat.md +1 -1
- package/docs/platforms/mac/xpc.md +4 -4
- package/docs/platforms/macos-vm.md +27 -27
- package/docs/platforms/macos.md +16 -16
- package/docs/platforms/oracle.md +35 -35
- package/docs/platforms/raspberry-pi.md +22 -22
- package/docs/platforms/windows.md +11 -11
- package/docs/plugin.md +65 -65
- package/docs/plugins/agent-tools.md +1 -1
- package/docs/plugins/manifest.md +4 -4
- package/docs/plugins/voice-call.md +12 -12
- package/docs/plugins/zalouser.md +9 -9
- package/docs/prose.md +9 -9
- package/docs/providers/anthropic.md +16 -16
- package/docs/providers/claude-max-api-proxy.md +4 -4
- package/docs/providers/deepgram.md +2 -2
- package/docs/providers/github-copilot.md +11 -11
- package/docs/providers/glm.md +4 -4
- package/docs/providers/index.md +4 -3
- package/docs/providers/minimax.md +9 -9
- package/docs/providers/models.md +3 -3
- package/docs/providers/moonshot.md +15 -4
- package/docs/providers/ollama.md +11 -11
- package/docs/providers/openai.md +6 -6
- package/docs/providers/opencode.md +3 -3
- package/docs/providers/openrouter.md +3 -3
- package/docs/providers/qwen.md +6 -6
- package/docs/providers/synthetic.md +4 -4
- package/docs/providers/venice.md +23 -23
- package/docs/providers/vercel-ai-gateway.md +4 -4
- package/docs/providers/xiaomi.md +62 -0
- package/docs/providers/zai.md +5 -5
- package/docs/railway.mdx +8 -8
- package/docs/refactor/exec-host.md +5 -5
- package/docs/refactor/plugin-sdk.md +12 -12
- package/docs/refactor/strict-config.md +11 -11
- package/docs/reference/AGENTS.default.md +17 -17
- package/docs/reference/RELEASING.md +29 -29
- package/docs/reference/api-usage-costs.md +6 -6
- package/docs/reference/device-models.md +7 -7
- package/docs/reference/rpc.md +3 -3
- package/docs/reference/session-management-compaction.md +19 -19
- package/docs/reference/templates/AGENTS.dev.md +1 -1
- package/docs/reference/templates/BOOT.md +1 -1
- package/docs/reference/templates/IDENTITY.md +1 -1
- package/docs/reference/templates/TOOLS.dev.md +1 -1
- package/docs/reference/templates/USER.dev.md +2 -2
- package/docs/reference/test.md +2 -2
- package/docs/reference/transcript-hygiene.md +1 -1
- package/docs/render.mdx +13 -13
- package/docs/scripts.md +1 -1
- package/docs/security/formal-verification.md +66 -13
- package/docs/start/getting-started.md +29 -29
- package/docs/start/hubs.md +2 -2
- package/docs/start/lore.md +14 -14
- package/docs/start/onboarding.md +7 -7
- package/docs/start/{clawd.md → openclaw.md} +35 -35
- package/docs/start/pairing.md +10 -10
- package/docs/start/setup.md +22 -22
- package/docs/start/showcase.md +32 -32
- package/docs/start/wizard.md +30 -30
- package/docs/testing.md +56 -56
- package/docs/token-use.md +7 -7
- package/docs/tools/agent-send.md +10 -10
- package/docs/tools/browser-linux-troubleshooting.md +16 -16
- package/docs/tools/browser-login.md +6 -6
- package/docs/tools/browser.md +126 -126
- package/docs/tools/chrome-extension.md +17 -17
- package/docs/tools/clawdhub.md +7 -7
- package/docs/tools/creating-skills.md +6 -6
- package/docs/tools/exec-approvals.md +5 -5
- package/docs/tools/exec.md +4 -4
- package/docs/tools/firecrawl.md +2 -2
- package/docs/tools/index.md +13 -13
- package/docs/tools/llm-task.md +2 -2
- package/docs/tools/lobster.md +13 -13
- package/docs/tools/skills-config.md +2 -2
- package/docs/tools/skills.md +31 -31
- package/docs/tools/slash-commands.md +8 -8
- package/docs/tools/web.md +8 -8
- package/docs/tts.md +11 -11
- package/docs/tui.md +7 -7
- package/docs/vps.md +1 -1
- package/docs/web/control-ui.md +8 -8
- package/docs/web/dashboard.md +6 -6
- package/docs/web/index.md +5 -5
- package/extensions/bluebubbles/index.ts +3 -3
- package/extensions/bluebubbles/package.json +5 -5
- package/extensions/bluebubbles/src/accounts.ts +9 -9
- package/extensions/bluebubbles/src/actions.test.ts +22 -22
- package/extensions/bluebubbles/src/actions.ts +6 -6
- package/extensions/bluebubbles/src/attachments.ts +2 -2
- package/extensions/bluebubbles/src/channel.ts +17 -17
- package/extensions/bluebubbles/src/chat.ts +2 -2
- package/extensions/bluebubbles/src/config-schema.ts +1 -1
- package/extensions/bluebubbles/src/media-send.ts +2 -2
- package/extensions/bluebubbles/src/monitor.test.ts +48 -48
- package/extensions/bluebubbles/src/monitor.ts +6 -6
- package/extensions/bluebubbles/src/onboarding.ts +9 -9
- package/extensions/bluebubbles/src/reactions.ts +2 -2
- package/extensions/bluebubbles/src/runtime.ts +1 -1
- package/extensions/bluebubbles/src/send.ts +2 -2
- package/extensions/copilot-proxy/README.md +3 -3
- package/extensions/copilot-proxy/index.ts +1 -1
- package/extensions/copilot-proxy/package.json +4 -4
- package/extensions/diagnostics-otel/index.ts +3 -3
- package/extensions/diagnostics-otel/package.json +4 -4
- package/extensions/diagnostics-otel/src/service.test.ts +15 -15
- package/extensions/diagnostics-otel/src/service.ts +85 -85
- package/extensions/discord/index.ts +3 -3
- package/extensions/discord/package.json +4 -4
- package/extensions/discord/src/channel.ts +1 -1
- package/extensions/discord/src/runtime.ts +1 -1
- package/extensions/google-antigravity-auth/README.md +3 -3
- package/extensions/google-antigravity-auth/index.ts +2 -2
- package/extensions/google-antigravity-auth/package.json +4 -4
- package/extensions/google-gemini-cli-auth/README.md +5 -5
- package/extensions/google-gemini-cli-auth/index.ts +3 -3
- package/extensions/google-gemini-cli-auth/oauth.ts +4 -4
- package/extensions/google-gemini-cli-auth/package.json +4 -4
- package/extensions/googlechat/index.ts +4 -4
- package/extensions/googlechat/node_modules/.bin/openclaw +16 -0
- package/extensions/googlechat/node_modules/.bin/openclaw.CMD +7 -0
- package/extensions/googlechat/node_modules/.bin/openclaw.ps1 +28 -0
- package/extensions/googlechat/package.json +7 -7
- package/extensions/googlechat/src/accounts.ts +9 -9
- package/extensions/googlechat/src/actions.ts +8 -8
- package/extensions/googlechat/src/api.ts +1 -1
- package/extensions/googlechat/src/channel.ts +23 -23
- package/extensions/googlechat/src/monitor.ts +9 -9
- package/extensions/googlechat/src/onboarding.ts +11 -11
- package/extensions/googlechat/src/runtime.ts +1 -1
- package/extensions/googlechat/src/types.config.ts +1 -1
- package/extensions/imessage/index.ts +3 -3
- package/extensions/imessage/package.json +4 -4
- package/extensions/imessage/src/channel.ts +1 -1
- package/extensions/imessage/src/runtime.ts +1 -1
- package/extensions/line/index.ts +3 -3
- package/extensions/line/node_modules/.bin/openclaw +16 -0
- package/extensions/line/node_modules/.bin/openclaw.CMD +7 -0
- package/extensions/line/node_modules/.bin/openclaw.ps1 +28 -0
- package/extensions/line/package.json +6 -6
- package/extensions/line/src/card-command.ts +3 -3
- package/extensions/line/src/channel.logout.test.ts +4 -4
- package/extensions/line/src/channel.sendPayload.test.ts +8 -8
- package/extensions/line/src/channel.ts +5 -5
- package/extensions/line/src/runtime.ts +1 -1
- package/extensions/llm-task/README.md +4 -4
- package/extensions/llm-task/index.ts +2 -2
- package/extensions/llm-task/package.json +4 -4
- package/extensions/llm-task/src/llm-task-tool.ts +6 -6
- package/extensions/lobster/README.md +7 -7
- package/extensions/lobster/index.ts +2 -2
- package/extensions/lobster/package.json +3 -3
- package/extensions/lobster/src/lobster-tool.test.ts +7 -7
- package/extensions/lobster/src/lobster-tool.ts +2 -2
- package/extensions/matrix/CHANGELOG.md +14 -9
- package/extensions/matrix/index.ts +3 -3
- package/extensions/matrix/node_modules/.bin/markdown-it +0 -5
- package/extensions/matrix/node_modules/.bin/markdown-it.CMD +0 -5
- package/extensions/matrix/node_modules/.bin/markdown-it.ps1 +0 -13
- package/extensions/matrix/node_modules/.bin/openclaw +16 -0
- package/extensions/matrix/node_modules/.bin/openclaw.CMD +7 -0
- package/extensions/matrix/node_modules/.bin/openclaw.ps1 +28 -0
- package/extensions/matrix/package.json +6 -6
- package/extensions/matrix/src/actions.ts +1 -1
- package/extensions/matrix/src/channel.directory.test.ts +1 -1
- package/extensions/matrix/src/channel.ts +1 -1
- package/extensions/matrix/src/config-schema.ts +1 -1
- package/extensions/matrix/src/directory-live.ts +1 -1
- package/extensions/matrix/src/group-mentions.ts +1 -1
- package/extensions/matrix/src/matrix/accounts.ts +1 -1
- package/extensions/matrix/src/matrix/actions/client.ts +1 -1
- package/extensions/matrix/src/matrix/client/config.ts +1 -1
- package/extensions/matrix/src/matrix/deps.ts +1 -1
- package/extensions/matrix/src/matrix/monitor/allowlist.ts +1 -1
- package/extensions/matrix/src/matrix/monitor/auto-join.ts +1 -1
- package/extensions/matrix/src/matrix/monitor/events.ts +1 -1
- package/extensions/matrix/src/matrix/monitor/handler.ts +5 -5
- package/extensions/matrix/src/matrix/monitor/index.ts +1 -1
- package/extensions/matrix/src/matrix/monitor/location.ts +1 -1
- package/extensions/matrix/src/matrix/monitor/media.test.ts +1 -1
- package/extensions/matrix/src/matrix/monitor/replies.ts +1 -1
- package/extensions/matrix/src/matrix/monitor/rooms.ts +1 -1
- package/extensions/matrix/src/matrix/poll-types.ts +1 -1
- package/extensions/matrix/src/matrix/send/client.ts +1 -1
- package/extensions/matrix/src/matrix/send.test.ts +1 -1
- package/extensions/matrix/src/matrix/send.ts +1 -1
- package/extensions/matrix/src/onboarding.ts +2 -2
- package/extensions/matrix/src/outbound.ts +1 -1
- package/extensions/matrix/src/resolve-targets.ts +1 -1
- package/extensions/matrix/src/runtime.ts +1 -1
- package/extensions/matrix/src/tool-actions.ts +1 -1
- package/extensions/mattermost/index.ts +3 -3
- package/extensions/mattermost/package.json +5 -5
- package/extensions/mattermost/src/channel.ts +1 -1
- package/extensions/mattermost/src/config-schema.ts +1 -1
- package/extensions/mattermost/src/group-mentions.ts +1 -1
- package/extensions/mattermost/src/mattermost/accounts.ts +9 -9
- package/extensions/mattermost/src/mattermost/monitor-helpers.ts +5 -5
- package/extensions/mattermost/src/mattermost/monitor.ts +4 -4
- package/extensions/mattermost/src/onboarding-helpers.ts +4 -4
- package/extensions/mattermost/src/onboarding.ts +4 -4
- package/extensions/mattermost/src/runtime.ts +1 -1
- package/extensions/mattermost/src/types.ts +1 -1
- package/extensions/memory-core/index.ts +3 -3
- package/extensions/memory-core/node_modules/.bin/openclaw +16 -0
- package/extensions/memory-core/node_modules/.bin/openclaw.CMD +7 -0
- package/extensions/memory-core/node_modules/.bin/openclaw.ps1 +28 -0
- package/extensions/memory-core/package.json +6 -6
- package/extensions/memory-lancedb/config.ts +26 -2
- package/extensions/memory-lancedb/index.test.ts +3 -3
- package/extensions/memory-lancedb/index.ts +4 -4
- package/extensions/memory-lancedb/node_modules/.bin/openai +0 -5
- package/extensions/memory-lancedb/node_modules/.bin/openai.CMD +0 -5
- package/extensions/memory-lancedb/node_modules/.bin/openai.ps1 +0 -13
- package/extensions/memory-lancedb/{clawdbot.plugin.json → openclaw.plugin.json} +1 -1
- package/extensions/memory-lancedb/package.json +4 -4
- package/extensions/msteams/CHANGELOG.md +12 -7
- package/extensions/msteams/index.ts +3 -3
- package/extensions/msteams/node_modules/.bin/openclaw +16 -0
- package/extensions/msteams/node_modules/.bin/openclaw.CMD +7 -0
- package/extensions/msteams/node_modules/.bin/openclaw.ps1 +28 -0
- package/extensions/msteams/package.json +6 -6
- package/extensions/msteams/src/attachments.test.ts +1 -1
- package/extensions/msteams/src/channel.directory.test.ts +2 -2
- package/extensions/msteams/src/channel.ts +3 -3
- package/extensions/msteams/src/conversation-store-fs.test.ts +6 -5
- package/extensions/msteams/src/directory-live.ts +1 -1
- package/extensions/msteams/src/graph-upload.ts +4 -4
- package/extensions/msteams/src/media-helpers.ts +1 -1
- package/extensions/msteams/src/messenger.test.ts +1 -1
- package/extensions/msteams/src/messenger.ts +1 -1
- package/extensions/msteams/src/monitor-handler/message-handler.ts +1 -1
- package/extensions/msteams/src/monitor-handler.ts +2 -2
- package/extensions/msteams/src/monitor.ts +3 -3
- package/extensions/msteams/src/onboarding.ts +11 -11
- package/extensions/msteams/src/outbound.ts +1 -1
- package/extensions/msteams/src/policy.test.ts +1 -1
- package/extensions/msteams/src/policy.ts +2 -2
- package/extensions/msteams/src/polls-store.test.ts +1 -1
- package/extensions/msteams/src/polls.test.ts +6 -5
- package/extensions/msteams/src/polls.ts +9 -8
- package/extensions/msteams/src/probe.test.ts +1 -1
- package/extensions/msteams/src/probe.ts +1 -1
- package/extensions/msteams/src/reply-dispatcher.ts +3 -3
- package/extensions/msteams/src/runtime.ts +1 -1
- package/extensions/msteams/src/send-context.ts +2 -2
- package/extensions/msteams/src/send.ts +5 -5
- package/extensions/msteams/src/token.ts +1 -1
- package/extensions/nextcloud-talk/index.ts +3 -3
- package/extensions/nextcloud-talk/package.json +5 -5
- package/extensions/nextcloud-talk/src/accounts.ts +2 -2
- package/extensions/nextcloud-talk/src/channel.ts +8 -8
- package/extensions/nextcloud-talk/src/config-schema.ts +1 -1
- package/extensions/nextcloud-talk/src/inbound.ts +8 -8
- package/extensions/nextcloud-talk/src/monitor.ts +1 -1
- package/extensions/nextcloud-talk/src/onboarding.ts +2 -2
- package/extensions/nextcloud-talk/src/policy.ts +2 -2
- package/extensions/nextcloud-talk/src/room-info.ts +1 -1
- package/extensions/nextcloud-talk/src/runtime.ts +1 -1
- package/extensions/nextcloud-talk/src/types.ts +1 -1
- package/extensions/nostr/CHANGELOG.md +9 -4
- package/extensions/nostr/README.md +5 -5
- package/extensions/nostr/index.ts +6 -6
- package/extensions/nostr/node_modules/.bin/openclaw +16 -0
- package/extensions/nostr/node_modules/.bin/openclaw.CMD +7 -0
- package/extensions/nostr/node_modules/.bin/openclaw.ps1 +28 -0
- package/extensions/nostr/package.json +6 -6
- package/extensions/nostr/src/channel.ts +2 -2
- package/extensions/nostr/src/config-schema.ts +1 -1
- package/extensions/nostr/src/nostr-state-store.test.ts +9 -8
- package/extensions/nostr/src/runtime.ts +1 -1
- package/extensions/nostr/src/types.ts +4 -4
- package/extensions/open-prose/index.ts +2 -2
- package/extensions/open-prose/package.json +3 -3
- package/extensions/open-prose/skills/prose/SKILL.md +5 -5
- package/extensions/open-prose/skills/prose/prose.md +4 -4
- package/extensions/qwen-portal-auth/README.md +3 -3
- package/extensions/qwen-portal-auth/index.ts +1 -1
- package/extensions/signal/index.ts +3 -3
- package/extensions/signal/package.json +4 -4
- package/extensions/signal/src/channel.ts +1 -1
- package/extensions/signal/src/runtime.ts +1 -1
- package/extensions/slack/index.ts +3 -3
- package/extensions/slack/package.json +4 -4
- package/extensions/slack/src/channel.ts +1 -1
- package/extensions/slack/src/runtime.ts +1 -1
- package/extensions/telegram/index.ts +3 -3
- package/extensions/telegram/package.json +4 -4
- package/extensions/telegram/src/channel.ts +3 -3
- package/extensions/telegram/src/runtime.ts +1 -1
- package/extensions/tlon/README.md +3 -3
- package/extensions/tlon/index.ts +3 -3
- package/extensions/tlon/package.json +5 -5
- package/extensions/tlon/src/channel.ts +15 -15
- package/extensions/tlon/src/config-schema.ts +1 -1
- package/extensions/tlon/src/monitor/discovery.ts +1 -1
- package/extensions/tlon/src/monitor/history.ts +1 -1
- package/extensions/tlon/src/monitor/index.ts +3 -3
- package/extensions/tlon/src/onboarding.ts +4 -4
- package/extensions/tlon/src/runtime.ts +1 -1
- package/extensions/tlon/src/types.ts +3 -3
- package/extensions/twitch/CHANGELOG.md +6 -1
- package/extensions/twitch/README.md +8 -8
- package/extensions/twitch/index.ts +3 -3
- package/extensions/twitch/node_modules/.bin/openclaw +16 -0
- package/extensions/twitch/node_modules/.bin/openclaw.CMD +7 -0
- package/extensions/twitch/node_modules/.bin/openclaw.ps1 +28 -0
- package/extensions/twitch/package.json +5 -5
- package/extensions/twitch/src/actions.ts +1 -1
- package/extensions/twitch/src/config-schema.ts +1 -1
- package/extensions/twitch/src/config.ts +3 -3
- package/extensions/twitch/src/monitor.ts +3 -3
- package/extensions/twitch/src/onboarding.test.ts +1 -1
- package/extensions/twitch/src/onboarding.ts +13 -13
- package/extensions/twitch/src/outbound.test.ts +2 -2
- package/extensions/twitch/src/outbound.ts +2 -2
- package/extensions/twitch/src/plugin.test.ts +2 -2
- package/extensions/twitch/src/plugin.ts +9 -9
- package/extensions/twitch/src/runtime.ts +1 -1
- package/extensions/twitch/src/send.test.ts +2 -2
- package/extensions/twitch/src/send.ts +5 -5
- package/extensions/twitch/src/token.test.ts +12 -12
- package/extensions/twitch/src/token.ts +7 -7
- package/extensions/twitch/src/twitch-client.ts +4 -4
- package/extensions/twitch/src/types.ts +3 -3
- package/extensions/twitch/src/utils/markdown.ts +1 -1
- package/extensions/voice-call/CHANGELOG.md +16 -11
- package/extensions/voice-call/README.md +16 -16
- package/extensions/voice-call/package.json +4 -4
- package/extensions/voice-call/src/cli.ts +16 -4
- package/extensions/voice-call/src/core-bridge.ts +5 -5
- package/extensions/voice-call/src/manager.test.ts +2 -2
- package/extensions/voice-call/src/manager.ts +17 -5
- package/extensions/voice-call/src/response-generator.ts +1 -1
- package/extensions/whatsapp/index.ts +3 -3
- package/extensions/whatsapp/package.json +4 -4
- package/extensions/whatsapp/src/channel.ts +1 -1
- package/extensions/whatsapp/src/runtime.ts +1 -1
- package/extensions/zalo/CHANGELOG.md +14 -9
- package/extensions/zalo/README.md +4 -4
- package/extensions/zalo/index.ts +3 -3
- package/extensions/zalo/node_modules/.bin/openclaw +16 -0
- package/extensions/zalo/node_modules/.bin/openclaw.CMD +7 -0
- package/extensions/zalo/node_modules/.bin/openclaw.ps1 +28 -0
- package/extensions/zalo/package.json +6 -6
- package/extensions/zalo/src/accounts.ts +9 -9
- package/extensions/zalo/src/actions.ts +6 -6
- package/extensions/zalo/src/channel.directory.test.ts +2 -2
- package/extensions/zalo/src/channel.ts +20 -20
- package/extensions/zalo/src/config-schema.ts +1 -1
- package/extensions/zalo/src/monitor.ts +9 -9
- package/extensions/zalo/src/monitor.webhook.test.ts +2 -2
- package/extensions/zalo/src/onboarding.ts +27 -27
- package/extensions/zalo/src/runtime.ts +1 -1
- package/extensions/zalo/src/send.ts +2 -2
- package/extensions/zalo/src/status-issues.ts +1 -1
- package/extensions/zalo/src/token.ts +1 -1
- package/extensions/zalouser/CHANGELOG.md +9 -4
- package/extensions/zalouser/README.md +18 -18
- package/extensions/zalouser/index.ts +3 -3
- package/extensions/zalouser/node_modules/.bin/openclaw +16 -0
- package/extensions/zalouser/node_modules/.bin/openclaw.CMD +7 -0
- package/extensions/zalouser/node_modules/.bin/openclaw.ps1 +28 -0
- package/extensions/zalouser/package.json +6 -6
- package/extensions/zalouser/src/accounts.ts +10 -10
- package/extensions/zalouser/src/channel.ts +27 -27
- package/extensions/zalouser/src/config-schema.ts +1 -1
- package/extensions/zalouser/src/monitor.ts +5 -5
- package/extensions/zalouser/src/onboarding.ts +32 -32
- package/extensions/zalouser/src/runtime.ts +1 -1
- package/extensions/zalouser/src/status-issues.ts +2 -2
- package/openclaw.mjs +14 -0
- package/package.json +35 -25
- package/scripts/postinstall.js +1 -0
- package/skills/1password/SKILL.md +3 -3
- package/skills/apple-notes/SKILL.md +2 -2
- package/skills/apple-reminders/SKILL.md +1 -1
- package/skills/bear-notes/SKILL.md +1 -1
- package/skills/bird/SKILL.md +1 -1
- package/skills/blogwatcher/SKILL.md +1 -1
- package/skills/blucli/SKILL.md +1 -1
- package/skills/bluebubbles/SKILL.md +1 -1
- package/skills/camsnap/SKILL.md +1 -1
- package/skills/canvas/SKILL.md +6 -6
- package/skills/clawdhub/SKILL.md +2 -2
- package/skills/coding-agent/SKILL.md +6 -6
- package/skills/discord/SKILL.md +5 -5
- package/skills/eightctl/SKILL.md +1 -1
- package/skills/food-order/SKILL.md +1 -1
- package/skills/gemini/SKILL.md +1 -1
- package/skills/gifgrep/SKILL.md +1 -1
- package/skills/github/SKILL.md +1 -1
- package/skills/gog/SKILL.md +1 -1
- package/skills/goplaces/SKILL.md +1 -1
- package/skills/himalaya/SKILL.md +1 -1
- package/skills/imsg/SKILL.md +1 -1
- package/skills/local-places/SKILL.md +1 -1
- package/skills/mcporter/SKILL.md +1 -1
- package/skills/model-usage/SKILL.md +1 -1
- package/skills/nano-banana-pro/SKILL.md +3 -3
- package/skills/nano-banana-pro/scripts/generate_image.py +1 -1
- package/skills/nano-pdf/SKILL.md +1 -1
- package/skills/notion/SKILL.md +1 -1
- package/skills/obsidian/SKILL.md +1 -1
- package/skills/openai-image-gen/SKILL.md +1 -1
- package/skills/openai-whisper/SKILL.md +1 -1
- package/skills/openai-whisper-api/SKILL.md +2 -2
- package/skills/openhue/SKILL.md +1 -1
- package/skills/oracle/SKILL.md +1 -1
- package/skills/ordercli/SKILL.md +1 -1
- package/skills/peekaboo/SKILL.md +1 -1
- package/skills/sag/SKILL.md +1 -1
- package/skills/session-logs/SKILL.md +1 -1
- package/skills/sherpa-onnx-tts/SKILL.md +2 -2
- package/skills/slack/SKILL.md +4 -4
- package/skills/songsee/SKILL.md +1 -1
- package/skills/sonoscli/SKILL.md +1 -1
- package/skills/spotify-player/SKILL.md +1 -1
- package/skills/summarize/SKILL.md +1 -1
- package/skills/things-mac/SKILL.md +3 -3
- package/skills/tmux/SKILL.md +7 -7
- package/skills/trello/SKILL.md +2 -2
- package/skills/video-frames/SKILL.md +1 -1
- package/skills/voice-call/SKILL.md +4 -4
- package/skills/wacli/SKILL.md +2 -2
- package/skills/weather/SKILL.md +1 -1
- package/dist/control-ui/assets/index-BAFzd9IE.css +0 -1
- package/dist/control-ui/assets/index-CxLFx0Ae.js.map +0 -1
- package/dist/control-ui/pixel_pig_icon.png +0 -0
- package/dist/daemon/legacy.js +0 -44
- /package/dist/config/{types.clawdbot.js → types.openclaw.js} +0 -0
- /package/docs/{whatsapp-clawd.jpg → whatsapp-openclaw.jpg} +0 -0
- /package/extensions/bluebubbles/{clawdbot.plugin.json → openclaw.plugin.json} +0 -0
- /package/extensions/copilot-proxy/{clawdbot.plugin.json → openclaw.plugin.json} +0 -0
- /package/extensions/diagnostics-otel/{clawdbot.plugin.json → openclaw.plugin.json} +0 -0
- /package/extensions/discord/{clawdbot.plugin.json → openclaw.plugin.json} +0 -0
- /package/extensions/google-antigravity-auth/{clawdbot.plugin.json → openclaw.plugin.json} +0 -0
- /package/extensions/google-gemini-cli-auth/{clawdbot.plugin.json → openclaw.plugin.json} +0 -0
- /package/extensions/googlechat/{clawdbot.plugin.json → openclaw.plugin.json} +0 -0
- /package/extensions/imessage/{clawdbot.plugin.json → openclaw.plugin.json} +0 -0
- /package/extensions/line/{clawdbot.plugin.json → openclaw.plugin.json} +0 -0
- /package/extensions/llm-task/{clawdbot.plugin.json → openclaw.plugin.json} +0 -0
- /package/extensions/lobster/{clawdbot.plugin.json → openclaw.plugin.json} +0 -0
- /package/extensions/matrix/{clawdbot.plugin.json → openclaw.plugin.json} +0 -0
- /package/extensions/mattermost/{clawdbot.plugin.json → openclaw.plugin.json} +0 -0
- /package/extensions/memory-core/{clawdbot.plugin.json → openclaw.plugin.json} +0 -0
- /package/extensions/msteams/{clawdbot.plugin.json → openclaw.plugin.json} +0 -0
- /package/extensions/nextcloud-talk/{clawdbot.plugin.json → openclaw.plugin.json} +0 -0
- /package/extensions/nostr/{clawdbot.plugin.json → openclaw.plugin.json} +0 -0
- /package/extensions/open-prose/{clawdbot.plugin.json → openclaw.plugin.json} +0 -0
- /package/extensions/qwen-portal-auth/{clawdbot.plugin.json → openclaw.plugin.json} +0 -0
- /package/extensions/signal/{clawdbot.plugin.json → openclaw.plugin.json} +0 -0
- /package/extensions/slack/{clawdbot.plugin.json → openclaw.plugin.json} +0 -0
- /package/extensions/telegram/{clawdbot.plugin.json → openclaw.plugin.json} +0 -0
- /package/extensions/tlon/{clawdbot.plugin.json → openclaw.plugin.json} +0 -0
- /package/extensions/twitch/{clawdbot.plugin.json → openclaw.plugin.json} +0 -0
- /package/extensions/voice-call/{clawdbot.plugin.json → openclaw.plugin.json} +0 -0
- /package/extensions/whatsapp/{clawdbot.plugin.json → openclaw.plugin.json} +0 -0
- /package/extensions/zalo/{clawdbot.plugin.json → openclaw.plugin.json} +0 -0
- /package/extensions/zalouser/{clawdbot.plugin.json → openclaw.plugin.json} +0 -0
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function s(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();const
|
|
2
|
-
\f\r]`,
|
|
3
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),Gi=/'/g,Yi=/"/g,no=/^(?:script|style|textarea|title)$/i,tl=e=>(t,...n)=>({_$litType$:e,strings:t,values:n}),c=tl(1),Se=Symbol.for("lit-noChange"),f=Symbol.for("lit-nothing"),Qi=new WeakMap,Pe=Oe.createTreeWalker(Oe,129);function so(e,t){if(!Ns(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return qi!==void 0?qi.createHTML(t):t}const nl=(e,t)=>{const n=e.length-1,s=[];let i,a=t===2?"<svg>":t===3?"<math>":"",o=rt;for(let l=0;l<n;l++){const r=e[l];let p,d,u=-1,g=0;for(;g<r.length&&(o.lastIndex=g,d=o.exec(r),d!==null);)g=o.lastIndex,o===rt?d[1]==="!--"?o=Wi:d[1]!==void 0?o=Vi:d[2]!==void 0?(no.test(d[2])&&(i=RegExp("</"+d[2],"g")),o=Ie):d[3]!==void 0&&(o=Ie):o===Ie?d[0]===">"?(o=i??rt,u=-1):d[1]===void 0?u=-2:(u=o.lastIndex-d[2].length,p=d[1],o=d[3]===void 0?Ie:d[3]==='"'?Yi:Gi):o===Yi||o===Gi?o=Ie:o===Wi||o===Vi?o=rt:(o=Ie,i=void 0);const v=o===Ie&&e[l+1].startsWith("/>")?" ":"";a+=o===rt?r+Xr:u>=0?(s.push(p),r.slice(0,u)+eo+r.slice(u)+xe+v):r+xe+(u===-2?l:v)}return[so(e,a+(e[n]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]};let as=class io{constructor({strings:t,_$litType$:n},s){let i;this.parts=[];let a=0,o=0;const l=t.length-1,r=this.parts,[p,d]=nl(t,n);if(this.el=io.createElement(p,s),Pe.currentNode=this.el.content,n===2||n===3){const u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(i=Pe.nextNode())!==null&&r.length<l;){if(i.nodeType===1){if(i.hasAttributes())for(const u of i.getAttributeNames())if(u.endsWith(eo)){const g=d[o++],v=i.getAttribute(u).split(xe),m=/([.?@])?(.*)/.exec(g);r.push({type:1,index:a,name:m[2],strings:v,ctor:m[1]==="."?il:m[1]==="?"?al:m[1]==="@"?ol:rn}),i.removeAttribute(u)}else u.startsWith(xe)&&(r.push({type:6,index:a}),i.removeAttribute(u));if(no.test(i.tagName)){const u=i.textContent.split(xe),g=u.length-1;if(g>0){i.textContent=Qt?Qt.emptyScript:"";for(let v=0;v<g;v++)i.append(u[v],xt()),Pe.nextNode(),r.push({type:2,index:++a});i.append(u[g],xt())}}}else if(i.nodeType===8)if(i.data===to)r.push({type:2,index:a});else{let u=-1;for(;(u=i.data.indexOf(xe,u+1))!==-1;)r.push({type:7,index:a}),u+=xe.length-1}a++}}static createElement(t,n){const s=Oe.createElement("template");return s.innerHTML=t,s}};function Je(e,t,n=e,s){if(t===Se)return t;let i=s!==void 0?n._$Co?.[s]:n._$Cl;const a=At(t)?void 0:t._$litDirective$;return i?.constructor!==a&&(i?._$AO?.(!1),a===void 0?i=void 0:(i=new a(e),i._$AT(e,n,s)),s!==void 0?(n._$Co??=[])[s]=i:n._$Cl=i),i!==void 0&&(t=Je(e,i._$AS(e,t.values),i,s)),t}class sl{constructor(t,n){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=n}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:n},parts:s}=this._$AD,i=(t?.creationScope??Oe).importNode(n,!0);Pe.currentNode=i;let a=Pe.nextNode(),o=0,l=0,r=s[0];for(;r!==void 0;){if(o===r.index){let p;r.type===2?p=new on(a,a.nextSibling,this,t):r.type===1?p=new r.ctor(a,r.name,r.strings,this,t):r.type===6&&(p=new rl(a,this,t)),this._$AV.push(p),r=s[++l]}o!==r?.index&&(a=Pe.nextNode(),o++)}return Pe.currentNode=Oe,i}p(t){let n=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,n),n+=s.strings.length-2):s._$AI(t[n])),n++}}let on=class ao{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,n,s,i){this.type=2,this._$AH=f,this._$AN=void 0,this._$AA=t,this._$AB=n,this._$AM=s,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const n=this._$AM;return n!==void 0&&t?.nodeType===11&&(t=n.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,n=this){t=Je(this,t,n),At(t)?t===f||t==null||t===""?(this._$AH!==f&&this._$AR(),this._$AH=f):t!==this._$AH&&t!==Se&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):el(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==f&&At(this._$AH)?this._$AA.nextSibling.data=t:this.T(Oe.createTextNode(t)),this._$AH=t}$(t){const{values:n,_$litType$:s}=t,i=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=as.createElement(so(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===i)this._$AH.p(n);else{const a=new sl(i,this),o=a.u(this.options);a.p(n),this.T(o),this._$AH=a}}_$AC(t){let n=Qi.get(t.strings);return n===void 0&&Qi.set(t.strings,n=new as(t)),n}k(t){Ns(this._$AH)||(this._$AH=[],this._$AR());const n=this._$AH;let s,i=0;for(const a of t)i===n.length?n.push(s=new ao(this.O(xt()),this.O(xt()),this,this.options)):s=n[i],s._$AI(a),i++;i<n.length&&(this._$AR(s&&s._$AB.nextSibling,i),n.length=i)}_$AR(t=this._$AA.nextSibling,n){for(this._$AP?.(!1,!0,n);t!==this._$AB;){const s=ji(t).nextSibling;ji(t).remove(),t=s}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}};class rn{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,n,s,i,a){this.type=1,this._$AH=f,this._$AN=void 0,this.element=t,this.name=n,this._$AM=i,this.options=a,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=f}_$AI(t,n=this,s,i){const a=this.strings;let o=!1;if(a===void 0)t=Je(this,t,n,0),o=!At(t)||t!==this._$AH&&t!==Se,o&&(this._$AH=t);else{const l=t;let r,p;for(t=a[0],r=0;r<a.length-1;r++)p=Je(this,l[s+r],n,r),p===Se&&(p=this._$AH[r]),o||=!At(p)||p!==this._$AH[r],p===f?t=f:t!==f&&(t+=(p??"")+a[r+1]),this._$AH[r]=p}o&&!i&&this.j(t)}j(t){t===f?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}let il=class extends rn{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===f?void 0:t}},al=class extends rn{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==f)}},ol=class extends rn{constructor(t,n,s,i,a){super(t,n,s,i,a),this.type=5}_$AI(t,n=this){if((t=Je(this,t,n,0)??f)===Se)return;const s=this._$AH,i=t===f&&s!==f||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,a=t!==f&&(s===f||i);i&&this.element.removeEventListener(this.name,this,s),a&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},rl=class{constructor(t,n,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=n,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){Je(this,t)}};const ll={I:on},cl=Ps.litHtmlPolyfillSupport;cl?.(as,on),(Ps.litHtmlVersions??=[]).push("3.3.2");const dl=(e,t,n)=>{const s=n?.renderBefore??t;let i=s._$litPart$;if(i===void 0){const a=n?.renderBefore??null;s._$litPart$=i=new on(t.insertBefore(xt(),a),a,void 0,n??{})}return i._$AI(e),i};const Os=globalThis;let Ze=class extends Ye{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=dl(n,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Se}};Ze._$litElement$=!0,Ze.finalized=!0,Os.litElementHydrateSupport?.({LitElement:Ze});const ul=Os.litElementPolyfillSupport;ul?.({LitElement:Ze});(Os.litElementVersions??=[]).push("4.2.2");const oo=e=>(t,n)=>{n!==void 0?n.addInitializer(()=>{customElements.define(e,t)}):customElements.define(e,t)};const pl={attribute:!0,type:String,converter:Yt,reflect:!1,hasChanged:Rs},hl=(e=pl,t,n)=>{const{kind:s,metadata:i}=n;let a=globalThis.litPropertyMetadata.get(i);if(a===void 0&&globalThis.litPropertyMetadata.set(i,a=new Map),s==="setter"&&((e=Object.create(e)).wrapped=!0),a.set(n.name,e),s==="accessor"){const{name:o}=n;return{set(l){const r=t.get.call(this);t.set.call(this,l),this.requestUpdate(o,r,e,!0,l)},init(l){return l!==void 0&&this.C(o,void 0,e,l),l}}}if(s==="setter"){const{name:o}=n;return function(l){const r=this[o];t.call(this,l),this.requestUpdate(o,r,e,!0,l)}}throw Error("Unsupported decorator location: "+s)};function ln(e){return(t,n)=>typeof n=="object"?hl(e,t,n):((s,i,a)=>{const o=i.hasOwnProperty(a);return i.constructor.createProperty(a,s),o?Object.getOwnPropertyDescriptor(i,a):void 0})(e,t,n)}function w(e){return ln({...e,state:!0,attribute:!1})}const fl=50,gl=200,vl="Assistant";function Zi(e,t){if(typeof e!="string")return;const n=e.trim();if(n)return n.length<=t?n:n.slice(0,t)}function os(e){const t=Zi(e?.name,fl)??vl,n=Zi(e?.avatar??void 0,gl)??null;return{agentId:typeof e?.agentId=="string"&&e.agentId.trim()?e.agentId.trim():null,name:t,avatar:n}}function ml(){return os(typeof window>"u"?{}:{name:window.__CLAWDBOT_ASSISTANT_NAME__,avatar:window.__CLAWDBOT_ASSISTANT_AVATAR__})}const ro="moltbot.control.settings.v1";function yl(){const t={gatewayUrl:`${location.protocol==="https:"?"wss":"ws"}://${location.host}`,token:"",sessionKey:"main",lastActiveSessionKey:"main",theme:"system",chatFocusMode:!1,chatShowThinking:!0,splitRatio:.6,navCollapsed:!1,navGroupsCollapsed:{}};try{const n=localStorage.getItem(ro);if(!n)return t;const s=JSON.parse(n);return{gatewayUrl:typeof s.gatewayUrl=="string"&&s.gatewayUrl.trim()?s.gatewayUrl.trim():t.gatewayUrl,token:typeof s.token=="string"?s.token:t.token,sessionKey:typeof s.sessionKey=="string"&&s.sessionKey.trim()?s.sessionKey.trim():t.sessionKey,lastActiveSessionKey:typeof s.lastActiveSessionKey=="string"&&s.lastActiveSessionKey.trim()?s.lastActiveSessionKey.trim():typeof s.sessionKey=="string"&&s.sessionKey.trim()||t.lastActiveSessionKey,theme:s.theme==="light"||s.theme==="dark"||s.theme==="system"?s.theme:t.theme,chatFocusMode:typeof s.chatFocusMode=="boolean"?s.chatFocusMode:t.chatFocusMode,chatShowThinking:typeof s.chatShowThinking=="boolean"?s.chatShowThinking:t.chatShowThinking,splitRatio:typeof s.splitRatio=="number"&&s.splitRatio>=.4&&s.splitRatio<=.7?s.splitRatio:t.splitRatio,navCollapsed:typeof s.navCollapsed=="boolean"?s.navCollapsed:t.navCollapsed,navGroupsCollapsed:typeof s.navGroupsCollapsed=="object"&&s.navGroupsCollapsed!==null?s.navGroupsCollapsed:t.navGroupsCollapsed}}catch{return t}}function bl(e){localStorage.setItem(ro,JSON.stringify(e))}function lo(e){const t=(e??"").trim();if(!t)return null;const n=t.split(":").filter(Boolean);if(n.length<3||n[0]!=="agent")return null;const s=n[1]?.trim(),i=n.slice(2).join(":");return!s||!i?null:{agentId:s,rest:i}}const wl=[{label:"Chat",tabs:["chat"]},{label:"Control",tabs:["overview","channels","instances","sessions","cron"]},{label:"Agent",tabs:["skills","nodes"]},{label:"Settings",tabs:["config","debug","logs"]}],co={overview:"/overview",channels:"/channels",instances:"/instances",sessions:"/sessions",cron:"/cron",skills:"/skills",nodes:"/nodes",chat:"/chat",config:"/config",debug:"/debug",logs:"/logs"},uo=new Map(Object.entries(co).map(([e,t])=>[t,e]));function cn(e){if(!e)return"";let t=e.trim();return t.startsWith("/")||(t=`/${t}`),t==="/"?"":(t.endsWith("/")&&(t=t.slice(0,-1)),t)}function kt(e){if(!e)return"/";let t=e.trim();return t.startsWith("/")||(t=`/${t}`),t.length>1&&t.endsWith("/")&&(t=t.slice(0,-1)),t}function Ds(e,t=""){const n=cn(t),s=co[e];return n?`${n}${s}`:s}function po(e,t=""){const n=cn(t);let s=e||"/";n&&(s===n?s="/":s.startsWith(`${n}/`)&&(s=s.slice(n.length)));let i=kt(s).toLowerCase();return i.endsWith("/index.html")&&(i="/"),i==="/"?"chat":uo.get(i)??null}function $l(e){let t=kt(e);if(t.endsWith("/index.html")&&(t=kt(t.slice(0,-11))),t==="/")return"";const n=t.split("/").filter(Boolean);if(n.length===0)return"";for(let s=0;s<n.length;s++){const i=`/${n.slice(s).join("/")}`.toLowerCase();if(uo.has(i)){const a=n.slice(0,s);return a.length?`/${a.join("/")}`:""}}return`/${n.join("/")}`}function xl(e){switch(e){case"chat":return"messageSquare";case"overview":return"barChart";case"channels":return"link";case"instances":return"radio";case"sessions":return"fileText";case"cron":return"loader";case"skills":return"zap";case"nodes":return"monitor";case"config":return"settings";case"debug":return"bug";case"logs":return"scrollText";default:return"folder"}}function rs(e){switch(e){case"overview":return"Overview";case"channels":return"Channels";case"instances":return"Instances";case"sessions":return"Sessions";case"cron":return"Cron Jobs";case"skills":return"Skills";case"nodes":return"Nodes";case"chat":return"Chat";case"config":return"Config";case"debug":return"Debug";case"logs":return"Logs";default:return"Control"}}function Al(e){switch(e){case"overview":return"Gateway status, entry points, and a fast health read.";case"channels":return"Manage channels and settings.";case"instances":return"Presence beacons from connected clients and nodes.";case"sessions":return"Inspect active sessions and adjust per-session defaults.";case"cron":return"Schedule wakeups and recurring agent runs.";case"skills":return"Manage skill availability and API key injection.";case"nodes":return"Paired devices, capabilities, and command exposure.";case"chat":return"Direct gateway chat session for quick interventions.";case"config":return"Edit ~/.clawdbot/moltbot.json safely.";case"debug":return"Gateway snapshots, events, and manual RPC calls.";case"logs":return"Live tail of the gateway file logs.";default:return""}}const V={messageSquare:c`<svg viewBox="0 0 24 24"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/></svg>`,barChart:c`<svg viewBox="0 0 24 24"><line x1="12" x2="12" y1="20" y2="10"/><line x1="18" x2="18" y1="20" y2="4"/><line x1="6" x2="6" y1="20" y2="16"/></svg>`,link:c`<svg viewBox="0 0 24 24"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg>`,radio:c`<svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="2"/><path d="M16.24 7.76a6 6 0 0 1 0 8.49m-8.48-.01a6 6 0 0 1 0-8.49m11.31-2.82a10 10 0 0 1 0 14.14m-14.14 0a10 10 0 0 1 0-14.14"/></svg>`,fileText:c`<svg viewBox="0 0 24 24"><path d="M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z"/><polyline points="14 2 14 8 20 8"/><line x1="16" x2="8" y1="13" y2="13"/><line x1="16" x2="8" y1="17" y2="17"/><line x1="10" x2="8" y1="9" y2="9"/></svg>`,zap:c`<svg viewBox="0 0 24 24"><polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"/></svg>`,monitor:c`<svg viewBox="0 0 24 24"><rect width="20" height="14" x="2" y="3" rx="2"/><line x1="8" x2="16" y1="21" y2="21"/><line x1="12" x2="12" y1="17" y2="21"/></svg>`,settings:c`<svg viewBox="0 0 24 24"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"/><circle cx="12" cy="12" r="3"/></svg>`,bug:c`<svg viewBox="0 0 24 24"><path d="m8 2 1.88 1.88"/><path d="M14.12 3.88 16 2"/><path d="M9 7.13v-1a3.003 3.003 0 1 1 6 0v1"/><path d="M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6"/><path d="M12 20v-9"/><path d="M6.53 9C4.6 8.8 3 7.1 3 5"/><path d="M6 13H2"/><path d="M3 21c0-2.1 1.7-3.9 3.8-4"/><path d="M20.97 5c0 2.1-1.6 3.8-3.5 4"/><path d="M22 13h-4"/><path d="M17.2 17c2.1.1 3.8 1.9 3.8 4"/></svg>`,scrollText:c`<svg viewBox="0 0 24 24"><path d="M8 21h12a2 2 0 0 0 2-2v-2H10v2a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v3h4"/><path d="M19 17V5a2 2 0 0 0-2-2H4"/><path d="M15 8h-5"/><path d="M15 12h-5"/></svg>`,folder:c`<svg viewBox="0 0 24 24"><path d="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"/></svg>`,menu:c`<svg viewBox="0 0 24 24"><line x1="4" x2="20" y1="12" y2="12"/><line x1="4" x2="20" y1="6" y2="6"/><line x1="4" x2="20" y1="18" y2="18"/></svg>`,x:c`<svg viewBox="0 0 24 24"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>`,check:c`<svg viewBox="0 0 24 24"><path d="M20 6 9 17l-5-5"/></svg>`,copy:c`<svg viewBox="0 0 24 24"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/></svg>`,search:c`<svg viewBox="0 0 24 24"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg>`,brain:c`<svg viewBox="0 0 24 24"><path d="M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z"/><path d="M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z"/><path d="M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4"/><path d="M17.599 6.5a3 3 0 0 0 .399-1.375"/><path d="M6.003 5.125A3 3 0 0 0 6.401 6.5"/><path d="M3.477 10.896a4 4 0 0 1 .585-.396"/><path d="M19.938 10.5a4 4 0 0 1 .585.396"/><path d="M6 18a4 4 0 0 1-1.967-.516"/><path d="M19.967 17.484A4 4 0 0 1 18 18"/></svg>`,book:c`<svg viewBox="0 0 24 24"><path d="M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H20v20H6.5a2.5 2.5 0 0 1 0-5H20"/></svg>`,loader:c`<svg viewBox="0 0 24 24"><path d="M12 2v4"/><path d="m16.2 7.8 2.9-2.9"/><path d="M18 12h4"/><path d="m16.2 16.2 2.9 2.9"/><path d="M12 18v4"/><path d="m4.9 19.1 2.9-2.9"/><path d="M2 12h4"/><path d="m4.9 4.9 2.9 2.9"/></svg>`,wrench:c`<svg viewBox="0 0 24 24"><path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"/></svg>`,fileCode:c`<svg viewBox="0 0 24 24"><path d="M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z"/><polyline points="14 2 14 8 20 8"/><path d="m10 13-2 2 2 2"/><path d="m14 17 2-2-2-2"/></svg>`,edit:c`<svg viewBox="0 0 24 24"><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"/><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"/></svg>`,penLine:c`<svg viewBox="0 0 24 24"><path d="M12 20h9"/><path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"/></svg>`,paperclip:c`<svg viewBox="0 0 24 24"><path d="m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48"/></svg>`,globe:c`<svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"/><path d="M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"/><path d="M2 12h20"/></svg>`,image:c`<svg viewBox="0 0 24 24"><rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"/></svg>`,smartphone:c`<svg viewBox="0 0 24 24"><rect width="14" height="20" x="5" y="2" rx="2" ry="2"/><path d="M12 18h.01"/></svg>`,plug:c`<svg viewBox="0 0 24 24"><path d="M12 22v-5"/><path d="M9 8V2"/><path d="M15 8V2"/><path d="M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z"/></svg>`,circle:c`<svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"/></svg>`,puzzle:c`<svg viewBox="0 0 24 24"><path d="M19.439 7.85c-.049.322.059.648.289.878l1.568 1.568c.47.47.706 1.087.706 1.704s-.235 1.233-.706 1.704l-1.611 1.611a.98.98 0 0 1-.837.276c-.47-.07-.802-.48-.968-.925a2.501 2.501 0 1 0-3.214 3.214c.446.166.855.497.925.968a.979.979 0 0 1-.276.837l-1.61 1.61a2.404 2.404 0 0 1-1.705.707 2.402 2.402 0 0 1-1.704-.706l-1.568-1.568a1.026 1.026 0 0 0-.877-.29c-.493.074-.84.504-1.02.968a2.5 2.5 0 1 1-3.237-3.237c.464-.18.894-.527.967-1.02a1.026 1.026 0 0 0-.289-.877l-1.568-1.568A2.402 2.402 0 0 1 1.998 12c0-.617.236-1.234.706-1.704L4.23 8.77c.24-.24.581-.353.917-.303.515.076.874.54 1.02 1.02a2.5 2.5 0 1 0 3.237-3.237c-.48-.146-.944-.505-1.02-1.02a.98.98 0 0 1 .303-.917l1.526-1.526A2.402 2.402 0 0 1 11.998 2c.617 0 1.234.236 1.704.706l1.568 1.568c.23.23.556.338.877.29.493-.074.84-.504 1.02-.968a2.5 2.5 0 1 1 3.236 3.236c-.464.18-.894.527-.967 1.02Z"/></svg>`},kl=/<\s*\/?\s*(?:think(?:ing)?|thought|antthinking|final)\b/i,Bt=/<\s*\/?\s*final\b[^>]*>/gi,Ji=/<\s*(\/?)\s*(?:think(?:ing)?|thought|antthinking)\b[^>]*>/gi;function Sl(e,t){return e.trimStart()}function _l(e,t){if(!e||!kl.test(e))return e;let n=e;Bt.test(n)?(Bt.lastIndex=0,n=n.replace(Bt,"")):Bt.lastIndex=0,Ji.lastIndex=0;let s="",i=0,a=!1;for(const o of n.matchAll(Ji)){const l=o.index??0,r=o[1]==="/";a?r&&(a=!1):(s+=n.slice(i,l),r||(a=!0)),i=l+o[0].length}return s+=n.slice(i),Sl(s)}function St(e){return!e&&e!==0?"n/a":new Date(e).toLocaleString()}function O(e){if(!e&&e!==0)return"n/a";const t=Date.now()-e;if(t<0)return"just now";const n=Math.round(t/1e3);if(n<60)return`${n}s ago`;const s=Math.round(n/60);if(s<60)return`${s}m ago`;const i=Math.round(s/60);return i<48?`${i}h ago`:`${Math.round(i/24)}d ago`}function ho(e){if(!e&&e!==0)return"n/a";if(e<1e3)return`${e}ms`;const t=Math.round(e/1e3);if(t<60)return`${t}s`;const n=Math.round(t/60);if(n<60)return`${n}m`;const s=Math.round(n/60);return s<48?`${s}h`:`${Math.round(s/24)}d`}function ls(e){return!e||e.length===0?"none":e.filter(t=>!!(t&&t.trim())).join(", ")}function cs(e,t=120){return e.length<=t?e:`${e.slice(0,Math.max(0,t-1))}…`}function fo(e,t){return e.length<=t?{text:e,truncated:!1,total:e.length}:{text:e.slice(0,Math.max(0,t)),truncated:!0,total:e.length}}function Zt(e,t){const n=Number(e);return Number.isFinite(n)?n:t}function Un(e){return _l(e)}const Tl=/^\[([^\]]+)\]\s*/,Cl=["WebChat","WhatsApp","Telegram","Signal","Slack","Discord","iMessage","Teams","Matrix","Zalo","Zalo Personal","BlueBubbles"],Kn=new WeakMap,Hn=new WeakMap;function El(e){return/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}Z\b/.test(e)||/\d{4}-\d{2}-\d{2} \d{2}:\d{2}\b/.test(e)?!0:Cl.some(t=>e.startsWith(`${t} `))}function zn(e){const t=e.match(Tl);if(!t)return e;const n=t[1]??"";return El(n)?e.slice(t[0].length):e}function ds(e){const t=e,n=typeof t.role=="string"?t.role:"",s=t.content;if(typeof s=="string")return n==="assistant"?Un(s):zn(s);if(Array.isArray(s)){const i=s.map(a=>{const o=a;return o.type==="text"&&typeof o.text=="string"?o.text:null}).filter(a=>typeof a=="string");if(i.length>0){const a=i.join(`
|
|
4
|
-
`);return n==="assistant"?Un(a):zn(a)}}return typeof t.text=="string"?n==="assistant"?Un(t.text):zn(t.text):null}function
|
|
5
|
-
`);const i=
|
|
6
|
-
`):null}function
|
|
7
|
-
`)}return typeof t.text=="string"?t.text:null}function
|
|
8
|
-
`):""}let
|
|
9
|
-
|
|
10
|
-
Deletes the session entry and archives its transcript.`))){e.sessionsLoading=!0,e.sessionsError=null;try{await e.client.request("sessions.delete",{key:t,deleteTranscript:!0}),await
|
|
11
|
-
`)}function
|
|
12
|
-
|
|
13
|
-
… truncated (${s.total} chars, showing first ${s.text.length}).`:s.text}function
|
|
1
|
+
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function s(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();const Gt=globalThis,Ls=Gt.ShadowRoot&&(Gt.ShadyCSS===void 0||Gt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Is=Symbol(),Ui=new WeakMap;let to=class{constructor(t,n,s){if(this._$cssResult$=!0,s!==Is)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=n}get styleSheet(){let t=this.o;const n=this.t;if(Ls&&t===void 0){const s=n!==void 0&&n.length===1;s&&(t=Ui.get(n)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&Ui.set(n,t))}return t}toString(){return this.cssText}};const qr=e=>new to(typeof e=="string"?e:e+"",void 0,Is),Gr=(e,...t)=>{const n=e.length===1?e[0]:t.reduce((s,i,a)=>s+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+e[a+1],e[0]);return new to(n,e,Is)},Wr=(e,t)=>{if(Ls)e.adoptedStyleSheets=t.map(n=>n instanceof CSSStyleSheet?n:n.styleSheet);else for(const n of t){const s=document.createElement("style"),i=Gt.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=n.cssText,e.appendChild(s)}},Ki=Ls?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let n="";for(const s of t.cssRules)n+=s.cssText;return qr(n)})(e):e;const{is:Vr,defineProperty:Yr,getOwnPropertyDescriptor:Qr,getOwnPropertyNames:Zr,getOwnPropertySymbols:Jr,getPrototypeOf:Xr}=Object,an=globalThis,Hi=an.trustedTypes,el=Hi?Hi.emptyScript:"",tl=an.reactiveElementPolyfillSupport,mt=(e,t)=>e,Yt={toAttribute(e,t){switch(t){case Boolean:e=e?el:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=e!==null;break;case Number:n=e===null?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch{n=null}}return n}},Rs=(e,t)=>!Vr(e,t),zi={attribute:!0,type:String,converter:Yt,reflect:!1,useDefault:!1,hasChanged:Rs};Symbol.metadata??=Symbol("metadata"),an.litPropertyMetadata??=new WeakMap;let Qe=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,n=zi){if(n.state&&(n.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((n=Object.create(n)).wrapped=!0),this.elementProperties.set(t,n),!n.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(t,s,n);i!==void 0&&Yr(this.prototype,t,i)}}static getPropertyDescriptor(t,n,s){const{get:i,set:a}=Qr(this.prototype,t)??{get(){return this[n]},set(o){this[n]=o}};return{get:i,set(o){const r=i?.call(this);a?.call(this,o),this.requestUpdate(t,r,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??zi}static _$Ei(){if(this.hasOwnProperty(mt("elementProperties")))return;const t=Xr(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(mt("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(mt("properties"))){const n=this.properties,s=[...Zr(n),...Jr(n)];for(const i of s)this.createProperty(i,n[i])}const t=this[Symbol.metadata];if(t!==null){const n=litPropertyMetadata.get(t);if(n!==void 0)for(const[s,i]of n)this.elementProperties.set(s,i)}this._$Eh=new Map;for(const[n,s]of this.elementProperties){const i=this._$Eu(n,s);i!==void 0&&this._$Eh.set(i,n)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const n=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const i of s)n.unshift(Ki(i))}else t!==void 0&&n.push(Ki(t));return n}static _$Eu(t,n){const s=n.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,n=this.constructor.elementProperties;for(const s of n.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Wr(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,n,s){this._$AK(t,s)}_$ET(t,n){const s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){const a=(s.converter?.toAttribute!==void 0?s.converter:Yt).toAttribute(n,s.type);this._$Em=t,a==null?this.removeAttribute(i):this.setAttribute(i,a),this._$Em=null}}_$AK(t,n){const s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){const a=s.getPropertyOptions(i),o=typeof a.converter=="function"?{fromAttribute:a.converter}:a.converter?.fromAttribute!==void 0?a.converter:Yt;this._$Em=i;const r=o.fromAttribute(n,a.type);this[i]=r??this._$Ej?.get(i)??r,this._$Em=null}}requestUpdate(t,n,s,i=!1,a){if(t!==void 0){const o=this.constructor;if(i===!1&&(a=this[t]),s??=o.getPropertyOptions(t),!((s.hasChanged??Rs)(a,n)||s.useDefault&&s.reflect&&a===this._$Ej?.get(t)&&!this.hasAttribute(o._$Eu(t,s))))return;this.C(t,n,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,n,{useDefault:s,reflect:i,wrapped:a},o){s&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,o??n??this[t]),a!==!0||o!==void 0)||(this._$AL.has(t)||(this.hasUpdated||s||(n=void 0),this._$AL.set(t,n)),i===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(n){Promise.reject(n)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[i,a]of this._$Ep)this[i]=a;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[i,a]of s){const{wrapped:o}=a,r=this[i];o!==!0||this._$AL.has(i)||r===void 0||this.C(i,void 0,a,r)}}let t=!1;const n=this._$AL;try{t=this.shouldUpdate(n),t?(this.willUpdate(n),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(n)):this._$EM()}catch(s){throw t=!1,this._$EM(),s}t&&this._$AE(n)}willUpdate(t){}_$AE(t){this._$EO?.forEach(n=>n.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(n=>this._$ET(n,this[n])),this._$EM()}updated(t){}firstUpdated(t){}};Qe.elementStyles=[],Qe.shadowRootOptions={mode:"open"},Qe[mt("elementProperties")]=new Map,Qe[mt("finalized")]=new Map,tl?.({ReactiveElement:Qe}),(an.reactiveElementVersions??=[]).push("2.1.2");const Ps=globalThis,ji=e=>e,Qt=Ps.trustedTypes,qi=Qt?Qt.createPolicy("lit-html",{createHTML:e=>e}):void 0,no="$lit$",xe=`lit$${Math.random().toFixed(9).slice(2)}$`,so="?"+xe,nl=`<${so}>`,Oe=document,$t=()=>Oe.createComment(""),xt=e=>e===null||typeof e!="object"&&typeof e!="function",Ns=Array.isArray,sl=e=>Ns(e)||typeof e?.[Symbol.iterator]=="function",Fn=`[
|
|
2
|
+
\f\r]`,ot=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Gi=/-->/g,Wi=/>/g,Me=RegExp(`>|${Fn}(?:([^\\s"'>=/]+)(${Fn}*=${Fn}*(?:[^
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Vi=/'/g,Yi=/"/g,io=/^(?:script|style|textarea|title)$/i,il=e=>(t,...n)=>({_$litType$:e,strings:t,values:n}),c=il(1),ke=Symbol.for("lit-noChange"),f=Symbol.for("lit-nothing"),Qi=new WeakMap,Pe=Oe.createTreeWalker(Oe,129);function ao(e,t){if(!Ns(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return qi!==void 0?qi.createHTML(t):t}const al=(e,t)=>{const n=e.length-1,s=[];let i,a=t===2?"<svg>":t===3?"<math>":"",o=ot;for(let r=0;r<n;r++){const l=e[r];let p,d,u=-1,g=0;for(;g<l.length&&(o.lastIndex=g,d=o.exec(l),d!==null);)g=o.lastIndex,o===ot?d[1]==="!--"?o=Gi:d[1]!==void 0?o=Wi:d[2]!==void 0?(io.test(d[2])&&(i=RegExp("</"+d[2],"g")),o=Me):d[3]!==void 0&&(o=Me):o===Me?d[0]===">"?(o=i??ot,u=-1):d[1]===void 0?u=-2:(u=o.lastIndex-d[2].length,p=d[1],o=d[3]===void 0?Me:d[3]==='"'?Yi:Vi):o===Yi||o===Vi?o=Me:o===Gi||o===Wi?o=ot:(o=Me,i=void 0);const v=o===Me&&e[r+1].startsWith("/>")?" ":"";a+=o===ot?l+nl:u>=0?(s.push(p),l.slice(0,u)+no+l.slice(u)+xe+v):l+xe+(u===-2?r:v)}return[ao(e,a+(e[n]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]};let as=class oo{constructor({strings:t,_$litType$:n},s){let i;this.parts=[];let a=0,o=0;const r=t.length-1,l=this.parts,[p,d]=al(t,n);if(this.el=oo.createElement(p,s),Pe.currentNode=this.el.content,n===2||n===3){const u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(i=Pe.nextNode())!==null&&l.length<r;){if(i.nodeType===1){if(i.hasAttributes())for(const u of i.getAttributeNames())if(u.endsWith(no)){const g=d[o++],v=i.getAttribute(u).split(xe),y=/([.?@])?(.*)/.exec(g);l.push({type:1,index:a,name:y[2],strings:v,ctor:y[1]==="."?rl:y[1]==="?"?ll:y[1]==="@"?cl:rn}),i.removeAttribute(u)}else u.startsWith(xe)&&(l.push({type:6,index:a}),i.removeAttribute(u));if(io.test(i.tagName)){const u=i.textContent.split(xe),g=u.length-1;if(g>0){i.textContent=Qt?Qt.emptyScript:"";for(let v=0;v<g;v++)i.append(u[v],$t()),Pe.nextNode(),l.push({type:2,index:++a});i.append(u[g],$t())}}}else if(i.nodeType===8)if(i.data===so)l.push({type:2,index:a});else{let u=-1;for(;(u=i.data.indexOf(xe,u+1))!==-1;)l.push({type:7,index:a}),u+=xe.length-1}a++}}static createElement(t,n){const s=Oe.createElement("template");return s.innerHTML=t,s}};function Xe(e,t,n=e,s){if(t===ke)return t;let i=s!==void 0?n._$Co?.[s]:n._$Cl;const a=xt(t)?void 0:t._$litDirective$;return i?.constructor!==a&&(i?._$AO?.(!1),a===void 0?i=void 0:(i=new a(e),i._$AT(e,n,s)),s!==void 0?(n._$Co??=[])[s]=i:n._$Cl=i),i!==void 0&&(t=Xe(e,i._$AS(e,t.values),i,s)),t}class ol{constructor(t,n){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=n}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:n},parts:s}=this._$AD,i=(t?.creationScope??Oe).importNode(n,!0);Pe.currentNode=i;let a=Pe.nextNode(),o=0,r=0,l=s[0];for(;l!==void 0;){if(o===l.index){let p;l.type===2?p=new on(a,a.nextSibling,this,t):l.type===1?p=new l.ctor(a,l.name,l.strings,this,t):l.type===6&&(p=new dl(a,this,t)),this._$AV.push(p),l=s[++r]}o!==l?.index&&(a=Pe.nextNode(),o++)}return Pe.currentNode=Oe,i}p(t){let n=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,n),n+=s.strings.length-2):s._$AI(t[n])),n++}}let on=class ro{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,n,s,i){this.type=2,this._$AH=f,this._$AN=void 0,this._$AA=t,this._$AB=n,this._$AM=s,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const n=this._$AM;return n!==void 0&&t?.nodeType===11&&(t=n.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,n=this){t=Xe(this,t,n),xt(t)?t===f||t==null||t===""?(this._$AH!==f&&this._$AR(),this._$AH=f):t!==this._$AH&&t!==ke&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):sl(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==f&&xt(this._$AH)?this._$AA.nextSibling.data=t:this.T(Oe.createTextNode(t)),this._$AH=t}$(t){const{values:n,_$litType$:s}=t,i=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=as.createElement(ao(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===i)this._$AH.p(n);else{const a=new ol(i,this),o=a.u(this.options);a.p(n),this.T(o),this._$AH=a}}_$AC(t){let n=Qi.get(t.strings);return n===void 0&&Qi.set(t.strings,n=new as(t)),n}k(t){Ns(this._$AH)||(this._$AH=[],this._$AR());const n=this._$AH;let s,i=0;for(const a of t)i===n.length?n.push(s=new ro(this.O($t()),this.O($t()),this,this.options)):s=n[i],s._$AI(a),i++;i<n.length&&(this._$AR(s&&s._$AB.nextSibling,i),n.length=i)}_$AR(t=this._$AA.nextSibling,n){for(this._$AP?.(!1,!0,n);t!==this._$AB;){const s=ji(t).nextSibling;ji(t).remove(),t=s}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}};class rn{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,n,s,i,a){this.type=1,this._$AH=f,this._$AN=void 0,this.element=t,this.name=n,this._$AM=i,this.options=a,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=f}_$AI(t,n=this,s,i){const a=this.strings;let o=!1;if(a===void 0)t=Xe(this,t,n,0),o=!xt(t)||t!==this._$AH&&t!==ke,o&&(this._$AH=t);else{const r=t;let l,p;for(t=a[0],l=0;l<a.length-1;l++)p=Xe(this,r[s+l],n,l),p===ke&&(p=this._$AH[l]),o||=!xt(p)||p!==this._$AH[l],p===f?t=f:t!==f&&(t+=(p??"")+a[l+1]),this._$AH[l]=p}o&&!i&&this.j(t)}j(t){t===f?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}let rl=class extends rn{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===f?void 0:t}},ll=class extends rn{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==f)}},cl=class extends rn{constructor(t,n,s,i,a){super(t,n,s,i,a),this.type=5}_$AI(t,n=this){if((t=Xe(this,t,n,0)??f)===ke)return;const s=this._$AH,i=t===f&&s!==f||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,a=t!==f&&(s===f||i);i&&this.element.removeEventListener(this.name,this,s),a&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},dl=class{constructor(t,n,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=n,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){Xe(this,t)}};const ul={I:on},pl=Ps.litHtmlPolyfillSupport;pl?.(as,on),(Ps.litHtmlVersions??=[]).push("3.3.2");const hl=(e,t,n)=>{const s=n?.renderBefore??t;let i=s._$litPart$;if(i===void 0){const a=n?.renderBefore??null;s._$litPart$=i=new on(t.insertBefore($t(),a),a,void 0,n??{})}return i._$AI(e),i};const Os=globalThis;let Je=class extends Qe{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=hl(n,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return ke}};Je._$litElement$=!0,Je.finalized=!0,Os.litElementHydrateSupport?.({LitElement:Je});const fl=Os.litElementPolyfillSupport;fl?.({LitElement:Je});(Os.litElementVersions??=[]).push("4.2.2");const lo=e=>(t,n)=>{n!==void 0?n.addInitializer(()=>{customElements.define(e,t)}):customElements.define(e,t)};const gl={attribute:!0,type:String,converter:Yt,reflect:!1,hasChanged:Rs},vl=(e=gl,t,n)=>{const{kind:s,metadata:i}=n;let a=globalThis.litPropertyMetadata.get(i);if(a===void 0&&globalThis.litPropertyMetadata.set(i,a=new Map),s==="setter"&&((e=Object.create(e)).wrapped=!0),a.set(n.name,e),s==="accessor"){const{name:o}=n;return{set(r){const l=t.get.call(this);t.set.call(this,r),this.requestUpdate(o,l,e,!0,r)},init(r){return r!==void 0&&this.C(o,void 0,e,r),r}}}if(s==="setter"){const{name:o}=n;return function(r){const l=this[o];t.call(this,r),this.requestUpdate(o,l,e,!0,r)}}throw Error("Unsupported decorator location: "+s)};function ln(e){return(t,n)=>typeof n=="object"?vl(e,t,n):((s,i,a)=>{const o=i.hasOwnProperty(a);return i.constructor.createProperty(a,s),o?Object.getOwnPropertyDescriptor(i,a):void 0})(e,t,n)}function w(e){return ln({...e,state:!0,attribute:!1})}const ml=50,yl=200,bl="Assistant";function Zi(e,t){if(typeof e!="string")return;const n=e.trim();if(n)return n.length<=t?n:n.slice(0,t)}function os(e){const t=Zi(e?.name,ml)??bl,n=Zi(e?.avatar??void 0,yl)??null;return{agentId:typeof e?.agentId=="string"&&e.agentId.trim()?e.agentId.trim():null,name:t,avatar:n}}function wl(){return os(typeof window>"u"?{}:{name:window.__OPENCLAW_ASSISTANT_NAME__,avatar:window.__OPENCLAW_ASSISTANT_AVATAR__})}const co="openclaw.control.settings.v1";function $l(){const t={gatewayUrl:`${location.protocol==="https:"?"wss":"ws"}://${location.host}`,token:"",sessionKey:"main",lastActiveSessionKey:"main",theme:"system",chatFocusMode:!1,chatShowThinking:!0,splitRatio:.6,navCollapsed:!1,navGroupsCollapsed:{}};try{const n=localStorage.getItem(co);if(!n)return t;const s=JSON.parse(n);return{gatewayUrl:typeof s.gatewayUrl=="string"&&s.gatewayUrl.trim()?s.gatewayUrl.trim():t.gatewayUrl,token:typeof s.token=="string"?s.token:t.token,sessionKey:typeof s.sessionKey=="string"&&s.sessionKey.trim()?s.sessionKey.trim():t.sessionKey,lastActiveSessionKey:typeof s.lastActiveSessionKey=="string"&&s.lastActiveSessionKey.trim()?s.lastActiveSessionKey.trim():typeof s.sessionKey=="string"&&s.sessionKey.trim()||t.lastActiveSessionKey,theme:s.theme==="light"||s.theme==="dark"||s.theme==="system"?s.theme:t.theme,chatFocusMode:typeof s.chatFocusMode=="boolean"?s.chatFocusMode:t.chatFocusMode,chatShowThinking:typeof s.chatShowThinking=="boolean"?s.chatShowThinking:t.chatShowThinking,splitRatio:typeof s.splitRatio=="number"&&s.splitRatio>=.4&&s.splitRatio<=.7?s.splitRatio:t.splitRatio,navCollapsed:typeof s.navCollapsed=="boolean"?s.navCollapsed:t.navCollapsed,navGroupsCollapsed:typeof s.navGroupsCollapsed=="object"&&s.navGroupsCollapsed!==null?s.navGroupsCollapsed:t.navGroupsCollapsed}}catch{return t}}function xl(e){localStorage.setItem(co,JSON.stringify(e))}function uo(e){const t=(e??"").trim();if(!t)return null;const n=t.split(":").filter(Boolean);if(n.length<3||n[0]!=="agent")return null;const s=n[1]?.trim(),i=n.slice(2).join(":");return!s||!i?null:{agentId:s,rest:i}}const Al=[{label:"Chat",tabs:["chat"]},{label:"Control",tabs:["overview","channels","instances","sessions","cron"]},{label:"Agent",tabs:["skills","nodes"]},{label:"Settings",tabs:["config","debug","logs"]}],po={overview:"/overview",channels:"/channels",instances:"/instances",sessions:"/sessions",cron:"/cron",skills:"/skills",nodes:"/nodes",chat:"/chat",config:"/config",debug:"/debug",logs:"/logs"},ho=new Map(Object.entries(po).map(([e,t])=>[t,e]));function cn(e){if(!e)return"";let t=e.trim();return t.startsWith("/")||(t=`/${t}`),t==="/"?"":(t.endsWith("/")&&(t=t.slice(0,-1)),t)}function At(e){if(!e)return"/";let t=e.trim();return t.startsWith("/")||(t=`/${t}`),t.length>1&&t.endsWith("/")&&(t=t.slice(0,-1)),t}function Ds(e,t=""){const n=cn(t),s=po[e];return n?`${n}${s}`:s}function fo(e,t=""){const n=cn(t);let s=e||"/";n&&(s===n?s="/":s.startsWith(`${n}/`)&&(s=s.slice(n.length)));let i=At(s).toLowerCase();return i.endsWith("/index.html")&&(i="/"),i==="/"?"chat":ho.get(i)??null}function kl(e){let t=At(e);if(t.endsWith("/index.html")&&(t=At(t.slice(0,-11))),t==="/")return"";const n=t.split("/").filter(Boolean);if(n.length===0)return"";for(let s=0;s<n.length;s++){const i=`/${n.slice(s).join("/")}`.toLowerCase();if(ho.has(i)){const a=n.slice(0,s);return a.length?`/${a.join("/")}`:""}}return`/${n.join("/")}`}function Sl(e){switch(e){case"chat":return"messageSquare";case"overview":return"barChart";case"channels":return"link";case"instances":return"radio";case"sessions":return"fileText";case"cron":return"loader";case"skills":return"zap";case"nodes":return"monitor";case"config":return"settings";case"debug":return"bug";case"logs":return"scrollText";default:return"folder"}}function rs(e){switch(e){case"overview":return"Overview";case"channels":return"Channels";case"instances":return"Instances";case"sessions":return"Sessions";case"cron":return"Cron Jobs";case"skills":return"Skills";case"nodes":return"Nodes";case"chat":return"Chat";case"config":return"Config";case"debug":return"Debug";case"logs":return"Logs";default:return"Control"}}function _l(e){switch(e){case"overview":return"Gateway status, entry points, and a fast health read.";case"channels":return"Manage channels and settings.";case"instances":return"Presence beacons from connected clients and nodes.";case"sessions":return"Inspect active sessions and adjust per-session defaults.";case"cron":return"Schedule wakeups and recurring agent runs.";case"skills":return"Manage skill availability and API key injection.";case"nodes":return"Paired devices, capabilities, and command exposure.";case"chat":return"Direct gateway chat session for quick interventions.";case"config":return"Edit ~/.openclaw/openclaw.json safely.";case"debug":return"Gateway snapshots, events, and manual RPC calls.";case"logs":return"Live tail of the gateway file logs.";default:return""}}const W={messageSquare:c`<svg viewBox="0 0 24 24"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/></svg>`,barChart:c`<svg viewBox="0 0 24 24"><line x1="12" x2="12" y1="20" y2="10"/><line x1="18" x2="18" y1="20" y2="4"/><line x1="6" x2="6" y1="20" y2="16"/></svg>`,link:c`<svg viewBox="0 0 24 24"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg>`,radio:c`<svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="2"/><path d="M16.24 7.76a6 6 0 0 1 0 8.49m-8.48-.01a6 6 0 0 1 0-8.49m11.31-2.82a10 10 0 0 1 0 14.14m-14.14 0a10 10 0 0 1 0-14.14"/></svg>`,fileText:c`<svg viewBox="0 0 24 24"><path d="M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z"/><polyline points="14 2 14 8 20 8"/><line x1="16" x2="8" y1="13" y2="13"/><line x1="16" x2="8" y1="17" y2="17"/><line x1="10" x2="8" y1="9" y2="9"/></svg>`,zap:c`<svg viewBox="0 0 24 24"><polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"/></svg>`,monitor:c`<svg viewBox="0 0 24 24"><rect width="20" height="14" x="2" y="3" rx="2"/><line x1="8" x2="16" y1="21" y2="21"/><line x1="12" x2="12" y1="17" y2="21"/></svg>`,settings:c`<svg viewBox="0 0 24 24"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"/><circle cx="12" cy="12" r="3"/></svg>`,bug:c`<svg viewBox="0 0 24 24"><path d="m8 2 1.88 1.88"/><path d="M14.12 3.88 16 2"/><path d="M9 7.13v-1a3.003 3.003 0 1 1 6 0v1"/><path d="M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6"/><path d="M12 20v-9"/><path d="M6.53 9C4.6 8.8 3 7.1 3 5"/><path d="M6 13H2"/><path d="M3 21c0-2.1 1.7-3.9 3.8-4"/><path d="M20.97 5c0 2.1-1.6 3.8-3.5 4"/><path d="M22 13h-4"/><path d="M17.2 17c2.1.1 3.8 1.9 3.8 4"/></svg>`,scrollText:c`<svg viewBox="0 0 24 24"><path d="M8 21h12a2 2 0 0 0 2-2v-2H10v2a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v3h4"/><path d="M19 17V5a2 2 0 0 0-2-2H4"/><path d="M15 8h-5"/><path d="M15 12h-5"/></svg>`,folder:c`<svg viewBox="0 0 24 24"><path d="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"/></svg>`,menu:c`<svg viewBox="0 0 24 24"><line x1="4" x2="20" y1="12" y2="12"/><line x1="4" x2="20" y1="6" y2="6"/><line x1="4" x2="20" y1="18" y2="18"/></svg>`,x:c`<svg viewBox="0 0 24 24"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>`,check:c`<svg viewBox="0 0 24 24"><path d="M20 6 9 17l-5-5"/></svg>`,copy:c`<svg viewBox="0 0 24 24"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/></svg>`,search:c`<svg viewBox="0 0 24 24"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg>`,brain:c`<svg viewBox="0 0 24 24"><path d="M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z"/><path d="M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z"/><path d="M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4"/><path d="M17.599 6.5a3 3 0 0 0 .399-1.375"/><path d="M6.003 5.125A3 3 0 0 0 6.401 6.5"/><path d="M3.477 10.896a4 4 0 0 1 .585-.396"/><path d="M19.938 10.5a4 4 0 0 1 .585.396"/><path d="M6 18a4 4 0 0 1-1.967-.516"/><path d="M19.967 17.484A4 4 0 0 1 18 18"/></svg>`,book:c`<svg viewBox="0 0 24 24"><path d="M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H20v20H6.5a2.5 2.5 0 0 1 0-5H20"/></svg>`,loader:c`<svg viewBox="0 0 24 24"><path d="M12 2v4"/><path d="m16.2 7.8 2.9-2.9"/><path d="M18 12h4"/><path d="m16.2 16.2 2.9 2.9"/><path d="M12 18v4"/><path d="m4.9 19.1 2.9-2.9"/><path d="M2 12h4"/><path d="m4.9 4.9 2.9 2.9"/></svg>`,wrench:c`<svg viewBox="0 0 24 24"><path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"/></svg>`,fileCode:c`<svg viewBox="0 0 24 24"><path d="M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z"/><polyline points="14 2 14 8 20 8"/><path d="m10 13-2 2 2 2"/><path d="m14 17 2-2-2-2"/></svg>`,edit:c`<svg viewBox="0 0 24 24"><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"/><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"/></svg>`,penLine:c`<svg viewBox="0 0 24 24"><path d="M12 20h9"/><path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"/></svg>`,paperclip:c`<svg viewBox="0 0 24 24"><path d="m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48"/></svg>`,globe:c`<svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"/><path d="M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"/><path d="M2 12h20"/></svg>`,image:c`<svg viewBox="0 0 24 24"><rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"/></svg>`,smartphone:c`<svg viewBox="0 0 24 24"><rect width="14" height="20" x="5" y="2" rx="2" ry="2"/><path d="M12 18h.01"/></svg>`,plug:c`<svg viewBox="0 0 24 24"><path d="M12 22v-5"/><path d="M9 8V2"/><path d="M15 8V2"/><path d="M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z"/></svg>`,circle:c`<svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"/></svg>`,puzzle:c`<svg viewBox="0 0 24 24"><path d="M19.439 7.85c-.049.322.059.648.289.878l1.568 1.568c.47.47.706 1.087.706 1.704s-.235 1.233-.706 1.704l-1.611 1.611a.98.98 0 0 1-.837.276c-.47-.07-.802-.48-.968-.925a2.501 2.501 0 1 0-3.214 3.214c.446.166.855.497.925.968a.979.979 0 0 1-.276.837l-1.61 1.61a2.404 2.404 0 0 1-1.705.707 2.402 2.402 0 0 1-1.704-.706l-1.568-1.568a1.026 1.026 0 0 0-.877-.29c-.493.074-.84.504-1.02.968a2.5 2.5 0 1 1-3.237-3.237c.464-.18.894-.527.967-1.02a1.026 1.026 0 0 0-.289-.877l-1.568-1.568A2.402 2.402 0 0 1 1.998 12c0-.617.236-1.234.706-1.704L4.23 8.77c.24-.24.581-.353.917-.303.515.076.874.54 1.02 1.02a2.5 2.5 0 1 0 3.237-3.237c-.48-.146-.944-.505-1.02-1.02a.98.98 0 0 1 .303-.917l1.526-1.526A2.402 2.402 0 0 1 11.998 2c.617 0 1.234.236 1.704.706l1.568 1.568c.23.23.556.338.877.29.493-.074.84-.504 1.02-.968a2.5 2.5 0 1 1 3.236 3.236c-.464.18-.894.527-.967 1.02Z"/></svg>`},Cl=/<\s*\/?\s*(?:think(?:ing)?|thought|antthinking|final)\b/i,Bt=/<\s*\/?\s*final\b[^<>]*>/gi,Ji=/<\s*(\/?)\s*(?:think(?:ing)?|thought|antthinking)\b[^<>]*>/gi;function Xi(e){const t=[],n=/(^|\n)(```|~~~)[^\n]*\n[\s\S]*?(?:\n\2(?:\n|$)|$)/g;for(const i of e.matchAll(n)){const a=(i.index??0)+i[1].length;t.push({start:a,end:a+i[0].length-i[1].length})}const s=/`+[^`]+`+/g;for(const i of e.matchAll(s)){const a=i.index??0,o=a+i[0].length;t.some(l=>a>=l.start&&o<=l.end)||t.push({start:a,end:o})}return t.sort((i,a)=>i.start-a.start),t}function ea(e,t){return t.some(n=>e>=n.start&&e<n.end)}function Tl(e,t){return e.trimStart()}function El(e,t){if(!e||!Cl.test(e))return e;let n=e;if(Bt.test(n)){Bt.lastIndex=0;const r=[],l=Xi(n);for(const p of n.matchAll(Bt)){const d=p.index??0;r.push({start:d,length:p[0].length,inCode:ea(d,l)})}for(let p=r.length-1;p>=0;p--){const d=r[p];d.inCode||(n=n.slice(0,d.start)+n.slice(d.start+d.length))}}else Bt.lastIndex=0;const s=Xi(n);Ji.lastIndex=0;let i="",a=0,o=!1;for(const r of n.matchAll(Ji)){const l=r.index??0,p=r[1]==="/";ea(l,s)||(o?p&&(o=!1):(i+=n.slice(a,l),p||(o=!0)),a=l+r[0].length)}return i+=n.slice(a),Tl(i)}function kt(e){return!e&&e!==0?"n/a":new Date(e).toLocaleString()}function O(e){if(!e&&e!==0)return"n/a";const t=Date.now()-e;if(t<0)return"just now";const n=Math.round(t/1e3);if(n<60)return`${n}s ago`;const s=Math.round(n/60);if(s<60)return`${s}m ago`;const i=Math.round(s/60);return i<48?`${i}h ago`:`${Math.round(i/24)}d ago`}function go(e){if(!e&&e!==0)return"n/a";if(e<1e3)return`${e}ms`;const t=Math.round(e/1e3);if(t<60)return`${t}s`;const n=Math.round(t/60);if(n<60)return`${n}m`;const s=Math.round(n/60);return s<48?`${s}h`:`${Math.round(s/24)}d`}function ls(e){return!e||e.length===0?"none":e.filter(t=>!!(t&&t.trim())).join(", ")}function cs(e,t=120){return e.length<=t?e:`${e.slice(0,Math.max(0,t-1))}…`}function vo(e,t){return e.length<=t?{text:e,truncated:!1,total:e.length}:{text:e.slice(0,Math.max(0,t)),truncated:!0,total:e.length}}function Zt(e,t){const n=Number(e);return Number.isFinite(n)?n:t}function Un(e){return El(e)}const Ml=/^\[([^\]]+)\]\s*/,Ll=["WebChat","WhatsApp","Telegram","Signal","Slack","Discord","iMessage","Teams","Matrix","Zalo","Zalo Personal","BlueBubbles"],Kn=new WeakMap,Hn=new WeakMap;function Il(e){return/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}Z\b/.test(e)||/\d{4}-\d{2}-\d{2} \d{2}:\d{2}\b/.test(e)?!0:Ll.some(t=>e.startsWith(`${t} `))}function zn(e){const t=e.match(Ml);if(!t)return e;const n=t[1]??"";return Il(n)?e.slice(t[0].length):e}function ds(e){const t=e,n=typeof t.role=="string"?t.role:"",s=t.content;if(typeof s=="string")return n==="assistant"?Un(s):zn(s);if(Array.isArray(s)){const i=s.map(a=>{const o=a;return o.type==="text"&&typeof o.text=="string"?o.text:null}).filter(a=>typeof a=="string");if(i.length>0){const a=i.join(`
|
|
4
|
+
`);return n==="assistant"?Un(a):zn(a)}}return typeof t.text=="string"?n==="assistant"?Un(t.text):zn(t.text):null}function mo(e){if(!e||typeof e!="object")return ds(e);const t=e;if(Kn.has(t))return Kn.get(t)??null;const n=ds(e);return Kn.set(t,n),n}function ta(e){const n=e.content,s=[];if(Array.isArray(n))for(const r of n){const l=r;if(l.type==="thinking"&&typeof l.thinking=="string"){const p=l.thinking.trim();p&&s.push(p)}}if(s.length>0)return s.join(`
|
|
5
|
+
`);const i=Pl(e);if(!i)return null;const o=[...i.matchAll(/<\s*think(?:ing)?\s*>([\s\S]*?)<\s*\/\s*think(?:ing)?\s*>/gi)].map(r=>(r[1]??"").trim()).filter(Boolean);return o.length>0?o.join(`
|
|
6
|
+
`):null}function Rl(e){if(!e||typeof e!="object")return ta(e);const t=e;if(Hn.has(t))return Hn.get(t)??null;const n=ta(e);return Hn.set(t,n),n}function Pl(e){const t=e,n=t.content;if(typeof n=="string")return n;if(Array.isArray(n)){const s=n.map(i=>{const a=i;return a.type==="text"&&typeof a.text=="string"?a.text:null}).filter(i=>typeof i=="string");if(s.length>0)return s.join(`
|
|
7
|
+
`)}return typeof t.text=="string"?t.text:null}function Nl(e){const t=e.trim();if(!t)return"";const n=t.split(/\r?\n/).map(s=>s.trim()).filter(Boolean).map(s=>`_${s}_`);return n.length?["_Reasoning:_",...n].join(`
|
|
8
|
+
`):""}let na=!1;function sa(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 Ol(){const e=new Uint8Array(16),t=Date.now();for(let n=0;n<e.length;n++)e[n]=Math.floor(Math.random()*256);return e[0]^=t&255,e[1]^=t>>>8&255,e[2]^=t>>>16&255,e[3]^=t>>>24&255,e}function Dl(){na||(na=!0,console.warn("[uuid] crypto API missing; falling back to weak randomness"))}function Bs(e=globalThis.crypto){if(e&&typeof e.randomUUID=="function")return e.randomUUID();if(e&&typeof e.getRandomValues=="function"){const t=new Uint8Array(16);return e.getRandomValues(t),sa(t)}return Dl(),sa(Ol())}async function St(e){if(!(!e.client||!e.connected)){e.chatLoading=!0,e.lastError=null;try{const t=await e.client.request("chat.history",{sessionKey:e.sessionKey,limit:200});e.chatMessages=Array.isArray(t.messages)?t.messages:[],e.chatThinkingLevel=t.thinkingLevel??null}catch(t){e.lastError=String(t)}finally{e.chatLoading=!1}}}function Bl(e){const t=/^data:([^;]+);base64,(.+)$/.exec(e);return t?{mimeType:t[1],content:t[2]}:null}async function Fl(e,t,n){if(!e.client||!e.connected)return!1;const s=t.trim(),i=n&&n.length>0;if(!s&&!i)return!1;const a=Date.now(),o=[];if(s&&o.push({type:"text",text:s}),i)for(const p of n)o.push({type:"image",source:{type:"base64",media_type:p.mimeType,data:p.dataUrl}});e.chatMessages=[...e.chatMessages,{role:"user",content:o,timestamp:a}],e.chatSending=!0,e.lastError=null;const r=Bs();e.chatRunId=r,e.chatStream="",e.chatStreamStartedAt=a;const l=i?n.map(p=>{const d=Bl(p.dataUrl);return d?{type:"image",mimeType:d.mimeType,content:d.content}:null}).filter(p=>p!==null):void 0;try{return await e.client.request("chat.send",{sessionKey:e.sessionKey,message:s,deliver:!1,idempotencyKey:r,attachments:l}),!0}catch(p){const d=String(p);return e.chatRunId=null,e.chatStream=null,e.chatStreamStartedAt=null,e.lastError=d,e.chatMessages=[...e.chatMessages,{role:"assistant",content:[{type:"text",text:"Error: "+d}],timestamp:Date.now()}],!1}finally{e.chatSending=!1}}async function Ul(e){if(!e.client||!e.connected)return!1;const t=e.chatRunId;try{return await e.client.request("chat.abort",t?{sessionKey:e.sessionKey,runId:t}:{sessionKey:e.sessionKey}),!0}catch(n){return e.lastError=String(n),!1}}function Kl(e,t){if(!t||t.sessionKey!==e.sessionKey)return null;if(t.runId&&e.chatRunId&&t.runId!==e.chatRunId)return t.state==="final"?"final":null;if(t.state==="delta"){const n=ds(t.message);if(typeof n=="string"){const s=e.chatStream??"";(!s||n.length>=s.length)&&(e.chatStream=n)}}else t.state==="final"||t.state==="aborted"?(e.chatStream=null,e.chatRunId=null,e.chatStreamStartedAt=null):t.state==="error"&&(e.chatStream=null,e.chatRunId=null,e.chatStreamStartedAt=null,e.lastError=t.errorMessage??"chat error");return t.state}async function Ke(e,t){if(!(!e.client||!e.connected)&&!e.sessionsLoading){e.sessionsLoading=!0,e.sessionsError=null;try{const n=t?.includeGlobal??e.sessionsIncludeGlobal,s=t?.includeUnknown??e.sessionsIncludeUnknown,i=t?.activeMinutes??Zt(e.sessionsFilterActive,0),a=t?.limit??Zt(e.sessionsFilterLimit,0),o={includeGlobal:n,includeUnknown:s};i>0&&(o.activeMinutes=i),a>0&&(o.limit=a);const r=await e.client.request("sessions.list",o);r&&(e.sessionsResult=r)}catch(n){e.sessionsError=String(n)}finally{e.sessionsLoading=!1}}}async function Hl(e,t,n){if(!e.client||!e.connected)return;const s={key:t};"label"in n&&(s.label=n.label),"thinkingLevel"in n&&(s.thinkingLevel=n.thinkingLevel),"verboseLevel"in n&&(s.verboseLevel=n.verboseLevel),"reasoningLevel"in n&&(s.reasoningLevel=n.reasoningLevel);try{await e.client.request("sessions.patch",s),await Ke(e)}catch(i){e.sessionsError=String(i)}}async function zl(e,t){if(!(!e.client||!e.connected||e.sessionsLoading||!window.confirm(`Delete session "${t}"?
|
|
9
|
+
|
|
10
|
+
Deletes the session entry and archives its transcript.`))){e.sessionsLoading=!0,e.sessionsError=null;try{await e.client.request("sessions.delete",{key:t,deleteTranscript:!0}),await Ke(e)}catch(s){e.sessionsError=String(s)}finally{e.sessionsLoading=!1}}}const ia=50,jl=80,ql=12e4;function Gl(e){if(!e||typeof e!="object")return null;const t=e;if(typeof t.text=="string")return t.text;const n=t.content;if(!Array.isArray(n))return null;const s=n.map(i=>{if(!i||typeof i!="object")return null;const a=i;return a.type==="text"&&typeof a.text=="string"?a.text:null}).filter(i=>!!i);return s.length===0?null:s.join(`
|
|
11
|
+
`)}function aa(e){if(e==null)return null;if(typeof e=="number"||typeof e=="boolean")return String(e);const t=Gl(e);let n;if(typeof e=="string")n=e;else if(t)n=t;else try{n=JSON.stringify(e,null,2)}catch{n=String(e)}const s=vo(n,ql);return s.truncated?`${s.text}
|
|
12
|
+
|
|
13
|
+
… truncated (${s.total} chars, showing first ${s.text.length}).`:s.text}function Wl(e){const t=[];return t.push({type:"toolcall",name:e.name,arguments:e.args??{}}),e.output&&t.push({type:"toolresult",name:e.name,text:e.output}),{role:"assistant",toolCallId:e.toolCallId,runId:e.runId,content:t,timestamp:e.startedAt}}function Vl(e){if(e.toolStreamOrder.length<=ia)return;const t=e.toolStreamOrder.length-ia,n=e.toolStreamOrder.splice(0,t);for(const s of n)e.toolStreamById.delete(s)}function Yl(e){e.chatToolMessages=e.toolStreamOrder.map(t=>e.toolStreamById.get(t)?.message).filter(t=>!!t)}function us(e){e.toolStreamSyncTimer!=null&&(clearTimeout(e.toolStreamSyncTimer),e.toolStreamSyncTimer=null),Yl(e)}function Ql(e,t=!1){if(t){us(e);return}e.toolStreamSyncTimer==null&&(e.toolStreamSyncTimer=window.setTimeout(()=>us(e),jl))}function dn(e){e.toolStreamById.clear(),e.toolStreamOrder=[],e.chatToolMessages=[],us(e)}const Zl=5e3;function Jl(e,t){const n=t.data??{},s=typeof n.phase=="string"?n.phase:"";e.compactionClearTimer!=null&&(window.clearTimeout(e.compactionClearTimer),e.compactionClearTimer=null),s==="start"?e.compactionStatus={active:!0,startedAt:Date.now(),completedAt:null}:s==="end"&&(e.compactionStatus={active:!1,startedAt:e.compactionStatus?.startedAt??null,completedAt:Date.now()},e.compactionClearTimer=window.setTimeout(()=>{e.compactionStatus=null,e.compactionClearTimer=null},Zl))}function Xl(e,t){if(!t)return;if(t.stream==="compaction"){Jl(e,t);return}if(t.stream!=="tool")return;const n=typeof t.sessionKey=="string"?t.sessionKey:void 0;if(n&&n!==e.sessionKey||!n&&e.chatRunId&&t.runId!==e.chatRunId||e.chatRunId&&t.runId!==e.chatRunId||!e.chatRunId)return;const s=t.data??{},i=typeof s.toolCallId=="string"?s.toolCallId:"";if(!i)return;const a=typeof s.name=="string"?s.name:"tool",o=typeof s.phase=="string"?s.phase:"",r=o==="start"?s.args:void 0,l=o==="update"?aa(s.partialResult):o==="result"?aa(s.result):void 0,p=Date.now();let d=e.toolStreamById.get(i);d?(d.name=a,r!==void 0&&(d.args=r),l!==void 0&&(d.output=l),d.updatedAt=p):(d={toolCallId:i,runId:t.runId,sessionKey:n,name:a,args:r,output:l,startedAt:typeof t.ts=="number"?t.ts:p,updatedAt:p,message:{}},e.toolStreamById.set(i,d),e.toolStreamOrder.push(i)),d.message=Wl(d),Vl(e),Ql(e,o==="result")}function un(e,t=!1){e.chatScrollFrame&&cancelAnimationFrame(e.chatScrollFrame),e.chatScrollTimeout!=null&&(clearTimeout(e.chatScrollTimeout),e.chatScrollTimeout=null);const n=()=>{const s=e.querySelector(".chat-thread");if(s){const i=getComputedStyle(s).overflowY;if(i==="auto"||i==="scroll"||s.scrollHeight-s.clientHeight>1)return s}return document.scrollingElement??document.documentElement};e.updateComplete.then(()=>{e.chatScrollFrame=requestAnimationFrame(()=>{e.chatScrollFrame=null;const s=n();if(!s)return;const i=s.scrollHeight-s.scrollTop-s.clientHeight;if(!(t||e.chatUserNearBottom||i<200))return;t&&(e.chatHasAutoScrolled=!0),s.scrollTop=s.scrollHeight,e.chatUserNearBottom=!0;const o=t?150:120;e.chatScrollTimeout=window.setTimeout(()=>{e.chatScrollTimeout=null;const r=n();if(!r)return;const l=r.scrollHeight-r.scrollTop-r.clientHeight;(t||e.chatUserNearBottom||l<200)&&(r.scrollTop=r.scrollHeight,e.chatUserNearBottom=!0)},o)})})}function yo(e,t=!1){e.logsScrollFrame&&cancelAnimationFrame(e.logsScrollFrame),e.updateComplete.then(()=>{e.logsScrollFrame=requestAnimationFrame(()=>{e.logsScrollFrame=null;const n=e.querySelector(".log-stream");if(!n)return;const s=n.scrollHeight-n.scrollTop-n.clientHeight;(t||s<80)&&(n.scrollTop=n.scrollHeight)})})}function ec(e,t){const n=t.currentTarget;if(!n)return;const s=n.scrollHeight-n.scrollTop-n.clientHeight;e.chatUserNearBottom=s<200}function tc(e,t){const n=t.currentTarget;if(!n)return;const s=n.scrollHeight-n.scrollTop-n.clientHeight;e.logsAtBottom=s<80}function nc(e){e.chatHasAutoScrolled=!1,e.chatUserNearBottom=!0}function sc(e,t){if(e.length===0)return;const n=new Blob([`${e.join(`
|
|
14
14
|
`)}
|
|
15
|
-
`],{type:"text/plain"}),s=URL.createObjectURL(n),i=document.createElement("a"),a=new Date().toISOString().slice(0,19).replace(/[:T]/g,"-");i.href=s,i.download=`
|
|
16
|
-
`}function mo(e,t,n){if(t.length===0)return;let s=e;for(let a=0;a<t.length-1;a+=1){const o=t[a],l=t[a+1];if(typeof o=="number"){if(!Array.isArray(s))return;s[o]==null&&(s[o]=typeof l=="number"?[]:{}),s=s[o]}else{if(typeof s!="object"||s==null)return;const r=s;r[o]==null&&(r[o]=typeof l=="number"?[]:{}),s=r[o]}}const i=t[t.length-1];if(typeof i=="number"){Array.isArray(s)&&(s[i]=n);return}typeof s=="object"&&s!=null&&(s[i]=n)}function yo(e,t){if(t.length===0)return;let n=e;for(let i=0;i<t.length-1;i+=1){const a=t[i];if(typeof a=="number"){if(!Array.isArray(n))return;n=n[a]}else{if(typeof n!="object"||n==null)return;n=n[a]}if(n==null)return}const s=t[t.length-1];if(typeof s=="number"){Array.isArray(n)&&n.splice(s,1);return}typeof n=="object"&&n!=null&&delete n[s]}async function ye(e){if(!(!e.client||!e.connected)){e.configLoading=!0,e.lastError=null;try{const t=await e.client.request("config.get",{});sc(e,t)}catch(t){e.lastError=String(t)}finally{e.configLoading=!1}}}async function bo(e){if(!(!e.client||!e.connected)&&!e.configSchemaLoading){e.configSchemaLoading=!0;try{const t=await e.client.request("config.schema",{});nc(e,t)}catch(t){e.lastError=String(t)}finally{e.configSchemaLoading=!1}}}function nc(e,t){e.configSchema=t.schema??null,e.configUiHints=t.uiHints??{},e.configSchemaVersion=t.version??null}function sc(e,t){e.configSnapshot=t;const n=typeof t.raw=="string"?t.raw:t.config&&typeof t.config=="object"?et(t.config):e.configRaw;!e.configFormDirty||e.configFormMode==="raw"?e.configRaw=n:e.configForm?e.configRaw=et(e.configForm):e.configRaw=n,e.configValid=typeof t.valid=="boolean"?t.valid:null,e.configIssues=Array.isArray(t.issues)?t.issues:[],e.configFormDirty||(e.configForm=De(t.config??{}),e.configFormOriginal=De(t.config??{}),e.configRawOriginal=n)}async function ps(e){if(!(!e.client||!e.connected)){e.configSaving=!0,e.lastError=null;try{const t=e.configFormMode==="form"&&e.configForm?et(e.configForm):e.configRaw,n=e.configSnapshot?.hash;if(!n){e.lastError="Config hash missing; reload and retry.";return}await e.client.request("config.set",{raw:t,baseHash:n}),e.configFormDirty=!1,await ye(e)}catch(t){e.lastError=String(t)}finally{e.configSaving=!1}}}async function ic(e){if(!(!e.client||!e.connected)){e.configApplying=!0,e.lastError=null;try{const t=e.configFormMode==="form"&&e.configForm?et(e.configForm):e.configRaw,n=e.configSnapshot?.hash;if(!n){e.lastError="Config hash missing; reload and retry.";return}await e.client.request("config.apply",{raw:t,baseHash:n,sessionKey:e.applySessionKey}),e.configFormDirty=!1,await ye(e)}catch(t){e.lastError=String(t)}finally{e.configApplying=!1}}}async function ac(e){if(!(!e.client||!e.connected)){e.updateRunning=!0,e.lastError=null;try{await e.client.request("update.run",{sessionKey:e.applySessionKey})}catch(t){e.lastError=String(t)}finally{e.updateRunning=!1}}}function Ft(e,t,n){const s=De(e.configForm??e.configSnapshot?.config??{});mo(s,t,n),e.configForm=s,e.configFormDirty=!0,e.configFormMode==="form"&&(e.configRaw=et(s))}function ia(e,t){const n=De(e.configForm??e.configSnapshot?.config??{});yo(n,t),e.configForm=n,e.configFormDirty=!0,e.configFormMode==="form"&&(e.configRaw=et(n))}async function Ct(e){if(!(!e.client||!e.connected))try{const t=await e.client.request("cron.status",{});e.cronStatus=t}catch(t){e.cronError=String(t)}}async function pn(e){if(!(!e.client||!e.connected)&&!e.cronLoading){e.cronLoading=!0,e.cronError=null;try{const t=await e.client.request("cron.list",{includeDisabled:!0});e.cronJobs=Array.isArray(t.jobs)?t.jobs:[]}catch(t){e.cronError=String(t)}finally{e.cronLoading=!1}}}function oc(e){if(e.scheduleKind==="at"){const n=Date.parse(e.scheduleAt);if(!Number.isFinite(n))throw new Error("Invalid run time.");return{kind:"at",atMs:n}}if(e.scheduleKind==="every"){const n=Zt(e.everyAmount,0);if(n<=0)throw new Error("Invalid interval amount.");const s=e.everyUnit;return{kind:"every",everyMs:n*(s==="minutes"?6e4:s==="hours"?36e5:864e5)}}const t=e.cronExpr.trim();if(!t)throw new Error("Cron expression required.");return{kind:"cron",expr:t,tz:e.cronTz.trim()||void 0}}function rc(e){if(e.payloadKind==="systemEvent"){const i=e.payloadText.trim();if(!i)throw new Error("System event text required.");return{kind:"systemEvent",text:i}}const t=e.payloadText.trim();if(!t)throw new Error("Agent message required.");const n={kind:"agentTurn",message:t};e.deliver&&(n.deliver=!0),e.channel&&(n.channel=e.channel),e.to.trim()&&(n.to=e.to.trim());const s=Zt(e.timeoutSeconds,0);return s>0&&(n.timeoutSeconds=s),n}async function lc(e){if(!(!e.client||!e.connected||e.cronBusy)){e.cronBusy=!0,e.cronError=null;try{const t=oc(e.cronForm),n=rc(e.cronForm),s=e.cronForm.agentId.trim(),i={name:e.cronForm.name.trim(),description:e.cronForm.description.trim()||void 0,agentId:s||void 0,enabled:e.cronForm.enabled,schedule:t,sessionTarget:e.cronForm.sessionTarget,wakeMode:e.cronForm.wakeMode,payload:n,isolation:e.cronForm.postToMainPrefix.trim()&&e.cronForm.sessionTarget==="isolated"?{postToMainPrefix:e.cronForm.postToMainPrefix.trim()}:void 0};if(!i.name)throw new Error("Name required.");await e.client.request("cron.add",i),e.cronForm={...e.cronForm,name:"",description:"",payloadText:""},await pn(e),await Ct(e)}catch(t){e.cronError=String(t)}finally{e.cronBusy=!1}}}async function cc(e,t,n){if(!(!e.client||!e.connected||e.cronBusy)){e.cronBusy=!0,e.cronError=null;try{await e.client.request("cron.update",{id:t.id,patch:{enabled:n}}),await pn(e),await Ct(e)}catch(s){e.cronError=String(s)}finally{e.cronBusy=!1}}}async function dc(e,t){if(!(!e.client||!e.connected||e.cronBusy)){e.cronBusy=!0,e.cronError=null;try{await e.client.request("cron.run",{id:t.id,mode:"force"}),await wo(e,t.id)}catch(n){e.cronError=String(n)}finally{e.cronBusy=!1}}}async function uc(e,t){if(!(!e.client||!e.connected||e.cronBusy)){e.cronBusy=!0,e.cronError=null;try{await e.client.request("cron.remove",{id:t.id}),e.cronRunsJobId===t.id&&(e.cronRunsJobId=null,e.cronRuns=[]),await pn(e),await Ct(e)}catch(n){e.cronError=String(n)}finally{e.cronBusy=!1}}}async function wo(e,t){if(!(!e.client||!e.connected))try{const n=await e.client.request("cron.runs",{id:t,limit:50});e.cronRunsJobId=t,e.cronRuns=Array.isArray(n.entries)?n.entries:[]}catch(n){e.cronError=String(n)}}async function oe(e,t){if(!(!e.client||!e.connected)&&!e.channelsLoading){e.channelsLoading=!0,e.channelsError=null;try{const n=await e.client.request("channels.status",{probe:t,timeoutMs:8e3});e.channelsSnapshot=n,e.channelsLastSuccess=Date.now()}catch(n){e.channelsError=String(n)}finally{e.channelsLoading=!1}}}async function pc(e,t){if(!(!e.client||!e.connected||e.whatsappBusy)){e.whatsappBusy=!0;try{const n=await e.client.request("web.login.start",{force:t,timeoutMs:3e4});e.whatsappLoginMessage=n.message??null,e.whatsappLoginQrDataUrl=n.qrDataUrl??null,e.whatsappLoginConnected=null}catch(n){e.whatsappLoginMessage=String(n),e.whatsappLoginQrDataUrl=null,e.whatsappLoginConnected=null}finally{e.whatsappBusy=!1}}}async function hc(e){if(!(!e.client||!e.connected||e.whatsappBusy)){e.whatsappBusy=!0;try{const t=await e.client.request("web.login.wait",{timeoutMs:12e4});e.whatsappLoginMessage=t.message??null,e.whatsappLoginConnected=t.connected??null,t.connected&&(e.whatsappLoginQrDataUrl=null)}catch(t){e.whatsappLoginMessage=String(t),e.whatsappLoginConnected=null}finally{e.whatsappBusy=!1}}}async function fc(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}}}async function hn(e){if(!(!e.client||!e.connected)&&!e.debugLoading){e.debugLoading=!0;try{const[t,n,s,i]=await Promise.all([e.client.request("status",{}),e.client.request("health",{}),e.client.request("models.list",{}),e.client.request("last-heartbeat",{})]);e.debugStatus=t,e.debugHealth=n;const a=s;e.debugModels=Array.isArray(a?.models)?a?.models:[],e.debugHeartbeat=i}catch(t){e.debugCallError=String(t)}finally{e.debugLoading=!1}}}async function gc(e){if(!(!e.client||!e.connected)){e.debugCallError=null,e.debugCallResult=null;try{const t=e.debugCallParams.trim()?JSON.parse(e.debugCallParams):{},n=await e.client.request(e.debugCallMethod.trim(),t);e.debugCallResult=JSON.stringify(n,null,2)}catch(t){e.debugCallError=String(t)}}}const vc=2e3,mc=new Set(["trace","debug","info","warn","error","fatal"]);function yc(e){if(typeof e!="string")return null;const t=e.trim();if(!t.startsWith("{")||!t.endsWith("}"))return null;try{const n=JSON.parse(t);return!n||typeof n!="object"?null:n}catch{return null}}function bc(e){if(typeof e!="string")return null;const t=e.toLowerCase();return mc.has(t)?t:null}function wc(e){if(!e.trim())return{raw:e,message:e};try{const t=JSON.parse(e),n=t&&typeof t._meta=="object"&&t._meta!==null?t._meta:null,s=typeof t.time=="string"?t.time:typeof n?.date=="string"?n?.date:null,i=bc(n?.logLevelName??n?.level),a=typeof t[0]=="string"?t[0]:typeof n?.name=="string"?n?.name:null,o=yc(a);let l=null;o&&(typeof o.subsystem=="string"?l=o.subsystem:typeof o.module=="string"&&(l=o.module)),!l&&a&&a.length<120&&(l=a);let r=null;return typeof t[1]=="string"?r=t[1]:!o&&typeof t[0]=="string"?r=t[0]:typeof t.message=="string"&&(r=t.message),{raw:e,time:s,level:i,subsystem:l,message:r??e,meta:n??void 0}}catch{return{raw:e,message:e}}}async function Fs(e,t){if(!(!e.client||!e.connected)&&!(e.logsLoading&&!t?.quiet)){t?.quiet||(e.logsLoading=!0),e.logsError=null;try{const s=await e.client.request("logs.tail",{cursor:t?.reset?void 0:e.logsCursor??void 0,limit:e.logsLimit,maxBytes:e.logsMaxBytes}),a=(Array.isArray(s.lines)?s.lines.filter(l=>typeof l=="string"):[]).map(wc),o=!!(t?.reset||s.reset||e.logsCursor==null);e.logsEntries=o?a:[...e.logsEntries,...a].slice(-vc),typeof s.cursor=="number"&&(e.logsCursor=s.cursor),typeof s.file=="string"&&(e.logsFile=s.file),e.logsTruncated=!!s.truncated,e.logsLastFetchAt=Date.now()}catch(n){e.logsError=String(n)}finally{t?.quiet||(e.logsLoading=!1)}}}const $o={p:0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffedn,n:0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3edn,h:8n,a:0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffecn,d:0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3n,Gx:0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51an,Gy:0x6666666666666666666666666666666666666666666666666666666666666658n},{p:W,n:Vt,Gx:aa,Gy:oa,a:jn,d:qn,h:$c}=$o,Be=32,Us=64,xc=(...e)=>{"captureStackTrace"in Error&&typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(...e)},H=(e="")=>{const t=new Error(e);throw xc(t,H),t},Ac=e=>typeof e=="bigint",kc=e=>typeof e=="string",Sc=e=>e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array",_e=(e,t,n="")=>{const s=Sc(e),i=e?.length,a=t!==void 0;if(!s||a&&i!==t){const o=n&&`"${n}" `,l=a?` of length ${t}`:"",r=s?`length=${i}`:`type=${typeof e}`;H(o+"expected Uint8Array"+l+", got "+r)}return e},fn=e=>new Uint8Array(e),xo=e=>Uint8Array.from(e),Ao=(e,t)=>e.toString(16).padStart(t,"0"),ko=e=>Array.from(_e(e)).map(t=>Ao(t,2)).join(""),ve={_0:48,_9:57,A:65,F:70,a:97,f:102},ra=e=>{if(e>=ve._0&&e<=ve._9)return e-ve._0;if(e>=ve.A&&e<=ve.F)return e-(ve.A-10);if(e>=ve.a&&e<=ve.f)return e-(ve.a-10)},So=e=>{const t="hex invalid";if(!kc(e))return H(t);const n=e.length,s=n/2;if(n%2)return H(t);const i=fn(s);for(let a=0,o=0;a<s;a++,o+=2){const l=ra(e.charCodeAt(o)),r=ra(e.charCodeAt(o+1));if(l===void 0||r===void 0)return H(t);i[a]=l*16+r}return i},_o=()=>globalThis?.crypto,_c=()=>_o()?.subtle??H("crypto.subtle must be defined, consider polyfill"),_t=(...e)=>{const t=fn(e.reduce((s,i)=>s+_e(i).length,0));let n=0;return e.forEach(s=>{t.set(s,n),n+=s.length}),t},Tc=(e=Be)=>_o().getRandomValues(fn(e)),Jt=BigInt,Re=(e,t,n,s="bad number: out of range")=>Ac(e)&&t<=e&&e<n?e:H(s),k=(e,t=W)=>{const n=e%t;return n>=0n?n:t+n},To=e=>k(e,Vt),Cc=(e,t)=>{(e===0n||t<=0n)&&H("no inverse n="+e+" mod="+t);let n=k(e,t),s=t,i=0n,a=1n;for(;n!==0n;){const o=s/n,l=s%n,r=i-a*o;s=n,n=l,i=a,a=r}return s===1n?k(i,t):H("no inverse")},Ec=e=>{const t=Lo[e];return typeof t!="function"&&H("hashes."+e+" not set"),t},Wn=e=>e instanceof ee?e:H("Point expected"),hs=2n**256n;class ee{static BASE;static ZERO;X;Y;Z;T;constructor(t,n,s,i){const a=hs;this.X=Re(t,0n,a),this.Y=Re(n,0n,a),this.Z=Re(s,1n,a),this.T=Re(i,0n,a),Object.freeze(this)}static CURVE(){return $o}static fromAffine(t){return new ee(t.x,t.y,1n,k(t.x*t.y))}static fromBytes(t,n=!1){const s=qn,i=xo(_e(t,Be)),a=t[31];i[31]=a&-129;const o=Eo(i);Re(o,0n,n?hs:W);const r=k(o*o),p=k(r-1n),d=k(s*r+1n);let{isValid:u,value:g}=Lc(p,d);u||H("bad point: y not sqrt");const v=(g&1n)===1n,m=(a&128)!==0;return!n&&g===0n&&m&&H("bad point: x==0, isLastByteOdd"),m!==v&&(g=k(-g)),new ee(g,o,1n,k(g*o))}static fromHex(t,n){return ee.fromBytes(So(t),n)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}assertValidity(){const t=jn,n=qn,s=this;if(s.is0())return H("bad point: ZERO");const{X:i,Y:a,Z:o,T:l}=s,r=k(i*i),p=k(a*a),d=k(o*o),u=k(d*d),g=k(r*t),v=k(d*k(g+p)),m=k(u+k(n*k(r*p)));if(v!==m)return H("bad point: equation left != right (1)");const $=k(i*a),A=k(o*l);return $!==A?H("bad point: equation left != right (2)"):this}equals(t){const{X:n,Y:s,Z:i}=this,{X:a,Y:o,Z:l}=Wn(t),r=k(n*l),p=k(a*i),d=k(s*l),u=k(o*i);return r===p&&d===u}is0(){return this.equals(Qe)}negate(){return new ee(k(-this.X),this.Y,this.Z,k(-this.T))}double(){const{X:t,Y:n,Z:s}=this,i=jn,a=k(t*t),o=k(n*n),l=k(2n*k(s*s)),r=k(i*a),p=t+n,d=k(k(p*p)-a-o),u=r+o,g=u-l,v=r-o,m=k(d*g),$=k(u*v),A=k(d*v),_=k(g*u);return new ee(m,$,_,A)}add(t){const{X:n,Y:s,Z:i,T:a}=this,{X:o,Y:l,Z:r,T:p}=Wn(t),d=jn,u=qn,g=k(n*o),v=k(s*l),m=k(a*u*p),$=k(i*r),A=k((n+s)*(o+l)-g-v),_=k($-m),L=k($+m),P=k(v-d*g),I=k(A*_),C=k(L*P),E=k(A*P),pe=k(_*L);return new ee(I,C,pe,E)}subtract(t){return this.add(Wn(t).negate())}multiply(t,n=!0){if(!n&&(t===0n||this.is0()))return Qe;if(Re(t,1n,Vt),t===1n)return this;if(this.equals(Fe))return Hc(t).p;let s=Qe,i=Fe;for(let a=this;t>0n;a=a.double(),t>>=1n)t&1n?s=s.add(a):n&&(i=i.add(a));return s}multiplyUnsafe(t){return this.multiply(t,!1)}toAffine(){const{X:t,Y:n,Z:s}=this;if(this.equals(Qe))return{x:0n,y:1n};const i=Cc(s,W);k(s*i)!==1n&&H("invalid inverse");const a=k(t*i),o=k(n*i);return{x:a,y:o}}toBytes(){const{x:t,y:n}=this.assertValidity().toAffine(),s=Co(n);return s[31]|=t&1n?128:0,s}toHex(){return ko(this.toBytes())}clearCofactor(){return this.multiply(Jt($c),!1)}isSmallOrder(){return this.clearCofactor().is0()}isTorsionFree(){let t=this.multiply(Vt/2n,!1).double();return Vt%2n&&(t=t.add(this)),t.is0()}}const Fe=new ee(aa,oa,1n,k(aa*oa)),Qe=new ee(0n,1n,1n,0n);ee.BASE=Fe;ee.ZERO=Qe;const Co=e=>So(Ao(Re(e,0n,hs),Us)).reverse(),Eo=e=>Jt("0x"+ko(xo(_e(e)).reverse())),ce=(e,t)=>{let n=e;for(;t-- >0n;)n*=n,n%=W;return n},Ic=e=>{const n=e*e%W*e%W,s=ce(n,2n)*n%W,i=ce(s,1n)*e%W,a=ce(i,5n)*i%W,o=ce(a,10n)*a%W,l=ce(o,20n)*o%W,r=ce(l,40n)*l%W,p=ce(r,80n)*r%W,d=ce(p,80n)*r%W,u=ce(d,10n)*a%W;return{pow_p_5_8:ce(u,2n)*e%W,b2:n}},la=0x2b8324804fc1df0b2b4d00993dfbd7a72f431806ad2fe478c4ee1b274a0ea0b0n,Lc=(e,t)=>{const n=k(t*t*t),s=k(n*n*t),i=Ic(e*s).pow_p_5_8;let a=k(e*n*i);const o=k(t*a*a),l=a,r=k(a*la),p=o===e,d=o===k(-e),u=o===k(-e*la);return p&&(a=l),(d||u)&&(a=r),(k(a)&1n)===1n&&(a=k(-a)),{isValid:p||d,value:a}},fs=e=>To(Eo(e)),Ks=(...e)=>Lo.sha512Async(_t(...e)),Mc=(...e)=>Ec("sha512")(_t(...e)),Io=e=>{const t=e.slice(0,Be);t[0]&=248,t[31]&=127,t[31]|=64;const n=e.slice(Be,Us),s=fs(t),i=Fe.multiply(s),a=i.toBytes();return{head:t,prefix:n,scalar:s,point:i,pointBytes:a}},Hs=e=>Ks(_e(e,Be)).then(Io),Rc=e=>Io(Mc(_e(e,Be))),Pc=e=>Hs(e).then(t=>t.pointBytes),Nc=e=>Ks(e.hashable).then(e.finish),Oc=(e,t,n)=>{const{pointBytes:s,scalar:i}=e,a=fs(t),o=Fe.multiply(a).toBytes();return{hashable:_t(o,s,n),finish:p=>{const d=To(a+fs(p)*i);return _e(_t(o,Co(d)),Us)}}},Dc=async(e,t)=>{const n=_e(e),s=await Hs(t),i=await Ks(s.prefix,n);return Nc(Oc(s,i,n))},Lo={sha512Async:async e=>{const t=_c(),n=_t(e);return fn(await t.digest("SHA-512",n.buffer))},sha512:void 0},Bc=(e=Tc(Be))=>e,Fc={getExtendedPublicKeyAsync:Hs,getExtendedPublicKey:Rc,randomSecretKey:Bc},Xt=8,Uc=256,Mo=Math.ceil(Uc/Xt)+1,gs=2**(Xt-1),Kc=()=>{const e=[];let t=Fe,n=t;for(let s=0;s<Mo;s++){n=t,e.push(n);for(let i=1;i<gs;i++)n=n.add(t),e.push(n);t=n.double()}return e};let ca;const da=(e,t)=>{const n=t.negate();return e?n:t},Hc=e=>{const t=ca||(ca=Kc());let n=Qe,s=Fe;const i=2**Xt,a=i,o=Jt(i-1),l=Jt(Xt);for(let r=0;r<Mo;r++){let p=Number(e&o);e>>=l,p>gs&&(p-=a,e+=1n);const d=r*gs,u=d,g=d+Math.abs(p)-1,v=r%2!==0,m=p<0;p===0?s=s.add(da(v,t[u])):n=n.add(da(m,t[g]))}return e!==0n&&H("invalid wnaf"),{p:n,f:s}},Vn="moltbot-device-identity-v1";function vs(e){let t="";for(const n of e)t+=String.fromCharCode(n);return btoa(t).replaceAll("+","-").replaceAll("/","_").replace(/=+$/g,"")}function Ro(e){const t=e.replaceAll("-","+").replaceAll("_","/"),n=t+"=".repeat((4-t.length%4)%4),s=atob(n),i=new Uint8Array(s.length);for(let a=0;a<s.length;a+=1)i[a]=s.charCodeAt(a);return i}function zc(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}async function Po(e){const t=await crypto.subtle.digest("SHA-256",e);return zc(new Uint8Array(t))}async function jc(){const e=Fc.randomSecretKey(),t=await Pc(e);return{deviceId:await Po(t),publicKey:vs(t),privateKey:vs(e)}}async function zs(){try{const n=localStorage.getItem(Vn);if(n){const s=JSON.parse(n);if(s?.version===1&&typeof s.deviceId=="string"&&typeof s.publicKey=="string"&&typeof s.privateKey=="string"){const i=await Po(Ro(s.publicKey));if(i!==s.deviceId){const a={...s,deviceId:i};return localStorage.setItem(Vn,JSON.stringify(a)),{deviceId:i,publicKey:s.publicKey,privateKey:s.privateKey}}return{deviceId:s.deviceId,publicKey:s.publicKey,privateKey:s.privateKey}}}}catch{}const e=await jc(),t={version:1,deviceId:e.deviceId,publicKey:e.publicKey,privateKey:e.privateKey,createdAtMs:Date.now()};return localStorage.setItem(Vn,JSON.stringify(t)),e}async function qc(e,t){const n=Ro(e),s=new TextEncoder().encode(t),i=await Dc(s,n);return vs(i)}const No="moltbot.device.auth.v1";function js(e){return e.trim()}function Wc(e){if(!Array.isArray(e))return[];const t=new Set;for(const n of e){const s=n.trim();s&&t.add(s)}return[...t].sort()}function qs(){try{const e=window.localStorage.getItem(No);if(!e)return null;const t=JSON.parse(e);return!t||t.version!==1||!t.deviceId||typeof t.deviceId!="string"||!t.tokens||typeof t.tokens!="object"?null:t}catch{return null}}function Oo(e){try{window.localStorage.setItem(No,JSON.stringify(e))}catch{}}function Vc(e){const t=qs();if(!t||t.deviceId!==e.deviceId)return null;const n=js(e.role),s=t.tokens[n];return!s||typeof s.token!="string"?null:s}function Do(e){const t=js(e.role),n={version:1,deviceId:e.deviceId,tokens:{}},s=qs();s&&s.deviceId===e.deviceId&&(n.tokens={...s.tokens});const i={token:e.token,role:t,scopes:Wc(e.scopes),updatedAtMs:Date.now()};return n.tokens[t]=i,Oo(n),i}function Bo(e){const t=qs();if(!t||t.deviceId!==e.deviceId)return;const n=js(e.role);if(!t.tokens[n])return;const s={...t,tokens:{...t.tokens}};delete s.tokens[n],Oo(s)}async function Te(e,t){if(!(!e.client||!e.connected)&&!e.devicesLoading){e.devicesLoading=!0,t?.quiet||(e.devicesError=null);try{const n=await e.client.request("device.pair.list",{});e.devicesList={pending:Array.isArray(n?.pending)?n.pending:[],paired:Array.isArray(n?.paired)?n.paired:[]}}catch(n){t?.quiet||(e.devicesError=String(n))}finally{e.devicesLoading=!1}}}async function Gc(e,t){if(!(!e.client||!e.connected))try{await e.client.request("device.pair.approve",{requestId:t}),await Te(e)}catch(n){e.devicesError=String(n)}}async function Yc(e,t){if(!(!e.client||!e.connected||!window.confirm("Reject this device pairing request?")))try{await e.client.request("device.pair.reject",{requestId:t}),await Te(e)}catch(s){e.devicesError=String(s)}}async function Qc(e,t){if(!(!e.client||!e.connected))try{const n=await e.client.request("device.token.rotate",t);if(n?.token){const s=await zs(),i=n.role??t.role;(n.deviceId===s.deviceId||t.deviceId===s.deviceId)&&Do({deviceId:s.deviceId,role:i,token:n.token,scopes:n.scopes??t.scopes??[]}),window.prompt("New device token (copy and store securely):",n.token)}await Te(e)}catch(n){e.devicesError=String(n)}}async function Zc(e,t){if(!(!e.client||!e.connected||!window.confirm(`Revoke token for ${t.deviceId} (${t.role})?`)))try{await e.client.request("device.token.revoke",t);const s=await zs();t.deviceId===s.deviceId&&Bo({deviceId:s.deviceId,role:t.role}),await Te(e)}catch(s){e.devicesError=String(s)}}async function gn(e,t){if(!(!e.client||!e.connected)&&!e.nodesLoading){e.nodesLoading=!0,t?.quiet||(e.lastError=null);try{const n=await e.client.request("node.list",{});e.nodes=Array.isArray(n.nodes)?n.nodes:[]}catch(n){t?.quiet||(e.lastError=String(n))}finally{e.nodesLoading=!1}}}function Jc(e){if(!e||e.kind==="gateway")return{method:"exec.approvals.get",params:{}};const t=e.nodeId.trim();return t?{method:"exec.approvals.node.get",params:{nodeId:t}}:null}function Xc(e,t){if(!e||e.kind==="gateway")return{method:"exec.approvals.set",params:t};const n=e.nodeId.trim();return n?{method:"exec.approvals.node.set",params:{...t,nodeId:n}}:null}async function Ws(e,t){if(!(!e.client||!e.connected)&&!e.execApprovalsLoading){e.execApprovalsLoading=!0,e.lastError=null;try{const n=Jc(t);if(!n){e.lastError="Select a node before loading exec approvals.";return}const s=await e.client.request(n.method,n.params);ed(e,s)}catch(n){e.lastError=String(n)}finally{e.execApprovalsLoading=!1}}}function ed(e,t){e.execApprovalsSnapshot=t,e.execApprovalsDirty||(e.execApprovalsForm=De(t.file??{}))}async function td(e,t){if(!(!e.client||!e.connected)){e.execApprovalsSaving=!0,e.lastError=null;try{const n=e.execApprovalsSnapshot?.hash;if(!n){e.lastError="Exec approvals hash missing; reload and retry.";return}const s=e.execApprovalsForm??e.execApprovalsSnapshot?.file??{},i=Xc(t,{file:s,baseHash:n});if(!i){e.lastError="Select a node before saving exec approvals.";return}await e.client.request(i.method,i.params),e.execApprovalsDirty=!1,await Ws(e,t)}catch(n){e.lastError=String(n)}finally{e.execApprovalsSaving=!1}}}function nd(e,t,n){const s=De(e.execApprovalsForm??e.execApprovalsSnapshot?.file??{});mo(s,t,n),e.execApprovalsForm=s,e.execApprovalsDirty=!0}function sd(e,t){const n=De(e.execApprovalsForm??e.execApprovalsSnapshot?.file??{});yo(n,t),e.execApprovalsForm=n,e.execApprovalsDirty=!0}async function Vs(e){if(!(!e.client||!e.connected)&&!e.presenceLoading){e.presenceLoading=!0,e.presenceError=null,e.presenceStatus=null;try{const t=await e.client.request("system-presence",{});Array.isArray(t)?(e.presenceEntries=t,e.presenceStatus=t.length===0?"No instances yet.":null):(e.presenceEntries=[],e.presenceStatus="No presence payload.")}catch(t){e.presenceError=String(t)}finally{e.presenceLoading=!1}}}function tt(e,t,n){if(!t.trim())return;const s={...e.skillMessages};n?s[t]=n:delete s[t],e.skillMessages=s}function vn(e){return e instanceof Error?e.message:String(e)}async function Et(e,t){if(t?.clearMessages&&Object.keys(e.skillMessages).length>0&&(e.skillMessages={}),!(!e.client||!e.connected)&&!e.skillsLoading){e.skillsLoading=!0,e.skillsError=null;try{const n=await e.client.request("skills.status",{});n&&(e.skillsReport=n)}catch(n){e.skillsError=vn(n)}finally{e.skillsLoading=!1}}}function id(e,t,n){e.skillEdits={...e.skillEdits,[t]:n}}async function ad(e,t,n){if(!(!e.client||!e.connected)){e.skillsBusyKey=t,e.skillsError=null;try{await e.client.request("skills.update",{skillKey:t,enabled:n}),await Et(e),tt(e,t,{kind:"success",message:n?"Skill enabled":"Skill disabled"})}catch(s){const i=vn(s);e.skillsError=i,tt(e,t,{kind:"error",message:i})}finally{e.skillsBusyKey=null}}}async function od(e,t){if(!(!e.client||!e.connected)){e.skillsBusyKey=t,e.skillsError=null;try{const n=e.skillEdits[t]??"";await e.client.request("skills.update",{skillKey:t,apiKey:n}),await Et(e),tt(e,t,{kind:"success",message:"API key saved"})}catch(n){const s=vn(n);e.skillsError=s,tt(e,t,{kind:"error",message:s})}finally{e.skillsBusyKey=null}}}async function rd(e,t,n,s){if(!(!e.client||!e.connected)){e.skillsBusyKey=t,e.skillsError=null;try{const i=await e.client.request("skills.install",{name:n,installId:s,timeoutMs:12e4});await Et(e),tt(e,t,{kind:"success",message:i?.message??"Installed"})}catch(i){const a=vn(i);e.skillsError=a,tt(e,t,{kind:"error",message:a})}finally{e.skillsBusyKey=null}}}function ld(){return typeof window>"u"||typeof window.matchMedia!="function"||window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Gs(e){return e==="system"?ld():e}const Ut=e=>Number.isNaN(e)?.5:e<=0?0:e>=1?1:e,cd=()=>typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches??!1,Kt=e=>{e.classList.remove("theme-transition"),e.style.removeProperty("--theme-switch-x"),e.style.removeProperty("--theme-switch-y")},dd=({nextTheme:e,applyTheme:t,context:n,currentTheme:s})=>{if(s===e)return;const i=globalThis.document??null;if(!i){t();return}const a=i.documentElement,o=i,l=cd();if(!!o.startViewTransition&&!l){let p=.5,d=.5;if(n?.pointerClientX!==void 0&&n?.pointerClientY!==void 0&&typeof window<"u")p=Ut(n.pointerClientX/window.innerWidth),d=Ut(n.pointerClientY/window.innerHeight);else if(n?.element){const u=n.element.getBoundingClientRect();u.width>0&&u.height>0&&typeof window<"u"&&(p=Ut((u.left+u.width/2)/window.innerWidth),d=Ut((u.top+u.height/2)/window.innerHeight))}a.style.setProperty("--theme-switch-x",`${p*100}%`),a.style.setProperty("--theme-switch-y",`${d*100}%`),a.classList.add("theme-transition");try{const u=o.startViewTransition?.(()=>{t()});u?.finished?u.finished.finally(()=>Kt(a)):Kt(a)}catch{Kt(a),t()}return}t(),Kt(a)};function ud(e){e.nodesPollInterval==null&&(e.nodesPollInterval=window.setInterval(()=>{gn(e,{quiet:!0})},5e3))}function pd(e){e.nodesPollInterval!=null&&(clearInterval(e.nodesPollInterval),e.nodesPollInterval=null)}function Ys(e){e.logsPollInterval==null&&(e.logsPollInterval=window.setInterval(()=>{e.tab==="logs"&&Fs(e,{quiet:!0})},2e3))}function Qs(e){e.logsPollInterval!=null&&(clearInterval(e.logsPollInterval),e.logsPollInterval=null)}function Zs(e){e.debugPollInterval==null&&(e.debugPollInterval=window.setInterval(()=>{e.tab==="debug"&&hn(e)},3e3))}function Js(e){e.debugPollInterval!=null&&(clearInterval(e.debugPollInterval),e.debugPollInterval=null)}function Ae(e,t){const n={...t,lastActiveSessionKey:t.lastActiveSessionKey?.trim()||t.sessionKey.trim()||"main"};e.settings=n,bl(n),t.theme!==e.theme&&(e.theme=t.theme,mn(e,Gs(t.theme))),e.applySessionKey=e.settings.lastActiveSessionKey}function Fo(e,t){const n=t.trim();n&&e.settings.lastActiveSessionKey!==n&&Ae(e,{...e.settings,lastActiveSessionKey:n})}function hd(e){if(!window.location.search)return;const t=new URLSearchParams(window.location.search),n=t.get("token"),s=t.get("password"),i=t.get("session"),a=t.get("gatewayUrl");let o=!1;if(n!=null){const r=n.trim();r&&r!==e.settings.token&&Ae(e,{...e.settings,token:r}),t.delete("token"),o=!0}if(s!=null){const r=s.trim();r&&(e.password=r),t.delete("password"),o=!0}if(i!=null){const r=i.trim();r&&(e.sessionKey=r,Ae(e,{...e.settings,sessionKey:r,lastActiveSessionKey:r}))}if(a!=null){const r=a.trim();r&&r!==e.settings.gatewayUrl&&Ae(e,{...e.settings,gatewayUrl:r}),t.delete("gatewayUrl"),o=!0}if(!o)return;const l=new URL(window.location.href);l.search=t.toString(),window.history.replaceState({},"",l.toString())}function fd(e,t){e.tab!==t&&(e.tab=t),t==="chat"&&(e.chatHasAutoScrolled=!1),t==="logs"?Ys(e):Qs(e),t==="debug"?Zs(e):Js(e),Xs(e),Ko(e,t,!1)}function gd(e,t,n){dd({nextTheme:t,applyTheme:()=>{e.theme=t,Ae(e,{...e.settings,theme:t}),mn(e,Gs(t))},context:n,currentTheme:e.theme})}async function Xs(e){e.tab==="overview"&&await Ho(e),e.tab==="channels"&&await Ad(e),e.tab==="instances"&&await Vs(e),e.tab==="sessions"&&await st(e),e.tab==="cron"&&await ei(e),e.tab==="skills"&&await Et(e),e.tab==="nodes"&&(await gn(e),await Te(e),await ye(e),await Ws(e)),e.tab==="chat"&&(await Cd(e),un(e,!e.chatHasAutoScrolled)),e.tab==="config"&&(await bo(e),await ye(e)),e.tab==="debug"&&(await hn(e),e.eventLog=e.eventLogBuffer),e.tab==="logs"&&(e.logsAtBottom=!0,await Fs(e,{reset:!0}),vo(e,!0))}function vd(){if(typeof window>"u")return"";const e=window.__CLAWDBOT_CONTROL_UI_BASE_PATH__;return typeof e=="string"&&e.trim()?cn(e):$l(window.location.pathname)}function md(e){e.theme=e.settings.theme??"system",mn(e,Gs(e.theme))}function mn(e,t){if(e.themeResolved=t,typeof document>"u")return;const n=document.documentElement;n.dataset.theme=t,n.style.colorScheme=t}function yd(e){if(typeof window>"u"||typeof window.matchMedia!="function")return;if(e.themeMedia=window.matchMedia("(prefers-color-scheme: dark)"),e.themeMediaHandler=n=>{e.theme==="system"&&mn(e,n.matches?"dark":"light")},typeof e.themeMedia.addEventListener=="function"){e.themeMedia.addEventListener("change",e.themeMediaHandler);return}e.themeMedia.addListener(e.themeMediaHandler)}function bd(e){if(!e.themeMedia||!e.themeMediaHandler)return;if(typeof e.themeMedia.removeEventListener=="function"){e.themeMedia.removeEventListener("change",e.themeMediaHandler);return}e.themeMedia.removeListener(e.themeMediaHandler),e.themeMedia=null,e.themeMediaHandler=null}function wd(e,t){if(typeof window>"u")return;const n=po(window.location.pathname,e.basePath)??"chat";Uo(e,n),Ko(e,n,t)}function $d(e){if(typeof window>"u")return;const t=po(window.location.pathname,e.basePath);if(!t)return;const s=new URL(window.location.href).searchParams.get("session")?.trim();s&&(e.sessionKey=s,Ae(e,{...e.settings,sessionKey:s,lastActiveSessionKey:s})),Uo(e,t)}function Uo(e,t){e.tab!==t&&(e.tab=t),t==="chat"&&(e.chatHasAutoScrolled=!1),t==="logs"?Ys(e):Qs(e),t==="debug"?Zs(e):Js(e),e.connected&&Xs(e)}function Ko(e,t,n){if(typeof window>"u")return;const s=kt(Ds(t,e.basePath)),i=kt(window.location.pathname),a=new URL(window.location.href);t==="chat"&&e.sessionKey?a.searchParams.set("session",e.sessionKey):a.searchParams.delete("session"),i!==s&&(a.pathname=s),n?window.history.replaceState({},"",a.toString()):window.history.pushState({},"",a.toString())}function xd(e,t,n){if(typeof window>"u")return;const s=new URL(window.location.href);s.searchParams.set("session",t),window.history.replaceState({},"",s.toString())}async function Ho(e){await Promise.all([oe(e,!1),Vs(e),st(e),Ct(e),hn(e)])}async function Ad(e){await Promise.all([oe(e,!0),bo(e),ye(e)])}async function ei(e){await Promise.all([oe(e,!1),Ct(e),pn(e)])}function zo(e){return e.chatSending||!!e.chatRunId}function kd(e){const t=e.trim();if(!t)return!1;const n=t.toLowerCase();return n==="/stop"?!0:n==="stop"||n==="esc"||n==="abort"||n==="wait"||n==="exit"}async function jo(e){e.connected&&(e.chatMessage="",await Dl(e))}function Sd(e,t,n){const s=t.trim(),i=!!(n&&n.length>0);!s&&!i||(e.chatQueue=[...e.chatQueue,{id:Bs(),text:s,createdAt:Date.now(),attachments:i?n?.map(a=>({...a})):void 0}])}async function qo(e,t,n){dn(e);const s=await Ol(e,t,n?.attachments);return!s&&n?.previousDraft!=null&&(e.chatMessage=n.previousDraft),!s&&n?.previousAttachments&&(e.chatAttachments=n.previousAttachments),s&&Fo(e,e.sessionKey),s&&n?.restoreDraft&&n.previousDraft?.trim()&&(e.chatMessage=n.previousDraft),s&&n?.restoreAttachments&&n.previousAttachments?.length&&(e.chatAttachments=n.previousAttachments),un(e),s&&!e.chatRunId&&Wo(e),s}async function Wo(e){if(!e.connected||zo(e))return;const[t,...n]=e.chatQueue;if(!t)return;e.chatQueue=n,await qo(e,t.text,{attachments:t.attachments})||(e.chatQueue=[t,...e.chatQueue])}function _d(e,t){e.chatQueue=e.chatQueue.filter(n=>n.id!==t)}async function Td(e,t,n){if(!e.connected)return;const s=e.chatMessage,i=(t??e.chatMessage).trim(),a=e.chatAttachments??[],o=t==null?a:[],l=o.length>0;if(!(!i&&!l)){if(kd(i)){await jo(e);return}if(t==null&&(e.chatMessage="",e.chatAttachments=[]),zo(e)){Sd(e,i,o);return}await qo(e,i,{previousDraft:t==null?s:void 0,restoreDraft:!!(t&&n?.restoreDraft),attachments:l?o:void 0,previousAttachments:t==null?a:void 0,restoreAttachments:!!(t&&n?.restoreDraft)})}}async function Cd(e){await Promise.all([Xe(e),st(e),ms(e)]),un(e,!0)}const Ed=Wo;function Id(e){const t=lo(e.sessionKey);return t?.agentId?t.agentId:e.hello?.snapshot?.sessionDefaults?.defaultAgentId?.trim()||"main"}function Ld(e,t){const n=cn(e),s=encodeURIComponent(t);return n?`${n}/avatar/${s}?meta=1`:`/avatar/${s}?meta=1`}async function ms(e){if(!e.connected){e.chatAvatarUrl=null;return}const t=Id(e);if(!t){e.chatAvatarUrl=null;return}e.chatAvatarUrl=null;const n=Ld(e.basePath,t);try{const s=await fetch(n,{method:"GET"});if(!s.ok){e.chatAvatarUrl=null;return}const i=await s.json(),a=typeof i.avatarUrl=="string"?i.avatarUrl.trim():"";e.chatAvatarUrl=a||null}catch{e.chatAvatarUrl=null}}const{I:Md}=ll,ua=e=>e,Rd=e=>e.strings===void 0,pa=()=>document.createComment(""),lt=(e,t,n)=>{const s=e._$AA.parentNode,i=t===void 0?e._$AB:t._$AA;if(n===void 0){const a=s.insertBefore(pa(),i),o=s.insertBefore(pa(),i);n=new Md(a,o,e,e.options)}else{const a=n._$AB.nextSibling,o=n._$AM,l=o!==e;if(l){let r;n._$AQ?.(e),n._$AM=e,n._$AP!==void 0&&(r=e._$AU)!==o._$AU&&n._$AP(r)}if(a!==i||l){let r=n._$AA;for(;r!==a;){const p=ua(r).nextSibling;ua(s).insertBefore(r,i),r=p}}}return n},Le=(e,t,n=e)=>(e._$AI(t,n),e),Pd={},Nd=(e,t=Pd)=>e._$AH=t,Od=e=>e._$AH,Gn=e=>{e._$AR(),e._$AA.remove()};const ti={CHILD:2},ni=e=>(...t)=>({_$litDirective$:e,values:t});class si{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,n,s){this._$Ct=t,this._$AM=n,this._$Ci=s}_$AS(t,n){return this.update(t,n)}update(t,n){return this.render(...n)}}const bt=(e,t)=>{const n=e._$AN;if(n===void 0)return!1;for(const s of n)s._$AO?.(t,!1),bt(s,t);return!0},en=e=>{let t,n;do{if((t=e._$AM)===void 0)break;n=t._$AN,n.delete(e),e=t}while(n?.size===0)},Vo=e=>{for(let t;t=e._$AM;e=t){let n=t._$AN;if(n===void 0)t._$AN=n=new Set;else if(n.has(e))break;n.add(e),Fd(t)}};function Dd(e){this._$AN!==void 0?(en(this),this._$AM=e,Vo(this)):this._$AM=e}function Bd(e,t=!1,n=0){const s=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(t)if(Array.isArray(s))for(let a=n;a<s.length;a++)bt(s[a],!1),en(s[a]);else s!=null&&(bt(s,!1),en(s));else bt(this,e)}const Fd=e=>{e.type==ti.CHILD&&(e._$AP??=Bd,e._$AQ??=Dd)};class Ud extends si{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,n,s){super._$AT(t,n,s),Vo(this),this.isConnected=t._$AU}_$AO(t,n=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),n&&(bt(this,t),en(this))}setValue(t){if(Rd(this._$Ct))this._$Ct._$AI(t,this);else{const n=[...this._$Ct._$AH];n[this._$Ci]=t,this._$Ct._$AI(n,this,0)}}disconnected(){}reconnected(){}}const Yn=new WeakMap,Kd=ni(class extends Ud{render(e){return f}update(e,[t]){const n=t!==this.G;return n&&this.G!==void 0&&this.rt(void 0),(n||this.lt!==this.ct)&&(this.G=t,this.ht=e.options?.host,this.rt(this.ct=e.element)),f}rt(e){if(this.isConnected||(e=void 0),typeof this.G=="function"){const t=this.ht??globalThis;let n=Yn.get(t);n===void 0&&(n=new WeakMap,Yn.set(t,n)),n.get(this.G)!==void 0&&this.G.call(this.ht,void 0),n.set(this.G,e),e!==void 0&&this.G.call(this.ht,e)}else this.G.value=e}get lt(){return typeof this.G=="function"?Yn.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});const ha=(e,t,n)=>{const s=new Map;for(let i=t;i<=n;i++)s.set(e[i],i);return s},Go=ni(class extends si{constructor(e){if(super(e),e.type!==ti.CHILD)throw Error("repeat() can only be used in text expressions")}dt(e,t,n){let s;n===void 0?n=t:t!==void 0&&(s=t);const i=[],a=[];let o=0;for(const l of e)i[o]=s?s(l,o):o,a[o]=n(l,o),o++;return{values:a,keys:i}}render(e,t,n){return this.dt(e,t,n).values}update(e,[t,n,s]){const i=Od(e),{values:a,keys:o}=this.dt(t,n,s);if(!Array.isArray(i))return this.ut=o,a;const l=this.ut??=[],r=[];let p,d,u=0,g=i.length-1,v=0,m=a.length-1;for(;u<=g&&v<=m;)if(i[u]===null)u++;else if(i[g]===null)g--;else if(l[u]===o[v])r[v]=Le(i[u],a[v]),u++,v++;else if(l[g]===o[m])r[m]=Le(i[g],a[m]),g--,m--;else if(l[u]===o[m])r[m]=Le(i[u],a[m]),lt(e,r[m+1],i[u]),u++,m--;else if(l[g]===o[v])r[v]=Le(i[g],a[v]),lt(e,i[u],i[g]),g--,v++;else if(p===void 0&&(p=ha(o,v,m),d=ha(l,u,g)),p.has(l[u]))if(p.has(l[g])){const $=d.get(o[v]),A=$!==void 0?i[$]:null;if(A===null){const _=lt(e,i[u]);Le(_,a[v]),r[v]=_}else r[v]=Le(A,a[v]),lt(e,i[u],A),i[$]=null;v++}else Gn(i[g]),g--;else Gn(i[u]),u++;for(;v<=m;){const $=lt(e,r[m+1]);Le($,a[v]),r[v++]=$}for(;u<=g;){const $=i[u++];$!==null&&Gn($)}return this.ut=o,Nd(e,r),Se}});function Yo(e){const t=e;let n=typeof t.role=="string"?t.role:"unknown";const s=typeof t.toolCallId=="string"||typeof t.tool_call_id=="string",i=t.content,a=Array.isArray(i)?i:null,o=Array.isArray(a)&&a.some(u=>{const v=String(u.type??"").toLowerCase();return v==="toolresult"||v==="tool_result"}),l=typeof t.toolName=="string"||typeof t.tool_name=="string";(s||o||l)&&(n="toolResult");let r=[];typeof t.content=="string"?r=[{type:"text",text:t.content}]:Array.isArray(t.content)?r=t.content.map(u=>({type:u.type||"text",text:u.text,name:u.name,args:u.args||u.arguments})):typeof t.text=="string"&&(r=[{type:"text",text:t.text}]);const p=typeof t.timestamp=="number"?t.timestamp:Date.now(),d=typeof t.id=="string"?t.id:void 0;return{role:n,content:r,timestamp:p,id:d}}function ii(e){const t=e.toLowerCase();return e==="user"||e==="User"?e:e==="assistant"?"assistant":e==="system"?"system":t==="toolresult"||t==="tool_result"||t==="tool"||t==="function"?"tool":e}function Qo(e){const t=e,n=typeof t.role=="string"?t.role.toLowerCase():"";return n==="toolresult"||n==="tool_result"}class ys extends si{constructor(t){if(super(t),this.it=f,t.type!==ti.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===f||t==null)return this._t=void 0,this.it=t;if(t===Se)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const n=[t];return n.raw=n,this._t={_$litType$:this.constructor.resultType,strings:n,values:[]}}}ys.directiveName="unsafeHTML",ys.resultType=1;const bs=ni(ys);const{entries:Zo,setPrototypeOf:fa,isFrozen:Hd,getPrototypeOf:zd,getOwnPropertyDescriptor:jd}=Object;let{freeze:Z,seal:ne,create:ws}=Object,{apply:$s,construct:xs}=typeof Reflect<"u"&&Reflect;Z||(Z=function(t){return t});ne||(ne=function(t){return t});$s||($s=function(t,n){for(var s=arguments.length,i=new Array(s>2?s-2:0),a=2;a<s;a++)i[a-2]=arguments[a];return t.apply(n,i)});xs||(xs=function(t){for(var n=arguments.length,s=new Array(n>1?n-1:0),i=1;i<n;i++)s[i-1]=arguments[i];return new t(...s)});const Ht=J(Array.prototype.forEach),qd=J(Array.prototype.lastIndexOf),ga=J(Array.prototype.pop),ct=J(Array.prototype.push),Wd=J(Array.prototype.splice),Gt=J(String.prototype.toLowerCase),Qn=J(String.prototype.toString),Zn=J(String.prototype.match),dt=J(String.prototype.replace),Vd=J(String.prototype.indexOf),Gd=J(String.prototype.trim),se=J(Object.prototype.hasOwnProperty),Y=J(RegExp.prototype.test),ut=Yd(TypeError);function J(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,s=new Array(n>1?n-1:0),i=1;i<n;i++)s[i-1]=arguments[i];return $s(e,t,s)}}function Yd(e){return function(){for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];return xs(e,n)}}function M(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Gt;fa&&fa(e,null);let s=t.length;for(;s--;){let i=t[s];if(typeof i=="string"){const a=n(i);a!==i&&(Hd(t)||(t[s]=a),i=a)}e[i]=!0}return e}function Qd(e){for(let t=0;t<e.length;t++)se(e,t)||(e[t]=null);return e}function de(e){const t=ws(null);for(const[n,s]of Zo(e))se(e,n)&&(Array.isArray(s)?t[n]=Qd(s):s&&typeof s=="object"&&s.constructor===Object?t[n]=de(s):t[n]=s);return t}function pt(e,t){for(;e!==null;){const s=jd(e,t);if(s){if(s.get)return J(s.get);if(typeof s.value=="function")return J(s.value)}e=zd(e)}function n(){return null}return n}const va=Z(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Jn=Z(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Xn=Z(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Zd=Z(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),es=Z(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Jd=Z(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),ma=Z(["#text"]),ya=Z(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),ts=Z(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),ba=Z(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),zt=Z(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Xd=ne(/\{\{[\w\W]*|[\w\W]*\}\}/gm),eu=ne(/<%[\w\W]*|[\w\W]*%>/gm),tu=ne(/\$\{[\w\W]*/gm),nu=ne(/^data-[\-\w.\u00B7-\uFFFF]+$/),su=ne(/^aria-[\-\w]+$/),Jo=ne(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),iu=ne(/^(?:\w+script|data):/i),au=ne(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Xo=ne(/^html$/i),ou=ne(/^[a-z][.\w]*(-[.\w]+)+$/i);var wa=Object.freeze({__proto__:null,ARIA_ATTR:su,ATTR_WHITESPACE:au,CUSTOM_ELEMENT:ou,DATA_ATTR:nu,DOCTYPE_NAME:Xo,ERB_EXPR:eu,IS_ALLOWED_URI:Jo,IS_SCRIPT_OR_DATA:iu,MUSTACHE_EXPR:Xd,TMPLIT_EXPR:tu});const ht={element:1,text:3,progressingInstruction:7,comment:8,document:9},ru=function(){return typeof window>"u"?null:window},lu=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let s=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(s=n.getAttribute(i));const a="dompurify"+(s?"#"+s:"");try{return t.createPolicy(a,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},$a=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function er(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ru();const t=T=>er(T);if(t.version="3.3.1",t.removed=[],!e||!e.document||e.document.nodeType!==ht.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e;const s=n,i=s.currentScript,{DocumentFragment:a,HTMLTemplateElement:o,Node:l,Element:r,NodeFilter:p,NamedNodeMap:d=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:u,DOMParser:g,trustedTypes:v}=e,m=r.prototype,$=pt(m,"cloneNode"),A=pt(m,"remove"),_=pt(m,"nextSibling"),L=pt(m,"childNodes"),P=pt(m,"parentNode");if(typeof o=="function"){const T=n.createElement("template");T.content&&T.content.ownerDocument&&(n=T.content.ownerDocument)}let I,C="";const{implementation:E,createNodeIterator:pe,createDocumentFragment:xn,getElementsByTagName:An}=n,{importNode:Er}=s;let G=$a();t.isSupported=typeof Zo=="function"&&typeof P=="function"&&E&&E.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:kn,ERB_EXPR:Sn,TMPLIT_EXPR:_n,DATA_ATTR:Ir,ARIA_ATTR:Lr,IS_SCRIPT_OR_DATA:Mr,ATTR_WHITESPACE:vi,CUSTOM_ELEMENT:Rr}=wa;let{IS_ALLOWED_URI:mi}=wa,K=null;const yi=M({},[...va,...Jn,...Xn,...es,...ma]);let z=null;const bi=M({},[...ya,...ts,...ba,...zt]);let B=Object.seal(ws(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),it=null,Tn=null;const He=Object.seal(ws(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let wi=!0,Cn=!0,$i=!1,xi=!0,ze=!1,Lt=!0,Ce=!1,En=!1,In=!1,je=!1,Mt=!1,Rt=!1,Ai=!0,ki=!1;const Pr="user-content-";let Ln=!0,at=!1,qe={},re=null;const Mn=M({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Si=null;const _i=M({},["audio","video","img","source","image","track"]);let Rn=null;const Ti=M({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Pt="http://www.w3.org/1998/Math/MathML",Nt="http://www.w3.org/2000/svg",he="http://www.w3.org/1999/xhtml";let We=he,Pn=!1,Nn=null;const Nr=M({},[Pt,Nt,he],Qn);let Ot=M({},["mi","mo","mn","ms","mtext"]),Dt=M({},["annotation-xml"]);const Or=M({},["title","style","font","a","script"]);let ot=null;const Dr=["application/xhtml+xml","text/html"],Br="text/html";let U=null,Ve=null;const Fr=n.createElement("form"),Ci=function(h){return h instanceof RegExp||h instanceof Function},On=function(){let h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Ve&&Ve===h)){if((!h||typeof h!="object")&&(h={}),h=de(h),ot=Dr.indexOf(h.PARSER_MEDIA_TYPE)===-1?Br:h.PARSER_MEDIA_TYPE,U=ot==="application/xhtml+xml"?Qn:Gt,K=se(h,"ALLOWED_TAGS")?M({},h.ALLOWED_TAGS,U):yi,z=se(h,"ALLOWED_ATTR")?M({},h.ALLOWED_ATTR,U):bi,Nn=se(h,"ALLOWED_NAMESPACES")?M({},h.ALLOWED_NAMESPACES,Qn):Nr,Rn=se(h,"ADD_URI_SAFE_ATTR")?M(de(Ti),h.ADD_URI_SAFE_ATTR,U):Ti,Si=se(h,"ADD_DATA_URI_TAGS")?M(de(_i),h.ADD_DATA_URI_TAGS,U):_i,re=se(h,"FORBID_CONTENTS")?M({},h.FORBID_CONTENTS,U):Mn,it=se(h,"FORBID_TAGS")?M({},h.FORBID_TAGS,U):de({}),Tn=se(h,"FORBID_ATTR")?M({},h.FORBID_ATTR,U):de({}),qe=se(h,"USE_PROFILES")?h.USE_PROFILES:!1,wi=h.ALLOW_ARIA_ATTR!==!1,Cn=h.ALLOW_DATA_ATTR!==!1,$i=h.ALLOW_UNKNOWN_PROTOCOLS||!1,xi=h.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ze=h.SAFE_FOR_TEMPLATES||!1,Lt=h.SAFE_FOR_XML!==!1,Ce=h.WHOLE_DOCUMENT||!1,je=h.RETURN_DOM||!1,Mt=h.RETURN_DOM_FRAGMENT||!1,Rt=h.RETURN_TRUSTED_TYPE||!1,In=h.FORCE_BODY||!1,Ai=h.SANITIZE_DOM!==!1,ki=h.SANITIZE_NAMED_PROPS||!1,Ln=h.KEEP_CONTENT!==!1,at=h.IN_PLACE||!1,mi=h.ALLOWED_URI_REGEXP||Jo,We=h.NAMESPACE||he,Ot=h.MATHML_TEXT_INTEGRATION_POINTS||Ot,Dt=h.HTML_INTEGRATION_POINTS||Dt,B=h.CUSTOM_ELEMENT_HANDLING||{},h.CUSTOM_ELEMENT_HANDLING&&Ci(h.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(B.tagNameCheck=h.CUSTOM_ELEMENT_HANDLING.tagNameCheck),h.CUSTOM_ELEMENT_HANDLING&&Ci(h.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(B.attributeNameCheck=h.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),h.CUSTOM_ELEMENT_HANDLING&&typeof h.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(B.allowCustomizedBuiltInElements=h.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ze&&(Cn=!1),Mt&&(je=!0),qe&&(K=M({},ma),z=[],qe.html===!0&&(M(K,va),M(z,ya)),qe.svg===!0&&(M(K,Jn),M(z,ts),M(z,zt)),qe.svgFilters===!0&&(M(K,Xn),M(z,ts),M(z,zt)),qe.mathMl===!0&&(M(K,es),M(z,ba),M(z,zt))),h.ADD_TAGS&&(typeof h.ADD_TAGS=="function"?He.tagCheck=h.ADD_TAGS:(K===yi&&(K=de(K)),M(K,h.ADD_TAGS,U))),h.ADD_ATTR&&(typeof h.ADD_ATTR=="function"?He.attributeCheck=h.ADD_ATTR:(z===bi&&(z=de(z)),M(z,h.ADD_ATTR,U))),h.ADD_URI_SAFE_ATTR&&M(Rn,h.ADD_URI_SAFE_ATTR,U),h.FORBID_CONTENTS&&(re===Mn&&(re=de(re)),M(re,h.FORBID_CONTENTS,U)),h.ADD_FORBID_CONTENTS&&(re===Mn&&(re=de(re)),M(re,h.ADD_FORBID_CONTENTS,U)),Ln&&(K["#text"]=!0),Ce&&M(K,["html","head","body"]),K.table&&(M(K,["tbody"]),delete it.tbody),h.TRUSTED_TYPES_POLICY){if(typeof h.TRUSTED_TYPES_POLICY.createHTML!="function")throw ut('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof h.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ut('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');I=h.TRUSTED_TYPES_POLICY,C=I.createHTML("")}else I===void 0&&(I=lu(v,i)),I!==null&&typeof C=="string"&&(C=I.createHTML(""));Z&&Z(h),Ve=h}},Ei=M({},[...Jn,...Xn,...Zd]),Ii=M({},[...es,...Jd]),Ur=function(h){let x=P(h);(!x||!x.tagName)&&(x={namespaceURI:We,tagName:"template"});const S=Gt(h.tagName),D=Gt(x.tagName);return Nn[h.namespaceURI]?h.namespaceURI===Nt?x.namespaceURI===he?S==="svg":x.namespaceURI===Pt?S==="svg"&&(D==="annotation-xml"||Ot[D]):!!Ei[S]:h.namespaceURI===Pt?x.namespaceURI===he?S==="math":x.namespaceURI===Nt?S==="math"&&Dt[D]:!!Ii[S]:h.namespaceURI===he?x.namespaceURI===Nt&&!Dt[D]||x.namespaceURI===Pt&&!Ot[D]?!1:!Ii[S]&&(Or[S]||!Ei[S]):!!(ot==="application/xhtml+xml"&&Nn[h.namespaceURI]):!1},le=function(h){ct(t.removed,{element:h});try{P(h).removeChild(h)}catch{A(h)}},Ee=function(h,x){try{ct(t.removed,{attribute:x.getAttributeNode(h),from:x})}catch{ct(t.removed,{attribute:null,from:x})}if(x.removeAttribute(h),h==="is")if(je||Mt)try{le(x)}catch{}else try{x.setAttribute(h,"")}catch{}},Li=function(h){let x=null,S=null;if(In)h="<remove></remove>"+h;else{const F=Zn(h,/^[\r\n\t ]+/);S=F&&F[0]}ot==="application/xhtml+xml"&&We===he&&(h='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+h+"</body></html>");const D=I?I.createHTML(h):h;if(We===he)try{x=new g().parseFromString(D,ot)}catch{}if(!x||!x.documentElement){x=E.createDocument(We,"template",null);try{x.documentElement.innerHTML=Pn?C:D}catch{}}const q=x.body||x.documentElement;return h&&S&&q.insertBefore(n.createTextNode(S),q.childNodes[0]||null),We===he?An.call(x,Ce?"html":"body")[0]:Ce?x.documentElement:q},Mi=function(h){return pe.call(h.ownerDocument||h,h,p.SHOW_ELEMENT|p.SHOW_COMMENT|p.SHOW_TEXT|p.SHOW_PROCESSING_INSTRUCTION|p.SHOW_CDATA_SECTION,null)},Dn=function(h){return h instanceof u&&(typeof h.nodeName!="string"||typeof h.textContent!="string"||typeof h.removeChild!="function"||!(h.attributes instanceof d)||typeof h.removeAttribute!="function"||typeof h.setAttribute!="function"||typeof h.namespaceURI!="string"||typeof h.insertBefore!="function"||typeof h.hasChildNodes!="function")},Ri=function(h){return typeof l=="function"&&h instanceof l};function fe(T,h,x){Ht(T,S=>{S.call(t,h,x,Ve)})}const Pi=function(h){let x=null;if(fe(G.beforeSanitizeElements,h,null),Dn(h))return le(h),!0;const S=U(h.nodeName);if(fe(G.uponSanitizeElement,h,{tagName:S,allowedTags:K}),Lt&&h.hasChildNodes()&&!Ri(h.firstElementChild)&&Y(/<[/\w!]/g,h.innerHTML)&&Y(/<[/\w!]/g,h.textContent)||h.nodeType===ht.progressingInstruction||Lt&&h.nodeType===ht.comment&&Y(/<[/\w]/g,h.data))return le(h),!0;if(!(He.tagCheck instanceof Function&&He.tagCheck(S))&&(!K[S]||it[S])){if(!it[S]&&Oi(S)&&(B.tagNameCheck instanceof RegExp&&Y(B.tagNameCheck,S)||B.tagNameCheck instanceof Function&&B.tagNameCheck(S)))return!1;if(Ln&&!re[S]){const D=P(h)||h.parentNode,q=L(h)||h.childNodes;if(q&&D){const F=q.length;for(let X=F-1;X>=0;--X){const ge=$(q[X],!0);ge.__removalCount=(h.__removalCount||0)+1,D.insertBefore(ge,_(h))}}}return le(h),!0}return h instanceof r&&!Ur(h)||(S==="noscript"||S==="noembed"||S==="noframes")&&Y(/<\/no(script|embed|frames)/i,h.innerHTML)?(le(h),!0):(ze&&h.nodeType===ht.text&&(x=h.textContent,Ht([kn,Sn,_n],D=>{x=dt(x,D," ")}),h.textContent!==x&&(ct(t.removed,{element:h.cloneNode()}),h.textContent=x)),fe(G.afterSanitizeElements,h,null),!1)},Ni=function(h,x,S){if(Ai&&(x==="id"||x==="name")&&(S in n||S in Fr))return!1;if(!(Cn&&!Tn[x]&&Y(Ir,x))){if(!(wi&&Y(Lr,x))){if(!(He.attributeCheck instanceof Function&&He.attributeCheck(x,h))){if(!z[x]||Tn[x]){if(!(Oi(h)&&(B.tagNameCheck instanceof RegExp&&Y(B.tagNameCheck,h)||B.tagNameCheck instanceof Function&&B.tagNameCheck(h))&&(B.attributeNameCheck instanceof RegExp&&Y(B.attributeNameCheck,x)||B.attributeNameCheck instanceof Function&&B.attributeNameCheck(x,h))||x==="is"&&B.allowCustomizedBuiltInElements&&(B.tagNameCheck instanceof RegExp&&Y(B.tagNameCheck,S)||B.tagNameCheck instanceof Function&&B.tagNameCheck(S))))return!1}else if(!Rn[x]){if(!Y(mi,dt(S,vi,""))){if(!((x==="src"||x==="xlink:href"||x==="href")&&h!=="script"&&Vd(S,"data:")===0&&Si[h])){if(!($i&&!Y(Mr,dt(S,vi,"")))){if(S)return!1}}}}}}}return!0},Oi=function(h){return h!=="annotation-xml"&&Zn(h,Rr)},Di=function(h){fe(G.beforeSanitizeAttributes,h,null);const{attributes:x}=h;if(!x||Dn(h))return;const S={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:z,forceKeepAttr:void 0};let D=x.length;for(;D--;){const q=x[D],{name:F,namespaceURI:X,value:ge}=q,Ge=U(F),Bn=ge;let j=F==="value"?Bn:Gd(Bn);if(S.attrName=Ge,S.attrValue=j,S.keepAttr=!0,S.forceKeepAttr=void 0,fe(G.uponSanitizeAttribute,h,S),j=S.attrValue,ki&&(Ge==="id"||Ge==="name")&&(Ee(F,h),j=Pr+j),Lt&&Y(/((--!?|])>)|<\/(style|title|textarea)/i,j)){Ee(F,h);continue}if(Ge==="attributename"&&Zn(j,"href")){Ee(F,h);continue}if(S.forceKeepAttr)continue;if(!S.keepAttr){Ee(F,h);continue}if(!xi&&Y(/\/>/i,j)){Ee(F,h);continue}ze&&Ht([kn,Sn,_n],Fi=>{j=dt(j,Fi," ")});const Bi=U(h.nodeName);if(!Ni(Bi,Ge,j)){Ee(F,h);continue}if(I&&typeof v=="object"&&typeof v.getAttributeType=="function"&&!X)switch(v.getAttributeType(Bi,Ge)){case"TrustedHTML":{j=I.createHTML(j);break}case"TrustedScriptURL":{j=I.createScriptURL(j);break}}if(j!==Bn)try{X?h.setAttributeNS(X,F,j):h.setAttribute(F,j),Dn(h)?le(h):ga(t.removed)}catch{Ee(F,h)}}fe(G.afterSanitizeAttributes,h,null)},Kr=function T(h){let x=null;const S=Mi(h);for(fe(G.beforeSanitizeShadowDOM,h,null);x=S.nextNode();)fe(G.uponSanitizeShadowNode,x,null),Pi(x),Di(x),x.content instanceof a&&T(x.content);fe(G.afterSanitizeShadowDOM,h,null)};return t.sanitize=function(T){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},x=null,S=null,D=null,q=null;if(Pn=!T,Pn&&(T="<!-->"),typeof T!="string"&&!Ri(T))if(typeof T.toString=="function"){if(T=T.toString(),typeof T!="string")throw ut("dirty is not a string, aborting")}else throw ut("toString is not a function");if(!t.isSupported)return T;if(En||On(h),t.removed=[],typeof T=="string"&&(at=!1),at){if(T.nodeName){const ge=U(T.nodeName);if(!K[ge]||it[ge])throw ut("root node is forbidden and cannot be sanitized in-place")}}else if(T instanceof l)x=Li("<!---->"),S=x.ownerDocument.importNode(T,!0),S.nodeType===ht.element&&S.nodeName==="BODY"||S.nodeName==="HTML"?x=S:x.appendChild(S);else{if(!je&&!ze&&!Ce&&T.indexOf("<")===-1)return I&&Rt?I.createHTML(T):T;if(x=Li(T),!x)return je?null:Rt?C:""}x&&In&&le(x.firstChild);const F=Mi(at?T:x);for(;D=F.nextNode();)Pi(D),Di(D),D.content instanceof a&&Kr(D.content);if(at)return T;if(je){if(Mt)for(q=xn.call(x.ownerDocument);x.firstChild;)q.appendChild(x.firstChild);else q=x;return(z.shadowroot||z.shadowrootmode)&&(q=Er.call(s,q,!0)),q}let X=Ce?x.outerHTML:x.innerHTML;return Ce&&K["!doctype"]&&x.ownerDocument&&x.ownerDocument.doctype&&x.ownerDocument.doctype.name&&Y(Xo,x.ownerDocument.doctype.name)&&(X="<!DOCTYPE "+x.ownerDocument.doctype.name+`>
|
|
17
|
-
`+X),
|
|
18
|
-
]`).replace("lheading",
|
|
19
|
-
`).map(a=>{let o=a.match(n.other.beginningSpace);if(o===null)return a;let[
|
|
20
|
-
`)}var nn=class{options;rules;lexer;constructor(e){this.options=e||
|
|
21
|
-
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],s=
|
|
22
|
-
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=
|
|
15
|
+
`],{type:"text/plain"}),s=URL.createObjectURL(n),i=document.createElement("a"),a=new Date().toISOString().slice(0,19).replace(/[:T]/g,"-");i.href=s,i.download=`openclaw-logs-${t}-${a}.log`,i.click(),URL.revokeObjectURL(s)}function ic(e){if(typeof ResizeObserver>"u")return;const t=e.querySelector(".topbar");if(!t)return;const n=()=>{const{height:s}=t.getBoundingClientRect();e.style.setProperty("--topbar-height",`${s}px`)};n(),e.topbarObserver=new ResizeObserver(()=>n()),e.topbarObserver.observe(t)}function De(e){return typeof structuredClone=="function"?structuredClone(e):JSON.parse(JSON.stringify(e))}function et(e){return`${JSON.stringify(e,null,2).trimEnd()}
|
|
16
|
+
`}function bo(e,t,n){if(t.length===0)return;let s=e;for(let a=0;a<t.length-1;a+=1){const o=t[a],r=t[a+1];if(typeof o=="number"){if(!Array.isArray(s))return;s[o]==null&&(s[o]=typeof r=="number"?[]:{}),s=s[o]}else{if(typeof s!="object"||s==null)return;const l=s;l[o]==null&&(l[o]=typeof r=="number"?[]:{}),s=l[o]}}const i=t[t.length-1];if(typeof i=="number"){Array.isArray(s)&&(s[i]=n);return}typeof s=="object"&&s!=null&&(s[i]=n)}function wo(e,t){if(t.length===0)return;let n=e;for(let i=0;i<t.length-1;i+=1){const a=t[i];if(typeof a=="number"){if(!Array.isArray(n))return;n=n[a]}else{if(typeof n!="object"||n==null)return;n=n[a]}if(n==null)return}const s=t[t.length-1];if(typeof s=="number"){Array.isArray(n)&&n.splice(s,1);return}typeof n=="object"&&n!=null&&delete n[s]}async function ye(e){if(!(!e.client||!e.connected)){e.configLoading=!0,e.lastError=null;try{const t=await e.client.request("config.get",{});oc(e,t)}catch(t){e.lastError=String(t)}finally{e.configLoading=!1}}}async function $o(e){if(!(!e.client||!e.connected)&&!e.configSchemaLoading){e.configSchemaLoading=!0;try{const t=await e.client.request("config.schema",{});ac(e,t)}catch(t){e.lastError=String(t)}finally{e.configSchemaLoading=!1}}}function ac(e,t){e.configSchema=t.schema??null,e.configUiHints=t.uiHints??{},e.configSchemaVersion=t.version??null}function oc(e,t){e.configSnapshot=t;const n=typeof t.raw=="string"?t.raw:t.config&&typeof t.config=="object"?et(t.config):e.configRaw;!e.configFormDirty||e.configFormMode==="raw"?e.configRaw=n:e.configForm?e.configRaw=et(e.configForm):e.configRaw=n,e.configValid=typeof t.valid=="boolean"?t.valid:null,e.configIssues=Array.isArray(t.issues)?t.issues:[],e.configFormDirty||(e.configForm=De(t.config??{}),e.configFormOriginal=De(t.config??{}),e.configRawOriginal=n)}async function ps(e){if(!(!e.client||!e.connected)){e.configSaving=!0,e.lastError=null;try{const t=e.configFormMode==="form"&&e.configForm?et(e.configForm):e.configRaw,n=e.configSnapshot?.hash;if(!n){e.lastError="Config hash missing; reload and retry.";return}await e.client.request("config.set",{raw:t,baseHash:n}),e.configFormDirty=!1,await ye(e)}catch(t){e.lastError=String(t)}finally{e.configSaving=!1}}}async function rc(e){if(!(!e.client||!e.connected)){e.configApplying=!0,e.lastError=null;try{const t=e.configFormMode==="form"&&e.configForm?et(e.configForm):e.configRaw,n=e.configSnapshot?.hash;if(!n){e.lastError="Config hash missing; reload and retry.";return}await e.client.request("config.apply",{raw:t,baseHash:n,sessionKey:e.applySessionKey}),e.configFormDirty=!1,await ye(e)}catch(t){e.lastError=String(t)}finally{e.configApplying=!1}}}async function lc(e){if(!(!e.client||!e.connected)){e.updateRunning=!0,e.lastError=null;try{await e.client.request("update.run",{sessionKey:e.applySessionKey})}catch(t){e.lastError=String(t)}finally{e.updateRunning=!1}}}function Ft(e,t,n){const s=De(e.configForm??e.configSnapshot?.config??{});bo(s,t,n),e.configForm=s,e.configFormDirty=!0,e.configFormMode==="form"&&(e.configRaw=et(s))}function oa(e,t){const n=De(e.configForm??e.configSnapshot?.config??{});wo(n,t),e.configForm=n,e.configFormDirty=!0,e.configFormMode==="form"&&(e.configRaw=et(n))}async function Tt(e){if(!(!e.client||!e.connected))try{const t=await e.client.request("cron.status",{});e.cronStatus=t}catch(t){e.cronError=String(t)}}async function pn(e){if(!(!e.client||!e.connected)&&!e.cronLoading){e.cronLoading=!0,e.cronError=null;try{const t=await e.client.request("cron.list",{includeDisabled:!0});e.cronJobs=Array.isArray(t.jobs)?t.jobs:[]}catch(t){e.cronError=String(t)}finally{e.cronLoading=!1}}}function cc(e){if(e.scheduleKind==="at"){const n=Date.parse(e.scheduleAt);if(!Number.isFinite(n))throw new Error("Invalid run time.");return{kind:"at",atMs:n}}if(e.scheduleKind==="every"){const n=Zt(e.everyAmount,0);if(n<=0)throw new Error("Invalid interval amount.");const s=e.everyUnit;return{kind:"every",everyMs:n*(s==="minutes"?6e4:s==="hours"?36e5:864e5)}}const t=e.cronExpr.trim();if(!t)throw new Error("Cron expression required.");return{kind:"cron",expr:t,tz:e.cronTz.trim()||void 0}}function dc(e){if(e.payloadKind==="systemEvent"){const i=e.payloadText.trim();if(!i)throw new Error("System event text required.");return{kind:"systemEvent",text:i}}const t=e.payloadText.trim();if(!t)throw new Error("Agent message required.");const n={kind:"agentTurn",message:t};e.deliver&&(n.deliver=!0),e.channel&&(n.channel=e.channel),e.to.trim()&&(n.to=e.to.trim());const s=Zt(e.timeoutSeconds,0);return s>0&&(n.timeoutSeconds=s),n}async function uc(e){if(!(!e.client||!e.connected||e.cronBusy)){e.cronBusy=!0,e.cronError=null;try{const t=cc(e.cronForm),n=dc(e.cronForm),s=e.cronForm.agentId.trim(),i={name:e.cronForm.name.trim(),description:e.cronForm.description.trim()||void 0,agentId:s||void 0,enabled:e.cronForm.enabled,schedule:t,sessionTarget:e.cronForm.sessionTarget,wakeMode:e.cronForm.wakeMode,payload:n,isolation:e.cronForm.postToMainPrefix.trim()&&e.cronForm.sessionTarget==="isolated"?{postToMainPrefix:e.cronForm.postToMainPrefix.trim()}:void 0};if(!i.name)throw new Error("Name required.");await e.client.request("cron.add",i),e.cronForm={...e.cronForm,name:"",description:"",payloadText:""},await pn(e),await Tt(e)}catch(t){e.cronError=String(t)}finally{e.cronBusy=!1}}}async function pc(e,t,n){if(!(!e.client||!e.connected||e.cronBusy)){e.cronBusy=!0,e.cronError=null;try{await e.client.request("cron.update",{id:t.id,patch:{enabled:n}}),await pn(e),await Tt(e)}catch(s){e.cronError=String(s)}finally{e.cronBusy=!1}}}async function hc(e,t){if(!(!e.client||!e.connected||e.cronBusy)){e.cronBusy=!0,e.cronError=null;try{await e.client.request("cron.run",{id:t.id,mode:"force"}),await xo(e,t.id)}catch(n){e.cronError=String(n)}finally{e.cronBusy=!1}}}async function fc(e,t){if(!(!e.client||!e.connected||e.cronBusy)){e.cronBusy=!0,e.cronError=null;try{await e.client.request("cron.remove",{id:t.id}),e.cronRunsJobId===t.id&&(e.cronRunsJobId=null,e.cronRuns=[]),await pn(e),await Tt(e)}catch(n){e.cronError=String(n)}finally{e.cronBusy=!1}}}async function xo(e,t){if(!(!e.client||!e.connected))try{const n=await e.client.request("cron.runs",{id:t,limit:50});e.cronRunsJobId=t,e.cronRuns=Array.isArray(n.entries)?n.entries:[]}catch(n){e.cronError=String(n)}}async function oe(e,t){if(!(!e.client||!e.connected)&&!e.channelsLoading){e.channelsLoading=!0,e.channelsError=null;try{const n=await e.client.request("channels.status",{probe:t,timeoutMs:8e3});e.channelsSnapshot=n,e.channelsLastSuccess=Date.now()}catch(n){e.channelsError=String(n)}finally{e.channelsLoading=!1}}}async function gc(e,t){if(!(!e.client||!e.connected||e.whatsappBusy)){e.whatsappBusy=!0;try{const n=await e.client.request("web.login.start",{force:t,timeoutMs:3e4});e.whatsappLoginMessage=n.message??null,e.whatsappLoginQrDataUrl=n.qrDataUrl??null,e.whatsappLoginConnected=null}catch(n){e.whatsappLoginMessage=String(n),e.whatsappLoginQrDataUrl=null,e.whatsappLoginConnected=null}finally{e.whatsappBusy=!1}}}async function vc(e){if(!(!e.client||!e.connected||e.whatsappBusy)){e.whatsappBusy=!0;try{const t=await e.client.request("web.login.wait",{timeoutMs:12e4});e.whatsappLoginMessage=t.message??null,e.whatsappLoginConnected=t.connected??null,t.connected&&(e.whatsappLoginQrDataUrl=null)}catch(t){e.whatsappLoginMessage=String(t),e.whatsappLoginConnected=null}finally{e.whatsappBusy=!1}}}async function mc(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}}}async function hn(e){if(!(!e.client||!e.connected)&&!e.debugLoading){e.debugLoading=!0;try{const[t,n,s,i]=await Promise.all([e.client.request("status",{}),e.client.request("health",{}),e.client.request("models.list",{}),e.client.request("last-heartbeat",{})]);e.debugStatus=t,e.debugHealth=n;const a=s;e.debugModels=Array.isArray(a?.models)?a?.models:[],e.debugHeartbeat=i}catch(t){e.debugCallError=String(t)}finally{e.debugLoading=!1}}}async function yc(e){if(!(!e.client||!e.connected)){e.debugCallError=null,e.debugCallResult=null;try{const t=e.debugCallParams.trim()?JSON.parse(e.debugCallParams):{},n=await e.client.request(e.debugCallMethod.trim(),t);e.debugCallResult=JSON.stringify(n,null,2)}catch(t){e.debugCallError=String(t)}}}const bc=2e3,wc=new Set(["trace","debug","info","warn","error","fatal"]);function $c(e){if(typeof e!="string")return null;const t=e.trim();if(!t.startsWith("{")||!t.endsWith("}"))return null;try{const n=JSON.parse(t);return!n||typeof n!="object"?null:n}catch{return null}}function xc(e){if(typeof e!="string")return null;const t=e.toLowerCase();return wc.has(t)?t:null}function Ac(e){if(!e.trim())return{raw:e,message:e};try{const t=JSON.parse(e),n=t&&typeof t._meta=="object"&&t._meta!==null?t._meta:null,s=typeof t.time=="string"?t.time:typeof n?.date=="string"?n?.date:null,i=xc(n?.logLevelName??n?.level),a=typeof t[0]=="string"?t[0]:typeof n?.name=="string"?n?.name:null,o=$c(a);let r=null;o&&(typeof o.subsystem=="string"?r=o.subsystem:typeof o.module=="string"&&(r=o.module)),!r&&a&&a.length<120&&(r=a);let l=null;return typeof t[1]=="string"?l=t[1]:!o&&typeof t[0]=="string"?l=t[0]:typeof t.message=="string"&&(l=t.message),{raw:e,time:s,level:i,subsystem:r,message:l??e,meta:n??void 0}}catch{return{raw:e,message:e}}}async function Fs(e,t){if(!(!e.client||!e.connected)&&!(e.logsLoading&&!t?.quiet)){t?.quiet||(e.logsLoading=!0),e.logsError=null;try{const s=await e.client.request("logs.tail",{cursor:t?.reset?void 0:e.logsCursor??void 0,limit:e.logsLimit,maxBytes:e.logsMaxBytes}),a=(Array.isArray(s.lines)?s.lines.filter(r=>typeof r=="string"):[]).map(Ac),o=!!(t?.reset||s.reset||e.logsCursor==null);e.logsEntries=o?a:[...e.logsEntries,...a].slice(-bc),typeof s.cursor=="number"&&(e.logsCursor=s.cursor),typeof s.file=="string"&&(e.logsFile=s.file),e.logsTruncated=!!s.truncated,e.logsLastFetchAt=Date.now()}catch(n){e.logsError=String(n)}finally{t?.quiet||(e.logsLoading=!1)}}}const Ao={p:0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffedn,n:0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3edn,h:8n,a:0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffecn,d:0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3n,Gx:0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51an,Gy:0x6666666666666666666666666666666666666666666666666666666666666658n},{p:G,n:Wt,Gx:ra,Gy:la,a:jn,d:qn,h:kc}=Ao,Be=32,Us=64,Sc=(...e)=>{"captureStackTrace"in Error&&typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(...e)},H=(e="")=>{const t=new Error(e);throw Sc(t,H),t},_c=e=>typeof e=="bigint",Cc=e=>typeof e=="string",Tc=e=>e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array",_e=(e,t,n="")=>{const s=Tc(e),i=e?.length,a=t!==void 0;if(!s||a&&i!==t){const o=n&&`"${n}" `,r=a?` of length ${t}`:"",l=s?`length=${i}`:`type=${typeof e}`;H(o+"expected Uint8Array"+r+", got "+l)}return e},fn=e=>new Uint8Array(e),ko=e=>Uint8Array.from(e),So=(e,t)=>e.toString(16).padStart(t,"0"),_o=e=>Array.from(_e(e)).map(t=>So(t,2)).join(""),ve={_0:48,_9:57,A:65,F:70,a:97,f:102},ca=e=>{if(e>=ve._0&&e<=ve._9)return e-ve._0;if(e>=ve.A&&e<=ve.F)return e-(ve.A-10);if(e>=ve.a&&e<=ve.f)return e-(ve.a-10)},Co=e=>{const t="hex invalid";if(!Cc(e))return H(t);const n=e.length,s=n/2;if(n%2)return H(t);const i=fn(s);for(let a=0,o=0;a<s;a++,o+=2){const r=ca(e.charCodeAt(o)),l=ca(e.charCodeAt(o+1));if(r===void 0||l===void 0)return H(t);i[a]=r*16+l}return i},To=()=>globalThis?.crypto,Ec=()=>To()?.subtle??H("crypto.subtle must be defined, consider polyfill"),_t=(...e)=>{const t=fn(e.reduce((s,i)=>s+_e(i).length,0));let n=0;return e.forEach(s=>{t.set(s,n),n+=s.length}),t},Mc=(e=Be)=>To().getRandomValues(fn(e)),Jt=BigInt,Re=(e,t,n,s="bad number: out of range")=>_c(e)&&t<=e&&e<n?e:H(s),k=(e,t=G)=>{const n=e%t;return n>=0n?n:t+n},Eo=e=>k(e,Wt),Lc=(e,t)=>{(e===0n||t<=0n)&&H("no inverse n="+e+" mod="+t);let n=k(e,t),s=t,i=0n,a=1n;for(;n!==0n;){const o=s/n,r=s%n,l=i-a*o;s=n,n=r,i=a,a=l}return s===1n?k(i,t):H("no inverse")},Ic=e=>{const t=Ro[e];return typeof t!="function"&&H("hashes."+e+" not set"),t},Gn=e=>e instanceof ee?e:H("Point expected"),hs=2n**256n;class ee{static BASE;static ZERO;X;Y;Z;T;constructor(t,n,s,i){const a=hs;this.X=Re(t,0n,a),this.Y=Re(n,0n,a),this.Z=Re(s,1n,a),this.T=Re(i,0n,a),Object.freeze(this)}static CURVE(){return Ao}static fromAffine(t){return new ee(t.x,t.y,1n,k(t.x*t.y))}static fromBytes(t,n=!1){const s=qn,i=ko(_e(t,Be)),a=t[31];i[31]=a&-129;const o=Lo(i);Re(o,0n,n?hs:G);const l=k(o*o),p=k(l-1n),d=k(s*l+1n);let{isValid:u,value:g}=Pc(p,d);u||H("bad point: y not sqrt");const v=(g&1n)===1n,y=(a&128)!==0;return!n&&g===0n&&y&&H("bad point: x==0, isLastByteOdd"),y!==v&&(g=k(-g)),new ee(g,o,1n,k(g*o))}static fromHex(t,n){return ee.fromBytes(Co(t),n)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}assertValidity(){const t=jn,n=qn,s=this;if(s.is0())return H("bad point: ZERO");const{X:i,Y:a,Z:o,T:r}=s,l=k(i*i),p=k(a*a),d=k(o*o),u=k(d*d),g=k(l*t),v=k(d*k(g+p)),y=k(u+k(n*k(l*p)));if(v!==y)return H("bad point: equation left != right (1)");const $=k(i*a),A=k(o*r);return $!==A?H("bad point: equation left != right (2)"):this}equals(t){const{X:n,Y:s,Z:i}=this,{X:a,Y:o,Z:r}=Gn(t),l=k(n*r),p=k(a*i),d=k(s*r),u=k(o*i);return l===p&&d===u}is0(){return this.equals(Ze)}negate(){return new ee(k(-this.X),this.Y,this.Z,k(-this.T))}double(){const{X:t,Y:n,Z:s}=this,i=jn,a=k(t*t),o=k(n*n),r=k(2n*k(s*s)),l=k(i*a),p=t+n,d=k(k(p*p)-a-o),u=l+o,g=u-r,v=l-o,y=k(d*g),$=k(u*v),A=k(d*v),_=k(g*u);return new ee(y,$,_,A)}add(t){const{X:n,Y:s,Z:i,T:a}=this,{X:o,Y:r,Z:l,T:p}=Gn(t),d=jn,u=qn,g=k(n*o),v=k(s*r),y=k(a*u*p),$=k(i*l),A=k((n+s)*(o+r)-g-v),_=k($-y),L=k($+y),P=k(v-d*g),M=k(A*_),T=k(L*P),E=k(A*P),pe=k(_*L);return new ee(M,T,pe,E)}subtract(t){return this.add(Gn(t).negate())}multiply(t,n=!0){if(!n&&(t===0n||this.is0()))return Ze;if(Re(t,1n,Wt),t===1n)return this;if(this.equals(Fe))return qc(t).p;let s=Ze,i=Fe;for(let a=this;t>0n;a=a.double(),t>>=1n)t&1n?s=s.add(a):n&&(i=i.add(a));return s}multiplyUnsafe(t){return this.multiply(t,!1)}toAffine(){const{X:t,Y:n,Z:s}=this;if(this.equals(Ze))return{x:0n,y:1n};const i=Lc(s,G);k(s*i)!==1n&&H("invalid inverse");const a=k(t*i),o=k(n*i);return{x:a,y:o}}toBytes(){const{x:t,y:n}=this.assertValidity().toAffine(),s=Mo(n);return s[31]|=t&1n?128:0,s}toHex(){return _o(this.toBytes())}clearCofactor(){return this.multiply(Jt(kc),!1)}isSmallOrder(){return this.clearCofactor().is0()}isTorsionFree(){let t=this.multiply(Wt/2n,!1).double();return Wt%2n&&(t=t.add(this)),t.is0()}}const Fe=new ee(ra,la,1n,k(ra*la)),Ze=new ee(0n,1n,1n,0n);ee.BASE=Fe;ee.ZERO=Ze;const Mo=e=>Co(So(Re(e,0n,hs),Us)).reverse(),Lo=e=>Jt("0x"+_o(ko(_e(e)).reverse())),ce=(e,t)=>{let n=e;for(;t-- >0n;)n*=n,n%=G;return n},Rc=e=>{const n=e*e%G*e%G,s=ce(n,2n)*n%G,i=ce(s,1n)*e%G,a=ce(i,5n)*i%G,o=ce(a,10n)*a%G,r=ce(o,20n)*o%G,l=ce(r,40n)*r%G,p=ce(l,80n)*l%G,d=ce(p,80n)*l%G,u=ce(d,10n)*a%G;return{pow_p_5_8:ce(u,2n)*e%G,b2:n}},da=0x2b8324804fc1df0b2b4d00993dfbd7a72f431806ad2fe478c4ee1b274a0ea0b0n,Pc=(e,t)=>{const n=k(t*t*t),s=k(n*n*t),i=Rc(e*s).pow_p_5_8;let a=k(e*n*i);const o=k(t*a*a),r=a,l=k(a*da),p=o===e,d=o===k(-e),u=o===k(-e*da);return p&&(a=r),(d||u)&&(a=l),(k(a)&1n)===1n&&(a=k(-a)),{isValid:p||d,value:a}},fs=e=>Eo(Lo(e)),Ks=(...e)=>Ro.sha512Async(_t(...e)),Nc=(...e)=>Ic("sha512")(_t(...e)),Io=e=>{const t=e.slice(0,Be);t[0]&=248,t[31]&=127,t[31]|=64;const n=e.slice(Be,Us),s=fs(t),i=Fe.multiply(s),a=i.toBytes();return{head:t,prefix:n,scalar:s,point:i,pointBytes:a}},Hs=e=>Ks(_e(e,Be)).then(Io),Oc=e=>Io(Nc(_e(e,Be))),Dc=e=>Hs(e).then(t=>t.pointBytes),Bc=e=>Ks(e.hashable).then(e.finish),Fc=(e,t,n)=>{const{pointBytes:s,scalar:i}=e,a=fs(t),o=Fe.multiply(a).toBytes();return{hashable:_t(o,s,n),finish:p=>{const d=Eo(a+fs(p)*i);return _e(_t(o,Mo(d)),Us)}}},Uc=async(e,t)=>{const n=_e(e),s=await Hs(t),i=await Ks(s.prefix,n);return Bc(Fc(s,i,n))},Ro={sha512Async:async e=>{const t=Ec(),n=_t(e);return fn(await t.digest("SHA-512",n.buffer))},sha512:void 0},Kc=(e=Mc(Be))=>e,Hc={getExtendedPublicKeyAsync:Hs,getExtendedPublicKey:Oc,randomSecretKey:Kc},Xt=8,zc=256,Po=Math.ceil(zc/Xt)+1,gs=2**(Xt-1),jc=()=>{const e=[];let t=Fe,n=t;for(let s=0;s<Po;s++){n=t,e.push(n);for(let i=1;i<gs;i++)n=n.add(t),e.push(n);t=n.double()}return e};let ua;const pa=(e,t)=>{const n=t.negate();return e?n:t},qc=e=>{const t=ua||(ua=jc());let n=Ze,s=Fe;const i=2**Xt,a=i,o=Jt(i-1),r=Jt(Xt);for(let l=0;l<Po;l++){let p=Number(e&o);e>>=r,p>gs&&(p-=a,e+=1n);const d=l*gs,u=d,g=d+Math.abs(p)-1,v=l%2!==0,y=p<0;p===0?s=s.add(pa(v,t[u])):n=n.add(pa(y,t[g]))}return e!==0n&&H("invalid wnaf"),{p:n,f:s}},Wn="openclaw-device-identity-v1";function vs(e){let t="";for(const n of e)t+=String.fromCharCode(n);return btoa(t).replaceAll("+","-").replaceAll("/","_").replace(/=+$/g,"")}function No(e){const t=e.replaceAll("-","+").replaceAll("_","/"),n=t+"=".repeat((4-t.length%4)%4),s=atob(n),i=new Uint8Array(s.length);for(let a=0;a<s.length;a+=1)i[a]=s.charCodeAt(a);return i}function Gc(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}async function Oo(e){const t=await crypto.subtle.digest("SHA-256",e);return Gc(new Uint8Array(t))}async function Wc(){const e=Hc.randomSecretKey(),t=await Dc(e);return{deviceId:await Oo(t),publicKey:vs(t),privateKey:vs(e)}}async function zs(){try{const n=localStorage.getItem(Wn);if(n){const s=JSON.parse(n);if(s?.version===1&&typeof s.deviceId=="string"&&typeof s.publicKey=="string"&&typeof s.privateKey=="string"){const i=await Oo(No(s.publicKey));if(i!==s.deviceId){const a={...s,deviceId:i};return localStorage.setItem(Wn,JSON.stringify(a)),{deviceId:i,publicKey:s.publicKey,privateKey:s.privateKey}}return{deviceId:s.deviceId,publicKey:s.publicKey,privateKey:s.privateKey}}}}catch{}const e=await Wc(),t={version:1,deviceId:e.deviceId,publicKey:e.publicKey,privateKey:e.privateKey,createdAtMs:Date.now()};return localStorage.setItem(Wn,JSON.stringify(t)),e}async function Vc(e,t){const n=No(e),s=new TextEncoder().encode(t),i=await Uc(s,n);return vs(i)}const Do="openclaw.device.auth.v1";function js(e){return e.trim()}function Yc(e){if(!Array.isArray(e))return[];const t=new Set;for(const n of e){const s=n.trim();s&&t.add(s)}return[...t].sort()}function qs(){try{const e=window.localStorage.getItem(Do);if(!e)return null;const t=JSON.parse(e);return!t||t.version!==1||!t.deviceId||typeof t.deviceId!="string"||!t.tokens||typeof t.tokens!="object"?null:t}catch{return null}}function Bo(e){try{window.localStorage.setItem(Do,JSON.stringify(e))}catch{}}function Qc(e){const t=qs();if(!t||t.deviceId!==e.deviceId)return null;const n=js(e.role),s=t.tokens[n];return!s||typeof s.token!="string"?null:s}function Fo(e){const t=js(e.role),n={version:1,deviceId:e.deviceId,tokens:{}},s=qs();s&&s.deviceId===e.deviceId&&(n.tokens={...s.tokens});const i={token:e.token,role:t,scopes:Yc(e.scopes),updatedAtMs:Date.now()};return n.tokens[t]=i,Bo(n),i}function Uo(e){const t=qs();if(!t||t.deviceId!==e.deviceId)return;const n=js(e.role);if(!t.tokens[n])return;const s={...t,tokens:{...t.tokens}};delete s.tokens[n],Bo(s)}async function Ce(e,t){if(!(!e.client||!e.connected)&&!e.devicesLoading){e.devicesLoading=!0,t?.quiet||(e.devicesError=null);try{const n=await e.client.request("device.pair.list",{});e.devicesList={pending:Array.isArray(n?.pending)?n.pending:[],paired:Array.isArray(n?.paired)?n.paired:[]}}catch(n){t?.quiet||(e.devicesError=String(n))}finally{e.devicesLoading=!1}}}async function Zc(e,t){if(!(!e.client||!e.connected))try{await e.client.request("device.pair.approve",{requestId:t}),await Ce(e)}catch(n){e.devicesError=String(n)}}async function Jc(e,t){if(!(!e.client||!e.connected||!window.confirm("Reject this device pairing request?")))try{await e.client.request("device.pair.reject",{requestId:t}),await Ce(e)}catch(s){e.devicesError=String(s)}}async function Xc(e,t){if(!(!e.client||!e.connected))try{const n=await e.client.request("device.token.rotate",t);if(n?.token){const s=await zs(),i=n.role??t.role;(n.deviceId===s.deviceId||t.deviceId===s.deviceId)&&Fo({deviceId:s.deviceId,role:i,token:n.token,scopes:n.scopes??t.scopes??[]}),window.prompt("New device token (copy and store securely):",n.token)}await Ce(e)}catch(n){e.devicesError=String(n)}}async function ed(e,t){if(!(!e.client||!e.connected||!window.confirm(`Revoke token for ${t.deviceId} (${t.role})?`)))try{await e.client.request("device.token.revoke",t);const s=await zs();t.deviceId===s.deviceId&&Uo({deviceId:s.deviceId,role:t.role}),await Ce(e)}catch(s){e.devicesError=String(s)}}async function gn(e,t){if(!(!e.client||!e.connected)&&!e.nodesLoading){e.nodesLoading=!0,t?.quiet||(e.lastError=null);try{const n=await e.client.request("node.list",{});e.nodes=Array.isArray(n.nodes)?n.nodes:[]}catch(n){t?.quiet||(e.lastError=String(n))}finally{e.nodesLoading=!1}}}function td(e){if(!e||e.kind==="gateway")return{method:"exec.approvals.get",params:{}};const t=e.nodeId.trim();return t?{method:"exec.approvals.node.get",params:{nodeId:t}}:null}function nd(e,t){if(!e||e.kind==="gateway")return{method:"exec.approvals.set",params:t};const n=e.nodeId.trim();return n?{method:"exec.approvals.node.set",params:{...t,nodeId:n}}:null}async function Gs(e,t){if(!(!e.client||!e.connected)&&!e.execApprovalsLoading){e.execApprovalsLoading=!0,e.lastError=null;try{const n=td(t);if(!n){e.lastError="Select a node before loading exec approvals.";return}const s=await e.client.request(n.method,n.params);sd(e,s)}catch(n){e.lastError=String(n)}finally{e.execApprovalsLoading=!1}}}function sd(e,t){e.execApprovalsSnapshot=t,e.execApprovalsDirty||(e.execApprovalsForm=De(t.file??{}))}async function id(e,t){if(!(!e.client||!e.connected)){e.execApprovalsSaving=!0,e.lastError=null;try{const n=e.execApprovalsSnapshot?.hash;if(!n){e.lastError="Exec approvals hash missing; reload and retry.";return}const s=e.execApprovalsForm??e.execApprovalsSnapshot?.file??{},i=nd(t,{file:s,baseHash:n});if(!i){e.lastError="Select a node before saving exec approvals.";return}await e.client.request(i.method,i.params),e.execApprovalsDirty=!1,await Gs(e,t)}catch(n){e.lastError=String(n)}finally{e.execApprovalsSaving=!1}}}function ad(e,t,n){const s=De(e.execApprovalsForm??e.execApprovalsSnapshot?.file??{});bo(s,t,n),e.execApprovalsForm=s,e.execApprovalsDirty=!0}function od(e,t){const n=De(e.execApprovalsForm??e.execApprovalsSnapshot?.file??{});wo(n,t),e.execApprovalsForm=n,e.execApprovalsDirty=!0}async function Ws(e){if(!(!e.client||!e.connected)&&!e.presenceLoading){e.presenceLoading=!0,e.presenceError=null,e.presenceStatus=null;try{const t=await e.client.request("system-presence",{});Array.isArray(t)?(e.presenceEntries=t,e.presenceStatus=t.length===0?"No instances yet.":null):(e.presenceEntries=[],e.presenceStatus="No presence payload.")}catch(t){e.presenceError=String(t)}finally{e.presenceLoading=!1}}}function tt(e,t,n){if(!t.trim())return;const s={...e.skillMessages};n?s[t]=n:delete s[t],e.skillMessages=s}function vn(e){return e instanceof Error?e.message:String(e)}async function Et(e,t){if(t?.clearMessages&&Object.keys(e.skillMessages).length>0&&(e.skillMessages={}),!(!e.client||!e.connected)&&!e.skillsLoading){e.skillsLoading=!0,e.skillsError=null;try{const n=await e.client.request("skills.status",{});n&&(e.skillsReport=n)}catch(n){e.skillsError=vn(n)}finally{e.skillsLoading=!1}}}function rd(e,t,n){e.skillEdits={...e.skillEdits,[t]:n}}async function ld(e,t,n){if(!(!e.client||!e.connected)){e.skillsBusyKey=t,e.skillsError=null;try{await e.client.request("skills.update",{skillKey:t,enabled:n}),await Et(e),tt(e,t,{kind:"success",message:n?"Skill enabled":"Skill disabled"})}catch(s){const i=vn(s);e.skillsError=i,tt(e,t,{kind:"error",message:i})}finally{e.skillsBusyKey=null}}}async function cd(e,t){if(!(!e.client||!e.connected)){e.skillsBusyKey=t,e.skillsError=null;try{const n=e.skillEdits[t]??"";await e.client.request("skills.update",{skillKey:t,apiKey:n}),await Et(e),tt(e,t,{kind:"success",message:"API key saved"})}catch(n){const s=vn(n);e.skillsError=s,tt(e,t,{kind:"error",message:s})}finally{e.skillsBusyKey=null}}}async function dd(e,t,n,s){if(!(!e.client||!e.connected)){e.skillsBusyKey=t,e.skillsError=null;try{const i=await e.client.request("skills.install",{name:n,installId:s,timeoutMs:12e4});await Et(e),tt(e,t,{kind:"success",message:i?.message??"Installed"})}catch(i){const a=vn(i);e.skillsError=a,tt(e,t,{kind:"error",message:a})}finally{e.skillsBusyKey=null}}}function ud(){return typeof window>"u"||typeof window.matchMedia!="function"||window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Vs(e){return e==="system"?ud():e}const Ut=e=>Number.isNaN(e)?.5:e<=0?0:e>=1?1:e,pd=()=>typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches??!1,Kt=e=>{e.classList.remove("theme-transition"),e.style.removeProperty("--theme-switch-x"),e.style.removeProperty("--theme-switch-y")},hd=({nextTheme:e,applyTheme:t,context:n,currentTheme:s})=>{if(s===e)return;const i=globalThis.document??null;if(!i){t();return}const a=i.documentElement,o=i,r=pd();if(!!o.startViewTransition&&!r){let p=.5,d=.5;if(n?.pointerClientX!==void 0&&n?.pointerClientY!==void 0&&typeof window<"u")p=Ut(n.pointerClientX/window.innerWidth),d=Ut(n.pointerClientY/window.innerHeight);else if(n?.element){const u=n.element.getBoundingClientRect();u.width>0&&u.height>0&&typeof window<"u"&&(p=Ut((u.left+u.width/2)/window.innerWidth),d=Ut((u.top+u.height/2)/window.innerHeight))}a.style.setProperty("--theme-switch-x",`${p*100}%`),a.style.setProperty("--theme-switch-y",`${d*100}%`),a.classList.add("theme-transition");try{const u=o.startViewTransition?.(()=>{t()});u?.finished?u.finished.finally(()=>Kt(a)):Kt(a)}catch{Kt(a),t()}return}t(),Kt(a)};function fd(e){e.nodesPollInterval==null&&(e.nodesPollInterval=window.setInterval(()=>{gn(e,{quiet:!0})},5e3))}function gd(e){e.nodesPollInterval!=null&&(clearInterval(e.nodesPollInterval),e.nodesPollInterval=null)}function Ys(e){e.logsPollInterval==null&&(e.logsPollInterval=window.setInterval(()=>{e.tab==="logs"&&Fs(e,{quiet:!0})},2e3))}function Qs(e){e.logsPollInterval!=null&&(clearInterval(e.logsPollInterval),e.logsPollInterval=null)}function Zs(e){e.debugPollInterval==null&&(e.debugPollInterval=window.setInterval(()=>{e.tab==="debug"&&hn(e)},3e3))}function Js(e){e.debugPollInterval!=null&&(clearInterval(e.debugPollInterval),e.debugPollInterval=null)}function Se(e,t){const n={...t,lastActiveSessionKey:t.lastActiveSessionKey?.trim()||t.sessionKey.trim()||"main"};e.settings=n,xl(n),t.theme!==e.theme&&(e.theme=t.theme,mn(e,Vs(t.theme))),e.applySessionKey=e.settings.lastActiveSessionKey}function Ko(e,t){const n=t.trim();n&&e.settings.lastActiveSessionKey!==n&&Se(e,{...e.settings,lastActiveSessionKey:n})}function vd(e){if(!window.location.search)return;const t=new URLSearchParams(window.location.search),n=t.get("token"),s=t.get("password"),i=t.get("session"),a=t.get("gatewayUrl");let o=!1;if(n!=null){const l=n.trim();l&&l!==e.settings.token&&Se(e,{...e.settings,token:l}),t.delete("token"),o=!0}if(s!=null){const l=s.trim();l&&(e.password=l),t.delete("password"),o=!0}if(i!=null){const l=i.trim();l&&(e.sessionKey=l,Se(e,{...e.settings,sessionKey:l,lastActiveSessionKey:l}))}if(a!=null){const l=a.trim();l&&l!==e.settings.gatewayUrl&&(e.pendingGatewayUrl=l),t.delete("gatewayUrl"),o=!0}if(!o)return;const r=new URL(window.location.href);r.search=t.toString(),window.history.replaceState({},"",r.toString())}function md(e,t){e.tab!==t&&(e.tab=t),t==="chat"&&(e.chatHasAutoScrolled=!1),t==="logs"?Ys(e):Qs(e),t==="debug"?Zs(e):Js(e),Xs(e),zo(e,t,!1)}function yd(e,t,n){hd({nextTheme:t,applyTheme:()=>{e.theme=t,Se(e,{...e.settings,theme:t}),mn(e,Vs(t))},context:n,currentTheme:e.theme})}async function Xs(e){e.tab==="overview"&&await jo(e),e.tab==="channels"&&await _d(e),e.tab==="instances"&&await Ws(e),e.tab==="sessions"&&await Ke(e),e.tab==="cron"&&await ei(e),e.tab==="skills"&&await Et(e),e.tab==="nodes"&&(await gn(e),await Ce(e),await ye(e),await Gs(e)),e.tab==="chat"&&(await Yo(e),un(e,!e.chatHasAutoScrolled)),e.tab==="config"&&(await $o(e),await ye(e)),e.tab==="debug"&&(await hn(e),e.eventLog=e.eventLogBuffer),e.tab==="logs"&&(e.logsAtBottom=!0,await Fs(e,{reset:!0}),yo(e,!0))}function bd(){if(typeof window>"u")return"";const e=window.__OPENCLAW_CONTROL_UI_BASE_PATH__;return typeof e=="string"&&e.trim()?cn(e):kl(window.location.pathname)}function wd(e){e.theme=e.settings.theme??"system",mn(e,Vs(e.theme))}function mn(e,t){if(e.themeResolved=t,typeof document>"u")return;const n=document.documentElement;n.dataset.theme=t,n.style.colorScheme=t}function $d(e){if(typeof window>"u"||typeof window.matchMedia!="function")return;if(e.themeMedia=window.matchMedia("(prefers-color-scheme: dark)"),e.themeMediaHandler=n=>{e.theme==="system"&&mn(e,n.matches?"dark":"light")},typeof e.themeMedia.addEventListener=="function"){e.themeMedia.addEventListener("change",e.themeMediaHandler);return}e.themeMedia.addListener(e.themeMediaHandler)}function xd(e){if(!e.themeMedia||!e.themeMediaHandler)return;if(typeof e.themeMedia.removeEventListener=="function"){e.themeMedia.removeEventListener("change",e.themeMediaHandler);return}e.themeMedia.removeListener(e.themeMediaHandler),e.themeMedia=null,e.themeMediaHandler=null}function Ad(e,t){if(typeof window>"u")return;const n=fo(window.location.pathname,e.basePath)??"chat";Ho(e,n),zo(e,n,t)}function kd(e){if(typeof window>"u")return;const t=fo(window.location.pathname,e.basePath);if(!t)return;const s=new URL(window.location.href).searchParams.get("session")?.trim();s&&(e.sessionKey=s,Se(e,{...e.settings,sessionKey:s,lastActiveSessionKey:s})),Ho(e,t)}function Ho(e,t){e.tab!==t&&(e.tab=t),t==="chat"&&(e.chatHasAutoScrolled=!1),t==="logs"?Ys(e):Qs(e),t==="debug"?Zs(e):Js(e),e.connected&&Xs(e)}function zo(e,t,n){if(typeof window>"u")return;const s=At(Ds(t,e.basePath)),i=At(window.location.pathname),a=new URL(window.location.href);t==="chat"&&e.sessionKey?a.searchParams.set("session",e.sessionKey):a.searchParams.delete("session"),i!==s&&(a.pathname=s),n?window.history.replaceState({},"",a.toString()):window.history.pushState({},"",a.toString())}function Sd(e,t,n){if(typeof window>"u")return;const s=new URL(window.location.href);s.searchParams.set("session",t),window.history.replaceState({},"",s.toString())}async function jo(e){await Promise.all([oe(e,!1),Ws(e),Ke(e),Tt(e),hn(e)])}async function _d(e){await Promise.all([oe(e,!0),$o(e),ye(e)])}async function ei(e){await Promise.all([oe(e,!1),Tt(e),pn(e)])}function qo(e){return e.chatSending||!!e.chatRunId}function Cd(e){const t=e.trim();if(!t)return!1;const n=t.toLowerCase();return n==="/stop"?!0:n==="stop"||n==="esc"||n==="abort"||n==="wait"||n==="exit"}function Td(e){const t=e.trim();if(!t)return!1;const n=t.toLowerCase();return n==="/new"||n==="/reset"?!0:n.startsWith("/new ")||n.startsWith("/reset ")}async function Go(e){e.connected&&(e.chatMessage="",await Ul(e))}function Ed(e,t,n){const s=t.trim(),i=!!(n&&n.length>0);!s&&!i||(e.chatQueue=[...e.chatQueue,{id:Bs(),text:s,createdAt:Date.now(),attachments:i?n?.map(a=>({...a})):void 0}])}async function Wo(e,t,n){dn(e);const s=await Fl(e,t,n?.attachments);return!s&&n?.previousDraft!=null&&(e.chatMessage=n.previousDraft),!s&&n?.previousAttachments&&(e.chatAttachments=n.previousAttachments),s&&Ko(e,e.sessionKey),s&&n?.restoreDraft&&n.previousDraft?.trim()&&(e.chatMessage=n.previousDraft),s&&n?.restoreAttachments&&n.previousAttachments?.length&&(e.chatAttachments=n.previousAttachments),un(e),s&&!e.chatRunId&&Vo(e),s&&n?.refreshSessions&&(e.refreshSessionsAfterChat=!0),s}async function Vo(e){if(!e.connected||qo(e))return;const[t,...n]=e.chatQueue;if(!t)return;e.chatQueue=n,await Wo(e,t.text,{attachments:t.attachments})||(e.chatQueue=[t,...e.chatQueue])}function Md(e,t){e.chatQueue=e.chatQueue.filter(n=>n.id!==t)}async function Ld(e,t,n){if(!e.connected)return;const s=e.chatMessage,i=(t??e.chatMessage).trim(),a=e.chatAttachments??[],o=t==null?a:[],r=o.length>0;if(!i&&!r)return;if(Cd(i)){await Go(e);return}const l=Td(i);if(t==null&&(e.chatMessage="",e.chatAttachments=[]),qo(e)){Ed(e,i,o);return}await Wo(e,i,{previousDraft:t==null?s:void 0,restoreDraft:!!(t&&n?.restoreDraft),attachments:r?o:void 0,previousAttachments:t==null?a:void 0,restoreAttachments:!!(t&&n?.restoreDraft),refreshSessions:l})}async function Yo(e){await Promise.all([St(e),Ke(e,{activeMinutes:0}),ms(e)]),un(e,!0)}const Id=Vo;function Rd(e){const t=uo(e.sessionKey);return t?.agentId?t.agentId:e.hello?.snapshot?.sessionDefaults?.defaultAgentId?.trim()||"main"}function Pd(e,t){const n=cn(e),s=encodeURIComponent(t);return n?`${n}/avatar/${s}?meta=1`:`/avatar/${s}?meta=1`}async function ms(e){if(!e.connected){e.chatAvatarUrl=null;return}const t=Rd(e);if(!t){e.chatAvatarUrl=null;return}e.chatAvatarUrl=null;const n=Pd(e.basePath,t);try{const s=await fetch(n,{method:"GET"});if(!s.ok){e.chatAvatarUrl=null;return}const i=await s.json(),a=typeof i.avatarUrl=="string"?i.avatarUrl.trim():"";e.chatAvatarUrl=a||null}catch{e.chatAvatarUrl=null}}const{I:Nd}=ul,ha=e=>e,Od=e=>e.strings===void 0,fa=()=>document.createComment(""),rt=(e,t,n)=>{const s=e._$AA.parentNode,i=t===void 0?e._$AB:t._$AA;if(n===void 0){const a=s.insertBefore(fa(),i),o=s.insertBefore(fa(),i);n=new Nd(a,o,e,e.options)}else{const a=n._$AB.nextSibling,o=n._$AM,r=o!==e;if(r){let l;n._$AQ?.(e),n._$AM=e,n._$AP!==void 0&&(l=e._$AU)!==o._$AU&&n._$AP(l)}if(a!==i||r){let l=n._$AA;for(;l!==a;){const p=ha(l).nextSibling;ha(s).insertBefore(l,i),l=p}}}return n},Le=(e,t,n=e)=>(e._$AI(t,n),e),Dd={},Bd=(e,t=Dd)=>e._$AH=t,Fd=e=>e._$AH,Vn=e=>{e._$AR(),e._$AA.remove()};const ti={CHILD:2},ni=e=>(...t)=>({_$litDirective$:e,values:t});class si{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,n,s){this._$Ct=t,this._$AM=n,this._$Ci=s}_$AS(t,n){return this.update(t,n)}update(t,n){return this.render(...n)}}const yt=(e,t)=>{const n=e._$AN;if(n===void 0)return!1;for(const s of n)s._$AO?.(t,!1),yt(s,t);return!0},en=e=>{let t,n;do{if((t=e._$AM)===void 0)break;n=t._$AN,n.delete(e),e=t}while(n?.size===0)},Qo=e=>{for(let t;t=e._$AM;e=t){let n=t._$AN;if(n===void 0)t._$AN=n=new Set;else if(n.has(e))break;n.add(e),Hd(t)}};function Ud(e){this._$AN!==void 0?(en(this),this._$AM=e,Qo(this)):this._$AM=e}function Kd(e,t=!1,n=0){const s=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(t)if(Array.isArray(s))for(let a=n;a<s.length;a++)yt(s[a],!1),en(s[a]);else s!=null&&(yt(s,!1),en(s));else yt(this,e)}const Hd=e=>{e.type==ti.CHILD&&(e._$AP??=Kd,e._$AQ??=Ud)};class zd extends si{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,n,s){super._$AT(t,n,s),Qo(this),this.isConnected=t._$AU}_$AO(t,n=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),n&&(yt(this,t),en(this))}setValue(t){if(Od(this._$Ct))this._$Ct._$AI(t,this);else{const n=[...this._$Ct._$AH];n[this._$Ci]=t,this._$Ct._$AI(n,this,0)}}disconnected(){}reconnected(){}}const Yn=new WeakMap,jd=ni(class extends zd{render(e){return f}update(e,[t]){const n=t!==this.G;return n&&this.G!==void 0&&this.rt(void 0),(n||this.lt!==this.ct)&&(this.G=t,this.ht=e.options?.host,this.rt(this.ct=e.element)),f}rt(e){if(this.isConnected||(e=void 0),typeof this.G=="function"){const t=this.ht??globalThis;let n=Yn.get(t);n===void 0&&(n=new WeakMap,Yn.set(t,n)),n.get(this.G)!==void 0&&this.G.call(this.ht,void 0),n.set(this.G,e),e!==void 0&&this.G.call(this.ht,e)}else this.G.value=e}get lt(){return typeof this.G=="function"?Yn.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});const ga=(e,t,n)=>{const s=new Map;for(let i=t;i<=n;i++)s.set(e[i],i);return s},Zo=ni(class extends si{constructor(e){if(super(e),e.type!==ti.CHILD)throw Error("repeat() can only be used in text expressions")}dt(e,t,n){let s;n===void 0?n=t:t!==void 0&&(s=t);const i=[],a=[];let o=0;for(const r of e)i[o]=s?s(r,o):o,a[o]=n(r,o),o++;return{values:a,keys:i}}render(e,t,n){return this.dt(e,t,n).values}update(e,[t,n,s]){const i=Fd(e),{values:a,keys:o}=this.dt(t,n,s);if(!Array.isArray(i))return this.ut=o,a;const r=this.ut??=[],l=[];let p,d,u=0,g=i.length-1,v=0,y=a.length-1;for(;u<=g&&v<=y;)if(i[u]===null)u++;else if(i[g]===null)g--;else if(r[u]===o[v])l[v]=Le(i[u],a[v]),u++,v++;else if(r[g]===o[y])l[y]=Le(i[g],a[y]),g--,y--;else if(r[u]===o[y])l[y]=Le(i[u],a[y]),rt(e,l[y+1],i[u]),u++,y--;else if(r[g]===o[v])l[v]=Le(i[g],a[v]),rt(e,i[u],i[g]),g--,v++;else if(p===void 0&&(p=ga(o,v,y),d=ga(r,u,g)),p.has(r[u]))if(p.has(r[g])){const $=d.get(o[v]),A=$!==void 0?i[$]:null;if(A===null){const _=rt(e,i[u]);Le(_,a[v]),l[v]=_}else l[v]=Le(A,a[v]),rt(e,i[u],A),i[$]=null;v++}else Vn(i[g]),g--;else Vn(i[u]),u++;for(;v<=y;){const $=rt(e,l[y+1]);Le($,a[v]),l[v++]=$}for(;u<=g;){const $=i[u++];$!==null&&Vn($)}return this.ut=o,Bd(e,l),ke}});function Jo(e){const t=e;let n=typeof t.role=="string"?t.role:"unknown";const s=typeof t.toolCallId=="string"||typeof t.tool_call_id=="string",i=t.content,a=Array.isArray(i)?i:null,o=Array.isArray(a)&&a.some(u=>{const v=String(u.type??"").toLowerCase();return v==="toolresult"||v==="tool_result"}),r=typeof t.toolName=="string"||typeof t.tool_name=="string";(s||o||r)&&(n="toolResult");let l=[];typeof t.content=="string"?l=[{type:"text",text:t.content}]:Array.isArray(t.content)?l=t.content.map(u=>({type:u.type||"text",text:u.text,name:u.name,args:u.args||u.arguments})):typeof t.text=="string"&&(l=[{type:"text",text:t.text}]);const p=typeof t.timestamp=="number"?t.timestamp:Date.now(),d=typeof t.id=="string"?t.id:void 0;return{role:n,content:l,timestamp:p,id:d}}function ii(e){const t=e.toLowerCase();return e==="user"||e==="User"?e:e==="assistant"?"assistant":e==="system"?"system":t==="toolresult"||t==="tool_result"||t==="tool"||t==="function"?"tool":e}function Xo(e){const t=e,n=typeof t.role=="string"?t.role.toLowerCase():"";return n==="toolresult"||n==="tool_result"}class ys extends si{constructor(t){if(super(t),this.it=f,t.type!==ti.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===f||t==null)return this._t=void 0,this.it=t;if(t===ke)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const n=[t];return n.raw=n,this._t={_$litType$:this.constructor.resultType,strings:n,values:[]}}}ys.directiveName="unsafeHTML",ys.resultType=1;const bs=ni(ys);const{entries:er,setPrototypeOf:va,isFrozen:qd,getPrototypeOf:Gd,getOwnPropertyDescriptor:Wd}=Object;let{freeze:Z,seal:ne,create:ws}=Object,{apply:$s,construct:xs}=typeof Reflect<"u"&&Reflect;Z||(Z=function(t){return t});ne||(ne=function(t){return t});$s||($s=function(t,n){for(var s=arguments.length,i=new Array(s>2?s-2:0),a=2;a<s;a++)i[a-2]=arguments[a];return t.apply(n,i)});xs||(xs=function(t){for(var n=arguments.length,s=new Array(n>1?n-1:0),i=1;i<n;i++)s[i-1]=arguments[i];return new t(...s)});const Ht=J(Array.prototype.forEach),Vd=J(Array.prototype.lastIndexOf),ma=J(Array.prototype.pop),lt=J(Array.prototype.push),Yd=J(Array.prototype.splice),Vt=J(String.prototype.toLowerCase),Qn=J(String.prototype.toString),Zn=J(String.prototype.match),ct=J(String.prototype.replace),Qd=J(String.prototype.indexOf),Zd=J(String.prototype.trim),se=J(Object.prototype.hasOwnProperty),Y=J(RegExp.prototype.test),dt=Jd(TypeError);function J(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,s=new Array(n>1?n-1:0),i=1;i<n;i++)s[i-1]=arguments[i];return $s(e,t,s)}}function Jd(e){return function(){for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];return xs(e,n)}}function I(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Vt;va&&va(e,null);let s=t.length;for(;s--;){let i=t[s];if(typeof i=="string"){const a=n(i);a!==i&&(qd(t)||(t[s]=a),i=a)}e[i]=!0}return e}function Xd(e){for(let t=0;t<e.length;t++)se(e,t)||(e[t]=null);return e}function de(e){const t=ws(null);for(const[n,s]of er(e))se(e,n)&&(Array.isArray(s)?t[n]=Xd(s):s&&typeof s=="object"&&s.constructor===Object?t[n]=de(s):t[n]=s);return t}function ut(e,t){for(;e!==null;){const s=Wd(e,t);if(s){if(s.get)return J(s.get);if(typeof s.value=="function")return J(s.value)}e=Gd(e)}function n(){return null}return n}const ya=Z(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Jn=Z(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Xn=Z(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),eu=Z(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),es=Z(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),tu=Z(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),ba=Z(["#text"]),wa=Z(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),ts=Z(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),$a=Z(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),zt=Z(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),nu=ne(/\{\{[\w\W]*|[\w\W]*\}\}/gm),su=ne(/<%[\w\W]*|[\w\W]*%>/gm),iu=ne(/\$\{[\w\W]*/gm),au=ne(/^data-[\-\w.\u00B7-\uFFFF]+$/),ou=ne(/^aria-[\-\w]+$/),tr=ne(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ru=ne(/^(?:\w+script|data):/i),lu=ne(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),nr=ne(/^html$/i),cu=ne(/^[a-z][.\w]*(-[.\w]+)+$/i);var xa=Object.freeze({__proto__:null,ARIA_ATTR:ou,ATTR_WHITESPACE:lu,CUSTOM_ELEMENT:cu,DATA_ATTR:au,DOCTYPE_NAME:nr,ERB_EXPR:su,IS_ALLOWED_URI:tr,IS_SCRIPT_OR_DATA:ru,MUSTACHE_EXPR:nu,TMPLIT_EXPR:iu});const pt={element:1,text:3,progressingInstruction:7,comment:8,document:9},du=function(){return typeof window>"u"?null:window},uu=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let s=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(s=n.getAttribute(i));const a="dompurify"+(s?"#"+s:"");try{return t.createPolicy(a,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},Aa=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function sr(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:du();const t=C=>sr(C);if(t.version="3.3.1",t.removed=[],!e||!e.document||e.document.nodeType!==pt.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e;const s=n,i=s.currentScript,{DocumentFragment:a,HTMLTemplateElement:o,Node:r,Element:l,NodeFilter:p,NamedNodeMap:d=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:u,DOMParser:g,trustedTypes:v}=e,y=l.prototype,$=ut(y,"cloneNode"),A=ut(y,"remove"),_=ut(y,"nextSibling"),L=ut(y,"childNodes"),P=ut(y,"parentNode");if(typeof o=="function"){const C=n.createElement("template");C.content&&C.content.ownerDocument&&(n=C.content.ownerDocument)}let M,T="";const{implementation:E,createNodeIterator:pe,createDocumentFragment:xn,getElementsByTagName:An}=n,{importNode:Ir}=s;let V=Aa();t.isSupported=typeof er=="function"&&typeof P=="function"&&E&&E.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:kn,ERB_EXPR:Sn,TMPLIT_EXPR:_n,DATA_ATTR:Rr,ARIA_ATTR:Pr,IS_SCRIPT_OR_DATA:Nr,ATTR_WHITESPACE:vi,CUSTOM_ELEMENT:Or}=xa;let{IS_ALLOWED_URI:mi}=xa,K=null;const yi=I({},[...ya,...Jn,...Xn,...es,...ba]);let z=null;const bi=I({},[...wa,...ts,...$a,...zt]);let B=Object.seal(ws(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),st=null,Cn=null;const ze=Object.seal(ws(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let wi=!0,Tn=!0,$i=!1,xi=!0,je=!1,Lt=!0,Te=!1,En=!1,Mn=!1,qe=!1,It=!1,Rt=!1,Ai=!0,ki=!1;const Dr="user-content-";let Ln=!0,it=!1,Ge={},re=null;const In=I({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Si=null;const _i=I({},["audio","video","img","source","image","track"]);let Rn=null;const Ci=I({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Pt="http://www.w3.org/1998/Math/MathML",Nt="http://www.w3.org/2000/svg",he="http://www.w3.org/1999/xhtml";let We=he,Pn=!1,Nn=null;const Br=I({},[Pt,Nt,he],Qn);let Ot=I({},["mi","mo","mn","ms","mtext"]),Dt=I({},["annotation-xml"]);const Fr=I({},["title","style","font","a","script"]);let at=null;const Ur=["application/xhtml+xml","text/html"],Kr="text/html";let U=null,Ve=null;const Hr=n.createElement("form"),Ti=function(h){return h instanceof RegExp||h instanceof Function},On=function(){let h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Ve&&Ve===h)){if((!h||typeof h!="object")&&(h={}),h=de(h),at=Ur.indexOf(h.PARSER_MEDIA_TYPE)===-1?Kr:h.PARSER_MEDIA_TYPE,U=at==="application/xhtml+xml"?Qn:Vt,K=se(h,"ALLOWED_TAGS")?I({},h.ALLOWED_TAGS,U):yi,z=se(h,"ALLOWED_ATTR")?I({},h.ALLOWED_ATTR,U):bi,Nn=se(h,"ALLOWED_NAMESPACES")?I({},h.ALLOWED_NAMESPACES,Qn):Br,Rn=se(h,"ADD_URI_SAFE_ATTR")?I(de(Ci),h.ADD_URI_SAFE_ATTR,U):Ci,Si=se(h,"ADD_DATA_URI_TAGS")?I(de(_i),h.ADD_DATA_URI_TAGS,U):_i,re=se(h,"FORBID_CONTENTS")?I({},h.FORBID_CONTENTS,U):In,st=se(h,"FORBID_TAGS")?I({},h.FORBID_TAGS,U):de({}),Cn=se(h,"FORBID_ATTR")?I({},h.FORBID_ATTR,U):de({}),Ge=se(h,"USE_PROFILES")?h.USE_PROFILES:!1,wi=h.ALLOW_ARIA_ATTR!==!1,Tn=h.ALLOW_DATA_ATTR!==!1,$i=h.ALLOW_UNKNOWN_PROTOCOLS||!1,xi=h.ALLOW_SELF_CLOSE_IN_ATTR!==!1,je=h.SAFE_FOR_TEMPLATES||!1,Lt=h.SAFE_FOR_XML!==!1,Te=h.WHOLE_DOCUMENT||!1,qe=h.RETURN_DOM||!1,It=h.RETURN_DOM_FRAGMENT||!1,Rt=h.RETURN_TRUSTED_TYPE||!1,Mn=h.FORCE_BODY||!1,Ai=h.SANITIZE_DOM!==!1,ki=h.SANITIZE_NAMED_PROPS||!1,Ln=h.KEEP_CONTENT!==!1,it=h.IN_PLACE||!1,mi=h.ALLOWED_URI_REGEXP||tr,We=h.NAMESPACE||he,Ot=h.MATHML_TEXT_INTEGRATION_POINTS||Ot,Dt=h.HTML_INTEGRATION_POINTS||Dt,B=h.CUSTOM_ELEMENT_HANDLING||{},h.CUSTOM_ELEMENT_HANDLING&&Ti(h.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(B.tagNameCheck=h.CUSTOM_ELEMENT_HANDLING.tagNameCheck),h.CUSTOM_ELEMENT_HANDLING&&Ti(h.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(B.attributeNameCheck=h.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),h.CUSTOM_ELEMENT_HANDLING&&typeof h.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(B.allowCustomizedBuiltInElements=h.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),je&&(Tn=!1),It&&(qe=!0),Ge&&(K=I({},ba),z=[],Ge.html===!0&&(I(K,ya),I(z,wa)),Ge.svg===!0&&(I(K,Jn),I(z,ts),I(z,zt)),Ge.svgFilters===!0&&(I(K,Xn),I(z,ts),I(z,zt)),Ge.mathMl===!0&&(I(K,es),I(z,$a),I(z,zt))),h.ADD_TAGS&&(typeof h.ADD_TAGS=="function"?ze.tagCheck=h.ADD_TAGS:(K===yi&&(K=de(K)),I(K,h.ADD_TAGS,U))),h.ADD_ATTR&&(typeof h.ADD_ATTR=="function"?ze.attributeCheck=h.ADD_ATTR:(z===bi&&(z=de(z)),I(z,h.ADD_ATTR,U))),h.ADD_URI_SAFE_ATTR&&I(Rn,h.ADD_URI_SAFE_ATTR,U),h.FORBID_CONTENTS&&(re===In&&(re=de(re)),I(re,h.FORBID_CONTENTS,U)),h.ADD_FORBID_CONTENTS&&(re===In&&(re=de(re)),I(re,h.ADD_FORBID_CONTENTS,U)),Ln&&(K["#text"]=!0),Te&&I(K,["html","head","body"]),K.table&&(I(K,["tbody"]),delete st.tbody),h.TRUSTED_TYPES_POLICY){if(typeof h.TRUSTED_TYPES_POLICY.createHTML!="function")throw dt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof h.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw dt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');M=h.TRUSTED_TYPES_POLICY,T=M.createHTML("")}else M===void 0&&(M=uu(v,i)),M!==null&&typeof T=="string"&&(T=M.createHTML(""));Z&&Z(h),Ve=h}},Ei=I({},[...Jn,...Xn,...eu]),Mi=I({},[...es,...tu]),zr=function(h){let x=P(h);(!x||!x.tagName)&&(x={namespaceURI:We,tagName:"template"});const S=Vt(h.tagName),D=Vt(x.tagName);return Nn[h.namespaceURI]?h.namespaceURI===Nt?x.namespaceURI===he?S==="svg":x.namespaceURI===Pt?S==="svg"&&(D==="annotation-xml"||Ot[D]):!!Ei[S]:h.namespaceURI===Pt?x.namespaceURI===he?S==="math":x.namespaceURI===Nt?S==="math"&&Dt[D]:!!Mi[S]:h.namespaceURI===he?x.namespaceURI===Nt&&!Dt[D]||x.namespaceURI===Pt&&!Ot[D]?!1:!Mi[S]&&(Fr[S]||!Ei[S]):!!(at==="application/xhtml+xml"&&Nn[h.namespaceURI]):!1},le=function(h){lt(t.removed,{element:h});try{P(h).removeChild(h)}catch{A(h)}},Ee=function(h,x){try{lt(t.removed,{attribute:x.getAttributeNode(h),from:x})}catch{lt(t.removed,{attribute:null,from:x})}if(x.removeAttribute(h),h==="is")if(qe||It)try{le(x)}catch{}else try{x.setAttribute(h,"")}catch{}},Li=function(h){let x=null,S=null;if(Mn)h="<remove></remove>"+h;else{const F=Zn(h,/^[\r\n\t ]+/);S=F&&F[0]}at==="application/xhtml+xml"&&We===he&&(h='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+h+"</body></html>");const D=M?M.createHTML(h):h;if(We===he)try{x=new g().parseFromString(D,at)}catch{}if(!x||!x.documentElement){x=E.createDocument(We,"template",null);try{x.documentElement.innerHTML=Pn?T:D}catch{}}const q=x.body||x.documentElement;return h&&S&&q.insertBefore(n.createTextNode(S),q.childNodes[0]||null),We===he?An.call(x,Te?"html":"body")[0]:Te?x.documentElement:q},Ii=function(h){return pe.call(h.ownerDocument||h,h,p.SHOW_ELEMENT|p.SHOW_COMMENT|p.SHOW_TEXT|p.SHOW_PROCESSING_INSTRUCTION|p.SHOW_CDATA_SECTION,null)},Dn=function(h){return h instanceof u&&(typeof h.nodeName!="string"||typeof h.textContent!="string"||typeof h.removeChild!="function"||!(h.attributes instanceof d)||typeof h.removeAttribute!="function"||typeof h.setAttribute!="function"||typeof h.namespaceURI!="string"||typeof h.insertBefore!="function"||typeof h.hasChildNodes!="function")},Ri=function(h){return typeof r=="function"&&h instanceof r};function fe(C,h,x){Ht(C,S=>{S.call(t,h,x,Ve)})}const Pi=function(h){let x=null;if(fe(V.beforeSanitizeElements,h,null),Dn(h))return le(h),!0;const S=U(h.nodeName);if(fe(V.uponSanitizeElement,h,{tagName:S,allowedTags:K}),Lt&&h.hasChildNodes()&&!Ri(h.firstElementChild)&&Y(/<[/\w!]/g,h.innerHTML)&&Y(/<[/\w!]/g,h.textContent)||h.nodeType===pt.progressingInstruction||Lt&&h.nodeType===pt.comment&&Y(/<[/\w]/g,h.data))return le(h),!0;if(!(ze.tagCheck instanceof Function&&ze.tagCheck(S))&&(!K[S]||st[S])){if(!st[S]&&Oi(S)&&(B.tagNameCheck instanceof RegExp&&Y(B.tagNameCheck,S)||B.tagNameCheck instanceof Function&&B.tagNameCheck(S)))return!1;if(Ln&&!re[S]){const D=P(h)||h.parentNode,q=L(h)||h.childNodes;if(q&&D){const F=q.length;for(let X=F-1;X>=0;--X){const ge=$(q[X],!0);ge.__removalCount=(h.__removalCount||0)+1,D.insertBefore(ge,_(h))}}}return le(h),!0}return h instanceof l&&!zr(h)||(S==="noscript"||S==="noembed"||S==="noframes")&&Y(/<\/no(script|embed|frames)/i,h.innerHTML)?(le(h),!0):(je&&h.nodeType===pt.text&&(x=h.textContent,Ht([kn,Sn,_n],D=>{x=ct(x,D," ")}),h.textContent!==x&&(lt(t.removed,{element:h.cloneNode()}),h.textContent=x)),fe(V.afterSanitizeElements,h,null),!1)},Ni=function(h,x,S){if(Ai&&(x==="id"||x==="name")&&(S in n||S in Hr))return!1;if(!(Tn&&!Cn[x]&&Y(Rr,x))){if(!(wi&&Y(Pr,x))){if(!(ze.attributeCheck instanceof Function&&ze.attributeCheck(x,h))){if(!z[x]||Cn[x]){if(!(Oi(h)&&(B.tagNameCheck instanceof RegExp&&Y(B.tagNameCheck,h)||B.tagNameCheck instanceof Function&&B.tagNameCheck(h))&&(B.attributeNameCheck instanceof RegExp&&Y(B.attributeNameCheck,x)||B.attributeNameCheck instanceof Function&&B.attributeNameCheck(x,h))||x==="is"&&B.allowCustomizedBuiltInElements&&(B.tagNameCheck instanceof RegExp&&Y(B.tagNameCheck,S)||B.tagNameCheck instanceof Function&&B.tagNameCheck(S))))return!1}else if(!Rn[x]){if(!Y(mi,ct(S,vi,""))){if(!((x==="src"||x==="xlink:href"||x==="href")&&h!=="script"&&Qd(S,"data:")===0&&Si[h])){if(!($i&&!Y(Nr,ct(S,vi,"")))){if(S)return!1}}}}}}}return!0},Oi=function(h){return h!=="annotation-xml"&&Zn(h,Or)},Di=function(h){fe(V.beforeSanitizeAttributes,h,null);const{attributes:x}=h;if(!x||Dn(h))return;const S={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:z,forceKeepAttr:void 0};let D=x.length;for(;D--;){const q=x[D],{name:F,namespaceURI:X,value:ge}=q,Ye=U(F),Bn=ge;let j=F==="value"?Bn:Zd(Bn);if(S.attrName=Ye,S.attrValue=j,S.keepAttr=!0,S.forceKeepAttr=void 0,fe(V.uponSanitizeAttribute,h,S),j=S.attrValue,ki&&(Ye==="id"||Ye==="name")&&(Ee(F,h),j=Dr+j),Lt&&Y(/((--!?|])>)|<\/(style|title|textarea)/i,j)){Ee(F,h);continue}if(Ye==="attributename"&&Zn(j,"href")){Ee(F,h);continue}if(S.forceKeepAttr)continue;if(!S.keepAttr){Ee(F,h);continue}if(!xi&&Y(/\/>/i,j)){Ee(F,h);continue}je&&Ht([kn,Sn,_n],Fi=>{j=ct(j,Fi," ")});const Bi=U(h.nodeName);if(!Ni(Bi,Ye,j)){Ee(F,h);continue}if(M&&typeof v=="object"&&typeof v.getAttributeType=="function"&&!X)switch(v.getAttributeType(Bi,Ye)){case"TrustedHTML":{j=M.createHTML(j);break}case"TrustedScriptURL":{j=M.createScriptURL(j);break}}if(j!==Bn)try{X?h.setAttributeNS(X,F,j):h.setAttribute(F,j),Dn(h)?le(h):ma(t.removed)}catch{Ee(F,h)}}fe(V.afterSanitizeAttributes,h,null)},jr=function C(h){let x=null;const S=Ii(h);for(fe(V.beforeSanitizeShadowDOM,h,null);x=S.nextNode();)fe(V.uponSanitizeShadowNode,x,null),Pi(x),Di(x),x.content instanceof a&&C(x.content);fe(V.afterSanitizeShadowDOM,h,null)};return t.sanitize=function(C){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},x=null,S=null,D=null,q=null;if(Pn=!C,Pn&&(C="<!-->"),typeof C!="string"&&!Ri(C))if(typeof C.toString=="function"){if(C=C.toString(),typeof C!="string")throw dt("dirty is not a string, aborting")}else throw dt("toString is not a function");if(!t.isSupported)return C;if(En||On(h),t.removed=[],typeof C=="string"&&(it=!1),it){if(C.nodeName){const ge=U(C.nodeName);if(!K[ge]||st[ge])throw dt("root node is forbidden and cannot be sanitized in-place")}}else if(C instanceof r)x=Li("<!---->"),S=x.ownerDocument.importNode(C,!0),S.nodeType===pt.element&&S.nodeName==="BODY"||S.nodeName==="HTML"?x=S:x.appendChild(S);else{if(!qe&&!je&&!Te&&C.indexOf("<")===-1)return M&&Rt?M.createHTML(C):C;if(x=Li(C),!x)return qe?null:Rt?T:""}x&&Mn&&le(x.firstChild);const F=Ii(it?C:x);for(;D=F.nextNode();)Pi(D),Di(D),D.content instanceof a&&jr(D.content);if(it)return C;if(qe){if(It)for(q=xn.call(x.ownerDocument);x.firstChild;)q.appendChild(x.firstChild);else q=x;return(z.shadowroot||z.shadowrootmode)&&(q=Ir.call(s,q,!0)),q}let X=Te?x.outerHTML:x.innerHTML;return Te&&K["!doctype"]&&x.ownerDocument&&x.ownerDocument.doctype&&x.ownerDocument.doctype.name&&Y(nr,x.ownerDocument.doctype.name)&&(X="<!DOCTYPE "+x.ownerDocument.doctype.name+`>
|
|
17
|
+
`+X),je&&Ht([kn,Sn,_n],ge=>{X=ct(X,ge," ")}),M&&Rt?M.createHTML(X):X},t.setConfig=function(){let C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};On(C),En=!0},t.clearConfig=function(){Ve=null,En=!1},t.isValidAttribute=function(C,h,x){Ve||On({});const S=U(C),D=U(h);return Ni(S,D,x)},t.addHook=function(C,h){typeof h=="function"&<(V[C],h)},t.removeHook=function(C,h){if(h!==void 0){const x=Vd(V[C],h);return x===-1?void 0:Yd(V[C],x,1)[0]}return ma(V[C])},t.removeHooks=function(C){V[C]=[]},t.removeAllHooks=function(){V=Aa()},t}var As=sr();function ai(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var He=ai();function ir(e){He=e}var bt={exec:()=>null};function R(e,t=""){let n=typeof e=="string"?e:e.source,s={replace:(i,a)=>{let o=typeof a=="string"?a:a.source;return o=o.replace(Q.caret,"$1"),n=n.replace(i,o),s},getRegex:()=>new RegExp(n,t)};return s}var pu=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Q={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},hu=/^(?:[ \t]*(?:\n|$))+/,fu=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,gu=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Mt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,vu=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,oi=/(?:[*+-]|\d{1,9}[.)])/,ar=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,or=R(ar).replace(/bull/g,oi).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),mu=R(ar).replace(/bull/g,oi).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ri=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,yu=/^[^\n]+/,li=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,bu=R(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",li).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),wu=R(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,oi).getRegex(),yn="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ci=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,$u=R("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ci).replace("tag",yn).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),rr=R(ri).replace("hr",Mt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",yn).getRegex(),xu=R(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",rr).getRegex(),di={blockquote:xu,code:fu,def:bu,fences:gu,heading:vu,hr:Mt,html:$u,lheading:or,list:wu,newline:hu,paragraph:rr,table:bt,text:yu},ka=R("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Mt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",yn).getRegex(),Au={...di,lheading:mu,table:ka,paragraph:R(ri).replace("hr",Mt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ka).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",yn).getRegex()},ku={...di,html:R(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ci).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:bt,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:R(ri).replace("hr",Mt).replace("heading",` *#{1,6} *[^
|
|
18
|
+
]`).replace("lheading",or).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Su=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,_u=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,lr=/^( {2,}|\\)\n(?!\s*$)/,Cu=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,bn=/[\p{P}\p{S}]/u,ui=/[\s\p{P}\p{S}]/u,cr=/[^\s\p{P}\p{S}]/u,Tu=R(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ui).getRegex(),dr=/(?!~)[\p{P}\p{S}]/u,Eu=/(?!~)[\s\p{P}\p{S}]/u,Mu=/(?:[^\s\p{P}\p{S}]|~)/u,Lu=R(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",pu?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),ur=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Iu=R(ur,"u").replace(/punct/g,bn).getRegex(),Ru=R(ur,"u").replace(/punct/g,dr).getRegex(),pr="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Pu=R(pr,"gu").replace(/notPunctSpace/g,cr).replace(/punctSpace/g,ui).replace(/punct/g,bn).getRegex(),Nu=R(pr,"gu").replace(/notPunctSpace/g,Mu).replace(/punctSpace/g,Eu).replace(/punct/g,dr).getRegex(),Ou=R("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,cr).replace(/punctSpace/g,ui).replace(/punct/g,bn).getRegex(),Du=R(/\\(punct)/,"gu").replace(/punct/g,bn).getRegex(),Bu=R(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Fu=R(ci).replace("(?:-->|$)","-->").getRegex(),Uu=R("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Fu).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),tn=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Ku=R(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",tn).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),hr=R(/^!?\[(label)\]\[(ref)\]/).replace("label",tn).replace("ref",li).getRegex(),fr=R(/^!?\[(ref)\](?:\[\])?/).replace("ref",li).getRegex(),Hu=R("reflink|nolink(?!\\()","g").replace("reflink",hr).replace("nolink",fr).getRegex(),Sa=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,pi={_backpedal:bt,anyPunctuation:Du,autolink:Bu,blockSkip:Lu,br:lr,code:_u,del:bt,emStrongLDelim:Iu,emStrongRDelimAst:Pu,emStrongRDelimUnd:Ou,escape:Su,link:Ku,nolink:fr,punctuation:Tu,reflink:hr,reflinkSearch:Hu,tag:Uu,text:Cu,url:bt},zu={...pi,link:R(/^!?\[(label)\]\((.*?)\)/).replace("label",tn).getRegex(),reflink:R(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",tn).getRegex()},ks={...pi,emStrongRDelimAst:Nu,emStrongLDelim:Ru,url:R(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Sa).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:R(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Sa).getRegex()},ju={...ks,br:R(lr).replace("{2,}","*").getRegex(),text:R(ks.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},jt={normal:di,gfm:Au,pedantic:ku},ht={normal:pi,gfm:ks,breaks:ju,pedantic:zu},qu={"&":"&","<":"<",">":">",'"':""","'":"'"},_a=e=>qu[e];function me(e,t){if(t){if(Q.escapeTest.test(e))return e.replace(Q.escapeReplace,_a)}else if(Q.escapeTestNoEncode.test(e))return e.replace(Q.escapeReplaceNoEncode,_a);return e}function Ca(e){try{e=encodeURI(e).replace(Q.percentDecode,"%")}catch{return null}return e}function Ta(e,t){let n=e.replace(Q.findPipe,(a,o,r)=>{let l=!1,p=o;for(;--p>=0&&r[p]==="\\";)l=!l;return l?"|":" |"}),s=n.split(Q.splitPipe),i=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),t)if(s.length>t)s.splice(t);else for(;s.length<t;)s.push("");for(;i<s.length;i++)s[i]=s[i].trim().replace(Q.slashPipe,"|");return s}function ft(e,t,n){let s=e.length;if(s===0)return"";let i=0;for(;i<s&&e.charAt(s-i-1)===t;)i++;return e.slice(0,s-i)}function Gu(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let s=0;s<e.length;s++)if(e[s]==="\\")s++;else if(e[s]===t[0])n++;else if(e[s]===t[1]&&(n--,n<0))return s;return n>0?-2:-1}function Ea(e,t,n,s,i){let a=t.href,o=t.title||null,r=e[1].replace(i.other.outputLinkReplace,"$1");s.state.inLink=!0;let l={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:a,title:o,text:r,tokens:s.inlineTokens(r)};return s.state.inLink=!1,l}function Wu(e,t,n){let s=e.match(n.other.indentCodeCompensation);if(s===null)return t;let i=s[1];return t.split(`
|
|
19
|
+
`).map(a=>{let o=a.match(n.other.beginningSpace);if(o===null)return a;let[r]=o;return r.length>=i.length?a.slice(i.length):a}).join(`
|
|
20
|
+
`)}var nn=class{options;rules;lexer;constructor(e){this.options=e||He}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:ft(n,`
|
|
21
|
+
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],s=Wu(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:s}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){let s=ft(n,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(n=s.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:ft(t[0],`
|
|
22
|
+
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=ft(t[0],`
|
|
23
23
|
`).split(`
|
|
24
|
-
`),s="",i="",a=[];for(;n.length>0;){let o=!1,
|
|
24
|
+
`),s="",i="",a=[];for(;n.length>0;){let o=!1,r=[],l;for(l=0;l<n.length;l++)if(this.rules.other.blockquoteStart.test(n[l]))r.push(n[l]),o=!0;else if(!o)r.push(n[l]);else break;n=n.slice(l);let p=r.join(`
|
|
25
25
|
`),d=p.replace(this.rules.other.blockquoteSetextReplace,`
|
|
26
26
|
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
|
|
27
27
|
${p}`:p,i=i?`${i}
|
|
28
|
-
${d}`:d;let u=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(d,a,!0),this.lexer.state.top=u,n.length===0)break;let g=a.at(-1);if(g?.type==="code")break;if(g?.type==="blockquote"){let v=g,
|
|
28
|
+
${d}`:d;let u=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(d,a,!0),this.lexer.state.top=u,n.length===0)break;let g=a.at(-1);if(g?.type==="code")break;if(g?.type==="blockquote"){let v=g,y=v.raw+`
|
|
29
29
|
`+n.join(`
|
|
30
|
-
`),$=this.blockquote(
|
|
30
|
+
`),$=this.blockquote(y);a[a.length-1]=$,s=s.substring(0,s.length-v.raw.length)+$.raw,i=i.substring(0,i.length-v.text.length)+$.text;break}else if(g?.type==="list"){let v=g,y=v.raw+`
|
|
31
31
|
`+n.join(`
|
|
32
|
-
`),$=this.list(
|
|
33
|
-
`);continue}}return{type:"blockquote",raw:s,tokens:a,text:i}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),s=n.length>1,i={type:"list",raw:"",ordered:s,start:s?+n.slice(0,-1):"",loose:!1,items:[]};n=s?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=s?n:"[*+-]");let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let
|
|
32
|
+
`),$=this.list(y);a[a.length-1]=$,s=s.substring(0,s.length-g.raw.length)+$.raw,i=i.substring(0,i.length-v.raw.length)+$.raw,n=y.substring(a.at(-1).raw.length).split(`
|
|
33
|
+
`);continue}}return{type:"blockquote",raw:s,tokens:a,text:i}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),s=n.length>1,i={type:"list",raw:"",ordered:s,start:s?+n.slice(0,-1):"",loose:!1,items:[]};n=s?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=s?n:"[*+-]");let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let l=!1,p="",d="";if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;p=t[0],e=e.substring(p.length);let u=t[2].split(`
|
|
34
34
|
`,1)[0].replace(this.rules.other.listReplaceTabs,$=>" ".repeat(3*$.length)),g=e.split(`
|
|
35
|
-
`,1)[0],v=!u.trim(),
|
|
36
|
-
`,e=e.substring(g.length+1),
|
|
37
|
-
`,1)[0],
|
|
38
|
-
`+
|
|
39
|
-
`+g}!v&&!g.trim()&&(v=!0),p+=
|
|
40
|
-
`,e=e.substring(
|
|
41
|
-
`):[],a={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===s.length){for(let o of s)this.rules.other.tableAlignRight.test(o)?a.align.push("right"):this.rules.other.tableAlignCenter.test(o)?a.align.push("center"):this.rules.other.tableAlignLeft.test(o)?a.align.push("left"):a.align.push(null);for(let o=0;o<n.length;o++)a.header.push({text:n[o],tokens:this.lexer.inline(n[o]),header:!0,align:a.align[o]});for(let o of i)a.rows.push(
|
|
42
|
-
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let a=
|
|
35
|
+
`,1)[0],v=!u.trim(),y=0;if(this.options.pedantic?(y=2,d=u.trimStart()):v?y=t[1].length+1:(y=t[2].search(this.rules.other.nonSpaceChar),y=y>4?1:y,d=u.slice(y),y+=t[1].length),v&&this.rules.other.blankLine.test(g)&&(p+=g+`
|
|
36
|
+
`,e=e.substring(g.length+1),l=!0),!l){let $=this.rules.other.nextBulletRegex(y),A=this.rules.other.hrRegex(y),_=this.rules.other.fencesBeginRegex(y),L=this.rules.other.headingBeginRegex(y),P=this.rules.other.htmlBeginRegex(y);for(;e;){let M=e.split(`
|
|
37
|
+
`,1)[0],T;if(g=M,this.options.pedantic?(g=g.replace(this.rules.other.listReplaceNesting," "),T=g):T=g.replace(this.rules.other.tabCharGlobal," "),_.test(g)||L.test(g)||P.test(g)||$.test(g)||A.test(g))break;if(T.search(this.rules.other.nonSpaceChar)>=y||!g.trim())d+=`
|
|
38
|
+
`+T.slice(y);else{if(v||u.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||_.test(u)||L.test(u)||A.test(u))break;d+=`
|
|
39
|
+
`+g}!v&&!g.trim()&&(v=!0),p+=M+`
|
|
40
|
+
`,e=e.substring(M.length+1),u=T.slice(y)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(p)&&(o=!0)),i.items.push({type:"list_item",raw:p,task:!!this.options.gfm&&this.rules.other.listIsTask.test(d),loose:!1,text:d,tokens:[]}),i.raw+=p}let r=i.items.at(-1);if(r)r.raw=r.raw.trimEnd(),r.text=r.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let l of i.items){if(this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]),l.task){if(l.text=l.text.replace(this.rules.other.listReplaceTask,""),l.tokens[0]?.type==="text"||l.tokens[0]?.type==="paragraph"){l.tokens[0].raw=l.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),l.tokens[0].text=l.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let d=this.lexer.inlineQueue.length-1;d>=0;d--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[d].src)){this.lexer.inlineQueue[d].src=this.lexer.inlineQueue[d].src.replace(this.rules.other.listReplaceTask,"");break}}let p=this.rules.other.listTaskCheckbox.exec(l.raw);if(p){let d={type:"checkbox",raw:p[0]+" ",checked:p[0]!=="[ ]"};l.checked=d.checked,i.loose?l.tokens[0]&&["paragraph","text"].includes(l.tokens[0].type)&&"tokens"in l.tokens[0]&&l.tokens[0].tokens?(l.tokens[0].raw=d.raw+l.tokens[0].raw,l.tokens[0].text=d.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(d)):l.tokens.unshift({type:"paragraph",raw:d.raw,text:d.raw,tokens:[d]}):l.tokens.unshift(d)}}if(!i.loose){let p=l.tokens.filter(u=>u.type==="space"),d=p.length>0&&p.some(u=>this.rules.other.anyLine.test(u.raw));i.loose=d}}if(i.loose)for(let l of i.items){l.loose=!0;for(let p of l.tokens)p.type==="text"&&(p.type="paragraph")}return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:s,title:i}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=Ta(t[1]),s=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
41
|
+
`):[],a={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===s.length){for(let o of s)this.rules.other.tableAlignRight.test(o)?a.align.push("right"):this.rules.other.tableAlignCenter.test(o)?a.align.push("center"):this.rules.other.tableAlignLeft.test(o)?a.align.push("left"):a.align.push(null);for(let o=0;o<n.length;o++)a.header.push({text:n[o],tokens:this.lexer.inline(n[o]),header:!0,align:a.align[o]});for(let o of i)a.rows.push(Ta(o,a.header.length).map((r,l)=>({text:r,tokens:this.lexer.inline(r),header:!1,align:a.align[l]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let n=t[1].charAt(t[1].length-1)===`
|
|
42
|
+
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let a=ft(n.slice(0,-1),"\\");if((n.length-a.length)%2===0)return}else{let a=Gu(t[2],"()");if(a===-2)return;if(a>-1){let o=(t[0].indexOf("!")===0?5:4)+t[1].length+a;t[2]=t[2].substring(0,a),t[0]=t[0].substring(0,o).trim(),t[3]=""}}let s=t[2],i="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(s);a&&(s=a[1],i=a[3])}else i=t[3]?t[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?s=s.slice(1):s=s.slice(1,-1)),Ea(t,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let s=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=t[s.toLowerCase()];if(!i){let a=n[0].charAt(0);return{type:"text",raw:a,text:a}}return Ea(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let s=this.rules.inline.emStrongLDelim.exec(e);if(!(!s||s[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[2])||!n||this.rules.inline.punctuation.exec(n))){let i=[...s[0]].length-1,a,o,r=i,l=0,p=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(p.lastIndex=0,t=t.slice(-1*e.length+i);(s=p.exec(t))!=null;){if(a=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!a)continue;if(o=[...a].length,s[3]||s[4]){r+=o;continue}else if((s[5]||s[6])&&i%3&&!((i+o)%3)){l+=o;continue}if(r-=o,r>0)continue;o=Math.min(o,o+r+l);let d=[...s[0]][0].length,u=e.slice(0,i+s.index+d+o);if(Math.min(i,o)%2){let v=u.slice(1,-1);return{type:"em",raw:u,text:v,tokens:this.lexer.inlineTokens(v)}}let g=u.slice(2,-2);return{type:"strong",raw:u,text:g,tokens:this.lexer.inlineTokens(g)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(n),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return s&&i&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let n,s;return t[2]==="@"?(n=t[1],s="mailto:"+n):(n=t[1],s=n),{type:"link",raw:t[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let n,s;if(t[2]==="@")n=t[0],s="mailto:"+n;else{let i;do i=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(i!==t[0]);n=t[0],t[1]==="www."?s="http://"+t[0]:s=t[0]}return{type:"link",raw:t[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}},ie=class Ss{tokens;options;state;inlineQueue;tokenizer;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||He,this.options.tokenizer=this.options.tokenizer||new nn,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:Q,block:jt.normal,inline:ht.normal};this.options.pedantic?(n.block=jt.pedantic,n.inline=ht.pedantic):this.options.gfm&&(n.block=jt.gfm,this.options.breaks?n.inline=ht.breaks:n.inline=ht.gfm),this.tokenizer.rules=n}static get rules(){return{block:jt,inline:ht}}static lex(t,n){return new Ss(n).lex(t)}static lexInline(t,n){return new Ss(n).inlineTokens(t)}lex(t){t=t.replace(Q.carriageReturn,`
|
|
43
43
|
`),this.blockTokens(t,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let s=this.inlineQueue[n];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,n=[],s=!1){for(this.options.pedantic&&(t=t.replace(Q.tabCharGlobal," ").replace(Q.spaceLine,""));t;){let i;if(this.options.extensions?.block?.some(o=>(i=o.call({lexer:this},t,n))?(t=t.substring(i.raw.length),n.push(i),!0):!1))continue;if(i=this.tokenizer.space(t)){t=t.substring(i.raw.length);let o=n.at(-1);i.raw.length===1&&o!==void 0?o.raw+=`
|
|
44
44
|
`:n.push(i);continue}if(i=this.tokenizer.code(t)){t=t.substring(i.raw.length);let o=n.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=(o.raw.endsWith(`
|
|
45
45
|
`)?"":`
|
|
@@ -47,20 +47,20 @@ ${d}`:d;let u=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
|
47
47
|
`+i.text,this.inlineQueue.at(-1).src=o.text):n.push(i);continue}if(i=this.tokenizer.fences(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.heading(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.hr(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.blockquote(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.list(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.html(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.def(t)){t=t.substring(i.raw.length);let o=n.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=(o.raw.endsWith(`
|
|
48
48
|
`)?"":`
|
|
49
49
|
`)+i.raw,o.text+=`
|
|
50
|
-
`+i.raw,this.inlineQueue.at(-1).src=o.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},n.push(i));continue}if(i=this.tokenizer.table(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.lheading(t)){t=t.substring(i.raw.length),n.push(i);continue}let a=t;if(this.options.extensions?.startBlock){let o=1/0,
|
|
50
|
+
`+i.raw,this.inlineQueue.at(-1).src=o.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},n.push(i));continue}if(i=this.tokenizer.table(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.lheading(t)){t=t.substring(i.raw.length),n.push(i);continue}let a=t;if(this.options.extensions?.startBlock){let o=1/0,r=t.slice(1),l;this.options.extensions.startBlock.forEach(p=>{l=p.call({lexer:this},r),typeof l=="number"&&l>=0&&(o=Math.min(o,l))}),o<1/0&&o>=0&&(a=t.substring(0,o+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){let o=n.at(-1);s&&o?.type==="paragraph"?(o.raw+=(o.raw.endsWith(`
|
|
51
51
|
`)?"":`
|
|
52
52
|
`)+i.raw,o.text+=`
|
|
53
53
|
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):n.push(i),s=a.length!==t.length,t=t.substring(i.raw.length);continue}if(i=this.tokenizer.text(t)){t=t.substring(i.raw.length);let o=n.at(-1);o?.type==="text"?(o.raw+=(o.raw.endsWith(`
|
|
54
54
|
`)?"":`
|
|
55
55
|
`)+i.raw,o.text+=`
|
|
56
|
-
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):n.push(i);continue}if(t){let o="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(o);break}else throw new Error(o)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){let s=t,i=null;if(this.tokens.links){let
|
|
56
|
+
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):n.push(i);continue}if(t){let o="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(o);break}else throw new Error(o)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){let s=t,i=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)l.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,i.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let a;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)a=i[2]?i[2].length:0,s=s.slice(0,i.index+a)+"["+"a".repeat(i[0].length-a-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let o=!1,r="";for(;t;){o||(r=""),o=!1;let l;if(this.options.extensions?.inline?.some(d=>(l=d.call({lexer:this},t,n))?(t=t.substring(l.raw.length),n.push(l),!0):!1))continue;if(l=this.tokenizer.escape(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.tag(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.link(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(l.raw.length);let d=n.at(-1);l.type==="text"&&d?.type==="text"?(d.raw+=l.raw,d.text+=l.text):n.push(l);continue}if(l=this.tokenizer.emStrong(t,s,r)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.codespan(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.br(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.del(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.autolink(t)){t=t.substring(l.raw.length),n.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(t))){t=t.substring(l.raw.length),n.push(l);continue}let p=t;if(this.options.extensions?.startInline){let d=1/0,u=t.slice(1),g;this.options.extensions.startInline.forEach(v=>{g=v.call({lexer:this},u),typeof g=="number"&&g>=0&&(d=Math.min(d,g))}),d<1/0&&d>=0&&(p=t.substring(0,d+1))}if(l=this.tokenizer.inlineText(p)){t=t.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(r=l.raw.slice(-1)),o=!0;let d=n.at(-1);d?.type==="text"?(d.raw+=l.raw,d.text+=l.text):n.push(l);continue}if(t){let d="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(d);break}else throw new Error(d)}}return n}},sn=class{options;parser;constructor(e){this.options=e||He}space(e){return""}code({text:e,lang:t,escaped:n}){let s=(t||"").match(Q.notSpaceStart)?.[0],i=e.replace(Q.endingNewline,"")+`
|
|
57
57
|
`;return s?'<pre><code class="language-'+me(s)+'">'+(n?i:me(i,!0))+`</code></pre>
|
|
58
58
|
`:"<pre><code>"+(n?i:me(i,!0))+`</code></pre>
|
|
59
59
|
`}blockquote({tokens:e}){return`<blockquote>
|
|
60
60
|
${this.parser.parse(e)}</blockquote>
|
|
61
61
|
`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
62
62
|
`}hr(e){return`<hr>
|
|
63
|
-
`}list(e){let t=e.ordered,n=e.start,s="";for(let o=0;o<e.items.length;o++){let
|
|
63
|
+
`}list(e){let t=e.ordered,n=e.start,s="";for(let o=0;o<e.items.length;o++){let r=e.items[o];s+=this.listitem(r)}let i=t?"ol":"ul",a=t&&n!==1?' start="'+n+'"':"";return"<"+i+a+`>
|
|
64
64
|
`+s+"</"+i+`>
|
|
65
65
|
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
|
66
66
|
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
@@ -71,29 +71,29 @@ ${this.parser.parse(e)}</blockquote>
|
|
|
71
71
|
`}tablerow({text:e}){return`<tr>
|
|
72
72
|
${e}</tr>
|
|
73
73
|
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
74
|
-
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${me(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let s=this.parser.parseInline(n),i=
|
|
75
|
-
Please report this to https://github.com/markedjs/marked.`,e){let s="<p>An error occurred:</p><pre>"+me(n.message+"",!0)+"</pre>";return t?Promise.resolve(s):s}if(t)return Promise.reject(n);throw n}}},Ue=new
|
|
74
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${me(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let s=this.parser.parseInline(n),i=Ca(e);if(i===null)return s;e=i;let a='<a href="'+e+'"';return t&&(a+=' title="'+me(t)+'"'),a+=">"+s+"</a>",a}image({href:e,title:t,text:n,tokens:s}){s&&(n=this.parser.parseInline(s,this.parser.textRenderer));let i=Ca(e);if(i===null)return me(n);e=i;let a=`<img src="${e}" alt="${n}"`;return t&&(a+=` title="${me(t)}"`),a+=">",a}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:me(e.text)}},hi=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},ae=class _s{options;renderer;textRenderer;constructor(t){this.options=t||He,this.options.renderer=this.options.renderer||new sn,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new hi}static parse(t,n){return new _s(n).parse(t)}static parseInline(t,n){return new _s(n).parseInline(t)}parse(t){let n="";for(let s=0;s<t.length;s++){let i=t[s];if(this.options.extensions?.renderers?.[i.type]){let o=i,r=this.options.extensions.renderers[o.type].call({parser:this},o);if(r!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(o.type)){n+=r||"";continue}}let a=i;switch(a.type){case"space":{n+=this.renderer.space(a);break}case"hr":{n+=this.renderer.hr(a);break}case"heading":{n+=this.renderer.heading(a);break}case"code":{n+=this.renderer.code(a);break}case"table":{n+=this.renderer.table(a);break}case"blockquote":{n+=this.renderer.blockquote(a);break}case"list":{n+=this.renderer.list(a);break}case"checkbox":{n+=this.renderer.checkbox(a);break}case"html":{n+=this.renderer.html(a);break}case"def":{n+=this.renderer.def(a);break}case"paragraph":{n+=this.renderer.paragraph(a);break}case"text":{n+=this.renderer.text(a);break}default:{let o='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return n}parseInline(t,n=this.renderer){let s="";for(let i=0;i<t.length;i++){let a=t[i];if(this.options.extensions?.renderers?.[a.type]){let r=this.options.extensions.renderers[a.type].call({parser:this},a);if(r!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){s+=r||"";continue}}let o=a;switch(o.type){case"escape":{s+=n.text(o);break}case"html":{s+=n.html(o);break}case"link":{s+=n.link(o);break}case"image":{s+=n.image(o);break}case"checkbox":{s+=n.checkbox(o);break}case"strong":{s+=n.strong(o);break}case"em":{s+=n.em(o);break}case"codespan":{s+=n.codespan(o);break}case"br":{s+=n.br(o);break}case"del":{s+=n.del(o);break}case"text":{s+=n.text(o);break}default:{let r='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(r),"";throw new Error(r)}}}return s}},gt=class{options;block;constructor(e){this.options=e||He}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?ie.lex:ie.lexInline}provideParser(){return this.block?ae.parse:ae.parseInline}},Vu=class{defaults=ai();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=ae;Renderer=sn;TextRenderer=hi;Lexer=ie;Tokenizer=nn;Hooks=gt;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let s of e)switch(n=n.concat(t.call(this,s)),s.type){case"table":{let i=s;for(let a of i.header)n=n.concat(this.walkTokens(a.tokens,t));for(let a of i.rows)for(let o of a)n=n.concat(this.walkTokens(o.tokens,t));break}case"list":{let i=s;n=n.concat(this.walkTokens(i.items,t));break}default:{let i=s;this.defaults.extensions?.childTokens?.[i.type]?this.defaults.extensions.childTokens[i.type].forEach(a=>{let o=i[a].flat(1/0);n=n.concat(this.walkTokens(o,t))}):i.tokens&&(n=n.concat(this.walkTokens(i.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let s={...n};if(s.async=this.defaults.async||s.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let a=t.renderers[i.name];a?t.renderers[i.name]=function(...o){let r=i.renderer.apply(this,o);return r===!1&&(r=a.apply(this,o)),r}:t.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=t[i.level];a?a.unshift(i.tokenizer):t[i.level]=[i.tokenizer],i.start&&(i.level==="block"?t.startBlock?t.startBlock.push(i.start):t.startBlock=[i.start]:i.level==="inline"&&(t.startInline?t.startInline.push(i.start):t.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(t.childTokens[i.name]=i.childTokens)}),s.extensions=t),n.renderer){let i=this.defaults.renderer||new sn(this.defaults);for(let a in n.renderer){if(!(a in i))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let o=a,r=n.renderer[o],l=i[o];i[o]=(...p)=>{let d=r.apply(i,p);return d===!1&&(d=l.apply(i,p)),d||""}}s.renderer=i}if(n.tokenizer){let i=this.defaults.tokenizer||new nn(this.defaults);for(let a in n.tokenizer){if(!(a in i))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let o=a,r=n.tokenizer[o],l=i[o];i[o]=(...p)=>{let d=r.apply(i,p);return d===!1&&(d=l.apply(i,p)),d}}s.tokenizer=i}if(n.hooks){let i=this.defaults.hooks||new gt;for(let a in n.hooks){if(!(a in i))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let o=a,r=n.hooks[o],l=i[o];gt.passThroughHooks.has(a)?i[o]=p=>{if(this.defaults.async&>.passThroughHooksRespectAsync.has(a))return(async()=>{let u=await r.call(i,p);return l.call(i,u)})();let d=r.call(i,p);return l.call(i,d)}:i[o]=(...p)=>{if(this.defaults.async)return(async()=>{let u=await r.apply(i,p);return u===!1&&(u=await l.apply(i,p)),u})();let d=r.apply(i,p);return d===!1&&(d=l.apply(i,p)),d}}s.hooks=i}if(n.walkTokens){let i=this.defaults.walkTokens,a=n.walkTokens;s.walkTokens=function(o){let r=[];return r.push(a.call(this,o)),i&&(r=r.concat(i.call(this,o))),r}}this.defaults={...this.defaults,...s}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return ie.lex(e,t??this.defaults)}parser(e,t){return ae.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let s={...n},i={...this.defaults,...s},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&s.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let o=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer():e?ie.lex:ie.lexInline)(o,i),l=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(l,i.walkTokens));let p=await(i.hooks?await i.hooks.provideParser():e?ae.parse:ae.parseInline)(l,i);return i.hooks?await i.hooks.postprocess(p):p})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let o=(i.hooks?i.hooks.provideLexer():e?ie.lex:ie.lexInline)(t,i);i.hooks&&(o=i.hooks.processAllTokens(o)),i.walkTokens&&this.walkTokens(o,i.walkTokens);let r=(i.hooks?i.hooks.provideParser():e?ae.parse:ae.parseInline)(o,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(o){return a(o)}}}onError(e,t){return n=>{if(n.message+=`
|
|
75
|
+
Please report this to https://github.com/markedjs/marked.`,e){let s="<p>An error occurred:</p><pre>"+me(n.message+"",!0)+"</pre>";return t?Promise.resolve(s):s}if(t)return Promise.reject(n);throw n}}},Ue=new Vu;function N(e,t){return Ue.parse(e,t)}N.options=N.setOptions=function(e){return Ue.setOptions(e),N.defaults=Ue.defaults,ir(N.defaults),N};N.getDefaults=ai;N.defaults=He;N.use=function(...e){return Ue.use(...e),N.defaults=Ue.defaults,ir(N.defaults),N};N.walkTokens=function(e,t){return Ue.walkTokens(e,t)};N.parseInline=Ue.parseInline;N.Parser=ae;N.parser=ae.parse;N.Renderer=sn;N.TextRenderer=hi;N.Lexer=ie;N.lexer=ie.lex;N.Tokenizer=nn;N.Hooks=gt;N.parse=N;N.options;N.setOptions;N.use;N.walkTokens;N.parseInline;ae.parse;ie.lex;N.setOptions({gfm:!0,breaks:!0,mangle:!1});const Ma=["a","b","blockquote","br","code","del","em","h1","h2","h3","h4","hr","i","li","ol","p","pre","strong","table","tbody","td","th","thead","tr","ul"],La=["class","href","rel","target","title","start"];let Ia=!1;const Yu=14e4,Qu=4e4,Zu=200,ns=5e4,Ne=new Map;function Ju(e){const t=Ne.get(e);return t===void 0?null:(Ne.delete(e),Ne.set(e,t),t)}function Ra(e,t){if(Ne.set(e,t),Ne.size<=Zu)return;const n=Ne.keys().next().value;n&&Ne.delete(n)}function Xu(){Ia||(Ia=!0,As.addHook("afterSanitizeAttributes",e=>{!(e instanceof HTMLAnchorElement)||!e.getAttribute("href")||(e.setAttribute("rel","noreferrer noopener"),e.setAttribute("target","_blank"))}))}function Cs(e){const t=e.trim();if(!t)return"";if(Xu(),t.length<=ns){const o=Ju(t);if(o!==null)return o}const n=vo(t,Yu),s=n.truncated?`
|
|
76
76
|
|
|
77
|
-
… truncated (${n.total} chars, showing first ${n.text.length}).`:"";if(n.text.length>
|
|
77
|
+
… truncated (${n.total} chars, showing first ${n.text.length}).`:"";if(n.text.length>Qu){const r=`<pre class="code-block">${ep(`${n.text}${s}`)}</pre>`,l=As.sanitize(r,{ALLOWED_TAGS:Ma,ALLOWED_ATTR:La});return t.length<=ns&&Ra(t,l),l}const i=N.parse(`${n.text}${s}`),a=As.sanitize(i,{ALLOWED_TAGS:Ma,ALLOWED_ATTR:La});return t.length<=ns&&Ra(t,a),a}function ep(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}const tp=1500,np=2e3,gr="Copy as markdown",sp="Copied",ip="Copy failed";async function ap(e){if(!e)return!1;try{return await navigator.clipboard.writeText(e),!0}catch{return!1}}function qt(e,t){e.title=t,e.setAttribute("aria-label",t)}function op(e){const t=e.label??gr;return c`
|
|
78
78
|
<button
|
|
79
79
|
class="chat-copy-btn"
|
|
80
80
|
type="button"
|
|
81
81
|
title=${t}
|
|
82
82
|
aria-label=${t}
|
|
83
|
-
@click=${async n=>{const s=n.currentTarget;if(s?.querySelector(".chat-copy-btn__icon"),!s||s.dataset.copying==="1")return;s.dataset.copying="1",s.setAttribute("aria-busy","true"),s.disabled=!0;const i=await
|
|
83
|
+
@click=${async n=>{const s=n.currentTarget;if(s?.querySelector(".chat-copy-btn__icon"),!s||s.dataset.copying==="1")return;s.dataset.copying="1",s.setAttribute("aria-busy","true"),s.disabled=!0;const i=await ap(e.text());if(s.isConnected){if(delete s.dataset.copying,s.removeAttribute("aria-busy"),s.disabled=!1,!i){s.dataset.error="1",qt(s,ip),window.setTimeout(()=>{s.isConnected&&(delete s.dataset.error,qt(s,t))},np);return}s.dataset.copied="1",qt(s,sp),window.setTimeout(()=>{s.isConnected&&(delete s.dataset.copied,qt(s,t))},tp)}}}
|
|
84
84
|
>
|
|
85
85
|
<span class="chat-copy-btn__icon" aria-hidden="true">
|
|
86
|
-
<span class="chat-copy-btn__icon-copy">${
|
|
87
|
-
<span class="chat-copy-btn__icon-check">${
|
|
86
|
+
<span class="chat-copy-btn__icon-copy">${W.copy}</span>
|
|
87
|
+
<span class="chat-copy-btn__icon-check">${W.check}</span>
|
|
88
88
|
</span>
|
|
89
89
|
</button>
|
|
90
|
-
`}function
|
|
91
|
-
`),n=t.slice(0
|
|
92
|
-
`);return s.length>
|
|
90
|
+
`}function rp(e){return op({text:()=>e,label:gr})}const lp={icon:"puzzle",detailKeys:["command","path","url","targetUrl","targetId","ref","element","node","nodeId","id","requestId","to","channelId","guildId","userId","name","query","pattern","messageId"]},cp={bash:{icon:"wrench",title:"Bash",detailKeys:["command"]},process:{icon:"wrench",title:"Process",detailKeys:["sessionId"]},read:{icon:"fileText",title:"Read",detailKeys:["path"]},write:{icon:"edit",title:"Write",detailKeys:["path"]},edit:{icon:"penLine",title:"Edit",detailKeys:["path"]},attach:{icon:"paperclip",title:"Attach",detailKeys:["path","url","fileName"]},browser:{icon:"globe",title:"Browser",actions:{status:{label:"status"},start:{label:"start"},stop:{label:"stop"},tabs:{label:"tabs"},open:{label:"open",detailKeys:["targetUrl"]},focus:{label:"focus",detailKeys:["targetId"]},close:{label:"close",detailKeys:["targetId"]},snapshot:{label:"snapshot",detailKeys:["targetUrl","targetId","ref","element","format"]},screenshot:{label:"screenshot",detailKeys:["targetUrl","targetId","ref","element"]},navigate:{label:"navigate",detailKeys:["targetUrl","targetId"]},console:{label:"console",detailKeys:["level","targetId"]},pdf:{label:"pdf",detailKeys:["targetId"]},upload:{label:"upload",detailKeys:["paths","ref","inputRef","element","targetId"]},dialog:{label:"dialog",detailKeys:["accept","promptText","targetId"]},act:{label:"act",detailKeys:["request.kind","request.ref","request.selector","request.text","request.value"]}}},canvas:{icon:"image",title:"Canvas",actions:{present:{label:"present",detailKeys:["target","node","nodeId"]},hide:{label:"hide",detailKeys:["node","nodeId"]},navigate:{label:"navigate",detailKeys:["url","node","nodeId"]},eval:{label:"eval",detailKeys:["javaScript","node","nodeId"]},snapshot:{label:"snapshot",detailKeys:["format","node","nodeId"]},a2ui_push:{label:"A2UI push",detailKeys:["jsonlPath","node","nodeId"]},a2ui_reset:{label:"A2UI reset",detailKeys:["node","nodeId"]}}},nodes:{icon:"smartphone",title:"Nodes",actions:{status:{label:"status"},describe:{label:"describe",detailKeys:["node","nodeId"]},pending:{label:"pending"},approve:{label:"approve",detailKeys:["requestId"]},reject:{label:"reject",detailKeys:["requestId"]},notify:{label:"notify",detailKeys:["node","nodeId","title","body"]},camera_snap:{label:"camera snap",detailKeys:["node","nodeId","facing","deviceId"]},camera_list:{label:"camera list",detailKeys:["node","nodeId"]},camera_clip:{label:"camera clip",detailKeys:["node","nodeId","facing","duration","durationMs"]},screen_record:{label:"screen record",detailKeys:["node","nodeId","duration","durationMs","fps","screenIndex"]}}},cron:{icon:"loader",title:"Cron",actions:{status:{label:"status"},list:{label:"list"},add:{label:"add",detailKeys:["job.name","job.id","job.schedule","job.cron"]},update:{label:"update",detailKeys:["id"]},remove:{label:"remove",detailKeys:["id"]},run:{label:"run",detailKeys:["id"]},runs:{label:"runs",detailKeys:["id"]},wake:{label:"wake",detailKeys:["text","mode"]}}},gateway:{icon:"plug",title:"Gateway",actions:{restart:{label:"restart",detailKeys:["reason","delayMs"]},"config.get":{label:"config get"},"config.schema":{label:"config schema"},"config.apply":{label:"config apply",detailKeys:["restartDelayMs"]},"update.run":{label:"update run",detailKeys:["restartDelayMs"]}}},whatsapp_login:{icon:"circle",title:"WhatsApp Login",actions:{start:{label:"start"},wait:{label:"wait"}}},discord:{icon:"messageSquare",title:"Discord",actions:{react:{label:"react",detailKeys:["channelId","messageId","emoji"]},reactions:{label:"reactions",detailKeys:["channelId","messageId"]},sticker:{label:"sticker",detailKeys:["to","stickerIds"]},poll:{label:"poll",detailKeys:["question","to"]},permissions:{label:"permissions",detailKeys:["channelId"]},readMessages:{label:"read messages",detailKeys:["channelId","limit"]},sendMessage:{label:"send",detailKeys:["to","content"]},editMessage:{label:"edit",detailKeys:["channelId","messageId"]},deleteMessage:{label:"delete",detailKeys:["channelId","messageId"]},threadCreate:{label:"thread create",detailKeys:["channelId","name"]},threadList:{label:"thread list",detailKeys:["guildId","channelId"]},threadReply:{label:"thread reply",detailKeys:["channelId","content"]},pinMessage:{label:"pin",detailKeys:["channelId","messageId"]},unpinMessage:{label:"unpin",detailKeys:["channelId","messageId"]},listPins:{label:"list pins",detailKeys:["channelId"]},searchMessages:{label:"search",detailKeys:["guildId","content"]},memberInfo:{label:"member",detailKeys:["guildId","userId"]},roleInfo:{label:"roles",detailKeys:["guildId"]},emojiList:{label:"emoji list",detailKeys:["guildId"]},roleAdd:{label:"role add",detailKeys:["guildId","userId","roleId"]},roleRemove:{label:"role remove",detailKeys:["guildId","userId","roleId"]},channelInfo:{label:"channel",detailKeys:["channelId"]},channelList:{label:"channels",detailKeys:["guildId"]},voiceStatus:{label:"voice",detailKeys:["guildId","userId"]},eventList:{label:"events",detailKeys:["guildId"]},eventCreate:{label:"event create",detailKeys:["guildId","name"]},timeout:{label:"timeout",detailKeys:["guildId","userId"]},kick:{label:"kick",detailKeys:["guildId","userId"]},ban:{label:"ban",detailKeys:["guildId","userId"]}}},slack:{icon:"messageSquare",title:"Slack",actions:{react:{label:"react",detailKeys:["channelId","messageId","emoji"]},reactions:{label:"reactions",detailKeys:["channelId","messageId"]},sendMessage:{label:"send",detailKeys:["to","content"]},editMessage:{label:"edit",detailKeys:["channelId","messageId"]},deleteMessage:{label:"delete",detailKeys:["channelId","messageId"]},readMessages:{label:"read messages",detailKeys:["channelId","limit"]},pinMessage:{label:"pin",detailKeys:["channelId","messageId"]},unpinMessage:{label:"unpin",detailKeys:["channelId","messageId"]},listPins:{label:"list pins",detailKeys:["channelId"]},memberInfo:{label:"member",detailKeys:["userId"]},emojiList:{label:"emoji list"}}}},dp={fallback:lp,tools:cp},vr=dp,Pa=vr.fallback??{icon:"puzzle"},up=vr.tools??{};function pp(e){return(e??"tool").trim()}function hp(e){const t=e.replace(/_/g," ").trim();return t?t.split(/\s+/).map(n=>n.length<=2&&n.toUpperCase()===n?n:`${n.at(0)?.toUpperCase()??""}${n.slice(1)}`).join(" "):"Tool"}function fp(e){const t=e?.trim();if(t)return t.replace(/_/g," ")}function mr(e){if(e!=null){if(typeof e=="string"){const t=e.trim();if(!t)return;const n=t.split(/\r?\n/)[0]?.trim()??"";return n?n.length>160?`${n.slice(0,157)}…`:n:void 0}if(typeof e=="number"||typeof e=="boolean")return String(e);if(Array.isArray(e)){const t=e.map(s=>mr(s)).filter(s=>!!s);if(t.length===0)return;const n=t.slice(0,3).join(", ");return t.length>3?`${n}…`:n}}}function gp(e,t){if(!e||typeof e!="object")return;let n=e;for(const s of t.split(".")){if(!s||!n||typeof n!="object")return;n=n[s]}return n}function vp(e,t){for(const n of t){const s=gp(e,n),i=mr(s);if(i)return i}}function mp(e){if(!e||typeof e!="object")return;const t=e,n=typeof t.path=="string"?t.path:void 0;if(!n)return;const s=typeof t.offset=="number"?t.offset:void 0,i=typeof t.limit=="number"?t.limit:void 0;return s!==void 0&&i!==void 0?`${n}:${s}-${s+i}`:n}function yp(e){if(!e||typeof e!="object")return;const t=e;return typeof t.path=="string"?t.path:void 0}function bp(e,t){if(!(!e||!t))return e.actions?.[t]??void 0}function wp(e){const t=pp(e.name),n=t.toLowerCase(),s=up[n],i=s?.icon??Pa.icon??"puzzle",a=s?.title??hp(t),o=s?.label??t,r=e.args&&typeof e.args=="object"?e.args.action:void 0,l=typeof r=="string"?r.trim():void 0,p=bp(s,l),d=fp(p?.label??l);let u;n==="read"&&(u=mp(e.args)),!u&&(n==="write"||n==="edit"||n==="attach")&&(u=yp(e.args));const g=p?.detailKeys??s?.detailKeys??Pa.detailKeys??[];return!u&&g.length>0&&(u=vp(e.args,g)),!u&&e.meta&&(u=e.meta),u&&(u=xp(u)),{name:t,icon:i,title:a,label:o,verb:d,detail:u}}function $p(e){const t=[];if(e.verb&&t.push(e.verb),e.detail&&t.push(e.detail),t.length!==0)return t.join(" · ")}function xp(e){return e&&e.replace(/\/Users\/[^/]+/g,"~").replace(/\/home\/[^/]+/g,"~")}const Ap=80,kp=2,Na=100;function Sp(e){const t=e.trim();if(t.startsWith("{")||t.startsWith("["))try{const n=JSON.parse(t);return"```json\n"+JSON.stringify(n,null,2)+"\n```"}catch{}return e}function _p(e){const t=e.split(`
|
|
91
|
+
`),n=t.slice(0,kp),s=n.join(`
|
|
92
|
+
`);return s.length>Na?s.slice(0,Na)+"…":n.length<t.length?s+"…":s}function Cp(e){const t=e,n=Tp(t.content),s=[];for(const i of n){const a=String(i.type??"").toLowerCase();(["toolcall","tool_call","tooluse","tool_use"].includes(a)||typeof i.name=="string"&&i.arguments!=null)&&s.push({kind:"call",name:i.name??"tool",args:Ep(i.arguments??i.args)})}for(const i of n){const a=String(i.type??"").toLowerCase();if(a!=="toolresult"&&a!=="tool_result")continue;const o=Mp(i),r=typeof i.name=="string"?i.name:"tool";s.push({kind:"result",name:r,text:o})}if(Xo(e)&&!s.some(i=>i.kind==="result")){const i=typeof t.toolName=="string"&&t.toolName||typeof t.tool_name=="string"&&t.tool_name||"tool",a=mo(e)??void 0;s.push({kind:"result",name:i,text:a})}return s}function Oa(e,t){const n=wp({name:e.name,args:e.args}),s=$p(n),i=!!e.text?.trim(),a=!!t,o=a?()=>{if(i){t(Sp(e.text));return}const u=`## ${n.label}
|
|
93
93
|
|
|
94
94
|
${s?`**Command:** \`${s}\`
|
|
95
95
|
|
|
96
|
-
`:""}*No output — tool completed successfully.*`;t(u)}:void 0,
|
|
96
|
+
`:""}*No output — tool completed successfully.*`;t(u)}:void 0,r=i&&(e.text?.length??0)<=Ap,l=i&&!r,p=i&&r,d=!i;return c`
|
|
97
97
|
<div
|
|
98
98
|
class="chat-tool-card ${a?"chat-tool-card--clickable":""}"
|
|
99
99
|
@click=${o}
|
|
@@ -103,18 +103,18 @@ ${s?`**Command:** \`${s}\`
|
|
|
103
103
|
>
|
|
104
104
|
<div class="chat-tool-card__header">
|
|
105
105
|
<div class="chat-tool-card__title">
|
|
106
|
-
<span class="chat-tool-card__icon">${
|
|
106
|
+
<span class="chat-tool-card__icon">${W[n.icon]}</span>
|
|
107
107
|
<span>${n.label}</span>
|
|
108
108
|
</div>
|
|
109
|
-
${a?c`<span class="chat-tool-card__action">${i?"View":""} ${
|
|
110
|
-
${d&&!a?c`<span class="chat-tool-card__status">${
|
|
109
|
+
${a?c`<span class="chat-tool-card__action">${i?"View":""} ${W.check}</span>`:f}
|
|
110
|
+
${d&&!a?c`<span class="chat-tool-card__status">${W.check}</span>`:f}
|
|
111
111
|
</div>
|
|
112
112
|
${s?c`<div class="chat-tool-card__detail">${s}</div>`:f}
|
|
113
113
|
${d?c`<div class="chat-tool-card__status-text muted">Completed</div>`:f}
|
|
114
|
-
${
|
|
114
|
+
${l?c`<div class="chat-tool-card__preview mono">${_p(e.text)}</div>`:f}
|
|
115
115
|
${p?c`<div class="chat-tool-card__inline mono">${e.text}</div>`:f}
|
|
116
116
|
</div>
|
|
117
|
-
`}function
|
|
117
|
+
`}function Tp(e){return Array.isArray(e)?e.filter(Boolean):[]}function Ep(e){if(typeof e!="string")return e;const t=e.trim();if(!t||!t.startsWith("{")&&!t.startsWith("["))return e;try{return JSON.parse(t)}catch{return e}}function Mp(e){if(typeof e.text=="string")return e.text;if(typeof e.content=="string")return e.content}function Lp(e){const n=e.content,s=[];if(Array.isArray(n))for(const i of n){if(typeof i!="object"||i===null)continue;const a=i;if(a.type==="image"){const o=a.source;if(o?.type==="base64"&&typeof o.data=="string"){const r=o.data,l=o.media_type||"image/png",p=r.startsWith("data:")?r:`data:${l};base64,${r}`;s.push({url:p})}else typeof a.url=="string"&&s.push({url:a.url})}else if(a.type==="image_url"){const o=a.image_url;typeof o?.url=="string"&&s.push({url:o.url})}}return s}function Ip(e){return c`
|
|
118
118
|
<div class="chat-group assistant">
|
|
119
119
|
${fi("assistant",e)}
|
|
120
120
|
<div class="chat-group-messages">
|
|
@@ -125,33 +125,33 @@ ${s?`**Command:** \`${s}\`
|
|
|
125
125
|
</div>
|
|
126
126
|
</div>
|
|
127
127
|
</div>
|
|
128
|
-
`}function
|
|
128
|
+
`}function Rp(e,t,n,s){const i=new Date(t).toLocaleTimeString([],{hour:"numeric",minute:"2-digit"}),a=s?.name??"Assistant";return c`
|
|
129
129
|
<div class="chat-group assistant">
|
|
130
130
|
${fi("assistant",s)}
|
|
131
131
|
<div class="chat-group-messages">
|
|
132
|
-
${
|
|
132
|
+
${yr({role:"assistant",content:[{type:"text",text:e}],timestamp:t},{isStreaming:!0,showReasoning:!1},n)}
|
|
133
133
|
<div class="chat-group-footer">
|
|
134
134
|
<span class="chat-sender-name">${a}</span>
|
|
135
135
|
<span class="chat-group-timestamp">${i}</span>
|
|
136
136
|
</div>
|
|
137
137
|
</div>
|
|
138
138
|
</div>
|
|
139
|
-
`}function
|
|
139
|
+
`}function Pp(e,t){const n=ii(e.role),s=t.assistantName??"Assistant",i=n==="user"?"You":n==="assistant"?s:n,a=n==="user"?"user":n==="assistant"?"assistant":"other",o=new Date(e.timestamp).toLocaleTimeString([],{hour:"numeric",minute:"2-digit"});return c`
|
|
140
140
|
<div class="chat-group ${a}">
|
|
141
141
|
${fi(e.role,{name:s,avatar:t.assistantAvatar??null})}
|
|
142
142
|
<div class="chat-group-messages">
|
|
143
|
-
${e.messages.map((l
|
|
143
|
+
${e.messages.map((r,l)=>yr(r.message,{isStreaming:e.isStreaming&&l===e.messages.length-1,showReasoning:t.showReasoning},t.onOpenSidebar))}
|
|
144
144
|
<div class="chat-group-footer">
|
|
145
145
|
<span class="chat-sender-name">${i}</span>
|
|
146
146
|
<span class="chat-group-timestamp">${o}</span>
|
|
147
147
|
</div>
|
|
148
148
|
</div>
|
|
149
149
|
</div>
|
|
150
|
-
`}function fi(e,t){const n=ii(e),s=t?.name?.trim()||"Assistant",i=t?.avatar?.trim()||"",a=n==="user"?"U":n==="assistant"?s.charAt(0).toUpperCase()||"A":n==="tool"?"⚙":"?",o=n==="user"?"user":n==="assistant"?"assistant":n==="tool"?"tool":"other";return i&&n==="assistant"?
|
|
150
|
+
`}function fi(e,t){const n=ii(e),s=t?.name?.trim()||"Assistant",i=t?.avatar?.trim()||"",a=n==="user"?"U":n==="assistant"?s.charAt(0).toUpperCase()||"A":n==="tool"?"⚙":"?",o=n==="user"?"user":n==="assistant"?"assistant":n==="tool"?"tool":"other";return i&&n==="assistant"?Np(i)?c`<img
|
|
151
151
|
class="chat-avatar ${o}"
|
|
152
152
|
src="${i}"
|
|
153
153
|
alt="${s}"
|
|
154
|
-
/>`:c`<div class="chat-avatar ${o}">${i}</div>`:c`<div class="chat-avatar ${o}">${a}</div>`}function
|
|
154
|
+
/>`:c`<div class="chat-avatar ${o}">${i}</div>`:c`<div class="chat-avatar ${o}">${a}</div>`}function Np(e){return/^https?:\/\//i.test(e)||/^data:image\//i.test(e)||/^\//.test(e)}function Op(e){return e.length===0?f:c`
|
|
155
155
|
<div class="chat-message-images">
|
|
156
156
|
${e.map(t=>c`
|
|
157
157
|
<img
|
|
@@ -162,20 +162,20 @@ ${s?`**Command:** \`${s}\`
|
|
|
162
162
|
/>
|
|
163
163
|
`)}
|
|
164
164
|
</div>
|
|
165
|
-
`}function
|
|
165
|
+
`}function yr(e,t,n){const s=e,i=typeof s.role=="string"?s.role:"unknown",a=Xo(e)||i.toLowerCase()==="toolresult"||i.toLowerCase()==="tool_result"||typeof s.toolCallId=="string"||typeof s.tool_call_id=="string",o=Cp(e),r=o.length>0,l=Lp(e),p=l.length>0,d=mo(e),u=t.showReasoning&&i==="assistant"?Rl(e):null,g=d?.trim()?d:null,v=u?Nl(u):null,y=g,$=i==="assistant"&&!!y?.trim(),A=["chat-bubble",$?"has-copy":"",t.isStreaming?"streaming":"","fade-in"].filter(Boolean).join(" ");return!y&&r&&a?c`${o.map(_=>Oa(_,n))}`:!y&&!r&&!p?f:c`
|
|
166
166
|
<div class="${A}">
|
|
167
|
-
${$?
|
|
168
|
-
${
|
|
169
|
-
${v?c`<div class="chat-thinking">${bs(
|
|
170
|
-
${
|
|
171
|
-
${o.map(_=>
|
|
167
|
+
${$?rp(y):f}
|
|
168
|
+
${Op(l)}
|
|
169
|
+
${v?c`<div class="chat-thinking">${bs(Cs(v))}</div>`:f}
|
|
170
|
+
${y?c`<div class="chat-text">${bs(Cs(y))}</div>`:f}
|
|
171
|
+
${o.map(_=>Oa(_,n))}
|
|
172
172
|
</div>
|
|
173
|
-
`}function
|
|
173
|
+
`}function Dp(e){return c`
|
|
174
174
|
<div class="sidebar-panel">
|
|
175
175
|
<div class="sidebar-header">
|
|
176
176
|
<div class="sidebar-title">Tool Output</div>
|
|
177
177
|
<button @click=${e.onClose} class="btn" title="Close sidebar">
|
|
178
|
-
${
|
|
178
|
+
${W.x}
|
|
179
179
|
</button>
|
|
180
180
|
</div>
|
|
181
181
|
<div class="sidebar-content">
|
|
@@ -184,10 +184,10 @@ ${s?`**Command:** \`${s}\`
|
|
|
184
184
|
<button @click=${e.onViewRawText} class="btn" style="margin-top: 12px;">
|
|
185
185
|
View Raw Text
|
|
186
186
|
</button>
|
|
187
|
-
`:e.content?c`<div class="sidebar-markdown">${bs(
|
|
187
|
+
`:e.content?c`<div class="sidebar-markdown">${bs(Cs(e.content))}</div>`:c`<div class="muted">No content available</div>`}
|
|
188
188
|
</div>
|
|
189
189
|
</div>
|
|
190
|
-
`}var
|
|
190
|
+
`}var Bp=Object.defineProperty,Fp=Object.getOwnPropertyDescriptor,wn=(e,t,n,s)=>{for(var i=s>1?void 0:s?Fp(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(s?o(t,n,i):o(i))||i);return s&&i&&Bp(t,n,i),i};let nt=class extends Je{constructor(){super(...arguments),this.splitRatio=.6,this.minRatio=.4,this.maxRatio=.7,this.isDragging=!1,this.startX=0,this.startRatio=0,this.handleMouseDown=e=>{this.isDragging=!0,this.startX=e.clientX,this.startRatio=this.splitRatio,this.classList.add("dragging"),document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("mouseup",this.handleMouseUp),e.preventDefault()},this.handleMouseMove=e=>{if(!this.isDragging)return;const t=this.parentElement;if(!t)return;const n=t.getBoundingClientRect().width,i=(e.clientX-this.startX)/n;let a=this.startRatio+i;a=Math.max(this.minRatio,Math.min(this.maxRatio,a)),this.dispatchEvent(new CustomEvent("resize",{detail:{splitRatio:a},bubbles:!0,composed:!0}))},this.handleMouseUp=()=>{this.isDragging=!1,this.classList.remove("dragging"),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp)}}render(){return c``}connectedCallback(){super.connectedCallback(),this.addEventListener("mousedown",this.handleMouseDown)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("mousedown",this.handleMouseDown),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp)}};nt.styles=Gr`
|
|
191
191
|
:host {
|
|
192
192
|
width: 4px;
|
|
193
193
|
cursor: col-resize;
|
|
@@ -213,15 +213,15 @@ ${s?`**Command:** \`${s}\`
|
|
|
213
213
|
:host(.dragging) {
|
|
214
214
|
background: var(--accent, #007bff);
|
|
215
215
|
}
|
|
216
|
-
`;wn([ln({type:Number})],nt.prototype,"splitRatio",2);wn([ln({type:Number})],nt.prototype,"minRatio",2);wn([ln({type:Number})],nt.prototype,"maxRatio",2);nt=wn([
|
|
216
|
+
`;wn([ln({type:Number})],nt.prototype,"splitRatio",2);wn([ln({type:Number})],nt.prototype,"minRatio",2);wn([ln({type:Number})],nt.prototype,"maxRatio",2);nt=wn([lo("resizable-divider")],nt);const Up=5e3;function Da(e){e.style.height="auto",e.style.height=`${e.scrollHeight}px`}function Kp(e){return e?e.active?c`
|
|
217
217
|
<div class="callout info compaction-indicator compaction-indicator--active">
|
|
218
|
-
${
|
|
218
|
+
${W.loader} Compacting context...
|
|
219
219
|
</div>
|
|
220
|
-
`:e.completedAt&&Date.now()-e.completedAt<
|
|
220
|
+
`:e.completedAt&&Date.now()-e.completedAt<Up?c`
|
|
221
221
|
<div class="callout success compaction-indicator compaction-indicator--complete">
|
|
222
|
-
${
|
|
222
|
+
${W.check} Context compacted
|
|
223
223
|
</div>
|
|
224
|
-
`:f:f}function
|
|
224
|
+
`:f:f}function Hp(){return`att-${Date.now()}-${Math.random().toString(36).slice(2,9)}`}function zp(e,t){const n=e.clipboardData?.items;if(!n||!t.onAttachmentsChange)return;const s=[];for(let i=0;i<n.length;i++){const a=n[i];a.type.startsWith("image/")&&s.push(a)}if(s.length!==0){e.preventDefault();for(const i of s){const a=i.getAsFile();if(!a)continue;const o=new FileReader;o.onload=()=>{const r=o.result,l={id:Hp(),dataUrl:r,mimeType:a.type},p=t.attachments??[];t.onAttachmentsChange?.([...p,l])},o.readAsDataURL(a)}}}function jp(e){const t=e.attachments??[];return t.length===0?f:c`
|
|
225
225
|
<div class="chat-attachments">
|
|
226
226
|
${t.map(n=>c`
|
|
227
227
|
<div class="chat-attachment">
|
|
@@ -236,12 +236,12 @@ ${s?`**Command:** \`${s}\`
|
|
|
236
236
|
aria-label="Remove attachment"
|
|
237
237
|
@click=${()=>{const s=(e.attachments??[]).filter(i=>i.id!==n.id);e.onAttachmentsChange?.(s)}}
|
|
238
238
|
>
|
|
239
|
-
${
|
|
239
|
+
${W.x}
|
|
240
240
|
</button>
|
|
241
241
|
</div>
|
|
242
242
|
`)}
|
|
243
243
|
</div>
|
|
244
|
-
`}function
|
|
244
|
+
`}function qp(e){const t=e.connected,n=e.sending||e.stream!==null,s=!!(e.canAbort&&e.onAbort),a=e.sessions?.sessions?.find(v=>v.key===e.sessionKey)?.reasoningLevel??"off",o=e.showThinking&&a!=="off",r={name:e.assistantName,avatar:e.assistantAvatar??e.assistantAvatarUrl??null},l=(e.attachments?.length??0)>0,p=e.connected?l?"Add a message or paste more images...":"Message (↩ to send, Shift+↩ for line breaks, paste images)":"Connect to the gateway to start chatting…",d=e.splitRatio??.6,u=!!(e.sidebarOpen&&e.onCloseSidebar),g=c`
|
|
245
245
|
<div
|
|
246
246
|
class="chat-thread"
|
|
247
247
|
role="log"
|
|
@@ -249,7 +249,7 @@ ${s?`**Command:** \`${s}\`
|
|
|
249
249
|
@scroll=${e.onChatScroll}
|
|
250
250
|
>
|
|
251
251
|
${e.loading?c`<div class="muted">Loading chat…</div>`:f}
|
|
252
|
-
${
|
|
252
|
+
${Zo(Wp(e),v=>v.key,v=>v.kind==="reading-indicator"?Ip(r):v.kind==="stream"?Rp(v.text,v.startedAt,e.onOpenSidebar,r):v.kind==="group"?Pp(v,{onOpenSidebar:e.onOpenSidebar,showReasoning:o,assistantName:e.assistantName,assistantAvatar:r.avatar}):f)}
|
|
253
253
|
</div>
|
|
254
254
|
`;return c`
|
|
255
255
|
<section class="card chat">
|
|
@@ -257,7 +257,7 @@ ${s?`**Command:** \`${s}\`
|
|
|
257
257
|
|
|
258
258
|
${e.error?c`<div class="callout danger">${e.error}</div>`:f}
|
|
259
259
|
|
|
260
|
-
${
|
|
260
|
+
${Kp(e.compactionStatus)}
|
|
261
261
|
|
|
262
262
|
${e.focusMode?c`
|
|
263
263
|
<button
|
|
@@ -267,7 +267,7 @@ ${s?`**Command:** \`${s}\`
|
|
|
267
267
|
aria-label="Exit focus mode"
|
|
268
268
|
title="Exit focus mode"
|
|
269
269
|
>
|
|
270
|
-
${
|
|
270
|
+
${W.x}
|
|
271
271
|
</button>
|
|
272
272
|
`:f}
|
|
273
273
|
|
|
@@ -287,7 +287,7 @@ ${s?`**Command:** \`${s}\`
|
|
|
287
287
|
@resize=${v=>e.onSplitRatioChange?.(v.detail.splitRatio)}
|
|
288
288
|
></resizable-divider>
|
|
289
289
|
<div class="chat-sidebar">
|
|
290
|
-
${
|
|
290
|
+
${Dp({content:e.sidebarContent??null,error:e.sidebarError??null,onClose:e.onCloseSidebar,onViewRawText:()=>{!e.sidebarContent||!e.onOpenSidebar||e.onOpenSidebar(`\`\`\`
|
|
291
291
|
${e.sidebarContent}
|
|
292
292
|
\`\`\``)}})}
|
|
293
293
|
</div>
|
|
@@ -309,7 +309,7 @@ ${e.sidebarContent}
|
|
|
309
309
|
aria-label="Remove queued message"
|
|
310
310
|
@click=${()=>e.onQueueRemove(v.id)}
|
|
311
311
|
>
|
|
312
|
-
${
|
|
312
|
+
${W.x}
|
|
313
313
|
</button>
|
|
314
314
|
</div>
|
|
315
315
|
`)}
|
|
@@ -318,17 +318,17 @@ ${e.sidebarContent}
|
|
|
318
318
|
`:f}
|
|
319
319
|
|
|
320
320
|
<div class="chat-compose">
|
|
321
|
-
${
|
|
321
|
+
${jp(e)}
|
|
322
322
|
<div class="chat-compose__row">
|
|
323
323
|
<label class="field chat-compose__field">
|
|
324
324
|
<span>Message</span>
|
|
325
325
|
<textarea
|
|
326
|
-
${
|
|
326
|
+
${jd(v=>v&&Da(v))}
|
|
327
327
|
.value=${e.draft}
|
|
328
328
|
?disabled=${!e.connected}
|
|
329
329
|
@keydown=${v=>{v.key==="Enter"&&(v.isComposing||v.keyCode===229||v.shiftKey||e.connected&&(v.preventDefault(),t&&e.onSend()))}}
|
|
330
|
-
@input=${v=>{const
|
|
331
|
-
@paste=${v=>
|
|
330
|
+
@input=${v=>{const y=v.target;Da(y),e.onDraftChange(y.value)}}
|
|
331
|
+
@paste=${v=>zp(v,e)}
|
|
332
332
|
placeholder=${p}
|
|
333
333
|
></textarea>
|
|
334
334
|
</label>
|
|
@@ -351,44 +351,44 @@ ${e.sidebarContent}
|
|
|
351
351
|
</div>
|
|
352
352
|
</div>
|
|
353
353
|
</section>
|
|
354
|
-
`}const
|
|
354
|
+
`}const Ba=200;function Gp(e){const t=[];let n=null;for(const s of e){if(s.kind!=="message"){n&&(t.push(n),n=null),t.push(s);continue}const i=Jo(s.message),a=ii(i.role),o=i.timestamp||Date.now();!n||n.role!==a?(n&&t.push(n),n={kind:"group",key:`group:${a}:${s.key}`,role:a,messages:[{message:s.message,key:s.key}],timestamp:o,isStreaming:!1}):n.messages.push({message:s.message,key:s.key})}return n&&t.push(n),t}function Wp(e){const t=[],n=Array.isArray(e.messages)?e.messages:[],s=Array.isArray(e.toolMessages)?e.toolMessages:[],i=Math.max(0,n.length-Ba);i>0&&t.push({kind:"message",key:"chat:history:notice",message:{role:"system",content:`Showing last ${Ba} messages (${i} hidden).`,timestamp:Date.now()}});for(let a=i;a<n.length;a++){const o=n[a],r=Jo(o);!e.showThinking&&r.role.toLowerCase()==="toolresult"||t.push({kind:"message",key:Fa(o,a),message:o})}if(e.showThinking)for(let a=0;a<s.length;a++)t.push({kind:"message",key:Fa(s[a],a+n.length),message:s[a]});if(e.stream!==null){const a=`stream:${e.sessionKey}:${e.streamStartedAt??"live"}`;e.stream.trim().length>0?t.push({kind:"stream",key:a,text:e.stream,startedAt:e.streamStartedAt??Date.now()}):t.push({kind:"reading-indicator",key:a})}return Gp(t)}function Fa(e,t){const n=e,s=typeof n.toolCallId=="string"?n.toolCallId:"";if(s)return`tool:${s}`;const i=typeof n.id=="string"?n.id:"";if(i)return`msg:${i}`;const a=typeof n.messageId=="string"?n.messageId:"";if(a)return`msg:${a}`;const o=typeof n.timestamp=="number"?n.timestamp:null,r=typeof n.role=="string"?n.role:"unknown";return o!=null?`msg:${r}:${o}:${t}`:`msg:${r}:${t}`}function ue(e){if(e)return Array.isArray(e.type)?e.type.filter(n=>n!=="null")[0]??e.type[0]:e.type}function br(e){if(!e)return"";if(e.default!==void 0)return e.default;switch(ue(e)){case"object":return{};case"array":return[];case"boolean":return!1;case"number":case"integer":return 0;case"string":return"";default:return""}}function $n(e){return e.filter(t=>typeof t=="string").join(".")}function te(e,t){const n=$n(e),s=t[n];if(s)return s;const i=n.split(".");for(const[a,o]of Object.entries(t)){if(!a.includes("*"))continue;const r=a.split(".");if(r.length!==i.length)continue;let l=!0;for(let p=0;p<i.length;p+=1)if(r[p]!=="*"&&r[p]!==i[p]){l=!1;break}if(l)return o}}function we(e){return e.replace(/_/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/\s+/g," ").replace(/^./,t=>t.toUpperCase())}function Vp(e){const t=$n(e).toLowerCase();return t.includes("token")||t.includes("password")||t.includes("secret")||t.includes("apikey")||t.endsWith("key")}const Yp=new Set(["title","description","default","nullable"]);function Qp(e){return Object.keys(e??{}).filter(n=>!Yp.has(n)).length===0}function Zp(e){if(e===void 0)return"";try{return JSON.stringify(e,null,2)??""}catch{return""}}const Ct={chevronDown:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>`,plus:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="12" y1="5" x2="12" y2="19"></line><line x1="5" y1="12" x2="19" y2="12"></line></svg>`,minus:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="5" y1="12" x2="19" y2="12"></line></svg>`,trash:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="3 6 5 6 21 6"></polyline><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path></svg>`,edit:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"></path><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"></path></svg>`};function be(e){const{schema:t,value:n,path:s,hints:i,unsupported:a,disabled:o,onPatch:r}=e,l=e.showLabel??!0,p=ue(t),d=te(s,i),u=d?.label??t.title??we(String(s.at(-1))),g=d?.help??t.description,v=$n(s);if(a.has(v))return c`<div class="cfg-field cfg-field--error">
|
|
355
355
|
<div class="cfg-field__label">${u}</div>
|
|
356
356
|
<div class="cfg-field__error">Unsupported schema node. Use Raw mode.</div>
|
|
357
|
-
</div>`;if(t.anyOf||t.oneOf){const $=(t.anyOf??t.oneOf??[]).filter(
|
|
357
|
+
</div>`;if(t.anyOf||t.oneOf){const $=(t.anyOf??t.oneOf??[]).filter(T=>!(T.type==="null"||Array.isArray(T.type)&&T.type.includes("null")));if($.length===1)return be({...e,schema:$[0]});const A=T=>{if(T.const!==void 0)return T.const;if(T.enum&&T.enum.length===1)return T.enum[0]},_=$.map(A),L=_.every(T=>T!==void 0);if(L&&_.length>0&&_.length<=5){const T=n??t.default;return c`
|
|
358
358
|
<div class="cfg-field">
|
|
359
|
-
${
|
|
359
|
+
${l?c`<label class="cfg-field__label">${u}</label>`:f}
|
|
360
360
|
${g?c`<div class="cfg-field__help">${g}</div>`:f}
|
|
361
361
|
<div class="cfg-segmented">
|
|
362
362
|
${_.map((E,pe)=>c`
|
|
363
363
|
<button
|
|
364
364
|
type="button"
|
|
365
|
-
class="cfg-segmented__btn ${E===
|
|
365
|
+
class="cfg-segmented__btn ${E===T||String(E)===String(T)?"active":""}"
|
|
366
366
|
?disabled=${o}
|
|
367
|
-
@click=${()=>
|
|
367
|
+
@click=${()=>r(s,E)}
|
|
368
368
|
>
|
|
369
369
|
${String(E)}
|
|
370
370
|
</button>
|
|
371
371
|
`)}
|
|
372
372
|
</div>
|
|
373
373
|
</div>
|
|
374
|
-
`}if(L&&_.length>5)return
|
|
374
|
+
`}if(L&&_.length>5)return Ka({...e,options:_,value:n??t.default});const P=new Set($.map(T=>ue(T)).filter(Boolean)),M=new Set([...P].map(T=>T==="integer"?"number":T));if([...M].every(T=>["string","number","boolean"].includes(T))){const T=M.has("string"),E=M.has("number");if(M.has("boolean")&&M.size===1)return be({...e,schema:{...t,type:"boolean",anyOf:void 0,oneOf:void 0}});if(T||E)return Ua({...e,inputType:E&&!T?"number":"text"})}}if(t.enum){const y=t.enum;if(y.length<=5){const $=n??t.default;return c`
|
|
375
375
|
<div class="cfg-field">
|
|
376
|
-
${
|
|
376
|
+
${l?c`<label class="cfg-field__label">${u}</label>`:f}
|
|
377
377
|
${g?c`<div class="cfg-field__help">${g}</div>`:f}
|
|
378
378
|
<div class="cfg-segmented">
|
|
379
|
-
${
|
|
379
|
+
${y.map(A=>c`
|
|
380
380
|
<button
|
|
381
381
|
type="button"
|
|
382
382
|
class="cfg-segmented__btn ${A===$||String(A)===String($)?"active":""}"
|
|
383
383
|
?disabled=${o}
|
|
384
|
-
@click=${()=>
|
|
384
|
+
@click=${()=>r(s,A)}
|
|
385
385
|
>
|
|
386
386
|
${String(A)}
|
|
387
387
|
</button>
|
|
388
388
|
`)}
|
|
389
389
|
</div>
|
|
390
390
|
</div>
|
|
391
|
-
`}return
|
|
391
|
+
`}return Ka({...e,options:y,value:n??t.default})}if(p==="object")return Xp(e);if(p==="array")return eh(e);if(p==="boolean"){const y=typeof n=="boolean"?n:typeof t.default=="boolean"?t.default:!1;return c`
|
|
392
392
|
<label class="cfg-toggle-row ${o?"disabled":""}">
|
|
393
393
|
<div class="cfg-toggle-row__content">
|
|
394
394
|
<span class="cfg-toggle-row__label">${u}</span>
|
|
@@ -397,30 +397,31 @@ ${e.sidebarContent}
|
|
|
397
397
|
<div class="cfg-toggle">
|
|
398
398
|
<input
|
|
399
399
|
type="checkbox"
|
|
400
|
-
.checked=${
|
|
400
|
+
.checked=${y}
|
|
401
401
|
?disabled=${o}
|
|
402
|
-
@change=${$=>
|
|
402
|
+
@change=${$=>r(s,$.target.checked)}
|
|
403
403
|
/>
|
|
404
404
|
<span class="cfg-toggle__track"></span>
|
|
405
405
|
</div>
|
|
406
406
|
</label>
|
|
407
|
-
`}return p==="number"||p==="integer"?
|
|
407
|
+
`}return p==="number"||p==="integer"?Jp(e):p==="string"?Ua({...e,inputType:"text"}):c`
|
|
408
408
|
<div class="cfg-field cfg-field--error">
|
|
409
409
|
<div class="cfg-field__label">${u}</div>
|
|
410
410
|
<div class="cfg-field__error">Unsupported type: ${p}. Use Raw mode.</div>
|
|
411
411
|
</div>
|
|
412
|
-
`}function
|
|
412
|
+
`}function Ua(e){const{schema:t,value:n,path:s,hints:i,disabled:a,onPatch:o,inputType:r}=e,l=e.showLabel??!0,p=te(s,i),d=p?.label??t.title??we(String(s.at(-1))),u=p?.help??t.description,g=p?.sensitive??Vp(s),v=p?.placeholder??(g?"••••":t.default!==void 0?`Default: ${t.default}`:""),y=n??"";return c`
|
|
413
413
|
<div class="cfg-field">
|
|
414
|
-
${
|
|
414
|
+
${l?c`<label class="cfg-field__label">${d}</label>`:f}
|
|
415
415
|
${u?c`<div class="cfg-field__help">${u}</div>`:f}
|
|
416
416
|
<div class="cfg-input-wrap">
|
|
417
417
|
<input
|
|
418
|
-
type=${g?"password":
|
|
418
|
+
type=${g?"password":r}
|
|
419
419
|
class="cfg-input"
|
|
420
420
|
placeholder=${v}
|
|
421
|
-
.value=${
|
|
421
|
+
.value=${y==null?"":String(y)}
|
|
422
422
|
?disabled=${a}
|
|
423
|
-
@input=${$=>{const A=$.target.value;if(
|
|
423
|
+
@input=${$=>{const A=$.target.value;if(r==="number"){if(A.trim()===""){o(s,void 0);return}const _=Number(A);o(s,Number.isNaN(_)?A:_);return}o(s,A)}}
|
|
424
|
+
@change=${$=>{if(r==="number")return;const A=$.target.value;o(s,A.trim())}}
|
|
424
425
|
/>
|
|
425
426
|
${t.default!==void 0?c`
|
|
426
427
|
<button
|
|
@@ -433,9 +434,9 @@ ${e.sidebarContent}
|
|
|
433
434
|
`:f}
|
|
434
435
|
</div>
|
|
435
436
|
</div>
|
|
436
|
-
`}function
|
|
437
|
+
`}function Jp(e){const{schema:t,value:n,path:s,hints:i,disabled:a,onPatch:o}=e,r=e.showLabel??!0,l=te(s,i),p=l?.label??t.title??we(String(s.at(-1))),d=l?.help??t.description,u=n??t.default??"",g=typeof u=="number"?u:0;return c`
|
|
437
438
|
<div class="cfg-field">
|
|
438
|
-
${
|
|
439
|
+
${r?c`<label class="cfg-field__label">${p}</label>`:f}
|
|
439
440
|
${d?c`<div class="cfg-field__help">${d}</div>`:f}
|
|
440
441
|
<div class="cfg-number">
|
|
441
442
|
<button
|
|
@@ -449,7 +450,7 @@ ${e.sidebarContent}
|
|
|
449
450
|
class="cfg-number__input"
|
|
450
451
|
.value=${u==null?"":String(u)}
|
|
451
452
|
?disabled=${a}
|
|
452
|
-
@input=${v=>{const
|
|
453
|
+
@input=${v=>{const y=v.target.value,$=y===""?void 0:Number(y);o(s,$)}}
|
|
453
454
|
/>
|
|
454
455
|
<button
|
|
455
456
|
type="button"
|
|
@@ -459,40 +460,40 @@ ${e.sidebarContent}
|
|
|
459
460
|
>+</button>
|
|
460
461
|
</div>
|
|
461
462
|
</div>
|
|
462
|
-
`}function
|
|
463
|
+
`}function Ka(e){const{schema:t,value:n,path:s,hints:i,disabled:a,options:o,onPatch:r}=e,l=e.showLabel??!0,p=te(s,i),d=p?.label??t.title??we(String(s.at(-1))),u=p?.help??t.description,g=n??t.default,v=o.findIndex($=>$===g||String($)===String(g)),y="__unset__";return c`
|
|
463
464
|
<div class="cfg-field">
|
|
464
|
-
${
|
|
465
|
+
${l?c`<label class="cfg-field__label">${d}</label>`:f}
|
|
465
466
|
${u?c`<div class="cfg-field__help">${u}</div>`:f}
|
|
466
467
|
<select
|
|
467
468
|
class="cfg-select"
|
|
468
469
|
?disabled=${a}
|
|
469
|
-
.value=${v>=0?String(v):
|
|
470
|
-
@change=${$=>{const A=$.target.value;
|
|
470
|
+
.value=${v>=0?String(v):y}
|
|
471
|
+
@change=${$=>{const A=$.target.value;r(s,A===y?void 0:o[Number(A)])}}
|
|
471
472
|
>
|
|
472
|
-
<option value=${
|
|
473
|
+
<option value=${y}>Select...</option>
|
|
473
474
|
${o.map(($,A)=>c`
|
|
474
475
|
<option value=${String(A)}>${String($)}</option>
|
|
475
476
|
`)}
|
|
476
477
|
</select>
|
|
477
478
|
</div>
|
|
478
|
-
`}function
|
|
479
|
+
`}function Xp(e){const{schema:t,value:n,path:s,hints:i,unsupported:a,disabled:o,onPatch:r}=e;e.showLabel;const l=te(s,i),p=l?.label??t.title??we(String(s.at(-1))),d=l?.help??t.description,u=n??t.default,g=u&&typeof u=="object"&&!Array.isArray(u)?u:{},v=t.properties??{},$=Object.entries(v).sort((P,M)=>{const T=te([...s,P[0]],i)?.order??0,E=te([...s,M[0]],i)?.order??0;return T!==E?T-E:P[0].localeCompare(M[0])}),A=new Set(Object.keys(v)),_=t.additionalProperties,L=!!_&&typeof _=="object";return s.length===1?c`
|
|
479
480
|
<div class="cfg-fields">
|
|
480
|
-
${$.map(([P,
|
|
481
|
-
${L?
|
|
481
|
+
${$.map(([P,M])=>be({schema:M,value:g[P],path:[...s,P],hints:i,unsupported:a,disabled:o,onPatch:r}))}
|
|
482
|
+
${L?Ha({schema:_,value:g,path:s,hints:i,unsupported:a,disabled:o,reservedKeys:A,onPatch:r}):f}
|
|
482
483
|
</div>
|
|
483
484
|
`:c`
|
|
484
485
|
<details class="cfg-object" open>
|
|
485
486
|
<summary class="cfg-object__header">
|
|
486
487
|
<span class="cfg-object__title">${p}</span>
|
|
487
|
-
<span class="cfg-object__chevron">${
|
|
488
|
+
<span class="cfg-object__chevron">${Ct.chevronDown}</span>
|
|
488
489
|
</summary>
|
|
489
490
|
${d?c`<div class="cfg-object__help">${d}</div>`:f}
|
|
490
491
|
<div class="cfg-object__content">
|
|
491
|
-
${$.map(([P,
|
|
492
|
-
${L?
|
|
492
|
+
${$.map(([P,M])=>be({schema:M,value:g[P],path:[...s,P],hints:i,unsupported:a,disabled:o,onPatch:r}))}
|
|
493
|
+
${L?Ha({schema:_,value:g,path:s,hints:i,unsupported:a,disabled:o,reservedKeys:A,onPatch:r}):f}
|
|
493
494
|
</div>
|
|
494
495
|
</details>
|
|
495
|
-
`}function
|
|
496
|
+
`}function eh(e){const{schema:t,value:n,path:s,hints:i,unsupported:a,disabled:o,onPatch:r}=e,l=e.showLabel??!0,p=te(s,i),d=p?.label??t.title??we(String(s.at(-1))),u=p?.help??t.description,g=Array.isArray(t.items)?t.items[0]:t.items;if(!g)return c`
|
|
496
497
|
<div class="cfg-field cfg-field--error">
|
|
497
498
|
<div class="cfg-field__label">${d}</div>
|
|
498
499
|
<div class="cfg-field__error">Unsupported array schema. Use Raw mode.</div>
|
|
@@ -500,15 +501,15 @@ ${e.sidebarContent}
|
|
|
500
501
|
`;const v=Array.isArray(n)?n:Array.isArray(t.default)?t.default:[];return c`
|
|
501
502
|
<div class="cfg-array">
|
|
502
503
|
<div class="cfg-array__header">
|
|
503
|
-
${
|
|
504
|
+
${l?c`<span class="cfg-array__label">${d}</span>`:f}
|
|
504
505
|
<span class="cfg-array__count">${v.length} item${v.length!==1?"s":""}</span>
|
|
505
506
|
<button
|
|
506
507
|
type="button"
|
|
507
508
|
class="cfg-array__add"
|
|
508
509
|
?disabled=${o}
|
|
509
|
-
@click=${()=>{const
|
|
510
|
+
@click=${()=>{const y=[...v,br(g)];r(s,y)}}
|
|
510
511
|
>
|
|
511
|
-
<span class="cfg-array__add-icon">${
|
|
512
|
+
<span class="cfg-array__add-icon">${Ct.plus}</span>
|
|
512
513
|
Add
|
|
513
514
|
</button>
|
|
514
515
|
</div>
|
|
@@ -520,7 +521,7 @@ ${e.sidebarContent}
|
|
|
520
521
|
</div>
|
|
521
522
|
`:c`
|
|
522
523
|
<div class="cfg-array__items">
|
|
523
|
-
${v.map((
|
|
524
|
+
${v.map((y,$)=>c`
|
|
524
525
|
<div class="cfg-array__item">
|
|
525
526
|
<div class="cfg-array__item-header">
|
|
526
527
|
<span class="cfg-array__item-index">#${$+1}</span>
|
|
@@ -529,20 +530,20 @@ ${e.sidebarContent}
|
|
|
529
530
|
class="cfg-array__item-remove"
|
|
530
531
|
title="Remove item"
|
|
531
532
|
?disabled=${o}
|
|
532
|
-
@click=${()=>{const A=[...v];A.splice($,1),
|
|
533
|
+
@click=${()=>{const A=[...v];A.splice($,1),r(s,A)}}
|
|
533
534
|
>
|
|
534
|
-
${
|
|
535
|
+
${Ct.trash}
|
|
535
536
|
</button>
|
|
536
537
|
</div>
|
|
537
538
|
<div class="cfg-array__item-content">
|
|
538
|
-
${be({schema:g,value:
|
|
539
|
+
${be({schema:g,value:y,path:[...s,$],hints:i,unsupported:a,disabled:o,showLabel:!1,onPatch:r})}
|
|
539
540
|
</div>
|
|
540
541
|
</div>
|
|
541
542
|
`)}
|
|
542
543
|
</div>
|
|
543
544
|
`}
|
|
544
545
|
</div>
|
|
545
|
-
`}function
|
|
546
|
+
`}function Ha(e){const{schema:t,value:n,path:s,hints:i,unsupported:a,disabled:o,reservedKeys:r,onPatch:l}=e,p=Qp(t),d=Object.entries(n??{}).filter(([u])=>!r.has(u));return c`
|
|
546
547
|
<div class="cfg-map">
|
|
547
548
|
<div class="cfg-map__header">
|
|
548
549
|
<span class="cfg-map__label">Custom entries</span>
|
|
@@ -550,9 +551,9 @@ ${e.sidebarContent}
|
|
|
550
551
|
type="button"
|
|
551
552
|
class="cfg-map__add"
|
|
552
553
|
?disabled=${o}
|
|
553
|
-
@click=${()=>{const u={...n??{}};let g=1,v=`custom-${g}`;for(;v in u;)g+=1,v=`custom-${g}`;u[v]=p?{}:
|
|
554
|
+
@click=${()=>{const u={...n??{}};let g=1,v=`custom-${g}`;for(;v in u;)g+=1,v=`custom-${g}`;u[v]=p?{}:br(t),l(s,u)}}
|
|
554
555
|
>
|
|
555
|
-
<span class="cfg-map__add-icon">${
|
|
556
|
+
<span class="cfg-map__add-icon">${Ct.plus}</span>
|
|
556
557
|
Add Entry
|
|
557
558
|
</button>
|
|
558
559
|
</div>
|
|
@@ -561,7 +562,7 @@ ${e.sidebarContent}
|
|
|
561
562
|
<div class="cfg-map__empty">No custom entries.</div>
|
|
562
563
|
`:c`
|
|
563
564
|
<div class="cfg-map__items">
|
|
564
|
-
${d.map(([u,g])=>{const v=[...s,u],
|
|
565
|
+
${d.map(([u,g])=>{const v=[...s,u],y=Zp(g);return c`
|
|
565
566
|
<div class="cfg-map__item">
|
|
566
567
|
<div class="cfg-map__item-key">
|
|
567
568
|
<input
|
|
@@ -570,7 +571,7 @@ ${e.sidebarContent}
|
|
|
570
571
|
placeholder="Key"
|
|
571
572
|
.value=${u}
|
|
572
573
|
?disabled=${o}
|
|
573
|
-
@change=${$=>{const A=$.target.value.trim();if(!A||A===u)return;const _={...n??{}};A in _||(_[A]=_[u],delete _[u],
|
|
574
|
+
@change=${$=>{const A=$.target.value.trim();if(!A||A===u)return;const _={...n??{}};A in _||(_[A]=_[u],delete _[u],l(s,_))}}
|
|
574
575
|
/>
|
|
575
576
|
</div>
|
|
576
577
|
<div class="cfg-map__item-value">
|
|
@@ -579,39 +580,39 @@ ${e.sidebarContent}
|
|
|
579
580
|
class="cfg-textarea cfg-textarea--sm"
|
|
580
581
|
placeholder="JSON value"
|
|
581
582
|
rows="2"
|
|
582
|
-
.value=${
|
|
583
|
+
.value=${y}
|
|
583
584
|
?disabled=${o}
|
|
584
|
-
@change=${$=>{const A=$.target,_=A.value.trim();if(!_){
|
|
585
|
+
@change=${$=>{const A=$.target,_=A.value.trim();if(!_){l(v,void 0);return}try{l(v,JSON.parse(_))}catch{A.value=y}}}
|
|
585
586
|
></textarea>
|
|
586
|
-
`:be({schema:t,value:g,path:v,hints:i,unsupported:a,disabled:o,showLabel:!1,onPatch:
|
|
587
|
+
`:be({schema:t,value:g,path:v,hints:i,unsupported:a,disabled:o,showLabel:!1,onPatch:l})}
|
|
587
588
|
</div>
|
|
588
589
|
<button
|
|
589
590
|
type="button"
|
|
590
591
|
class="cfg-map__item-remove"
|
|
591
592
|
title="Remove entry"
|
|
592
593
|
?disabled=${o}
|
|
593
|
-
@click=${()=>{const $={...n??{}};delete $[u],
|
|
594
|
+
@click=${()=>{const $={...n??{}};delete $[u],l(s,$)}}
|
|
594
595
|
>
|
|
595
|
-
${
|
|
596
|
+
${Ct.trash}
|
|
596
597
|
</button>
|
|
597
598
|
</div>
|
|
598
599
|
`})}
|
|
599
600
|
</div>
|
|
600
601
|
`}
|
|
601
602
|
</div>
|
|
602
|
-
`}const Ka={env:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><circle cx="12" cy="12" r="3"></circle><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"></path></svg>`,update:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="7 10 12 15 17 10"></polyline><line x1="12" y1="15" x2="12" y2="3"></line></svg>`,agents:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M12 2a2 2 0 0 1 2 2c0 .74-.4 1.39-1 1.73V7h1a7 7 0 0 1 7 7h1a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1h-1v1a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-1H2a1 1 0 0 1-1-1v-3a1 1 0 0 1 1-1h1a7 7 0 0 1 7-7h1V5.73c-.6-.34-1-.99-1-1.73a2 2 0 0 1 2-2z"></path><circle cx="8" cy="14" r="1"></circle><circle cx="16" cy="14" r="1"></circle></svg>`,auth:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="3" y="11" width="18" height="11" rx="2" ry="2"></rect><path d="M7 11V7a5 5 0 0 1 10 0v4"></path></svg>`,channels:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"></path></svg>`,messages:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"></path><polyline points="22,6 12,13 2,6"></polyline></svg>`,commands:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><polyline points="4 17 10 11 4 5"></polyline><line x1="12" y1="19" x2="20" y2="19"></line></svg>`,hooks:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>`,skills:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"></polygon></svg>`,tools:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"></path></svg>`,gateway:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><circle cx="12" cy="12" r="10"></circle><line x1="2" y1="12" x2="22" y2="12"></line><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"></path></svg>`,wizard:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M15 4V2"></path><path d="M15 16v-2"></path><path d="M8 9h2"></path><path d="M20 9h2"></path><path d="M17.8 11.8 19 13"></path><path d="M15 9h0"></path><path d="M17.8 6.2 19 5"></path><path d="m3 21 9-9"></path><path d="M12.2 6.2 11 5"></path></svg>`,meta:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M12 20h9"></path><path d="M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z"></path></svg>`,logging:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline><line x1="16" y1="13" x2="8" y2="13"></line><line x1="16" y1="17" x2="8" y2="17"></line><polyline points="10 9 9 9 8 9"></polyline></svg>`,browser:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><circle cx="12" cy="12" r="10"></circle><circle cx="12" cy="12" r="4"></circle><line x1="21.17" y1="8" x2="12" y2="8"></line><line x1="3.95" y1="6.06" x2="8.54" y2="14"></line><line x1="10.88" y1="21.94" x2="15.46" y2="14"></line></svg>`,ui:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><line x1="3" y1="9" x2="21" y2="9"></line><line x1="9" y1="21" x2="9" y2="9"></line></svg>`,models:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"></path><polyline points="3.27 6.96 12 12.01 20.73 6.96"></polyline><line x1="12" y1="22.08" x2="12" y2="12"></line></svg>`,bindings:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="2" y="2" width="20" height="8" rx="2" ry="2"></rect><rect x="2" y="14" width="20" height="8" rx="2" ry="2"></rect><line x1="6" y1="6" x2="6.01" y2="6"></line><line x1="6" y1="18" x2="6.01" y2="18"></line></svg>`,broadcast:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M4.9 19.1C1 15.2 1 8.8 4.9 4.9"></path><path d="M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5"></path><circle cx="12" cy="12" r="2"></circle><path d="M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5"></path><path d="M19.1 4.9C23 8.8 23 15.1 19.1 19"></path></svg>`,audio:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M9 18V5l12-2v13"></path><circle cx="6" cy="18" r="3"></circle><circle cx="18" cy="16" r="3"></circle></svg>`,session:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path><circle cx="9" cy="7" r="4"></circle><path d="M23 21v-2a4 4 0 0 0-3-3.87"></path><path d="M16 3.13a4 4 0 0 1 0 7.75"></path></svg>`,cron:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg>`,web:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><circle cx="12" cy="12" r="10"></circle><line x1="2" y1="12" x2="22" y2="12"></line><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"></path></svg>`,discovery:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>`,canvasHost:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><circle cx="8.5" cy="8.5" r="1.5"></circle><polyline points="21 15 16 10 5 21"></polyline></svg>`,talk:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"></path><path d="M19 10v2a7 7 0 0 1-14 0v-2"></path><line x1="12" y1="19" x2="12" y2="23"></line><line x1="8" y1="23" x2="16" y2="23"></line></svg>`,plugins:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M12 2v6"></path><path d="m4.93 10.93 4.24 4.24"></path><path d="M2 12h6"></path><path d="m4.93 13.07 4.24-4.24"></path><path d="M12 22v-6"></path><path d="m19.07 13.07-4.24-4.24"></path><path d="M22 12h-6"></path><path d="m19.07 10.93-4.24 4.24"></path></svg>`,default:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline></svg>`},gi={env:{label:"Environment Variables",description:"Environment variables passed to the gateway process"},update:{label:"Updates",description:"Auto-update settings and release channel"},agents:{label:"Agents",description:"Agent configurations, models, and identities"},auth:{label:"Authentication",description:"API keys and authentication profiles"},channels:{label:"Channels",description:"Messaging channels (Telegram, Discord, Slack, etc.)"},messages:{label:"Messages",description:"Message handling and routing settings"},commands:{label:"Commands",description:"Custom slash commands"},hooks:{label:"Hooks",description:"Webhooks and event hooks"},skills:{label:"Skills",description:"Skill packs and capabilities"},tools:{label:"Tools",description:"Tool configurations (browser, search, etc.)"},gateway:{label:"Gateway",description:"Gateway server settings (port, auth, binding)"},wizard:{label:"Setup Wizard",description:"Setup wizard state and history"},meta:{label:"Metadata",description:"Gateway metadata and version information"},logging:{label:"Logging",description:"Log levels and output configuration"},browser:{label:"Browser",description:"Browser automation settings"},ui:{label:"UI",description:"User interface preferences"},models:{label:"Models",description:"AI model configurations and providers"},bindings:{label:"Bindings",description:"Key bindings and shortcuts"},broadcast:{label:"Broadcast",description:"Broadcast and notification settings"},audio:{label:"Audio",description:"Audio input/output settings"},session:{label:"Session",description:"Session management and persistence"},cron:{label:"Cron",description:"Scheduled tasks and automation"},web:{label:"Web",description:"Web server and API settings"},discovery:{label:"Discovery",description:"Service discovery and networking"},canvasHost:{label:"Canvas Host",description:"Canvas rendering and display"},talk:{label:"Talk",description:"Voice and speech settings"},plugins:{label:"Plugins",description:"Plugin management and extensions"}};function Ha(e){return Ka[e]??Ka.default}function Jp(e,t,n){if(!n)return!0;const s=n.toLowerCase(),i=gi[e];return e.toLowerCase().includes(s)||i&&(i.label.toLowerCase().includes(s)||i.description.toLowerCase().includes(s))?!0:mt(t,s)}function mt(e,t){if(e.title?.toLowerCase().includes(t)||e.description?.toLowerCase().includes(t)||e.enum?.some(s=>String(s).toLowerCase().includes(t)))return!0;if(e.properties){for(const[s,i]of Object.entries(e.properties))if(s.toLowerCase().includes(t)||mt(i,t))return!0}if(e.items){const s=Array.isArray(e.items)?e.items:[e.items];for(const i of s)if(i&&mt(i,t))return!0}if(e.additionalProperties&&typeof e.additionalProperties=="object"&&mt(e.additionalProperties,t))return!0;const n=e.anyOf??e.oneOf??e.allOf;if(n){for(const s of n)if(s&&mt(s,t))return!0}return!1}function Xp(e){if(!e.schema)return c`<div class="muted">Schema unavailable.</div>`;const t=e.schema,n=e.value??{};if(ue(t)!=="object"||!t.properties)return c`<div class="callout danger">Unsupported schema. Use Raw.</div>`;const s=new Set(e.unsupportedPaths??[]),i=t.properties,a=e.searchQuery??"",o=e.activeSection,l=e.activeSubsection??null,p=Object.entries(i).sort((u,g)=>{const v=te([u[0]],e.uiHints)?.order??50,m=te([g[0]],e.uiHints)?.order??50;return v!==m?v-m:u[0].localeCompare(g[0])}).filter(([u,g])=>!(o&&u!==o||a&&!Jp(u,g,a)));let d=null;if(o&&l&&p.length===1){const u=p[0]?.[1];u&&ue(u)==="object"&&u.properties&&u.properties[l]&&(d={sectionKey:o,subsectionKey:l,schema:u.properties[l]})}return p.length===0?c`
|
|
603
|
+
`}const za={env:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><circle cx="12" cy="12" r="3"></circle><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"></path></svg>`,update:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="7 10 12 15 17 10"></polyline><line x1="12" y1="15" x2="12" y2="3"></line></svg>`,agents:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M12 2a2 2 0 0 1 2 2c0 .74-.4 1.39-1 1.73V7h1a7 7 0 0 1 7 7h1a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1h-1v1a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-1H2a1 1 0 0 1-1-1v-3a1 1 0 0 1 1-1h1a7 7 0 0 1 7-7h1V5.73c-.6-.34-1-.99-1-1.73a2 2 0 0 1 2-2z"></path><circle cx="8" cy="14" r="1"></circle><circle cx="16" cy="14" r="1"></circle></svg>`,auth:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="3" y="11" width="18" height="11" rx="2" ry="2"></rect><path d="M7 11V7a5 5 0 0 1 10 0v4"></path></svg>`,channels:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"></path></svg>`,messages:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"></path><polyline points="22,6 12,13 2,6"></polyline></svg>`,commands:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><polyline points="4 17 10 11 4 5"></polyline><line x1="12" y1="19" x2="20" y2="19"></line></svg>`,hooks:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>`,skills:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"></polygon></svg>`,tools:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"></path></svg>`,gateway:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><circle cx="12" cy="12" r="10"></circle><line x1="2" y1="12" x2="22" y2="12"></line><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"></path></svg>`,wizard:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M15 4V2"></path><path d="M15 16v-2"></path><path d="M8 9h2"></path><path d="M20 9h2"></path><path d="M17.8 11.8 19 13"></path><path d="M15 9h0"></path><path d="M17.8 6.2 19 5"></path><path d="m3 21 9-9"></path><path d="M12.2 6.2 11 5"></path></svg>`,meta:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M12 20h9"></path><path d="M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z"></path></svg>`,logging:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline><line x1="16" y1="13" x2="8" y2="13"></line><line x1="16" y1="17" x2="8" y2="17"></line><polyline points="10 9 9 9 8 9"></polyline></svg>`,browser:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><circle cx="12" cy="12" r="10"></circle><circle cx="12" cy="12" r="4"></circle><line x1="21.17" y1="8" x2="12" y2="8"></line><line x1="3.95" y1="6.06" x2="8.54" y2="14"></line><line x1="10.88" y1="21.94" x2="15.46" y2="14"></line></svg>`,ui:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><line x1="3" y1="9" x2="21" y2="9"></line><line x1="9" y1="21" x2="9" y2="9"></line></svg>`,models:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"></path><polyline points="3.27 6.96 12 12.01 20.73 6.96"></polyline><line x1="12" y1="22.08" x2="12" y2="12"></line></svg>`,bindings:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="2" y="2" width="20" height="8" rx="2" ry="2"></rect><rect x="2" y="14" width="20" height="8" rx="2" ry="2"></rect><line x1="6" y1="6" x2="6.01" y2="6"></line><line x1="6" y1="18" x2="6.01" y2="18"></line></svg>`,broadcast:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M4.9 19.1C1 15.2 1 8.8 4.9 4.9"></path><path d="M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5"></path><circle cx="12" cy="12" r="2"></circle><path d="M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5"></path><path d="M19.1 4.9C23 8.8 23 15.1 19.1 19"></path></svg>`,audio:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M9 18V5l12-2v13"></path><circle cx="6" cy="18" r="3"></circle><circle cx="18" cy="16" r="3"></circle></svg>`,session:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path><circle cx="9" cy="7" r="4"></circle><path d="M23 21v-2a4 4 0 0 0-3-3.87"></path><path d="M16 3.13a4 4 0 0 1 0 7.75"></path></svg>`,cron:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg>`,web:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><circle cx="12" cy="12" r="10"></circle><line x1="2" y1="12" x2="22" y2="12"></line><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"></path></svg>`,discovery:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>`,canvasHost:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><circle cx="8.5" cy="8.5" r="1.5"></circle><polyline points="21 15 16 10 5 21"></polyline></svg>`,talk:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"></path><path d="M19 10v2a7 7 0 0 1-14 0v-2"></path><line x1="12" y1="19" x2="12" y2="23"></line><line x1="8" y1="23" x2="16" y2="23"></line></svg>`,plugins:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M12 2v6"></path><path d="m4.93 10.93 4.24 4.24"></path><path d="M2 12h6"></path><path d="m4.93 13.07 4.24-4.24"></path><path d="M12 22v-6"></path><path d="m19.07 13.07-4.24-4.24"></path><path d="M22 12h-6"></path><path d="m19.07 10.93-4.24 4.24"></path></svg>`,default:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline></svg>`},gi={env:{label:"Environment Variables",description:"Environment variables passed to the gateway process"},update:{label:"Updates",description:"Auto-update settings and release channel"},agents:{label:"Agents",description:"Agent configurations, models, and identities"},auth:{label:"Authentication",description:"API keys and authentication profiles"},channels:{label:"Channels",description:"Messaging channels (Telegram, Discord, Slack, etc.)"},messages:{label:"Messages",description:"Message handling and routing settings"},commands:{label:"Commands",description:"Custom slash commands"},hooks:{label:"Hooks",description:"Webhooks and event hooks"},skills:{label:"Skills",description:"Skill packs and capabilities"},tools:{label:"Tools",description:"Tool configurations (browser, search, etc.)"},gateway:{label:"Gateway",description:"Gateway server settings (port, auth, binding)"},wizard:{label:"Setup Wizard",description:"Setup wizard state and history"},meta:{label:"Metadata",description:"Gateway metadata and version information"},logging:{label:"Logging",description:"Log levels and output configuration"},browser:{label:"Browser",description:"Browser automation settings"},ui:{label:"UI",description:"User interface preferences"},models:{label:"Models",description:"AI model configurations and providers"},bindings:{label:"Bindings",description:"Key bindings and shortcuts"},broadcast:{label:"Broadcast",description:"Broadcast and notification settings"},audio:{label:"Audio",description:"Audio input/output settings"},session:{label:"Session",description:"Session management and persistence"},cron:{label:"Cron",description:"Scheduled tasks and automation"},web:{label:"Web",description:"Web server and API settings"},discovery:{label:"Discovery",description:"Service discovery and networking"},canvasHost:{label:"Canvas Host",description:"Canvas rendering and display"},talk:{label:"Talk",description:"Voice and speech settings"},plugins:{label:"Plugins",description:"Plugin management and extensions"}};function ja(e){return za[e]??za.default}function th(e,t,n){if(!n)return!0;const s=n.toLowerCase(),i=gi[e];return e.toLowerCase().includes(s)||i&&(i.label.toLowerCase().includes(s)||i.description.toLowerCase().includes(s))?!0:vt(t,s)}function vt(e,t){if(e.title?.toLowerCase().includes(t)||e.description?.toLowerCase().includes(t)||e.enum?.some(s=>String(s).toLowerCase().includes(t)))return!0;if(e.properties){for(const[s,i]of Object.entries(e.properties))if(s.toLowerCase().includes(t)||vt(i,t))return!0}if(e.items){const s=Array.isArray(e.items)?e.items:[e.items];for(const i of s)if(i&&vt(i,t))return!0}if(e.additionalProperties&&typeof e.additionalProperties=="object"&&vt(e.additionalProperties,t))return!0;const n=e.anyOf??e.oneOf??e.allOf;if(n){for(const s of n)if(s&&vt(s,t))return!0}return!1}function nh(e){if(!e.schema)return c`<div class="muted">Schema unavailable.</div>`;const t=e.schema,n=e.value??{};if(ue(t)!=="object"||!t.properties)return c`<div class="callout danger">Unsupported schema. Use Raw.</div>`;const s=new Set(e.unsupportedPaths??[]),i=t.properties,a=e.searchQuery??"",o=e.activeSection,r=e.activeSubsection??null,p=Object.entries(i).sort((u,g)=>{const v=te([u[0]],e.uiHints)?.order??50,y=te([g[0]],e.uiHints)?.order??50;return v!==y?v-y:u[0].localeCompare(g[0])}).filter(([u,g])=>!(o&&u!==o||a&&!th(u,g,a)));let d=null;if(o&&r&&p.length===1){const u=p[0]?.[1];u&&ue(u)==="object"&&u.properties&&u.properties[r]&&(d={sectionKey:o,subsectionKey:r,schema:u.properties[r]})}return p.length===0?c`
|
|
603
604
|
<div class="config-empty">
|
|
604
|
-
<div class="config-empty__icon">${
|
|
605
|
+
<div class="config-empty__icon">${W.search}</div>
|
|
605
606
|
<div class="config-empty__text">
|
|
606
607
|
${a?`No settings match "${a}"`:"No settings in this section"}
|
|
607
608
|
</div>
|
|
608
609
|
</div>
|
|
609
610
|
`:c`
|
|
610
611
|
<div class="config-form config-form--modern">
|
|
611
|
-
${d?(()=>{const{sectionKey:u,subsectionKey:g,schema:v}=d,
|
|
612
|
+
${d?(()=>{const{sectionKey:u,subsectionKey:g,schema:v}=d,y=te([u,g],e.uiHints),$=y?.label??v.title??we(g),A=y?.help??v.description??"",_=n[u],L=_&&typeof _=="object"?_[g]:void 0,P=`config-section-${u}-${g}`;return c`
|
|
612
613
|
<section class="config-section-card" id=${P}>
|
|
613
614
|
<div class="config-section-card__header">
|
|
614
|
-
<span class="config-section-card__icon">${
|
|
615
|
+
<span class="config-section-card__icon">${ja(u)}</span>
|
|
615
616
|
<div class="config-section-card__titles">
|
|
616
617
|
<h3 class="config-section-card__title">${$}</h3>
|
|
617
618
|
${A?c`<p class="config-section-card__desc">${A}</p>`:f}
|
|
@@ -624,7 +625,7 @@ ${e.sidebarContent}
|
|
|
624
625
|
`})():p.map(([u,g])=>{const v=gi[u]??{label:u.charAt(0).toUpperCase()+u.slice(1),description:g.description??""};return c`
|
|
625
626
|
<section class="config-section-card" id="config-section-${u}">
|
|
626
627
|
<div class="config-section-card__header">
|
|
627
|
-
<span class="config-section-card__icon">${
|
|
628
|
+
<span class="config-section-card__icon">${ja(u)}</span>
|
|
628
629
|
<div class="config-section-card__titles">
|
|
629
630
|
<h3 class="config-section-card__title">${v.label}</h3>
|
|
630
631
|
${v.description?c`<p class="config-section-card__desc">${v.description}</p>`:f}
|
|
@@ -636,7 +637,7 @@ ${e.sidebarContent}
|
|
|
636
637
|
</section>
|
|
637
638
|
`})}
|
|
638
639
|
</div>
|
|
639
|
-
`}const eh=new Set(["title","description","default","nullable"]);function th(e){return Object.keys(e??{}).filter(n=>!eh.has(n)).length===0}function mr(e){const t=e.filter(i=>i!=null),n=t.length!==e.length,s=[];for(const i of t)s.some(a=>Object.is(a,i))||s.push(i);return{enumValues:s,nullable:n}}function yr(e){return!e||typeof e!="object"?{schema:null,unsupportedPaths:["<root>"]}:$t(e,[])}function $t(e,t){const n=new Set,s={...e},i=$n(t)||"<root>";if(e.anyOf||e.oneOf||e.allOf){const l=nh(e,t);return l||{schema:e,unsupportedPaths:[i]}}const a=Array.isArray(e.type)&&e.type.includes("null"),o=ue(e)??(e.properties||e.additionalProperties?"object":void 0);if(s.type=o??e.type,s.nullable=a||e.nullable,s.enum){const{enumValues:l,nullable:r}=mr(s.enum);s.enum=l,r&&(s.nullable=!0),l.length===0&&n.add(i)}if(o==="object"){const l=e.properties??{},r={};for(const[p,d]of Object.entries(l)){const u=$t(d,[...t,p]);u.schema&&(r[p]=u.schema);for(const g of u.unsupportedPaths)n.add(g)}if(s.properties=r,e.additionalProperties===!0)n.add(i);else if(e.additionalProperties===!1)s.additionalProperties=!1;else if(e.additionalProperties&&typeof e.additionalProperties=="object"&&!th(e.additionalProperties)){const p=$t(e.additionalProperties,[...t,"*"]);s.additionalProperties=p.schema??e.additionalProperties,p.unsupportedPaths.length>0&&n.add(i)}}else if(o==="array"){const l=Array.isArray(e.items)?e.items[0]:e.items;if(!l)n.add(i);else{const r=$t(l,[...t,"*"]);s.items=r.schema??l,r.unsupportedPaths.length>0&&n.add(i)}}else o!=="string"&&o!=="number"&&o!=="integer"&&o!=="boolean"&&!s.enum&&n.add(i);return{schema:s,unsupportedPaths:Array.from(n)}}function nh(e,t){if(e.allOf)return null;const n=e.anyOf??e.oneOf;if(!n)return null;const s=[],i=[];let a=!1;for(const l of n){if(!l||typeof l!="object")return null;if(Array.isArray(l.enum)){const{enumValues:r,nullable:p}=mr(l.enum);s.push(...r),p&&(a=!0);continue}if("const"in l){if(l.const==null){a=!0;continue}s.push(l.const);continue}if(ue(l)==="null"){a=!0;continue}i.push(l)}if(s.length>0&&i.length===0){const l=[];for(const r of s)l.some(p=>Object.is(p,r))||l.push(r);return{schema:{...e,enum:l,nullable:a,anyOf:void 0,oneOf:void 0,allOf:void 0},unsupportedPaths:[]}}if(i.length===1){const l=$t(i[0],t);return l.schema&&(l.schema.nullable=a||l.schema.nullable),l}const o=["string","number","integer","boolean"];return i.length>0&&s.length===0&&i.every(l=>l.type&&o.includes(String(l.type)))?{schema:{...e,nullable:a},unsupportedPaths:[]}:null}const Cs={all:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="3" width="7" height="7"></rect><rect x="14" y="3" width="7" height="7"></rect><rect x="14" y="14" width="7" height="7"></rect><rect x="3" y="14" width="7" height="7"></rect></svg>`,env:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="3"></circle><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"></path></svg>`,update:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="7 10 12 15 17 10"></polyline><line x1="12" y1="15" x2="12" y2="3"></line></svg>`,agents:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 2a2 2 0 0 1 2 2c0 .74-.4 1.39-1 1.73V7h1a7 7 0 0 1 7 7h1a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1h-1v1a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-1H2a1 1 0 0 1-1-1v-3a1 1 0 0 1 1-1h1a7 7 0 0 1 7-7h1V5.73c-.6-.34-1-.99-1-1.73a2 2 0 0 1 2-2z"></path><circle cx="8" cy="14" r="1"></circle><circle cx="16" cy="14" r="1"></circle></svg>`,auth:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="11" width="18" height="11" rx="2" ry="2"></rect><path d="M7 11V7a5 5 0 0 1 10 0v4"></path></svg>`,channels:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"></path></svg>`,messages:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"></path><polyline points="22,6 12,13 2,6"></polyline></svg>`,commands:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="4 17 10 11 4 5"></polyline><line x1="12" y1="19" x2="20" y2="19"></line></svg>`,hooks:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>`,skills:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"></polygon></svg>`,tools:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"></path></svg>`,gateway:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"></circle><line x1="2" y1="12" x2="22" y2="12"></line><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"></path></svg>`,wizard:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M15 4V2"></path><path d="M15 16v-2"></path><path d="M8 9h2"></path><path d="M20 9h2"></path><path d="M17.8 11.8 19 13"></path><path d="M15 9h0"></path><path d="M17.8 6.2 19 5"></path><path d="m3 21 9-9"></path><path d="M12.2 6.2 11 5"></path></svg>`,meta:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 20h9"></path><path d="M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z"></path></svg>`,logging:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline><line x1="16" y1="13" x2="8" y2="13"></line><line x1="16" y1="17" x2="8" y2="17"></line><polyline points="10 9 9 9 8 9"></polyline></svg>`,browser:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"></circle><circle cx="12" cy="12" r="4"></circle><line x1="21.17" y1="8" x2="12" y2="8"></line><line x1="3.95" y1="6.06" x2="8.54" y2="14"></line><line x1="10.88" y1="21.94" x2="15.46" y2="14"></line></svg>`,ui:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><line x1="3" y1="9" x2="21" y2="9"></line><line x1="9" y1="21" x2="9" y2="9"></line></svg>`,models:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"></path><polyline points="3.27 6.96 12 12.01 20.73 6.96"></polyline><line x1="12" y1="22.08" x2="12" y2="12"></line></svg>`,bindings:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="2" y="2" width="20" height="8" rx="2" ry="2"></rect><rect x="2" y="14" width="20" height="8" rx="2" ry="2"></rect><line x1="6" y1="6" x2="6.01" y2="6"></line><line x1="6" y1="18" x2="6.01" y2="18"></line></svg>`,broadcast:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M4.9 19.1C1 15.2 1 8.8 4.9 4.9"></path><path d="M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5"></path><circle cx="12" cy="12" r="2"></circle><path d="M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5"></path><path d="M19.1 4.9C23 8.8 23 15.1 19.1 19"></path></svg>`,audio:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M9 18V5l12-2v13"></path><circle cx="6" cy="18" r="3"></circle><circle cx="18" cy="16" r="3"></circle></svg>`,session:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path><circle cx="9" cy="7" r="4"></circle><path d="M23 21v-2a4 4 0 0 0-3-3.87"></path><path d="M16 3.13a4 4 0 0 1 0 7.75"></path></svg>`,cron:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg>`,web:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"></circle><line x1="2" y1="12" x2="22" y2="12"></line><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"></path></svg>`,discovery:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>`,canvasHost:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><circle cx="8.5" cy="8.5" r="1.5"></circle><polyline points="21 15 16 10 5 21"></polyline></svg>`,talk:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"></path><path d="M19 10v2a7 7 0 0 1-14 0v-2"></path><line x1="12" y1="19" x2="12" y2="23"></line><line x1="8" y1="23" x2="16" y2="23"></line></svg>`,plugins:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 2v6"></path><path d="m4.93 10.93 4.24 4.24"></path><path d="M2 12h6"></path><path d="m4.93 13.07 4.24-4.24"></path><path d="M12 22v-6"></path><path d="m19.07 13.07-4.24-4.24"></path><path d="M22 12h-6"></path><path d="m19.07 10.93-4.24 4.24"></path></svg>`,default:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline></svg>`},za=[{key:"env",label:"Environment"},{key:"update",label:"Updates"},{key:"agents",label:"Agents"},{key:"auth",label:"Authentication"},{key:"channels",label:"Channels"},{key:"messages",label:"Messages"},{key:"commands",label:"Commands"},{key:"hooks",label:"Hooks"},{key:"skills",label:"Skills"},{key:"tools",label:"Tools"},{key:"gateway",label:"Gateway"},{key:"wizard",label:"Setup Wizard"}],ja="__all__";function qa(e){return Cs[e]??Cs.default}function sh(e,t){const n=gi[e];return n||{label:t?.title??we(e),description:t?.description??""}}function ih(e){const{key:t,schema:n,uiHints:s}=e;if(!n||ue(n)!=="object"||!n.properties)return[];const i=Object.entries(n.properties).map(([a,o])=>{const l=te([t,a],s),r=l?.label??o.title??we(a),p=l?.help??o.description??"",d=l?.order??50;return{key:a,label:r,description:p,order:d}});return i.sort((a,o)=>a.order!==o.order?a.order-o.order:a.key.localeCompare(o.key)),i}function ah(e,t){if(!e||!t)return[];const n=[];function s(i,a,o){if(i===a)return;if(typeof i!=typeof a){n.push({path:o,from:i,to:a});return}if(typeof i!="object"||i===null||a===null){i!==a&&n.push({path:o,from:i,to:a});return}if(Array.isArray(i)&&Array.isArray(a)){JSON.stringify(i)!==JSON.stringify(a)&&n.push({path:o,from:i,to:a});return}const l=i,r=a,p=new Set([...Object.keys(l),...Object.keys(r)]);for(const d of p)s(l[d],r[d],o?`${o}.${d}`:d)}return s(e,t,""),n}function Wa(e,t=40){let n;try{n=JSON.stringify(e)??String(e)}catch{n=String(e)}return n.length<=t?n:n.slice(0,t-3)+"..."}function oh(e){const t=e.valid==null?"unknown":e.valid?"valid":"invalid",n=yr(e.schema),s=n.schema?n.unsupportedPaths.length>0:!1,i=n.schema?.properties??{},a=za.filter(E=>E.key in i),o=new Set(za.map(E=>E.key)),l=Object.keys(i).filter(E=>!o.has(E)).map(E=>({key:E,label:E.charAt(0).toUpperCase()+E.slice(1)})),r=[...a,...l],p=e.activeSection&&n.schema&&ue(n.schema)==="object"?n.schema.properties?.[e.activeSection]:void 0,d=e.activeSection?sh(e.activeSection,p):null,u=e.activeSection?ih({key:e.activeSection,schema:p,uiHints:e.uiHints}):[],g=e.formMode==="form"&&!!e.activeSection&&u.length>0,v=e.activeSubsection===ja,m=e.searchQuery||v?null:e.activeSubsection??u[0]?.key??null,$=e.formMode==="form"?ah(e.originalValue,e.formValue):[],A=e.formMode==="raw"&&e.raw!==e.originalRaw,_=e.formMode==="form"?$.length>0:A,L=!!e.formValue&&!e.loading&&!!n.schema,P=e.connected&&!e.saving&&_&&(e.formMode==="raw"?!0:L),I=e.connected&&!e.applying&&!e.updating&&_&&(e.formMode==="raw"?!0:L),C=e.connected&&!e.applying&&!e.updating;return c`
|
|
640
|
+
`}const sh=new Set(["title","description","default","nullable"]);function ih(e){return Object.keys(e??{}).filter(n=>!sh.has(n)).length===0}function wr(e){const t=e.filter(i=>i!=null),n=t.length!==e.length,s=[];for(const i of t)s.some(a=>Object.is(a,i))||s.push(i);return{enumValues:s,nullable:n}}function $r(e){return!e||typeof e!="object"?{schema:null,unsupportedPaths:["<root>"]}:wt(e,[])}function wt(e,t){const n=new Set,s={...e},i=$n(t)||"<root>";if(e.anyOf||e.oneOf||e.allOf){const r=ah(e,t);return r||{schema:e,unsupportedPaths:[i]}}const a=Array.isArray(e.type)&&e.type.includes("null"),o=ue(e)??(e.properties||e.additionalProperties?"object":void 0);if(s.type=o??e.type,s.nullable=a||e.nullable,s.enum){const{enumValues:r,nullable:l}=wr(s.enum);s.enum=r,l&&(s.nullable=!0),r.length===0&&n.add(i)}if(o==="object"){const r=e.properties??{},l={};for(const[p,d]of Object.entries(r)){const u=wt(d,[...t,p]);u.schema&&(l[p]=u.schema);for(const g of u.unsupportedPaths)n.add(g)}if(s.properties=l,e.additionalProperties===!0)n.add(i);else if(e.additionalProperties===!1)s.additionalProperties=!1;else if(e.additionalProperties&&typeof e.additionalProperties=="object"&&!ih(e.additionalProperties)){const p=wt(e.additionalProperties,[...t,"*"]);s.additionalProperties=p.schema??e.additionalProperties,p.unsupportedPaths.length>0&&n.add(i)}}else if(o==="array"){const r=Array.isArray(e.items)?e.items[0]:e.items;if(!r)n.add(i);else{const l=wt(r,[...t,"*"]);s.items=l.schema??r,l.unsupportedPaths.length>0&&n.add(i)}}else o!=="string"&&o!=="number"&&o!=="integer"&&o!=="boolean"&&!s.enum&&n.add(i);return{schema:s,unsupportedPaths:Array.from(n)}}function ah(e,t){if(e.allOf)return null;const n=e.anyOf??e.oneOf;if(!n)return null;const s=[],i=[];let a=!1;for(const r of n){if(!r||typeof r!="object")return null;if(Array.isArray(r.enum)){const{enumValues:l,nullable:p}=wr(r.enum);s.push(...l),p&&(a=!0);continue}if("const"in r){if(r.const==null){a=!0;continue}s.push(r.const);continue}if(ue(r)==="null"){a=!0;continue}i.push(r)}if(s.length>0&&i.length===0){const r=[];for(const l of s)r.some(p=>Object.is(p,l))||r.push(l);return{schema:{...e,enum:r,nullable:a,anyOf:void 0,oneOf:void 0,allOf:void 0},unsupportedPaths:[]}}if(i.length===1){const r=wt(i[0],t);return r.schema&&(r.schema.nullable=a||r.schema.nullable),r}const o=["string","number","integer","boolean"];return i.length>0&&s.length===0&&i.every(r=>r.type&&o.includes(String(r.type)))?{schema:{...e,nullable:a},unsupportedPaths:[]}:null}const Ts={all:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="3" width="7" height="7"></rect><rect x="14" y="3" width="7" height="7"></rect><rect x="14" y="14" width="7" height="7"></rect><rect x="3" y="14" width="7" height="7"></rect></svg>`,env:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="3"></circle><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"></path></svg>`,update:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="7 10 12 15 17 10"></polyline><line x1="12" y1="15" x2="12" y2="3"></line></svg>`,agents:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 2a2 2 0 0 1 2 2c0 .74-.4 1.39-1 1.73V7h1a7 7 0 0 1 7 7h1a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1h-1v1a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-1H2a1 1 0 0 1-1-1v-3a1 1 0 0 1 1-1h1a7 7 0 0 1 7-7h1V5.73c-.6-.34-1-.99-1-1.73a2 2 0 0 1 2-2z"></path><circle cx="8" cy="14" r="1"></circle><circle cx="16" cy="14" r="1"></circle></svg>`,auth:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="11" width="18" height="11" rx="2" ry="2"></rect><path d="M7 11V7a5 5 0 0 1 10 0v4"></path></svg>`,channels:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"></path></svg>`,messages:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"></path><polyline points="22,6 12,13 2,6"></polyline></svg>`,commands:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="4 17 10 11 4 5"></polyline><line x1="12" y1="19" x2="20" y2="19"></line></svg>`,hooks:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>`,skills:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"></polygon></svg>`,tools:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"></path></svg>`,gateway:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"></circle><line x1="2" y1="12" x2="22" y2="12"></line><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"></path></svg>`,wizard:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M15 4V2"></path><path d="M15 16v-2"></path><path d="M8 9h2"></path><path d="M20 9h2"></path><path d="M17.8 11.8 19 13"></path><path d="M15 9h0"></path><path d="M17.8 6.2 19 5"></path><path d="m3 21 9-9"></path><path d="M12.2 6.2 11 5"></path></svg>`,meta:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 20h9"></path><path d="M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z"></path></svg>`,logging:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline><line x1="16" y1="13" x2="8" y2="13"></line><line x1="16" y1="17" x2="8" y2="17"></line><polyline points="10 9 9 9 8 9"></polyline></svg>`,browser:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"></circle><circle cx="12" cy="12" r="4"></circle><line x1="21.17" y1="8" x2="12" y2="8"></line><line x1="3.95" y1="6.06" x2="8.54" y2="14"></line><line x1="10.88" y1="21.94" x2="15.46" y2="14"></line></svg>`,ui:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><line x1="3" y1="9" x2="21" y2="9"></line><line x1="9" y1="21" x2="9" y2="9"></line></svg>`,models:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"></path><polyline points="3.27 6.96 12 12.01 20.73 6.96"></polyline><line x1="12" y1="22.08" x2="12" y2="12"></line></svg>`,bindings:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="2" y="2" width="20" height="8" rx="2" ry="2"></rect><rect x="2" y="14" width="20" height="8" rx="2" ry="2"></rect><line x1="6" y1="6" x2="6.01" y2="6"></line><line x1="6" y1="18" x2="6.01" y2="18"></line></svg>`,broadcast:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M4.9 19.1C1 15.2 1 8.8 4.9 4.9"></path><path d="M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5"></path><circle cx="12" cy="12" r="2"></circle><path d="M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5"></path><path d="M19.1 4.9C23 8.8 23 15.1 19.1 19"></path></svg>`,audio:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M9 18V5l12-2v13"></path><circle cx="6" cy="18" r="3"></circle><circle cx="18" cy="16" r="3"></circle></svg>`,session:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path><circle cx="9" cy="7" r="4"></circle><path d="M23 21v-2a4 4 0 0 0-3-3.87"></path><path d="M16 3.13a4 4 0 0 1 0 7.75"></path></svg>`,cron:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg>`,web:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"></circle><line x1="2" y1="12" x2="22" y2="12"></line><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"></path></svg>`,discovery:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>`,canvasHost:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><circle cx="8.5" cy="8.5" r="1.5"></circle><polyline points="21 15 16 10 5 21"></polyline></svg>`,talk:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"></path><path d="M19 10v2a7 7 0 0 1-14 0v-2"></path><line x1="12" y1="19" x2="12" y2="23"></line><line x1="8" y1="23" x2="16" y2="23"></line></svg>`,plugins:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 2v6"></path><path d="m4.93 10.93 4.24 4.24"></path><path d="M2 12h6"></path><path d="m4.93 13.07 4.24-4.24"></path><path d="M12 22v-6"></path><path d="m19.07 13.07-4.24-4.24"></path><path d="M22 12h-6"></path><path d="m19.07 10.93-4.24 4.24"></path></svg>`,default:c`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline></svg>`},qa=[{key:"env",label:"Environment"},{key:"update",label:"Updates"},{key:"agents",label:"Agents"},{key:"auth",label:"Authentication"},{key:"channels",label:"Channels"},{key:"messages",label:"Messages"},{key:"commands",label:"Commands"},{key:"hooks",label:"Hooks"},{key:"skills",label:"Skills"},{key:"tools",label:"Tools"},{key:"gateway",label:"Gateway"},{key:"wizard",label:"Setup Wizard"}],Ga="__all__";function Wa(e){return Ts[e]??Ts.default}function oh(e,t){const n=gi[e];return n||{label:t?.title??we(e),description:t?.description??""}}function rh(e){const{key:t,schema:n,uiHints:s}=e;if(!n||ue(n)!=="object"||!n.properties)return[];const i=Object.entries(n.properties).map(([a,o])=>{const r=te([t,a],s),l=r?.label??o.title??we(a),p=r?.help??o.description??"",d=r?.order??50;return{key:a,label:l,description:p,order:d}});return i.sort((a,o)=>a.order!==o.order?a.order-o.order:a.key.localeCompare(o.key)),i}function lh(e,t){if(!e||!t)return[];const n=[];function s(i,a,o){if(i===a)return;if(typeof i!=typeof a){n.push({path:o,from:i,to:a});return}if(typeof i!="object"||i===null||a===null){i!==a&&n.push({path:o,from:i,to:a});return}if(Array.isArray(i)&&Array.isArray(a)){JSON.stringify(i)!==JSON.stringify(a)&&n.push({path:o,from:i,to:a});return}const r=i,l=a,p=new Set([...Object.keys(r),...Object.keys(l)]);for(const d of p)s(r[d],l[d],o?`${o}.${d}`:d)}return s(e,t,""),n}function Va(e,t=40){let n;try{n=JSON.stringify(e)??String(e)}catch{n=String(e)}return n.length<=t?n:n.slice(0,t-3)+"..."}function ch(e){const t=e.valid==null?"unknown":e.valid?"valid":"invalid",n=$r(e.schema),s=n.schema?n.unsupportedPaths.length>0:!1,i=n.schema?.properties??{},a=qa.filter(E=>E.key in i),o=new Set(qa.map(E=>E.key)),r=Object.keys(i).filter(E=>!o.has(E)).map(E=>({key:E,label:E.charAt(0).toUpperCase()+E.slice(1)})),l=[...a,...r],p=e.activeSection&&n.schema&&ue(n.schema)==="object"?n.schema.properties?.[e.activeSection]:void 0,d=e.activeSection?oh(e.activeSection,p):null,u=e.activeSection?rh({key:e.activeSection,schema:p,uiHints:e.uiHints}):[],g=e.formMode==="form"&&!!e.activeSection&&u.length>0,v=e.activeSubsection===Ga,y=e.searchQuery||v?null:e.activeSubsection??u[0]?.key??null,$=e.formMode==="form"?lh(e.originalValue,e.formValue):[],A=e.formMode==="raw"&&e.raw!==e.originalRaw,_=e.formMode==="form"?$.length>0:A,L=!!e.formValue&&!e.loading&&!!n.schema,P=e.connected&&!e.saving&&_&&(e.formMode==="raw"?!0:L),M=e.connected&&!e.applying&&!e.updating&&_&&(e.formMode==="raw"?!0:L),T=e.connected&&!e.applying&&!e.updating;return c`
|
|
640
641
|
<div class="config-layout">
|
|
641
642
|
<!-- Sidebar -->
|
|
642
643
|
<aside class="config-sidebar">
|
|
@@ -672,15 +673,15 @@ ${e.sidebarContent}
|
|
|
672
673
|
class="config-nav__item ${e.activeSection===null?"active":""}"
|
|
673
674
|
@click=${()=>e.onSectionChange(null)}
|
|
674
675
|
>
|
|
675
|
-
<span class="config-nav__icon">${
|
|
676
|
+
<span class="config-nav__icon">${Ts.all}</span>
|
|
676
677
|
<span class="config-nav__label">All Settings</span>
|
|
677
678
|
</button>
|
|
678
|
-
${
|
|
679
|
+
${l.map(E=>c`
|
|
679
680
|
<button
|
|
680
681
|
class="config-nav__item ${e.activeSection===E.key?"active":""}"
|
|
681
682
|
@click=${()=>e.onSectionChange(E.key)}
|
|
682
683
|
>
|
|
683
|
-
<span class="config-nav__icon">${
|
|
684
|
+
<span class="config-nav__icon">${Wa(E.key)}</span>
|
|
684
685
|
<span class="config-nav__label">${E.label}</span>
|
|
685
686
|
</button>
|
|
686
687
|
`)}
|
|
@@ -730,14 +731,14 @@ ${e.sidebarContent}
|
|
|
730
731
|
</button>
|
|
731
732
|
<button
|
|
732
733
|
class="btn btn--sm"
|
|
733
|
-
?disabled=${!
|
|
734
|
+
?disabled=${!M}
|
|
734
735
|
@click=${e.onApply}
|
|
735
736
|
>
|
|
736
737
|
${e.applying?"Applying…":"Apply"}
|
|
737
738
|
</button>
|
|
738
739
|
<button
|
|
739
740
|
class="btn btn--sm"
|
|
740
|
-
?disabled=${!
|
|
741
|
+
?disabled=${!T}
|
|
741
742
|
@click=${e.onUpdate}
|
|
742
743
|
>
|
|
743
744
|
${e.updating?"Updating…":"Update"}
|
|
@@ -759,9 +760,9 @@ ${e.sidebarContent}
|
|
|
759
760
|
<div class="config-diff__item">
|
|
760
761
|
<div class="config-diff__path">${E.path}</div>
|
|
761
762
|
<div class="config-diff__values">
|
|
762
|
-
<span class="config-diff__from">${
|
|
763
|
+
<span class="config-diff__from">${Va(E.from)}</span>
|
|
763
764
|
<span class="config-diff__arrow">→</span>
|
|
764
|
-
<span class="config-diff__to">${
|
|
765
|
+
<span class="config-diff__to">${Va(E.to)}</span>
|
|
765
766
|
</div>
|
|
766
767
|
</div>
|
|
767
768
|
`)}
|
|
@@ -771,7 +772,7 @@ ${e.sidebarContent}
|
|
|
771
772
|
|
|
772
773
|
${d&&e.formMode==="form"?c`
|
|
773
774
|
<div class="config-section-hero">
|
|
774
|
-
<div class="config-section-hero__icon">${
|
|
775
|
+
<div class="config-section-hero__icon">${Wa(e.activeSection??"")}</div>
|
|
775
776
|
<div class="config-section-hero__text">
|
|
776
777
|
<div class="config-section-hero__title">${d.label}</div>
|
|
777
778
|
${d.description?c`<div class="config-section-hero__desc">${d.description}</div>`:f}
|
|
@@ -782,14 +783,14 @@ ${e.sidebarContent}
|
|
|
782
783
|
${g?c`
|
|
783
784
|
<div class="config-subnav">
|
|
784
785
|
<button
|
|
785
|
-
class="config-subnav__item ${
|
|
786
|
-
@click=${()=>e.onSubsectionChange(
|
|
786
|
+
class="config-subnav__item ${y===null?"active":""}"
|
|
787
|
+
@click=${()=>e.onSubsectionChange(Ga)}
|
|
787
788
|
>
|
|
788
789
|
All
|
|
789
790
|
</button>
|
|
790
791
|
${u.map(E=>c`
|
|
791
792
|
<button
|
|
792
|
-
class="config-subnav__item ${
|
|
793
|
+
class="config-subnav__item ${y===E.key?"active":""}"
|
|
793
794
|
title=${E.description||E.label}
|
|
794
795
|
@click=${()=>e.onSubsectionChange(E.key)}
|
|
795
796
|
>
|
|
@@ -805,7 +806,7 @@ ${e.sidebarContent}
|
|
|
805
806
|
${e.schemaLoading?c`<div class="config-loading">
|
|
806
807
|
<div class="config-loading__spinner"></div>
|
|
807
808
|
<span>Loading schema…</span>
|
|
808
|
-
</div>`:
|
|
809
|
+
</div>`:nh({schema:n.schema,uiHints:e.uiHints,value:e.formValue,disabled:e.loading||!e.formValue,unsupportedPaths:n.unsupportedPaths,onPatch:e.onFormPatch,searchQuery:e.searchQuery,activeSection:e.activeSection,activeSubsection:y})}
|
|
809
810
|
${s?c`<div class="callout danger" style="margin-top: 12px;">
|
|
810
811
|
Form view can't safely edit some fields.
|
|
811
812
|
Use Raw to avoid losing config entries.
|
|
@@ -826,13 +827,13 @@ ${e.sidebarContent}
|
|
|
826
827
|
</div>`:f}
|
|
827
828
|
</main>
|
|
828
829
|
</div>
|
|
829
|
-
`}function
|
|
830
|
+
`}function dh(e){if(!e&&e!==0)return"n/a";const t=Math.round(e/1e3);if(t<60)return`${t}s`;const n=Math.round(t/60);return n<60?`${n}m`:`${Math.round(n/60)}h`}function uh(e,t){const n=t.snapshot,s=n?.channels;if(!n||!s)return!1;const i=s[e],a=typeof i?.configured=="boolean"&&i.configured,o=typeof i?.running=="boolean"&&i.running,r=typeof i?.connected=="boolean"&&i.connected,p=(n.channelAccounts?.[e]??[]).some(d=>d.configured||d.running||d.connected);return a||o||r||p}function ph(e,t){return t?.[e]?.length??0}function xr(e,t){const n=ph(e,t);return n<2?f:c`<div class="account-count">Accounts (${n})</div>`}function hh(e,t){let n=e;for(const s of t){if(!n)return null;const i=ue(n);if(i==="object"){const a=n.properties??{};if(typeof s=="string"&&a[s]){n=a[s];continue}const o=n.additionalProperties;if(typeof s=="string"&&o&&typeof o=="object"){n=o;continue}return null}if(i==="array"){if(typeof s!="number")return null;n=(Array.isArray(n.items)?n.items[0]:n.items)??null;continue}return null}return n}function fh(e,t){const s=(e.channels??{})[t],i=e[t];return(s&&typeof s=="object"?s:null)??(i&&typeof i=="object"?i:null)??{}}function gh(e){const t=$r(e.schema),n=t.schema;if(!n)return c`<div class="callout danger">Schema unavailable. Use Raw.</div>`;const s=hh(n,["channels",e.channelId]);if(!s)return c`<div class="callout danger">Channel config schema unavailable.</div>`;const i=e.configValue??{},a=fh(i,e.channelId);return c`
|
|
830
831
|
<div class="config-form">
|
|
831
832
|
${be({schema:s,value:a,path:["channels",e.channelId],hints:e.uiHints,unsupported:new Set(t.unsupportedPaths),disabled:e.disabled,showLabel:!1,onPatch:e.onPatch})}
|
|
832
833
|
</div>
|
|
833
834
|
`}function $e(e){const{channelId:t,props:n}=e,s=n.configSaving||n.configSchemaLoading;return c`
|
|
834
835
|
<div style="margin-top: 16px;">
|
|
835
|
-
${n.configSchemaLoading?c`<div class="muted">Loading config schema…</div>`:
|
|
836
|
+
${n.configSchemaLoading?c`<div class="muted">Loading config schema…</div>`:gh({channelId:t,configValue:n.configForm,schema:n.configSchema,uiHints:n.configUiHints,disabled:s,onPatch:n.onConfigPatch})}
|
|
836
837
|
<div class="row" style="margin-top: 12px;">
|
|
837
838
|
<button
|
|
838
839
|
class="btn primary"
|
|
@@ -850,7 +851,7 @@ ${e.sidebarContent}
|
|
|
850
851
|
</button>
|
|
851
852
|
</div>
|
|
852
853
|
</div>
|
|
853
|
-
`}function
|
|
854
|
+
`}function vh(e){const{props:t,discord:n,accountCountLabel:s}=e;return c`
|
|
854
855
|
<div class="card">
|
|
855
856
|
<div class="card-title">Discord</div>
|
|
856
857
|
<div class="card-sub">Bot status and channel configuration.</div>
|
|
@@ -892,7 +893,7 @@ ${e.sidebarContent}
|
|
|
892
893
|
</button>
|
|
893
894
|
</div>
|
|
894
895
|
</div>
|
|
895
|
-
`}function
|
|
896
|
+
`}function mh(e){const{props:t,googleChat:n,accountCountLabel:s}=e;return c`
|
|
896
897
|
<div class="card">
|
|
897
898
|
<div class="card-title">Google Chat</div>
|
|
898
899
|
<div class="card-sub">Chat API webhook status and channel configuration.</div>
|
|
@@ -944,7 +945,7 @@ ${e.sidebarContent}
|
|
|
944
945
|
</button>
|
|
945
946
|
</div>
|
|
946
947
|
</div>
|
|
947
|
-
`}function
|
|
948
|
+
`}function yh(e){const{props:t,imessage:n,accountCountLabel:s}=e;return c`
|
|
948
949
|
<div class="card">
|
|
949
950
|
<div class="card-title">iMessage</div>
|
|
950
951
|
<div class="card-sub">macOS bridge status and channel configuration.</div>
|
|
@@ -986,19 +987,19 @@ ${e.sidebarContent}
|
|
|
986
987
|
</button>
|
|
987
988
|
</div>
|
|
988
989
|
</div>
|
|
989
|
-
`}function
|
|
990
|
+
`}function bh(e){const{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 wh(e){const{state:t,callbacks:n,accountId:s}=e,i=bh(t),a=(r,l,p={})=>{const{type:d="text",placeholder:u,maxLength:g,help:v}=p,y=t.values[r]??"",$=t.fieldErrors[r],A=`nostr-profile-${r}`;return d==="textarea"?c`
|
|
990
991
|
<div class="form-field" style="margin-bottom: 12px;">
|
|
991
992
|
<label for="${A}" style="display: block; margin-bottom: 4px; font-weight: 500;">
|
|
992
|
-
${
|
|
993
|
+
${l}
|
|
993
994
|
</label>
|
|
994
995
|
<textarea
|
|
995
996
|
id="${A}"
|
|
996
|
-
.value=${
|
|
997
|
+
.value=${y}
|
|
997
998
|
placeholder=${u??""}
|
|
998
999
|
maxlength=${g??2e3}
|
|
999
1000
|
rows="3"
|
|
1000
1001
|
style="width: 100%; padding: 8px; border: 1px solid var(--border-color); border-radius: 4px; resize: vertical; font-family: inherit;"
|
|
1001
|
-
@input=${_=>{const L=_.target;n.onFieldChange(
|
|
1002
|
+
@input=${_=>{const L=_.target;n.onFieldChange(r,L.value)}}
|
|
1002
1003
|
?disabled=${t.saving}
|
|
1003
1004
|
></textarea>
|
|
1004
1005
|
${v?c`<div style="font-size: 12px; color: var(--text-muted); margin-top: 2px;">${v}</div>`:f}
|
|
@@ -1007,29 +1008,29 @@ ${e.sidebarContent}
|
|
|
1007
1008
|
`:c`
|
|
1008
1009
|
<div class="form-field" style="margin-bottom: 12px;">
|
|
1009
1010
|
<label for="${A}" style="display: block; margin-bottom: 4px; font-weight: 500;">
|
|
1010
|
-
${
|
|
1011
|
+
${l}
|
|
1011
1012
|
</label>
|
|
1012
1013
|
<input
|
|
1013
1014
|
id="${A}"
|
|
1014
1015
|
type=${d}
|
|
1015
|
-
.value=${
|
|
1016
|
+
.value=${y}
|
|
1016
1017
|
placeholder=${u??""}
|
|
1017
1018
|
maxlength=${g??256}
|
|
1018
1019
|
style="width: 100%; padding: 8px; border: 1px solid var(--border-color); border-radius: 4px;"
|
|
1019
|
-
@input=${_=>{const L=_.target;n.onFieldChange(
|
|
1020
|
+
@input=${_=>{const L=_.target;n.onFieldChange(r,L.value)}}
|
|
1020
1021
|
?disabled=${t.saving}
|
|
1021
1022
|
/>
|
|
1022
1023
|
${v?c`<div style="font-size: 12px; color: var(--text-muted); margin-top: 2px;">${v}</div>`:f}
|
|
1023
1024
|
${$?c`<div style="font-size: 12px; color: var(--danger-color); margin-top: 2px;">${$}</div>`:f}
|
|
1024
1025
|
</div>
|
|
1025
|
-
`},o=()=>{const
|
|
1026
|
+
`},o=()=>{const r=t.values.picture;return r?c`
|
|
1026
1027
|
<div style="margin-bottom: 12px;">
|
|
1027
1028
|
<img
|
|
1028
|
-
src=${
|
|
1029
|
+
src=${r}
|
|
1029
1030
|
alt="Profile picture preview"
|
|
1030
1031
|
style="max-width: 80px; max-height: 80px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border-color);"
|
|
1031
|
-
@error=${
|
|
1032
|
-
@load=${
|
|
1032
|
+
@error=${l=>{const p=l.target;p.style.display="none"}}
|
|
1033
|
+
@load=${l=>{const p=l.target;p.style.display="block"}}
|
|
1033
1034
|
/>
|
|
1034
1035
|
</div>
|
|
1035
1036
|
`:f};return c`
|
|
@@ -1104,10 +1105,10 @@ ${e.sidebarContent}
|
|
|
1104
1105
|
You have unsaved changes
|
|
1105
1106
|
</div>`:f}
|
|
1106
1107
|
</div>
|
|
1107
|
-
`}function
|
|
1108
|
+
`}function $h(e){const t={name:e?.name??"",displayName:e?.displayName??"",about:e?.about??"",picture:e?.picture??"",banner:e?.banner??"",website:e?.website??"",nip05:e?.nip05??"",lud16:e?.lud16??""};return{values:t,original:{...t},saving:!1,importing:!1,error:null,success:null,fieldErrors:{},showAdvanced:!!(e?.banner||e?.website||e?.nip05||e?.lud16)}}function Ya(e){return e?e.length<=20?e:`${e.slice(0,8)}...${e.slice(-8)}`:"n/a"}function xh(e){const{props:t,nostr:n,nostrAccounts:s,accountCountLabel:i,profileFormState:a,profileFormCallbacks:o,onEditProfile:r}=e,l=s[0],p=n?.configured??l?.configured??!1,d=n?.running??l?.running??!1,u=n?.publicKey??l?.publicKey,g=n?.lastStartAt??l?.lastStartAt??null,v=n?.lastError??l?.lastError??null,y=s.length>1,$=a!=null,A=L=>{const P=L.publicKey,M=L.profile,T=M?.displayName??M?.name??L.name??L.accountId;return c`
|
|
1108
1109
|
<div class="account-card">
|
|
1109
1110
|
<div class="account-card-header">
|
|
1110
|
-
<div class="account-card-title">${
|
|
1111
|
+
<div class="account-card-title">${T}</div>
|
|
1111
1112
|
<div class="account-card-id">${L.accountId}</div>
|
|
1112
1113
|
</div>
|
|
1113
1114
|
<div class="status-list account-card-status">
|
|
@@ -1121,7 +1122,7 @@ ${e.sidebarContent}
|
|
|
1121
1122
|
</div>
|
|
1122
1123
|
<div>
|
|
1123
1124
|
<span class="label">Public Key</span>
|
|
1124
|
-
<span class="monospace" title="${P??""}">${
|
|
1125
|
+
<span class="monospace" title="${P??""}">${Ya(P)}</span>
|
|
1125
1126
|
</div>
|
|
1126
1127
|
<div>
|
|
1127
1128
|
<span class="label">Last inbound</span>
|
|
@@ -1132,14 +1133,14 @@ ${e.sidebarContent}
|
|
|
1132
1133
|
`:f}
|
|
1133
1134
|
</div>
|
|
1134
1135
|
</div>
|
|
1135
|
-
`},_=()=>{if($&&o)return
|
|
1136
|
+
`},_=()=>{if($&&o)return wh({state:a,callbacks:o,accountId:s[0]?.accountId??"default"});const L=l?.profile??n?.profile,{name:P,displayName:M,about:T,picture:E,nip05:pe}=L??{},xn=P||M||T||E||pe;return c`
|
|
1136
1137
|
<div style="margin-top: 16px; padding: 12px; background: var(--bg-secondary); border-radius: 8px;">
|
|
1137
1138
|
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;">
|
|
1138
1139
|
<div style="font-weight: 500;">Profile</div>
|
|
1139
1140
|
${p?c`
|
|
1140
1141
|
<button
|
|
1141
1142
|
class="btn btn-sm"
|
|
1142
|
-
@click=${
|
|
1143
|
+
@click=${r}
|
|
1143
1144
|
style="font-size: 12px; padding: 4px 8px;"
|
|
1144
1145
|
>
|
|
1145
1146
|
Edit Profile
|
|
@@ -1159,8 +1160,8 @@ ${e.sidebarContent}
|
|
|
1159
1160
|
</div>
|
|
1160
1161
|
`:f}
|
|
1161
1162
|
${P?c`<div><span class="label">Name</span><span>${P}</span></div>`:f}
|
|
1162
|
-
${
|
|
1163
|
-
${
|
|
1163
|
+
${M?c`<div><span class="label">Display Name</span><span>${M}</span></div>`:f}
|
|
1164
|
+
${T?c`<div><span class="label">About</span><span style="max-width: 300px; overflow: hidden; text-overflow: ellipsis;">${T}</span></div>`:f}
|
|
1164
1165
|
${pe?c`<div><span class="label">NIP-05</span><span>${pe}</span></div>`:f}
|
|
1165
1166
|
</div>
|
|
1166
1167
|
`:c`
|
|
@@ -1175,7 +1176,7 @@ ${e.sidebarContent}
|
|
|
1175
1176
|
<div class="card-sub">Decentralized DMs via Nostr relays (NIP-04).</div>
|
|
1176
1177
|
${i}
|
|
1177
1178
|
|
|
1178
|
-
${
|
|
1179
|
+
${y?c`
|
|
1179
1180
|
<div class="account-card-list">
|
|
1180
1181
|
${s.map(L=>A(L))}
|
|
1181
1182
|
</div>
|
|
@@ -1192,7 +1193,7 @@ ${e.sidebarContent}
|
|
|
1192
1193
|
<div>
|
|
1193
1194
|
<span class="label">Public Key</span>
|
|
1194
1195
|
<span class="monospace" title="${u??""}"
|
|
1195
|
-
>${
|
|
1196
|
+
>${Ya(u)}</span
|
|
1196
1197
|
>
|
|
1197
1198
|
</div>
|
|
1198
1199
|
<div>
|
|
@@ -1212,7 +1213,7 @@ ${e.sidebarContent}
|
|
|
1212
1213
|
<button class="btn" @click=${()=>t.onRefresh(!1)}>Refresh</button>
|
|
1213
1214
|
</div>
|
|
1214
1215
|
</div>
|
|
1215
|
-
`}function
|
|
1216
|
+
`}function Ah(e){const{props:t,signal:n,accountCountLabel:s}=e;return c`
|
|
1216
1217
|
<div class="card">
|
|
1217
1218
|
<div class="card-title">Signal</div>
|
|
1218
1219
|
<div class="card-sub">signal-cli status and channel configuration.</div>
|
|
@@ -1258,7 +1259,7 @@ ${e.sidebarContent}
|
|
|
1258
1259
|
</button>
|
|
1259
1260
|
</div>
|
|
1260
1261
|
</div>
|
|
1261
|
-
`}function
|
|
1262
|
+
`}function kh(e){const{props:t,slack:n,accountCountLabel:s}=e;return c`
|
|
1262
1263
|
<div class="card">
|
|
1263
1264
|
<div class="card-title">Slack</div>
|
|
1264
1265
|
<div class="card-sub">Socket mode status and channel configuration.</div>
|
|
@@ -1300,30 +1301,30 @@ ${e.sidebarContent}
|
|
|
1300
1301
|
</button>
|
|
1301
1302
|
</div>
|
|
1302
1303
|
</div>
|
|
1303
|
-
`}function
|
|
1304
|
+
`}function Sh(e){const{props:t,telegram:n,telegramAccounts:s,accountCountLabel:i}=e,a=s.length>1,o=r=>{const p=r.probe?.bot?.username,d=r.name||r.accountId;return c`
|
|
1304
1305
|
<div class="account-card">
|
|
1305
1306
|
<div class="account-card-header">
|
|
1306
1307
|
<div class="account-card-title">
|
|
1307
1308
|
${p?`@${p}`:d}
|
|
1308
1309
|
</div>
|
|
1309
|
-
<div class="account-card-id">${
|
|
1310
|
+
<div class="account-card-id">${r.accountId}</div>
|
|
1310
1311
|
</div>
|
|
1311
1312
|
<div class="status-list account-card-status">
|
|
1312
1313
|
<div>
|
|
1313
1314
|
<span class="label">Running</span>
|
|
1314
|
-
<span>${
|
|
1315
|
+
<span>${r.running?"Yes":"No"}</span>
|
|
1315
1316
|
</div>
|
|
1316
1317
|
<div>
|
|
1317
1318
|
<span class="label">Configured</span>
|
|
1318
|
-
<span>${
|
|
1319
|
+
<span>${r.configured?"Yes":"No"}</span>
|
|
1319
1320
|
</div>
|
|
1320
1321
|
<div>
|
|
1321
1322
|
<span class="label">Last inbound</span>
|
|
1322
|
-
<span>${
|
|
1323
|
+
<span>${r.lastInboundAt?O(r.lastInboundAt):"n/a"}</span>
|
|
1323
1324
|
</div>
|
|
1324
|
-
${
|
|
1325
|
+
${r.lastError?c`
|
|
1325
1326
|
<div class="account-card-error">
|
|
1326
|
-
${
|
|
1327
|
+
${r.lastError}
|
|
1327
1328
|
</div>
|
|
1328
1329
|
`:f}
|
|
1329
1330
|
</div>
|
|
@@ -1336,7 +1337,7 @@ ${e.sidebarContent}
|
|
|
1336
1337
|
|
|
1337
1338
|
${a?c`
|
|
1338
1339
|
<div class="account-card-list">
|
|
1339
|
-
${s.map(
|
|
1340
|
+
${s.map(r=>o(r))}
|
|
1340
1341
|
</div>
|
|
1341
1342
|
`:c`
|
|
1342
1343
|
<div class="status-list" style="margin-top: 16px;">
|
|
@@ -1380,7 +1381,7 @@ ${e.sidebarContent}
|
|
|
1380
1381
|
</button>
|
|
1381
1382
|
</div>
|
|
1382
1383
|
</div>
|
|
1383
|
-
`}function
|
|
1384
|
+
`}function _h(e){const{props:t,whatsapp:n,accountCountLabel:s}=e;return c`
|
|
1384
1385
|
<div class="card">
|
|
1385
1386
|
<div class="card-title">WhatsApp</div>
|
|
1386
1387
|
<div class="card-sub">Link WhatsApp Web and monitor connection health.</div>
|
|
@@ -1418,7 +1419,7 @@ ${e.sidebarContent}
|
|
|
1418
1419
|
<div>
|
|
1419
1420
|
<span class="label">Auth age</span>
|
|
1420
1421
|
<span>
|
|
1421
|
-
${n?.authAgeMs!=null?
|
|
1422
|
+
${n?.authAgeMs!=null?dh(n.authAgeMs):"n/a"}
|
|
1422
1423
|
</span>
|
|
1423
1424
|
</div>
|
|
1424
1425
|
</div>
|
|
@@ -1471,9 +1472,9 @@ ${e.sidebarContent}
|
|
|
1471
1472
|
|
|
1472
1473
|
${$e({channelId:"whatsapp",props:t})}
|
|
1473
1474
|
</div>
|
|
1474
|
-
`}function
|
|
1475
|
+
`}function Ch(e){const t=e.snapshot?.channels,n=t?.whatsapp??void 0,s=t?.telegram??void 0,i=t?.discord??null;t?.googlechat;const a=t?.slack??null,o=t?.signal??null,r=t?.imessage??null,l=t?.nostr??null,d=Th(e.snapshot).map((u,g)=>({key:u,enabled:uh(u,e),order:g})).sort((u,g)=>u.enabled!==g.enabled?u.enabled?-1:1:u.order-g.order);return c`
|
|
1475
1476
|
<section class="grid grid-cols-2">
|
|
1476
|
-
${d.map(u=>
|
|
1477
|
+
${d.map(u=>Eh(u.key,e,{whatsapp:n,telegram:s,discord:i,slack:a,signal:o,imessage:r,nostr:l,channelAccounts:e.snapshot?.channelAccounts??null}))}
|
|
1477
1478
|
</section>
|
|
1478
1479
|
|
|
1479
1480
|
<section class="card" style="margin-top: 18px;">
|
|
@@ -1491,7 +1492,7 @@ ${e.sidebarContent}
|
|
|
1491
1492
|
${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
1492
1493
|
</pre>
|
|
1493
1494
|
</section>
|
|
1494
|
-
`}function
|
|
1495
|
+
`}function Th(e){return e?.channelMeta?.length?e.channelMeta.map(t=>t.id):e?.channelOrder?.length?e.channelOrder:["whatsapp","telegram","discord","googlechat","slack","signal","imessage","nostr"]}function Eh(e,t,n){const s=xr(e,n.channelAccounts);switch(e){case"whatsapp":return _h({props:t,whatsapp:n.whatsapp,accountCountLabel:s});case"telegram":return Sh({props:t,telegram:n.telegram,telegramAccounts:n.channelAccounts?.telegram??[],accountCountLabel:s});case"discord":return vh({props:t,discord:n.discord,accountCountLabel:s});case"googlechat":return mh({props:t,accountCountLabel:s});case"slack":return kh({props:t,slack:n.slack,accountCountLabel:s});case"signal":return Ah({props:t,signal:n.signal,accountCountLabel:s});case"imessage":return yh({props:t,imessage:n.imessage,accountCountLabel:s});case"nostr":{const i=n.channelAccounts?.nostr??[],a=i[0],o=a?.accountId??"default",r=a?.profile??null,l=t.nostrProfileAccountId===o?t.nostrProfileFormState:null,p=l?{onFieldChange:t.onNostrProfileFieldChange,onSave:t.onNostrProfileSave,onImport:t.onNostrProfileImport,onCancel:t.onNostrProfileCancel,onToggleAdvanced:t.onNostrProfileToggleAdvanced}:null;return xh({props:t,nostr:n.nostr,nostrAccounts:i,accountCountLabel:s,profileFormState:l,profileFormCallbacks:p,onEditProfile:()=>t.onNostrProfileEdit(o,r)})}default:return Mh(e,t,n.channelAccounts??{})}}function Mh(e,t,n){const s=Ih(t.snapshot,e),i=t.snapshot?.channels?.[e],a=typeof i?.configured=="boolean"?i.configured:void 0,o=typeof i?.running=="boolean"?i.running:void 0,r=typeof i?.connected=="boolean"?i.connected:void 0,l=typeof i?.lastError=="string"?i.lastError:void 0,p=n[e]??[],d=xr(e,n);return c`
|
|
1495
1496
|
<div class="card">
|
|
1496
1497
|
<div class="card-title">${s}</div>
|
|
1497
1498
|
<div class="card-sub">Channel status and configuration.</div>
|
|
@@ -1499,7 +1500,7 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
1499
1500
|
|
|
1500
1501
|
${p.length>0?c`
|
|
1501
1502
|
<div class="account-card-list">
|
|
1502
|
-
${p.map(u=>
|
|
1503
|
+
${p.map(u=>Oh(u))}
|
|
1503
1504
|
</div>
|
|
1504
1505
|
`:c`
|
|
1505
1506
|
<div class="status-list" style="margin-top: 16px;">
|
|
@@ -1513,18 +1514,18 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
1513
1514
|
</div>
|
|
1514
1515
|
<div>
|
|
1515
1516
|
<span class="label">Connected</span>
|
|
1516
|
-
<span>${
|
|
1517
|
+
<span>${r==null?"n/a":r?"Yes":"No"}</span>
|
|
1517
1518
|
</div>
|
|
1518
1519
|
</div>
|
|
1519
1520
|
`}
|
|
1520
1521
|
|
|
1521
|
-
${
|
|
1522
|
-
${
|
|
1522
|
+
${l?c`<div class="callout danger" style="margin-top: 12px;">
|
|
1523
|
+
${l}
|
|
1523
1524
|
</div>`:f}
|
|
1524
1525
|
|
|
1525
1526
|
${$e({channelId:e,props:t})}
|
|
1526
1527
|
</div>
|
|
1527
|
-
`}function
|
|
1528
|
+
`}function Lh(e){return e?.channelMeta?.length?Object.fromEntries(e.channelMeta.map(t=>[t.id,t])):{}}function Ih(e,t){return Lh(e)[t]?.label??e?.channelLabels?.[t]??t}const Rh=600*1e3;function Ar(e){return e.lastInboundAt?Date.now()-e.lastInboundAt<Rh:!1}function Ph(e){return e.running?"Yes":Ar(e)?"Active":"No"}function Nh(e){return e.connected===!0?"Yes":e.connected===!1?"No":Ar(e)?"Active":"n/a"}function Oh(e){const t=Ph(e),n=Nh(e);return c`
|
|
1528
1529
|
<div class="account-card">
|
|
1529
1530
|
<div class="account-card-header">
|
|
1530
1531
|
<div class="account-card-title">${e.name||e.accountId}</div>
|
|
@@ -1554,7 +1555,7 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
1554
1555
|
`:f}
|
|
1555
1556
|
</div>
|
|
1556
1557
|
</div>
|
|
1557
|
-
`}function
|
|
1558
|
+
`}function Dh(e){const t=e.host??"unknown",n=e.ip?`(${e.ip})`:"",s=e.mode??"",i=e.version??"";return`${t} ${n} ${s} ${i}`.trim()}function Bh(e){const t=e.ts??null;return t?O(t):"n/a"}function kr(e){return e?`${kt(e)} (${O(e)})`:"n/a"}function Fh(e){if(e.totalTokens==null)return"n/a";const t=e.totalTokens??0,n=e.contextTokens??0;return n?`${t} / ${n}`:String(t)}function Uh(e){if(e==null)return"";try{return JSON.stringify(e,null,2)}catch{return String(e)}}function Kh(e){const t=e.state??{},n=t.nextRunAtMs?kt(t.nextRunAtMs):"n/a",s=t.lastRunAtMs?kt(t.lastRunAtMs):"n/a";return`${t.lastStatus??"n/a"} · next ${n} · last ${s}`}function Hh(e){const t=e.schedule;return t.kind==="at"?`At ${kt(t.atMs)}`:t.kind==="every"?`Every ${go(t.everyMs)}`:`Cron ${t.expr}${t.tz?` (${t.tz})`:""}`}function zh(e){const t=e.payload;return t.kind==="systemEvent"?`System: ${t.text}`:`Agent: ${t.message}`}function jh(e){const t=["last",...e.channels.filter(Boolean)],n=e.form.channel?.trim();n&&!t.includes(n)&&t.push(n);const s=new Set;return t.filter(i=>s.has(i)?!1:(s.add(i),!0))}function qh(e,t){if(t==="last")return"last";const n=e.channelMeta?.find(s=>s.id===t);return n?.label?n.label:e.channelLabels?.[t]??t}function Gh(e){const t=jh(e);return c`
|
|
1558
1559
|
<section class="grid grid-cols-2">
|
|
1559
1560
|
<div class="card">
|
|
1560
1561
|
<div class="card-title">Scheduler</div>
|
|
@@ -1572,7 +1573,7 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
1572
1573
|
</div>
|
|
1573
1574
|
<div class="stat">
|
|
1574
1575
|
<div class="stat-label">Next wake</div>
|
|
1575
|
-
<div class="stat-value">${
|
|
1576
|
+
<div class="stat-value">${kr(e.status?.nextWakeAtMs??null)}</div>
|
|
1576
1577
|
</div>
|
|
1577
1578
|
</div>
|
|
1578
1579
|
<div class="row" style="margin-top: 12px;">
|
|
@@ -1629,7 +1630,7 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
1629
1630
|
</select>
|
|
1630
1631
|
</label>
|
|
1631
1632
|
</div>
|
|
1632
|
-
${
|
|
1633
|
+
${Wh(e)}
|
|
1633
1634
|
<div class="form-grid" style="margin-top: 12px;">
|
|
1634
1635
|
<label class="field">
|
|
1635
1636
|
<span>Session</span>
|
|
@@ -1687,7 +1688,7 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
1687
1688
|
@change=${n=>e.onFormChange({channel:n.target.value})}
|
|
1688
1689
|
>
|
|
1689
1690
|
${t.map(n=>c`<option value=${n}>
|
|
1690
|
-
${
|
|
1691
|
+
${qh(e,n)}
|
|
1691
1692
|
</option>`)}
|
|
1692
1693
|
</select>
|
|
1693
1694
|
</label>
|
|
@@ -1730,7 +1731,7 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
1730
1731
|
<div class="card-sub">All scheduled jobs stored in the gateway.</div>
|
|
1731
1732
|
${e.jobs.length===0?c`<div class="muted" style="margin-top: 12px;">No jobs yet.</div>`:c`
|
|
1732
1733
|
<div class="list" style="margin-top: 12px;">
|
|
1733
|
-
${e.jobs.map(n=>
|
|
1734
|
+
${e.jobs.map(n=>Vh(n,e))}
|
|
1734
1735
|
</div>
|
|
1735
1736
|
`}
|
|
1736
1737
|
</section>
|
|
@@ -1744,11 +1745,11 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
1744
1745
|
</div>
|
|
1745
1746
|
`:e.runs.length===0?c`<div class="muted" style="margin-top: 12px;">No runs yet.</div>`:c`
|
|
1746
1747
|
<div class="list" style="margin-top: 12px;">
|
|
1747
|
-
${e.runs.map(n=>
|
|
1748
|
+
${e.runs.map(n=>Yh(n))}
|
|
1748
1749
|
</div>
|
|
1749
1750
|
`}
|
|
1750
1751
|
</section>
|
|
1751
|
-
`}function
|
|
1752
|
+
`}function Wh(e){const t=e.form;return t.scheduleKind==="at"?c`
|
|
1752
1753
|
<label class="field" style="margin-top: 12px;">
|
|
1753
1754
|
<span>Run at</span>
|
|
1754
1755
|
<input
|
|
@@ -1795,12 +1796,12 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
1795
1796
|
/>
|
|
1796
1797
|
</label>
|
|
1797
1798
|
</div>
|
|
1798
|
-
`}function
|
|
1799
|
+
`}function Vh(e,t){const s=`list-item list-item-clickable${t.runsJobId===e.id?" list-item-selected":""}`;return c`
|
|
1799
1800
|
<div class=${s} @click=${()=>t.onLoadRuns(e.id)}>
|
|
1800
1801
|
<div class="list-main">
|
|
1801
1802
|
<div class="list-title">${e.name}</div>
|
|
1802
|
-
<div class="list-sub">${
|
|
1803
|
-
<div class="muted">${
|
|
1803
|
+
<div class="list-sub">${Hh(e)}</div>
|
|
1804
|
+
<div class="muted">${zh(e)}</div>
|
|
1804
1805
|
${e.agentId?c`<div class="muted">Agent: ${e.agentId}</div>`:f}
|
|
1805
1806
|
<div class="chip-row" style="margin-top: 6px;">
|
|
1806
1807
|
<span class="chip">${e.enabled?"enabled":"disabled"}</span>
|
|
@@ -1809,7 +1810,7 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
1809
1810
|
</div>
|
|
1810
1811
|
</div>
|
|
1811
1812
|
<div class="list-meta">
|
|
1812
|
-
<div>${
|
|
1813
|
+
<div>${Kh(e)}</div>
|
|
1813
1814
|
<div class="row" style="justify-content: flex-end; margin-top: 8px;">
|
|
1814
1815
|
<button
|
|
1815
1816
|
class="btn"
|
|
@@ -1842,19 +1843,19 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
1842
1843
|
</div>
|
|
1843
1844
|
</div>
|
|
1844
1845
|
</div>
|
|
1845
|
-
`}function
|
|
1846
|
+
`}function Yh(e){return c`
|
|
1846
1847
|
<div class="list-item">
|
|
1847
1848
|
<div class="list-main">
|
|
1848
1849
|
<div class="list-title">${e.status}</div>
|
|
1849
1850
|
<div class="list-sub">${e.summary??""}</div>
|
|
1850
1851
|
</div>
|
|
1851
1852
|
<div class="list-meta">
|
|
1852
|
-
<div>${
|
|
1853
|
+
<div>${kt(e.ts)}</div>
|
|
1853
1854
|
<div class="muted">${e.durationMs??0}ms</div>
|
|
1854
1855
|
${e.error?c`<div class="muted">${e.error}</div>`:f}
|
|
1855
1856
|
</div>
|
|
1856
1857
|
</div>
|
|
1857
|
-
`}function
|
|
1858
|
+
`}function Qh(e){const n=(e.status&&typeof e.status=="object"?e.status.securityAudit:null)?.summary??null,s=n?.critical??0,i=n?.warn??0,a=n?.info??0,o=s>0?"danger":i>0?"warn":"success",r=s>0?`${s} critical`:i>0?`${i} warnings`:"No critical issues";return c`
|
|
1858
1859
|
<section class="grid grid-cols-2">
|
|
1859
1860
|
<div class="card">
|
|
1860
1861
|
<div class="row" style="justify-content: space-between;">
|
|
@@ -1870,8 +1871,8 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
1870
1871
|
<div>
|
|
1871
1872
|
<div class="muted">Status</div>
|
|
1872
1873
|
${n?c`<div class="callout ${o}" style="margin-top: 8px;">
|
|
1873
|
-
Security audit: ${
|
|
1874
|
-
<span class="mono">
|
|
1874
|
+
Security audit: ${r}${a>0?` · ${a} info`:""}. Run
|
|
1875
|
+
<span class="mono">openclaw security audit --deep</span> for details.
|
|
1875
1876
|
</div>`:f}
|
|
1876
1877
|
<pre class="code-block">${JSON.stringify(e.status??{},null,2)}</pre>
|
|
1877
1878
|
</div>
|
|
@@ -1894,7 +1895,7 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
1894
1895
|
<span>Method</span>
|
|
1895
1896
|
<input
|
|
1896
1897
|
.value=${e.callMethod}
|
|
1897
|
-
@input=${
|
|
1898
|
+
@input=${l=>e.onCallMethodChange(l.target.value)}
|
|
1898
1899
|
placeholder="system-presence"
|
|
1899
1900
|
/>
|
|
1900
1901
|
</label>
|
|
@@ -1902,7 +1903,7 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
1902
1903
|
<span>Params (JSON)</span>
|
|
1903
1904
|
<textarea
|
|
1904
1905
|
.value=${e.callParams}
|
|
1905
|
-
@input=${
|
|
1906
|
+
@input=${l=>e.onCallParamsChange(l.target.value)}
|
|
1906
1907
|
rows="6"
|
|
1907
1908
|
></textarea>
|
|
1908
1909
|
</label>
|
|
@@ -1928,21 +1929,21 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
1928
1929
|
<div class="card-sub">Latest gateway events.</div>
|
|
1929
1930
|
${e.eventLog.length===0?c`<div class="muted" style="margin-top: 12px;">No events yet.</div>`:c`
|
|
1930
1931
|
<div class="list" style="margin-top: 12px;">
|
|
1931
|
-
${e.eventLog.map(
|
|
1932
|
+
${e.eventLog.map(l=>c`
|
|
1932
1933
|
<div class="list-item">
|
|
1933
1934
|
<div class="list-main">
|
|
1934
|
-
<div class="list-title">${
|
|
1935
|
-
<div class="list-sub">${new Date(
|
|
1935
|
+
<div class="list-title">${l.event}</div>
|
|
1936
|
+
<div class="list-sub">${new Date(l.ts).toLocaleTimeString()}</div>
|
|
1936
1937
|
</div>
|
|
1937
1938
|
<div class="list-meta">
|
|
1938
|
-
<pre class="code-block">${
|
|
1939
|
+
<pre class="code-block">${Uh(l.payload)}</pre>
|
|
1939
1940
|
</div>
|
|
1940
1941
|
</div>
|
|
1941
1942
|
`)}
|
|
1942
1943
|
</div>
|
|
1943
1944
|
`}
|
|
1944
1945
|
</section>
|
|
1945
|
-
`}function
|
|
1946
|
+
`}function Zh(e){return c`
|
|
1946
1947
|
<section class="card">
|
|
1947
1948
|
<div class="row" style="justify-content: space-between;">
|
|
1948
1949
|
<div>
|
|
@@ -1960,14 +1961,14 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
1960
1961
|
${e.statusMessage}
|
|
1961
1962
|
</div>`:f}
|
|
1962
1963
|
<div class="list" style="margin-top: 16px;">
|
|
1963
|
-
${e.entries.length===0?c`<div class="muted">No instances reported yet.</div>`:e.entries.map(t=>
|
|
1964
|
+
${e.entries.length===0?c`<div class="muted">No instances reported yet.</div>`:e.entries.map(t=>Jh(t))}
|
|
1964
1965
|
</div>
|
|
1965
1966
|
</section>
|
|
1966
|
-
`}function
|
|
1967
|
+
`}function Jh(e){const t=e.lastInputSeconds!=null?`${e.lastInputSeconds}s ago`:"n/a",n=e.mode??"unknown",s=Array.isArray(e.roles)?e.roles.filter(Boolean):[],i=Array.isArray(e.scopes)?e.scopes.filter(Boolean):[],a=i.length>0?i.length>3?`${i.length} scopes`:`scopes: ${i.join(", ")}`:null;return c`
|
|
1967
1968
|
<div class="list-item">
|
|
1968
1969
|
<div class="list-main">
|
|
1969
1970
|
<div class="list-title">${e.host??"unknown host"}</div>
|
|
1970
|
-
<div class="list-sub">${
|
|
1971
|
+
<div class="list-sub">${Dh(e)}</div>
|
|
1971
1972
|
<div class="chip-row">
|
|
1972
1973
|
<span class="chip">${n}</span>
|
|
1973
1974
|
${s.map(o=>c`<span class="chip">${o}</span>`)}
|
|
@@ -1979,12 +1980,12 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
1979
1980
|
</div>
|
|
1980
1981
|
</div>
|
|
1981
1982
|
<div class="list-meta">
|
|
1982
|
-
<div>${
|
|
1983
|
+
<div>${Bh(e)}</div>
|
|
1983
1984
|
<div class="muted">Last input ${t}</div>
|
|
1984
1985
|
<div class="muted">Reason ${e.reason??""}</div>
|
|
1985
1986
|
</div>
|
|
1986
1987
|
</div>
|
|
1987
|
-
`}const
|
|
1988
|
+
`}const Qa=["trace","debug","info","warn","error","fatal"];function Xh(e){if(!e)return"";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleTimeString()}function ef(e,t){return t?[e.message,e.subsystem,e.raw].filter(Boolean).join(" ").toLowerCase().includes(t):!0}function tf(e){const t=e.filterText.trim().toLowerCase(),n=Qa.some(a=>!e.levelFilters[a]),s=e.entries.filter(a=>a.level&&!e.levelFilters[a.level]?!1:ef(a,t)),i=t||n?"filtered":"visible";return c`
|
|
1988
1989
|
<section class="card">
|
|
1989
1990
|
<div class="row" style="justify-content: space-between;">
|
|
1990
1991
|
<div>
|
|
@@ -2025,7 +2026,7 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
2025
2026
|
</div>
|
|
2026
2027
|
|
|
2027
2028
|
<div class="chip-row" style="margin-top: 12px;">
|
|
2028
|
-
${
|
|
2029
|
+
${Qa.map(a=>c`
|
|
2029
2030
|
<label class="chip log-chip ${a}">
|
|
2030
2031
|
<input
|
|
2031
2032
|
type="checkbox"
|
|
@@ -2046,7 +2047,7 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
2046
2047
|
<div class="log-stream" style="margin-top: 12px;" @scroll=${e.onScroll}>
|
|
2047
2048
|
${s.length===0?c`<div class="muted" style="padding: 12px;">No log entries.</div>`:s.map(a=>c`
|
|
2048
2049
|
<div class="log-row">
|
|
2049
|
-
<div class="log-time mono">${
|
|
2050
|
+
<div class="log-time mono">${Xh(a.time)}</div>
|
|
2050
2051
|
<div class="log-level ${a.level??""}">${a.level??""}</div>
|
|
2051
2052
|
<div class="log-subsystem mono">${a.subsystem??""}</div>
|
|
2052
2053
|
<div class="log-message mono">${a.message??a.raw}</div>
|
|
@@ -2054,10 +2055,10 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
2054
2055
|
`)}
|
|
2055
2056
|
</div>
|
|
2056
2057
|
</section>
|
|
2057
|
-
`}function
|
|
2058
|
-
${
|
|
2059
|
-
${
|
|
2060
|
-
${
|
|
2058
|
+
`}function nf(e){const t=cf(e),n=gf(e);return c`
|
|
2059
|
+
${mf(n)}
|
|
2060
|
+
${vf(t)}
|
|
2061
|
+
${sf(e)}
|
|
2061
2062
|
<section class="card">
|
|
2062
2063
|
<div class="row" style="justify-content: space-between;">
|
|
2063
2064
|
<div>
|
|
@@ -2069,10 +2070,10 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
2069
2070
|
</button>
|
|
2070
2071
|
</div>
|
|
2071
2072
|
<div class="list" style="margin-top: 16px;">
|
|
2072
|
-
${e.nodes.length===0?c`<div class="muted">No nodes found.</div>`:e.nodes.map(s=>
|
|
2073
|
+
${e.nodes.length===0?c`<div class="muted">No nodes found.</div>`:e.nodes.map(s=>Cf(s))}
|
|
2073
2074
|
</div>
|
|
2074
2075
|
</section>
|
|
2075
|
-
`}function
|
|
2076
|
+
`}function sf(e){const t=e.devicesList??{pending:[],paired:[]},n=Array.isArray(t.pending)?t.pending:[],s=Array.isArray(t.paired)?t.paired:[];return c`
|
|
2076
2077
|
<section class="card">
|
|
2077
2078
|
<div class="row" style="justify-content: space-between;">
|
|
2078
2079
|
<div>
|
|
@@ -2087,16 +2088,16 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
2087
2088
|
<div class="list" style="margin-top: 16px;">
|
|
2088
2089
|
${n.length>0?c`
|
|
2089
2090
|
<div class="muted" style="margin-bottom: 8px;">Pending</div>
|
|
2090
|
-
${n.map(i=>
|
|
2091
|
+
${n.map(i=>af(i,e))}
|
|
2091
2092
|
`:f}
|
|
2092
2093
|
${s.length>0?c`
|
|
2093
2094
|
<div class="muted" style="margin-top: 12px; margin-bottom: 8px;">Paired</div>
|
|
2094
|
-
${s.map(i=>
|
|
2095
|
+
${s.map(i=>of(i,e))}
|
|
2095
2096
|
`:f}
|
|
2096
2097
|
${n.length===0&&s.length===0?c`<div class="muted">No paired devices.</div>`:f}
|
|
2097
2098
|
</div>
|
|
2098
2099
|
</section>
|
|
2099
|
-
`}function
|
|
2100
|
+
`}function af(e,t){const n=e.displayName?.trim()||e.deviceId,s=typeof e.ts=="number"?O(e.ts):"n/a",i=e.role?.trim()?`role: ${e.role}`:"role: -",a=e.isRepair?" · repair":"",o=e.remoteIp?` · ${e.remoteIp}`:"";return c`
|
|
2100
2101
|
<div class="list-item">
|
|
2101
2102
|
<div class="list-main">
|
|
2102
2103
|
<div class="list-title">${n}</div>
|
|
@@ -2116,7 +2117,7 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
2116
2117
|
</div>
|
|
2117
2118
|
</div>
|
|
2118
2119
|
</div>
|
|
2119
|
-
`}function
|
|
2120
|
+
`}function of(e,t){const n=e.displayName?.trim()||e.deviceId,s=e.remoteIp?` · ${e.remoteIp}`:"",i=`roles: ${ls(e.roles)}`,a=`scopes: ${ls(e.scopes)}`,o=Array.isArray(e.tokens)?e.tokens:[];return c`
|
|
2120
2121
|
<div class="list-item">
|
|
2121
2122
|
<div class="list-main">
|
|
2122
2123
|
<div class="list-title">${n}</div>
|
|
@@ -2125,12 +2126,12 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
2125
2126
|
${o.length===0?c`<div class="muted" style="margin-top: 6px;">Tokens: none</div>`:c`
|
|
2126
2127
|
<div class="muted" style="margin-top: 10px;">Tokens</div>
|
|
2127
2128
|
<div style="display: flex; flex-direction: column; gap: 8px; margin-top: 6px;">
|
|
2128
|
-
${o.map(
|
|
2129
|
+
${o.map(r=>rf(e.deviceId,r,t))}
|
|
2129
2130
|
</div>
|
|
2130
2131
|
`}
|
|
2131
2132
|
</div>
|
|
2132
2133
|
</div>
|
|
2133
|
-
`}function
|
|
2134
|
+
`}function rf(e,t,n){const s=t.revokedAtMs?"revoked":"active",i=`scopes: ${ls(t.scopes)}`,a=O(t.rotatedAtMs??t.createdAtMs??t.lastUsedAtMs??null);return c`
|
|
2134
2135
|
<div class="row" style="justify-content: space-between; gap: 8px;">
|
|
2135
2136
|
<div class="list-sub">${t.role} · ${s} · ${i} · ${a}</div>
|
|
2136
2137
|
<div class="row" style="justify-content: flex-end; gap: 6px; flex-wrap: wrap;">
|
|
@@ -2150,7 +2151,7 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
2150
2151
|
`}
|
|
2151
2152
|
</div>
|
|
2152
2153
|
</div>
|
|
2153
|
-
`}const
|
|
2154
|
+
`}const Ae="__defaults__",Za=[{value:"deny",label:"Deny"},{value:"allowlist",label:"Allowlist"},{value:"full",label:"Full"}],lf=[{value:"off",label:"Off"},{value:"on-miss",label:"On miss"},{value:"always",label:"Always"}];function cf(e){const t=e.configForm,n=kf(e.nodes),{defaultBinding:s,agents:i}=_f(t),a=!!t,o=e.configSaving||e.configFormMode==="raw";return{ready:a,disabled:o,configDirty:e.configDirty,configLoading:e.configLoading,configSaving:e.configSaving,defaultBinding:s,agents:i,nodes:n,onBindDefault:e.onBindDefault,onBindAgent:e.onBindAgent,onSave:e.onSaveBindings,onLoadConfig:e.onLoadConfig,formMode:e.configFormMode}}function Ja(e){return e==="allowlist"||e==="full"||e==="deny"?e:"deny"}function df(e){return e==="always"||e==="off"||e==="on-miss"?e:"on-miss"}function uf(e){const t=e?.defaults??{};return{security:Ja(t.security),ask:df(t.ask),askFallback:Ja(t.askFallback??"deny"),autoAllowSkills:!!(t.autoAllowSkills??!1)}}function pf(e){const t=e?.agents??{},n=Array.isArray(t.list)?t.list:[],s=[];return n.forEach(i=>{if(!i||typeof i!="object")return;const a=i,o=typeof a.id=="string"?a.id.trim():"";if(!o)return;const r=typeof a.name=="string"?a.name.trim():void 0,l=a.default===!0;s.push({id:o,name:r||void 0,isDefault:l})}),s}function hf(e,t){const n=pf(e),s=Object.keys(t?.agents??{}),i=new Map;n.forEach(o=>i.set(o.id,o)),s.forEach(o=>{i.has(o)||i.set(o,{id:o})});const a=Array.from(i.values());return a.length===0&&a.push({id:"main",isDefault:!0}),a.sort((o,r)=>{if(o.isDefault&&!r.isDefault)return-1;if(!o.isDefault&&r.isDefault)return 1;const l=o.name?.trim()?o.name:o.id,p=r.name?.trim()?r.name:r.id;return l.localeCompare(p)}),a}function ff(e,t){return e===Ae?Ae:e&&t.some(n=>n.id===e)?e:Ae}function gf(e){const t=e.execApprovalsForm??e.execApprovalsSnapshot?.file??null,n=!!t,s=uf(t),i=hf(e.configForm,t),a=Sf(e.nodes),o=e.execApprovalsTarget;let r=o==="node"&&e.execApprovalsTargetNodeId?e.execApprovalsTargetNodeId:null;o==="node"&&r&&!a.some(u=>u.id===r)&&(r=null);const l=ff(e.execApprovalsSelectedAgent,i),p=l!==Ae?(t?.agents??{})[l]??null:null,d=Array.isArray(p?.allowlist)?p.allowlist??[]:[];return{ready:n,disabled:e.execApprovalsSaving||e.execApprovalsLoading,dirty:e.execApprovalsDirty,loading:e.execApprovalsLoading,saving:e.execApprovalsSaving,form:t,defaults:s,selectedScope:l,selectedAgent:p,agents:i,allowlist:d,target:o,targetNodeId:r,targetNodes:a,onSelectScope:e.onExecApprovalsSelectAgent,onSelectTarget:e.onExecApprovalsTargetChange,onPatch:e.onExecApprovalsPatch,onRemove:e.onExecApprovalsRemove,onLoad:e.onLoadExecApprovals,onSave:e.onSaveExecApprovals}}function vf(e){const t=e.nodes.length>0,n=e.defaultBinding??"";return c`
|
|
2154
2155
|
<section class="card">
|
|
2155
2156
|
<div class="row" style="justify-content: space-between; align-items: center;">
|
|
2156
2157
|
<div>
|
|
@@ -2199,7 +2200,7 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
2199
2200
|
</div>
|
|
2200
2201
|
</div>
|
|
2201
2202
|
|
|
2202
|
-
${e.agents.length===0?c`<div class="muted">No agents found.</div>`:e.agents.map(s=>
|
|
2203
|
+
${e.agents.length===0?c`<div class="muted">No agents found.</div>`:e.agents.map(s=>Af(s,e))}
|
|
2203
2204
|
</div>
|
|
2204
2205
|
`:c`<div class="row" style="margin-top: 12px; gap: 12px;">
|
|
2205
2206
|
<div class="muted">Load config to edit bindings.</div>
|
|
@@ -2208,7 +2209,7 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
2208
2209
|
</button>
|
|
2209
2210
|
</div>`}
|
|
2210
2211
|
</section>
|
|
2211
|
-
`}function
|
|
2212
|
+
`}function mf(e){const t=e.ready,n=e.target!=="node"||!!e.targetNodeId;return c`
|
|
2212
2213
|
<section class="card">
|
|
2213
2214
|
<div class="row" style="justify-content: space-between; align-items: center;">
|
|
2214
2215
|
<div>
|
|
@@ -2226,12 +2227,12 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
2226
2227
|
</button>
|
|
2227
2228
|
</div>
|
|
2228
2229
|
|
|
2229
|
-
${
|
|
2230
|
+
${yf(e)}
|
|
2230
2231
|
|
|
2231
2232
|
${t?c`
|
|
2232
|
-
${
|
|
2233
|
-
${
|
|
2234
|
-
${e.selectedScope===
|
|
2233
|
+
${bf(e)}
|
|
2234
|
+
${wf(e)}
|
|
2235
|
+
${e.selectedScope===Ae?f:$f(e)}
|
|
2235
2236
|
`:c`<div class="row" style="margin-top: 12px; gap: 12px;">
|
|
2236
2237
|
<div class="muted">Load exec approvals to edit allowlists.</div>
|
|
2237
2238
|
<button class="btn" ?disabled=${e.loading||!n} @click=${e.onLoad}>
|
|
@@ -2239,7 +2240,7 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
2239
2240
|
</button>
|
|
2240
2241
|
</div>`}
|
|
2241
2242
|
</section>
|
|
2242
|
-
`}function
|
|
2243
|
+
`}function yf(e){const t=e.targetNodes.length>0,n=e.targetNodeId??"";return c`
|
|
2243
2244
|
<div class="list" style="margin-top: 12px;">
|
|
2244
2245
|
<div class="list-item">
|
|
2245
2246
|
<div class="list-main">
|
|
@@ -2280,13 +2281,13 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
2280
2281
|
</div>
|
|
2281
2282
|
${e.target==="node"&&!t?c`<div class="muted">No nodes advertise exec approvals yet.</div>`:f}
|
|
2282
2283
|
</div>
|
|
2283
|
-
`}function
|
|
2284
|
+
`}function bf(e){return c`
|
|
2284
2285
|
<div class="row" style="margin-top: 12px; gap: 8px; flex-wrap: wrap;">
|
|
2285
2286
|
<span class="label">Scope</span>
|
|
2286
2287
|
<div class="row" style="gap: 8px; flex-wrap: wrap;">
|
|
2287
2288
|
<button
|
|
2288
|
-
class="btn btn--sm ${e.selectedScope===
|
|
2289
|
-
@click=${()=>e.onSelectScope(
|
|
2289
|
+
class="btn btn--sm ${e.selectedScope===Ae?"active":""}"
|
|
2290
|
+
@click=${()=>e.onSelectScope(Ae)}
|
|
2290
2291
|
>
|
|
2291
2292
|
Defaults
|
|
2292
2293
|
</button>
|
|
@@ -2300,7 +2301,7 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
2300
2301
|
`})}
|
|
2301
2302
|
</div>
|
|
2302
2303
|
</div>
|
|
2303
|
-
`}function
|
|
2304
|
+
`}function wf(e){const t=e.selectedScope===Ae,n=e.defaults,s=e.selectedAgent??{},i=t?["defaults"]:["agents",e.selectedScope],a=typeof s.security=="string"?s.security:void 0,o=typeof s.ask=="string"?s.ask:void 0,r=typeof s.askFallback=="string"?s.askFallback:void 0,l=t?n.security:a??"__default__",p=t?n.ask:o??"__default__",d=t?n.askFallback:r??"__default__",u=typeof s.autoAllowSkills=="boolean"?s.autoAllowSkills:void 0,g=u??n.autoAllowSkills,v=u==null;return c`
|
|
2304
2305
|
<div class="list" style="margin-top: 16px;">
|
|
2305
2306
|
<div class="list-item">
|
|
2306
2307
|
<div class="list-main">
|
|
@@ -2314,16 +2315,16 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
2314
2315
|
<span>Mode</span>
|
|
2315
2316
|
<select
|
|
2316
2317
|
?disabled=${e.disabled}
|
|
2317
|
-
@change=${
|
|
2318
|
+
@change=${y=>{const A=y.target.value;!t&&A==="__default__"?e.onRemove([...i,"security"]):e.onPatch([...i,"security"],A)}}
|
|
2318
2319
|
>
|
|
2319
|
-
${t?f:c`<option value="__default__" ?selected=${
|
|
2320
|
+
${t?f:c`<option value="__default__" ?selected=${l==="__default__"}>
|
|
2320
2321
|
Use default (${n.security})
|
|
2321
2322
|
</option>`}
|
|
2322
|
-
${
|
|
2323
|
-
value=${
|
|
2324
|
-
?selected=${
|
|
2323
|
+
${Za.map(y=>c`<option
|
|
2324
|
+
value=${y.value}
|
|
2325
|
+
?selected=${l===y.value}
|
|
2325
2326
|
>
|
|
2326
|
-
${
|
|
2327
|
+
${y.label}
|
|
2327
2328
|
</option>`)}
|
|
2328
2329
|
</select>
|
|
2329
2330
|
</label>
|
|
@@ -2342,16 +2343,16 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
2342
2343
|
<span>Mode</span>
|
|
2343
2344
|
<select
|
|
2344
2345
|
?disabled=${e.disabled}
|
|
2345
|
-
@change=${
|
|
2346
|
+
@change=${y=>{const A=y.target.value;!t&&A==="__default__"?e.onRemove([...i,"ask"]):e.onPatch([...i,"ask"],A)}}
|
|
2346
2347
|
>
|
|
2347
2348
|
${t?f:c`<option value="__default__" ?selected=${p==="__default__"}>
|
|
2348
2349
|
Use default (${n.ask})
|
|
2349
2350
|
</option>`}
|
|
2350
|
-
${
|
|
2351
|
-
value=${
|
|
2352
|
-
?selected=${p===
|
|
2351
|
+
${lf.map(y=>c`<option
|
|
2352
|
+
value=${y.value}
|
|
2353
|
+
?selected=${p===y.value}
|
|
2353
2354
|
>
|
|
2354
|
-
${
|
|
2355
|
+
${y.label}
|
|
2355
2356
|
</option>`)}
|
|
2356
2357
|
</select>
|
|
2357
2358
|
</label>
|
|
@@ -2370,16 +2371,16 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
2370
2371
|
<span>Fallback</span>
|
|
2371
2372
|
<select
|
|
2372
2373
|
?disabled=${e.disabled}
|
|
2373
|
-
@change=${
|
|
2374
|
+
@change=${y=>{const A=y.target.value;!t&&A==="__default__"?e.onRemove([...i,"askFallback"]):e.onPatch([...i,"askFallback"],A)}}
|
|
2374
2375
|
>
|
|
2375
2376
|
${t?f:c`<option value="__default__" ?selected=${d==="__default__"}>
|
|
2376
2377
|
Use default (${n.askFallback})
|
|
2377
2378
|
</option>`}
|
|
2378
|
-
${
|
|
2379
|
-
value=${
|
|
2380
|
-
?selected=${d===
|
|
2379
|
+
${Za.map(y=>c`<option
|
|
2380
|
+
value=${y.value}
|
|
2381
|
+
?selected=${d===y.value}
|
|
2381
2382
|
>
|
|
2382
|
-
${
|
|
2383
|
+
${y.label}
|
|
2383
2384
|
</option>`)}
|
|
2384
2385
|
</select>
|
|
2385
2386
|
</label>
|
|
@@ -2400,7 +2401,7 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
2400
2401
|
type="checkbox"
|
|
2401
2402
|
?disabled=${e.disabled}
|
|
2402
2403
|
.checked=${g}
|
|
2403
|
-
@change=${
|
|
2404
|
+
@change=${y=>{const $=y.target;e.onPatch([...i,"autoAllowSkills"],$.checked)}}
|
|
2404
2405
|
/>
|
|
2405
2406
|
</label>
|
|
2406
2407
|
${!t&&!v?c`<button
|
|
@@ -2413,7 +2414,7 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
2413
2414
|
</div>
|
|
2414
2415
|
</div>
|
|
2415
2416
|
</div>
|
|
2416
|
-
`}function
|
|
2417
|
+
`}function $f(e){const t=["agents",e.selectedScope,"allowlist"],n=e.allowlist;return c`
|
|
2417
2418
|
<div class="row" style="margin-top: 18px; justify-content: space-between;">
|
|
2418
2419
|
<div>
|
|
2419
2420
|
<div class="card-title">Allowlist</div>
|
|
@@ -2428,9 +2429,9 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
2428
2429
|
</button>
|
|
2429
2430
|
</div>
|
|
2430
2431
|
<div class="list" style="margin-top: 12px;">
|
|
2431
|
-
${n.length===0?c`<div class="muted">No allowlist entries yet.</div>`:n.map((s,i)=>
|
|
2432
|
+
${n.length===0?c`<div class="muted">No allowlist entries yet.</div>`:n.map((s,i)=>xf(e,s,i))}
|
|
2432
2433
|
</div>
|
|
2433
|
-
`}function
|
|
2434
|
+
`}function xf(e,t,n){const s=t.lastUsedAt?O(t.lastUsedAt):"never",i=t.lastUsedCommand?cs(t.lastUsedCommand,120):null,a=t.lastResolvedPath?cs(t.lastResolvedPath,120):null;return c`
|
|
2434
2435
|
<div class="list-item">
|
|
2435
2436
|
<div class="list-main">
|
|
2436
2437
|
<div class="list-title">${t.pattern?.trim()?t.pattern:"New pattern"}</div>
|
|
@@ -2445,7 +2446,7 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
2445
2446
|
type="text"
|
|
2446
2447
|
.value=${t.pattern??""}
|
|
2447
2448
|
?disabled=${e.disabled}
|
|
2448
|
-
@input=${o=>{const
|
|
2449
|
+
@input=${o=>{const r=o.target;e.onPatch(["agents",e.selectedScope,"allowlist",n,"pattern"],r.value)}}
|
|
2449
2450
|
/>
|
|
2450
2451
|
</label>
|
|
2451
2452
|
<button
|
|
@@ -2457,7 +2458,7 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
2457
2458
|
</button>
|
|
2458
2459
|
</div>
|
|
2459
2460
|
</div>
|
|
2460
|
-
`}function
|
|
2461
|
+
`}function Af(e,t){const n=e.binding??"__default__",s=e.name?.trim()?`${e.name} (${e.id})`:e.id,i=t.nodes.length>0;return c`
|
|
2461
2462
|
<div class="list-item">
|
|
2462
2463
|
<div class="list-main">
|
|
2463
2464
|
<div class="list-title">${s}</div>
|
|
@@ -2471,7 +2472,7 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
2471
2472
|
<span>Binding</span>
|
|
2472
2473
|
<select
|
|
2473
2474
|
?disabled=${t.disabled||!i}
|
|
2474
|
-
@change=${a=>{const
|
|
2475
|
+
@change=${a=>{const r=a.target.value.trim();t.onBindAgent(e.index,r==="__default__"?null:r)}}
|
|
2475
2476
|
>
|
|
2476
2477
|
<option value="__default__" ?selected=${n==="__default__"}>
|
|
2477
2478
|
Use default
|
|
@@ -2486,7 +2487,7 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
2486
2487
|
</label>
|
|
2487
2488
|
</div>
|
|
2488
2489
|
</div>
|
|
2489
|
-
`}function
|
|
2490
|
+
`}function kf(e){const t=[];for(const n of e){if(!(Array.isArray(n.commands)?n.commands:[]).some(r=>String(r)==="system.run"))continue;const a=typeof n.nodeId=="string"?n.nodeId.trim():"";if(!a)continue;const o=typeof n.displayName=="string"&&n.displayName.trim()?n.displayName.trim():a;t.push({id:a,label:o===a?a:`${o} · ${a}`})}return t.sort((n,s)=>n.label.localeCompare(s.label)),t}function Sf(e){const t=[];for(const n of e){if(!(Array.isArray(n.commands)?n.commands:[]).some(r=>String(r)==="system.execApprovals.get"||String(r)==="system.execApprovals.set"))continue;const a=typeof n.nodeId=="string"?n.nodeId.trim():"";if(!a)continue;const o=typeof n.displayName=="string"&&n.displayName.trim()?n.displayName.trim():a;t.push({id:a,label:o===a?a:`${o} · ${a}`})}return t.sort((n,s)=>n.label.localeCompare(s.label)),t}function _f(e){const t={id:"main",name:void 0,index:0,isDefault:!0,binding:null};if(!e||typeof e!="object")return{defaultBinding:null,agents:[t]};const s=(e.tools??{}).exec??{},i=typeof s.node=="string"&&s.node.trim()?s.node.trim():null,a=e.agents??{},o=Array.isArray(a.list)?a.list:[];if(o.length===0)return{defaultBinding:i,agents:[t]};const r=[];return o.forEach((l,p)=>{if(!l||typeof l!="object")return;const d=l,u=typeof d.id=="string"?d.id.trim():"";if(!u)return;const g=typeof d.name=="string"?d.name.trim():void 0,v=d.default===!0,$=(d.tools??{}).exec??{},A=typeof $.node=="string"&&$.node.trim()?$.node.trim():null;r.push({id:u,name:g||void 0,index:p,isDefault:v,binding:A})}),r.length===0&&r.push(t),{defaultBinding:i,agents:r}}function Cf(e){const t=!!e.connected,n=!!e.paired,s=typeof e.displayName=="string"&&e.displayName.trim()||(typeof e.nodeId=="string"?e.nodeId:"unknown"),i=Array.isArray(e.caps)?e.caps:[],a=Array.isArray(e.commands)?e.commands:[];return c`
|
|
2490
2491
|
<div class="list-item">
|
|
2491
2492
|
<div class="list-main">
|
|
2492
2493
|
<div class="list-title">${s}</div>
|
|
@@ -2505,17 +2506,17 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
2505
2506
|
</div>
|
|
2506
2507
|
</div>
|
|
2507
2508
|
</div>
|
|
2508
|
-
`}function
|
|
2509
|
+
`}function Tf(e){const t=e.hello?.snapshot,n=t?.uptimeMs?go(t.uptimeMs):"n/a",s=t?.policy?.tickIntervalMs?`${t.policy.tickIntervalMs}ms`:"n/a",i=(()=>{if(e.connected||!e.lastError)return null;const o=e.lastError.toLowerCase();if(!(o.includes("unauthorized")||o.includes("connect failed")))return null;const l=!!e.settings.token.trim(),p=!!e.password.trim();return!l&&!p?c`
|
|
2509
2510
|
<div class="muted" style="margin-top: 8px;">
|
|
2510
2511
|
This gateway requires auth. Add a token or password, then click Connect.
|
|
2511
2512
|
<div style="margin-top: 6px;">
|
|
2512
|
-
<span class="mono">
|
|
2513
|
-
<span class="mono">
|
|
2513
|
+
<span class="mono">openclaw dashboard --no-open</span> → tokenized URL<br />
|
|
2514
|
+
<span class="mono">openclaw doctor --generate-gateway-token</span> → set token
|
|
2514
2515
|
</div>
|
|
2515
2516
|
<div style="margin-top: 6px;">
|
|
2516
2517
|
<a
|
|
2517
2518
|
class="session-link"
|
|
2518
|
-
href="https://docs.
|
|
2519
|
+
href="https://docs.openclaw.ai/web/dashboard"
|
|
2519
2520
|
target="_blank"
|
|
2520
2521
|
rel="noreferrer"
|
|
2521
2522
|
title="Control UI auth docs (opens in new tab)"
|
|
@@ -2526,12 +2527,12 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
2526
2527
|
`:c`
|
|
2527
2528
|
<div class="muted" style="margin-top: 8px;">
|
|
2528
2529
|
Auth failed. Re-copy a tokenized URL with
|
|
2529
|
-
<span class="mono">
|
|
2530
|
+
<span class="mono">openclaw dashboard --no-open</span>, or update the token,
|
|
2530
2531
|
then click Connect.
|
|
2531
2532
|
<div style="margin-top: 6px;">
|
|
2532
2533
|
<a
|
|
2533
2534
|
class="session-link"
|
|
2534
|
-
href="https://docs.
|
|
2535
|
+
href="https://docs.openclaw.ai/web/dashboard"
|
|
2535
2536
|
target="_blank"
|
|
2536
2537
|
rel="noreferrer"
|
|
2537
2538
|
title="Control UI auth docs (opens in new tab)"
|
|
@@ -2539,7 +2540,7 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
2539
2540
|
>
|
|
2540
2541
|
</div>
|
|
2541
2542
|
</div>
|
|
2542
|
-
`})(),a=(()=>{if(e.connected||!e.lastError||(typeof window<"u"?window.isSecureContext:!0)!==!1)return null;const
|
|
2543
|
+
`})(),a=(()=>{if(e.connected||!e.lastError||(typeof window<"u"?window.isSecureContext:!0)!==!1)return null;const r=e.lastError.toLowerCase();return!r.includes("secure context")&&!r.includes("device identity required")?null:c`
|
|
2543
2544
|
<div class="muted" style="margin-top: 8px;">
|
|
2544
2545
|
This page is HTTP, so the browser blocks device identity. Use HTTPS (Tailscale Serve) or
|
|
2545
2546
|
open <span class="mono">http://127.0.0.1:18789</span> on the gateway host.
|
|
@@ -2550,7 +2551,7 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
2550
2551
|
<div style="margin-top: 6px;">
|
|
2551
2552
|
<a
|
|
2552
2553
|
class="session-link"
|
|
2553
|
-
href="https://docs.
|
|
2554
|
+
href="https://docs.openclaw.ai/gateway/tailscale"
|
|
2554
2555
|
target="_blank"
|
|
2555
2556
|
rel="noreferrer"
|
|
2556
2557
|
title="Tailscale Serve docs (opens in new tab)"
|
|
@@ -2559,7 +2560,7 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
2559
2560
|
<span class="muted"> · </span>
|
|
2560
2561
|
<a
|
|
2561
2562
|
class="session-link"
|
|
2562
|
-
href="https://docs.
|
|
2563
|
+
href="https://docs.openclaw.ai/web/control-ui#insecure-http"
|
|
2563
2564
|
target="_blank"
|
|
2564
2565
|
rel="noreferrer"
|
|
2565
2566
|
title="Insecure HTTP docs (opens in new tab)"
|
|
@@ -2577,7 +2578,7 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
2577
2578
|
<span>WebSocket URL</span>
|
|
2578
2579
|
<input
|
|
2579
2580
|
.value=${e.settings.gatewayUrl}
|
|
2580
|
-
@input=${o=>{const
|
|
2581
|
+
@input=${o=>{const r=o.target.value;e.onSettingsChange({...e.settings,gatewayUrl:r})}}
|
|
2581
2582
|
placeholder="ws://100.x.y.z:18789"
|
|
2582
2583
|
/>
|
|
2583
2584
|
</label>
|
|
@@ -2585,8 +2586,8 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
2585
2586
|
<span>Gateway Token</span>
|
|
2586
2587
|
<input
|
|
2587
2588
|
.value=${e.settings.token}
|
|
2588
|
-
@input=${o=>{const
|
|
2589
|
-
placeholder="
|
|
2589
|
+
@input=${o=>{const r=o.target.value;e.onSettingsChange({...e.settings,token:r})}}
|
|
2590
|
+
placeholder="OPENCLAW_GATEWAY_TOKEN"
|
|
2590
2591
|
/>
|
|
2591
2592
|
</label>
|
|
2592
2593
|
<label class="field">
|
|
@@ -2594,7 +2595,7 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
2594
2595
|
<input
|
|
2595
2596
|
type="password"
|
|
2596
2597
|
.value=${e.password}
|
|
2597
|
-
@input=${o=>{const
|
|
2598
|
+
@input=${o=>{const r=o.target.value;e.onPasswordChange(r)}}
|
|
2598
2599
|
placeholder="system or shared password"
|
|
2599
2600
|
/>
|
|
2600
2601
|
</label>
|
|
@@ -2602,7 +2603,7 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
2602
2603
|
<span>Default Session Key</span>
|
|
2603
2604
|
<input
|
|
2604
2605
|
.value=${e.settings.sessionKey}
|
|
2605
|
-
@input=${o=>{const
|
|
2606
|
+
@input=${o=>{const r=o.target.value;e.onSessionKeyChange(r)}}
|
|
2606
2607
|
/>
|
|
2607
2608
|
</label>
|
|
2608
2609
|
</div>
|
|
@@ -2664,7 +2665,7 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
2664
2665
|
<div class="stat-value">
|
|
2665
2666
|
${e.cronEnabled==null?"n/a":e.cronEnabled?"Enabled":"Disabled"}
|
|
2666
2667
|
</div>
|
|
2667
|
-
<div class="muted">Next wake ${
|
|
2668
|
+
<div class="muted">Next wake ${kr(e.cronNext)}</div>
|
|
2668
2669
|
</div>
|
|
2669
2670
|
</section>
|
|
2670
2671
|
|
|
@@ -2688,7 +2689,7 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
2688
2689
|
</div>
|
|
2689
2690
|
</div>
|
|
2690
2691
|
</section>
|
|
2691
|
-
`}const
|
|
2692
|
+
`}const Ef=["","off","minimal","low","medium","high"],Mf=["","off","on"],Lf=[{value:"",label:"inherit"},{value:"off",label:"off (explicit)"},{value:"on",label:"on"}],If=["","off","on","stream"];function Rf(e){if(!e)return"";const t=e.trim().toLowerCase();return t==="z.ai"||t==="z-ai"?"zai":t}function Sr(e){return Rf(e)==="zai"}function Pf(e){return Sr(e)?Mf:Ef}function Nf(e,t){return!t||!e||e==="off"?e:"on"}function Of(e,t){return e?t&&e==="on"?"low":e:null}function Df(e){const t=e.result?.sessions??[];return c`
|
|
2692
2693
|
<section class="card">
|
|
2693
2694
|
<div class="row" style="justify-content: space-between;">
|
|
2694
2695
|
<div>
|
|
@@ -2751,12 +2752,12 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
2751
2752
|
<div>Reasoning</div>
|
|
2752
2753
|
<div>Actions</div>
|
|
2753
2754
|
</div>
|
|
2754
|
-
${t.length===0?c`<div class="muted">No sessions found.</div>`:t.map(n=>
|
|
2755
|
+
${t.length===0?c`<div class="muted">No sessions found.</div>`:t.map(n=>Bf(n,e.basePath,e.onPatch,e.onDelete,e.loading))}
|
|
2755
2756
|
</div>
|
|
2756
2757
|
</section>
|
|
2757
|
-
`}function
|
|
2758
|
+
`}function Bf(e,t,n,s,i){const a=e.updatedAt?O(e.updatedAt):"n/a",o=e.thinkingLevel??"",r=Sr(e.modelProvider),l=Nf(o,r),p=Pf(e.modelProvider),d=e.verboseLevel??"",u=e.reasoningLevel??"",g=e.displayName??e.key,v=e.kind!=="global",y=v?`${Ds("chat",t)}?session=${encodeURIComponent(e.key)}`:null;return c`
|
|
2758
2759
|
<div class="table-row">
|
|
2759
|
-
<div class="mono">${v?c`<a href=${
|
|
2760
|
+
<div class="mono">${v?c`<a href=${y} class="session-link">${g}</a>`:g}</div>
|
|
2760
2761
|
<div>
|
|
2761
2762
|
<input
|
|
2762
2763
|
.value=${e.label??""}
|
|
@@ -2767,12 +2768,12 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
2767
2768
|
</div>
|
|
2768
2769
|
<div>${e.kind}</div>
|
|
2769
2770
|
<div>${a}</div>
|
|
2770
|
-
<div>${
|
|
2771
|
+
<div>${Fh(e)}</div>
|
|
2771
2772
|
<div>
|
|
2772
2773
|
<select
|
|
2773
|
-
.value=${
|
|
2774
|
+
.value=${l}
|
|
2774
2775
|
?disabled=${i}
|
|
2775
|
-
@change=${$=>{const A=$.target.value;n(e.key,{thinkingLevel:
|
|
2776
|
+
@change=${$=>{const A=$.target.value;n(e.key,{thinkingLevel:Of(A,r)})}}
|
|
2776
2777
|
>
|
|
2777
2778
|
${p.map($=>c`<option value=${$}>${$||"inherit"}</option>`)}
|
|
2778
2779
|
</select>
|
|
@@ -2783,7 +2784,7 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
2783
2784
|
?disabled=${i}
|
|
2784
2785
|
@change=${$=>{const A=$.target.value;n(e.key,{verboseLevel:A||null})}}
|
|
2785
2786
|
>
|
|
2786
|
-
${
|
|
2787
|
+
${Lf.map($=>c`<option value=${$.value}>${$.label}</option>`)}
|
|
2787
2788
|
</select>
|
|
2788
2789
|
</div>
|
|
2789
2790
|
<div>
|
|
@@ -2792,7 +2793,7 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
2792
2793
|
?disabled=${i}
|
|
2793
2794
|
@change=${$=>{const A=$.target.value;n(e.key,{reasoningLevel:A||null})}}
|
|
2794
2795
|
>
|
|
2795
|
-
${
|
|
2796
|
+
${If.map($=>c`<option value=${$}>${$||"inherit"}</option>`)}
|
|
2796
2797
|
</select>
|
|
2797
2798
|
</div>
|
|
2798
2799
|
<div>
|
|
@@ -2801,7 +2802,7 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
2801
2802
|
</button>
|
|
2802
2803
|
</div>
|
|
2803
2804
|
</div>
|
|
2804
|
-
`}function
|
|
2805
|
+
`}function Ff(e){const t=Math.max(0,e),n=Math.floor(t/1e3);if(n<60)return`${n}s`;const s=Math.floor(n/60);return s<60?`${s}m`:`${Math.floor(s/60)}h`}function Ie(e,t){return t?c`<div class="exec-approval-meta-row"><span>${e}</span><span>${t}</span></div>`:f}function Uf(e){const t=e.execApprovalQueue[0];if(!t)return f;const n=t.request,s=t.expiresAtMs-Date.now(),i=s>0?`expires in ${Ff(s)}`:"expired",a=e.execApprovalQueue.length;return c`
|
|
2805
2806
|
<div class="exec-approval-overlay" role="dialog" aria-live="polite">
|
|
2806
2807
|
<div class="exec-approval-card">
|
|
2807
2808
|
<div class="exec-approval-header">
|
|
@@ -2813,13 +2814,13 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
2813
2814
|
</div>
|
|
2814
2815
|
<div class="exec-approval-command mono">${n.command}</div>
|
|
2815
2816
|
<div class="exec-approval-meta">
|
|
2816
|
-
${
|
|
2817
|
-
${
|
|
2818
|
-
${
|
|
2819
|
-
${
|
|
2820
|
-
${
|
|
2821
|
-
${
|
|
2822
|
-
${
|
|
2817
|
+
${Ie("Host",n.host)}
|
|
2818
|
+
${Ie("Agent",n.agentId)}
|
|
2819
|
+
${Ie("Session",n.sessionKey)}
|
|
2820
|
+
${Ie("CWD",n.cwd)}
|
|
2821
|
+
${Ie("Resolved",n.resolvedPath)}
|
|
2822
|
+
${Ie("Security",n.security)}
|
|
2823
|
+
${Ie("Ask",n.ask)}
|
|
2823
2824
|
</div>
|
|
2824
2825
|
${e.execApprovalError?c`<div class="exec-approval-error">${e.execApprovalError}</div>`:f}
|
|
2825
2826
|
<div class="exec-approval-actions">
|
|
@@ -2847,7 +2848,36 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
2847
2848
|
</div>
|
|
2848
2849
|
</div>
|
|
2849
2850
|
</div>
|
|
2850
|
-
`}function
|
|
2851
|
+
`}function Kf(e){const{pendingGatewayUrl:t}=e;return t?c`
|
|
2852
|
+
<div class="exec-approval-overlay" role="dialog" aria-modal="true" aria-live="polite">
|
|
2853
|
+
<div class="exec-approval-card">
|
|
2854
|
+
<div class="exec-approval-header">
|
|
2855
|
+
<div>
|
|
2856
|
+
<div class="exec-approval-title">Change Gateway URL</div>
|
|
2857
|
+
<div class="exec-approval-sub">This will reconnect to a different gateway server</div>
|
|
2858
|
+
</div>
|
|
2859
|
+
</div>
|
|
2860
|
+
<div class="exec-approval-command mono">${t}</div>
|
|
2861
|
+
<div class="callout danger" style="margin-top: 12px;">
|
|
2862
|
+
Only confirm if you trust this URL. Malicious URLs can compromise your system.
|
|
2863
|
+
</div>
|
|
2864
|
+
<div class="exec-approval-actions">
|
|
2865
|
+
<button
|
|
2866
|
+
class="btn primary"
|
|
2867
|
+
@click=${()=>e.handleGatewayUrlConfirm()}
|
|
2868
|
+
>
|
|
2869
|
+
Confirm
|
|
2870
|
+
</button>
|
|
2871
|
+
<button
|
|
2872
|
+
class="btn"
|
|
2873
|
+
@click=${()=>e.handleGatewayUrlCancel()}
|
|
2874
|
+
>
|
|
2875
|
+
Cancel
|
|
2876
|
+
</button>
|
|
2877
|
+
</div>
|
|
2878
|
+
</div>
|
|
2879
|
+
</div>
|
|
2880
|
+
`:f}function Hf(e){const t=e.report?.skills??[],n=e.filter.trim().toLowerCase(),s=n?t.filter(i=>[i.name,i.description,i.source].join(" ").toLowerCase().includes(n)):t;return c`
|
|
2851
2881
|
<section class="card">
|
|
2852
2882
|
<div class="row" style="justify-content: space-between;">
|
|
2853
2883
|
<div>
|
|
@@ -2875,11 +2905,11 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
2875
2905
|
|
|
2876
2906
|
${s.length===0?c`<div class="muted" style="margin-top: 16px;">No skills found.</div>`:c`
|
|
2877
2907
|
<div class="list" style="margin-top: 16px;">
|
|
2878
|
-
${s.map(i=>
|
|
2908
|
+
${s.map(i=>zf(i,e))}
|
|
2879
2909
|
</div>
|
|
2880
2910
|
`}
|
|
2881
2911
|
</section>
|
|
2882
|
-
`}function
|
|
2912
|
+
`}function zf(e,t){const n=t.busyKey===e.skillKey,s=t.edits[e.skillKey]??"",i=t.messages[e.skillKey]??null,a=e.install.length>0&&e.missing.bins.length>0,o=[...e.missing.bins.map(l=>`bin:${l}`),...e.missing.env.map(l=>`env:${l}`),...e.missing.config.map(l=>`config:${l}`),...e.missing.os.map(l=>`os:${l}`)],r=[];return e.disabled&&r.push("disabled"),e.blockedByAllowlist&&r.push("blocked by allowlist"),c`
|
|
2883
2913
|
<div class="list-item">
|
|
2884
2914
|
<div class="list-main">
|
|
2885
2915
|
<div class="list-title">
|
|
@@ -2898,9 +2928,9 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
2898
2928
|
Missing: ${o.join(", ")}
|
|
2899
2929
|
</div>
|
|
2900
2930
|
`:f}
|
|
2901
|
-
${
|
|
2931
|
+
${r.length>0?c`
|
|
2902
2932
|
<div class="muted" style="margin-top: 6px;">
|
|
2903
|
-
Reason: ${
|
|
2933
|
+
Reason: ${r.join(", ")}
|
|
2904
2934
|
</div>
|
|
2905
2935
|
`:f}
|
|
2906
2936
|
</div>
|
|
@@ -2933,7 +2963,7 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
2933
2963
|
<input
|
|
2934
2964
|
type="password"
|
|
2935
2965
|
.value=${s}
|
|
2936
|
-
@input=${
|
|
2966
|
+
@input=${l=>t.onEdit(e.skillKey,l.target.value)}
|
|
2937
2967
|
/>
|
|
2938
2968
|
</div>
|
|
2939
2969
|
<button
|
|
@@ -2947,58 +2977,58 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
2947
2977
|
`:f}
|
|
2948
2978
|
</div>
|
|
2949
2979
|
</div>
|
|
2950
|
-
`}function
|
|
2980
|
+
`}function jf(e,t){const n=Ds(t,e.basePath);return c`
|
|
2951
2981
|
<a
|
|
2952
2982
|
href=${n}
|
|
2953
2983
|
class="nav-item ${e.tab===t?"active":""}"
|
|
2954
2984
|
@click=${s=>{s.defaultPrevented||s.button!==0||s.metaKey||s.ctrlKey||s.shiftKey||s.altKey||(s.preventDefault(),e.setTab(t))}}
|
|
2955
2985
|
title=${rs(t)}
|
|
2956
2986
|
>
|
|
2957
|
-
<span class="nav-item__icon" aria-hidden="true">${
|
|
2987
|
+
<span class="nav-item__icon" aria-hidden="true">${W[Sl(t)]}</span>
|
|
2958
2988
|
<span class="nav-item__text">${rs(t)}</span>
|
|
2959
2989
|
</a>
|
|
2960
|
-
`}function
|
|
2990
|
+
`}function qf(e){const t=Gf(e.hello,e.sessionsResult),n=Wf(e.sessionKey,e.sessionsResult,t),s=e.onboarding,i=e.onboarding,a=e.onboarding?!1:e.settings.chatShowThinking,o=e.onboarding?!0:e.settings.chatFocusMode,r=c`<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"></path><path d="M21 3v5h-5"></path></svg>`,l=c`<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 7V4h3"></path><path d="M20 7V4h-3"></path><path d="M4 17v3h3"></path><path d="M20 17v3h-3"></path><circle cx="12" cy="12" r="3"></circle></svg>`;return c`
|
|
2961
2991
|
<div class="chat-controls">
|
|
2962
2992
|
<label class="field chat-controls__session">
|
|
2963
2993
|
<select
|
|
2964
2994
|
.value=${e.sessionKey}
|
|
2965
2995
|
?disabled=${!e.connected}
|
|
2966
|
-
@change=${
|
|
2996
|
+
@change=${p=>{const d=p.target.value;e.sessionKey=d,e.chatMessage="",e.chatStream=null,e.chatStreamStartedAt=null,e.chatRunId=null,e.resetToolStream(),e.resetChatScroll(),e.applySettings({...e.settings,sessionKey:d,lastActiveSessionKey:d}),e.loadAssistantIdentity(),Sd(e,d),St(e)}}
|
|
2967
2997
|
>
|
|
2968
|
-
${
|
|
2969
|
-
${
|
|
2998
|
+
${Zo(n,p=>p.key,p=>c`<option value=${p.key}>
|
|
2999
|
+
${p.displayName??p.key}
|
|
2970
3000
|
</option>`)}
|
|
2971
3001
|
</select>
|
|
2972
3002
|
</label>
|
|
2973
3003
|
<button
|
|
2974
3004
|
class="btn btn--sm btn--icon"
|
|
2975
3005
|
?disabled=${e.chatLoading||!e.connected}
|
|
2976
|
-
@click=${()=>{e.resetToolStream(),
|
|
2977
|
-
title="Refresh chat
|
|
3006
|
+
@click=${()=>{e.resetToolStream(),Yo(e)}}
|
|
3007
|
+
title="Refresh chat data"
|
|
2978
3008
|
>
|
|
2979
|
-
${
|
|
3009
|
+
${r}
|
|
2980
3010
|
</button>
|
|
2981
3011
|
<span class="chat-controls__separator">|</span>
|
|
2982
|
-
<button
|
|
2983
|
-
class="btn btn--sm btn--icon ${i?"active":""}"
|
|
2984
|
-
?disabled=${n}
|
|
2985
|
-
@click=${()=>{n||e.applySettings({...e.settings,chatShowThinking:!e.settings.chatShowThinking})}}
|
|
2986
|
-
aria-pressed=${i}
|
|
2987
|
-
title=${n?"Disabled during onboarding":"Toggle assistant thinking/working output"}
|
|
2988
|
-
>
|
|
2989
|
-
${V.brain}
|
|
2990
|
-
</button>
|
|
2991
3012
|
<button
|
|
2992
3013
|
class="btn btn--sm btn--icon ${a?"active":""}"
|
|
2993
3014
|
?disabled=${s}
|
|
2994
|
-
@click=${()=>{s||e.applySettings({...e.settings,
|
|
3015
|
+
@click=${()=>{s||e.applySettings({...e.settings,chatShowThinking:!e.settings.chatShowThinking})}}
|
|
2995
3016
|
aria-pressed=${a}
|
|
2996
|
-
title=${s?"Disabled during onboarding":"Toggle
|
|
3017
|
+
title=${s?"Disabled during onboarding":"Toggle assistant thinking/working output"}
|
|
3018
|
+
>
|
|
3019
|
+
${W.brain}
|
|
3020
|
+
</button>
|
|
3021
|
+
<button
|
|
3022
|
+
class="btn btn--sm btn--icon ${o?"active":""}"
|
|
3023
|
+
?disabled=${i}
|
|
3024
|
+
@click=${()=>{i||e.applySettings({...e.settings,chatFocusMode:!e.settings.chatFocusMode})}}
|
|
3025
|
+
aria-pressed=${o}
|
|
3026
|
+
title=${i?"Disabled during onboarding":"Toggle focus mode (hide sidebar + page header)"}
|
|
2997
3027
|
>
|
|
2998
3028
|
${l}
|
|
2999
3029
|
</button>
|
|
3000
3030
|
</div>
|
|
3001
|
-
`}function
|
|
3031
|
+
`}function Gf(e,t){const n=e?.snapshot,s=n?.sessionDefaults?.mainSessionKey?.trim();if(s)return s;const i=n?.sessionDefaults?.mainKey?.trim();return i||(t?.sessions?.some(a=>a.key==="main")?"main":null)}function Wf(e,t,n){const s=new Set,i=[],a=n&&t?.sessions?.find(r=>r.key===n),o=t?.sessions?.find(r=>r.key===e);if(n&&(s.add(n),i.push({key:n,displayName:a?.displayName})),s.has(e)||(s.add(e),i.push({key:e,displayName:o?.displayName})),t?.sessions)for(const r of t.sessions)s.has(r.key)||(s.add(r.key),i.push({key:r.key,displayName:r.displayName}));return i}const Vf=["system","light","dark"];function Yf(e){const t=Math.max(0,Vf.indexOf(e.theme)),n=s=>i=>{const o={element:i.currentTarget};(i.clientX||i.clientY)&&(o.pointerClientX=i.clientX,o.pointerClientY=i.clientY),e.setTheme(s,o)};return c`
|
|
3002
3032
|
<div class="theme-toggle" style="--theme-index: ${t};">
|
|
3003
3033
|
<div class="theme-toggle__track" role="group" aria-label="Theme">
|
|
3004
3034
|
<span class="theme-toggle__indicator"></span>
|
|
@@ -3009,7 +3039,7 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
3009
3039
|
aria-label="System theme"
|
|
3010
3040
|
title="System"
|
|
3011
3041
|
>
|
|
3012
|
-
${
|
|
3042
|
+
${Jf()}
|
|
3013
3043
|
</button>
|
|
3014
3044
|
<button
|
|
3015
3045
|
class="theme-toggle__button ${e.theme==="light"?"active":""}"
|
|
@@ -3018,7 +3048,7 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
3018
3048
|
aria-label="Light theme"
|
|
3019
3049
|
title="Light"
|
|
3020
3050
|
>
|
|
3021
|
-
${
|
|
3051
|
+
${Qf()}
|
|
3022
3052
|
</button>
|
|
3023
3053
|
<button
|
|
3024
3054
|
class="theme-toggle__button ${e.theme==="dark"?"active":""}"
|
|
@@ -3027,11 +3057,11 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
3027
3057
|
aria-label="Dark theme"
|
|
3028
3058
|
title="Dark"
|
|
3029
3059
|
>
|
|
3030
|
-
${
|
|
3060
|
+
${Zf()}
|
|
3031
3061
|
</button>
|
|
3032
3062
|
</div>
|
|
3033
3063
|
</div>
|
|
3034
|
-
`}function
|
|
3064
|
+
`}function Qf(){return c`
|
|
3035
3065
|
<svg class="theme-icon" viewBox="0 0 24 24" aria-hidden="true">
|
|
3036
3066
|
<circle cx="12" cy="12" r="4"></circle>
|
|
3037
3067
|
<path d="M12 2v2"></path>
|
|
@@ -3043,19 +3073,19 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
3043
3073
|
<path d="m6.34 17.66-1.41 1.41"></path>
|
|
3044
3074
|
<path d="m19.07 4.93-1.41 1.41"></path>
|
|
3045
3075
|
</svg>
|
|
3046
|
-
`}function
|
|
3076
|
+
`}function Zf(){return c`
|
|
3047
3077
|
<svg class="theme-icon" viewBox="0 0 24 24" aria-hidden="true">
|
|
3048
3078
|
<path
|
|
3049
3079
|
d="M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401"
|
|
3050
3080
|
></path>
|
|
3051
3081
|
</svg>
|
|
3052
|
-
`}function
|
|
3082
|
+
`}function Jf(){return c`
|
|
3053
3083
|
<svg class="theme-icon" viewBox="0 0 24 24" aria-hidden="true">
|
|
3054
3084
|
<rect width="20" height="14" x="2" y="3" rx="2"></rect>
|
|
3055
3085
|
<line x1="8" x2="16" y1="21" y2="21"></line>
|
|
3056
3086
|
<line x1="12" x2="12" y1="17" y2="21"></line>
|
|
3057
3087
|
</svg>
|
|
3058
|
-
`}const
|
|
3088
|
+
`}const Xf=/^data:/i,eg=/^https?:\/\//i;function tg(e){const t=e.agentsList?.agents??[],s=uo(e.sessionKey)?.agentId??e.agentsList?.defaultId??"main",a=t.find(r=>r.id===s)?.identity,o=a?.avatarUrl??a?.avatar;if(o)return Xf.test(o)||eg.test(o)?o:a?.avatarUrl}function ng(e){const t=e.presenceEntries.length,n=e.sessionsResult?.count??null,s=e.cronStatus?.nextWakeAtMs??null,i=e.connected?null:"Disconnected from gateway.",a=e.tab==="chat",o=a&&(e.settings.chatFocusMode||e.onboarding),r=e.onboarding?!1:e.settings.chatShowThinking,l=tg(e),p=e.chatAvatarUrl??l??null;return c`
|
|
3059
3089
|
<div class="shell ${a?"shell--chat":""} ${o?"shell--chat-focus":""} ${e.settings.navCollapsed?"shell--nav-collapsed":""} ${e.onboarding?"shell--onboarding":""}">
|
|
3060
3090
|
<header class="topbar">
|
|
3061
3091
|
<div class="topbar-left">
|
|
@@ -3065,14 +3095,14 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
3065
3095
|
title="${e.settings.navCollapsed?"Expand sidebar":"Collapse sidebar"}"
|
|
3066
3096
|
aria-label="${e.settings.navCollapsed?"Expand sidebar":"Collapse sidebar"}"
|
|
3067
3097
|
>
|
|
3068
|
-
<span class="nav-collapse-toggle__icon">${
|
|
3098
|
+
<span class="nav-collapse-toggle__icon">${W.menu}</span>
|
|
3069
3099
|
</button>
|
|
3070
3100
|
<div class="brand">
|
|
3071
3101
|
<div class="brand-logo">
|
|
3072
|
-
<img src="/
|
|
3102
|
+
<img src="https://mintcdn.com/clawdhub/4rYvG-uuZrMK_URE/assets/pixel-lobster.svg?fit=max&auto=format&n=4rYvG-uuZrMK_URE&q=85&s=da2032e9eac3b5d9bfe7eb96ca6a8a26" alt="OpenClaw" />
|
|
3073
3103
|
</div>
|
|
3074
3104
|
<div class="brand-text">
|
|
3075
|
-
<div class="brand-title">
|
|
3105
|
+
<div class="brand-title">OPENCLAW</div>
|
|
3076
3106
|
<div class="brand-sub">Gateway Dashboard</div>
|
|
3077
3107
|
</div>
|
|
3078
3108
|
</div>
|
|
@@ -3083,11 +3113,11 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
3083
3113
|
<span>Health</span>
|
|
3084
3114
|
<span class="mono">${e.connected?"OK":"Offline"}</span>
|
|
3085
3115
|
</div>
|
|
3086
|
-
${
|
|
3116
|
+
${Yf(e)}
|
|
3087
3117
|
</div>
|
|
3088
3118
|
</header>
|
|
3089
3119
|
<aside class="nav ${e.settings.navCollapsed?"nav--collapsed":""}">
|
|
3090
|
-
${
|
|
3120
|
+
${Al.map(d=>{const u=e.settings.navGroupsCollapsed[d.label]??!1,g=d.tabs.some(v=>v===e.tab);return c`
|
|
3091
3121
|
<div class="nav-group ${u&&!g?"nav-group--collapsed":""}">
|
|
3092
3122
|
<button
|
|
3093
3123
|
class="nav-label"
|
|
@@ -3098,7 +3128,7 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
3098
3128
|
<span class="nav-label__chevron">${u?"+":"−"}</span>
|
|
3099
3129
|
</button>
|
|
3100
3130
|
<div class="nav-group__items">
|
|
3101
|
-
${d.tabs.map(v=>
|
|
3131
|
+
${d.tabs.map(v=>jf(e,v))}
|
|
3102
3132
|
</div>
|
|
3103
3133
|
</div>
|
|
3104
3134
|
`})}
|
|
@@ -3109,12 +3139,12 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
3109
3139
|
<div class="nav-group__items">
|
|
3110
3140
|
<a
|
|
3111
3141
|
class="nav-item nav-item--external"
|
|
3112
|
-
href="https://docs.
|
|
3142
|
+
href="https://docs.openclaw.ai"
|
|
3113
3143
|
target="_blank"
|
|
3114
3144
|
rel="noreferrer"
|
|
3115
3145
|
title="Docs (opens in new tab)"
|
|
3116
3146
|
>
|
|
3117
|
-
<span class="nav-item__icon" aria-hidden="true">${
|
|
3147
|
+
<span class="nav-item__icon" aria-hidden="true">${W.book}</span>
|
|
3118
3148
|
<span class="nav-item__text">Docs</span>
|
|
3119
3149
|
</a>
|
|
3120
3150
|
</div>
|
|
@@ -3124,39 +3154,40 @@ ${e.snapshot?JSON.stringify(e.snapshot,null,2):"No snapshot yet."}
|
|
|
3124
3154
|
<section class="content-header">
|
|
3125
3155
|
<div>
|
|
3126
3156
|
<div class="page-title">${rs(e.tab)}</div>
|
|
3127
|
-
<div class="page-sub">${
|
|
3157
|
+
<div class="page-sub">${_l(e.tab)}</div>
|
|
3128
3158
|
</div>
|
|
3129
3159
|
<div class="page-meta">
|
|
3130
3160
|
${e.lastError?c`<div class="pill danger">${e.lastError}</div>`:f}
|
|
3131
|
-
${a?
|
|
3161
|
+
${a?qf(e):f}
|
|
3132
3162
|
</div>
|
|
3133
3163
|
</section>
|
|
3134
3164
|
|
|
3135
|
-
${e.tab==="overview"?
|
|
3165
|
+
${e.tab==="overview"?Tf({connected:e.connected,hello:e.hello,settings:e.settings,password:e.password,lastError:e.lastError,presenceCount:t,sessionsCount:n,cronEnabled:e.cronStatus?.enabled??null,cronNext:s,lastChannelsRefresh:e.channelsLastSuccess,onSettingsChange:d=>e.applySettings(d),onPasswordChange:d=>e.password=d,onSessionKeyChange:d=>{e.sessionKey=d,e.chatMessage="",e.resetToolStream(),e.applySettings({...e.settings,sessionKey:d,lastActiveSessionKey:d}),e.loadAssistantIdentity()},onConnect:()=>e.connect(),onRefresh:()=>e.loadOverview()}):f}
|
|
3136
3166
|
|
|
3137
|
-
${e.tab==="channels"?
|
|
3167
|
+
${e.tab==="channels"?Ch({connected:e.connected,loading:e.channelsLoading,snapshot:e.channelsSnapshot,lastError:e.channelsError,lastSuccessAt:e.channelsLastSuccess,whatsappMessage:e.whatsappLoginMessage,whatsappQrDataUrl:e.whatsappLoginQrDataUrl,whatsappConnected:e.whatsappLoginConnected,whatsappBusy:e.whatsappBusy,configSchema:e.configSchema,configSchemaLoading:e.configSchemaLoading,configForm:e.configForm,configUiHints:e.configUiHints,configSaving:e.configSaving,configFormDirty:e.configFormDirty,nostrProfileFormState:e.nostrProfileFormState,nostrProfileAccountId:e.nostrProfileAccountId,onRefresh:d=>oe(e,d),onWhatsAppStart:d=>e.handleWhatsAppStart(d),onWhatsAppWait:()=>e.handleWhatsAppWait(),onWhatsAppLogout:()=>e.handleWhatsAppLogout(),onConfigPatch:(d,u)=>Ft(e,d,u),onConfigSave:()=>e.handleChannelConfigSave(),onConfigReload:()=>e.handleChannelConfigReload(),onNostrProfileEdit:(d,u)=>e.handleNostrProfileEdit(d,u),onNostrProfileCancel:()=>e.handleNostrProfileCancel(),onNostrProfileFieldChange:(d,u)=>e.handleNostrProfileFieldChange(d,u),onNostrProfileSave:()=>e.handleNostrProfileSave(),onNostrProfileImport:()=>e.handleNostrProfileImport(),onNostrProfileToggleAdvanced:()=>e.handleNostrProfileToggleAdvanced()}):f}
|
|
3138
3168
|
|
|
3139
|
-
${e.tab==="instances"?
|
|
3169
|
+
${e.tab==="instances"?Zh({loading:e.presenceLoading,entries:e.presenceEntries,lastError:e.presenceError,statusMessage:e.presenceStatus,onRefresh:()=>Ws(e)}):f}
|
|
3140
3170
|
|
|
3141
|
-
${e.tab==="sessions"?
|
|
3171
|
+
${e.tab==="sessions"?Df({loading:e.sessionsLoading,result:e.sessionsResult,error:e.sessionsError,activeMinutes:e.sessionsFilterActive,limit:e.sessionsFilterLimit,includeGlobal:e.sessionsIncludeGlobal,includeUnknown:e.sessionsIncludeUnknown,basePath:e.basePath,onFiltersChange:d=>{e.sessionsFilterActive=d.activeMinutes,e.sessionsFilterLimit=d.limit,e.sessionsIncludeGlobal=d.includeGlobal,e.sessionsIncludeUnknown=d.includeUnknown},onRefresh:()=>Ke(e),onPatch:(d,u)=>Hl(e,d,u),onDelete:d=>zl(e,d)}):f}
|
|
3142
3172
|
|
|
3143
|
-
${e.tab==="cron"?
|
|
3173
|
+
${e.tab==="cron"?Gh({loading:e.cronLoading,status:e.cronStatus,jobs:e.cronJobs,error:e.cronError,busy:e.cronBusy,form:e.cronForm,channels:e.channelsSnapshot?.channelMeta?.length?e.channelsSnapshot.channelMeta.map(d=>d.id):e.channelsSnapshot?.channelOrder??[],channelLabels:e.channelsSnapshot?.channelLabels??{},channelMeta:e.channelsSnapshot?.channelMeta??[],runsJobId:e.cronRunsJobId,runs:e.cronRuns,onFormChange:d=>e.cronForm={...e.cronForm,...d},onRefresh:()=>e.loadCron(),onAdd:()=>uc(e),onToggle:(d,u)=>pc(e,d,u),onRun:d=>hc(e,d),onRemove:d=>fc(e,d),onLoadRuns:d=>xo(e,d)}):f}
|
|
3144
3174
|
|
|
3145
|
-
${e.tab==="skills"?
|
|
3175
|
+
${e.tab==="skills"?Hf({loading:e.skillsLoading,report:e.skillsReport,error:e.skillsError,filter:e.skillsFilter,edits:e.skillEdits,messages:e.skillMessages,busyKey:e.skillsBusyKey,onFilterChange:d=>e.skillsFilter=d,onRefresh:()=>Et(e,{clearMessages:!0}),onToggle:(d,u)=>ld(e,d,u),onEdit:(d,u)=>rd(e,d,u),onSaveKey:d=>cd(e,d),onInstall:(d,u,g)=>dd(e,d,u,g)}):f}
|
|
3146
3176
|
|
|
3147
|
-
${e.tab==="nodes"?
|
|
3177
|
+
${e.tab==="nodes"?nf({loading:e.nodesLoading,nodes:e.nodes,devicesLoading:e.devicesLoading,devicesError:e.devicesError,devicesList:e.devicesList,configForm:e.configForm??e.configSnapshot?.config,configLoading:e.configLoading,configSaving:e.configSaving,configDirty:e.configFormDirty,configFormMode:e.configFormMode,execApprovalsLoading:e.execApprovalsLoading,execApprovalsSaving:e.execApprovalsSaving,execApprovalsDirty:e.execApprovalsDirty,execApprovalsSnapshot:e.execApprovalsSnapshot,execApprovalsForm:e.execApprovalsForm,execApprovalsSelectedAgent:e.execApprovalsSelectedAgent,execApprovalsTarget:e.execApprovalsTarget,execApprovalsTargetNodeId:e.execApprovalsTargetNodeId,onRefresh:()=>gn(e),onDevicesRefresh:()=>Ce(e),onDeviceApprove:d=>Zc(e,d),onDeviceReject:d=>Jc(e,d),onDeviceRotate:(d,u,g)=>Xc(e,{deviceId:d,role:u,scopes:g}),onDeviceRevoke:(d,u)=>ed(e,{deviceId:d,role:u}),onLoadConfig:()=>ye(e),onLoadExecApprovals:()=>{const d=e.execApprovalsTarget==="node"&&e.execApprovalsTargetNodeId?{kind:"node",nodeId:e.execApprovalsTargetNodeId}:{kind:"gateway"};return Gs(e,d)},onBindDefault:d=>{d?Ft(e,["tools","exec","node"],d):oa(e,["tools","exec","node"])},onBindAgent:(d,u)=>{const g=["agents","list",d,"tools","exec","node"];u?Ft(e,g,u):oa(e,g)},onSaveBindings:()=>ps(e),onExecApprovalsTargetChange:(d,u)=>{e.execApprovalsTarget=d,e.execApprovalsTargetNodeId=u,e.execApprovalsSnapshot=null,e.execApprovalsForm=null,e.execApprovalsDirty=!1,e.execApprovalsSelectedAgent=null},onExecApprovalsSelectAgent:d=>{e.execApprovalsSelectedAgent=d},onExecApprovalsPatch:(d,u)=>ad(e,d,u),onExecApprovalsRemove:d=>od(e,d),onSaveExecApprovals:()=>{const d=e.execApprovalsTarget==="node"&&e.execApprovalsTargetNodeId?{kind:"node",nodeId:e.execApprovalsTargetNodeId}:{kind:"gateway"};return id(e,d)}}):f}
|
|
3148
3178
|
|
|
3149
|
-
${e.tab==="chat"?
|
|
3179
|
+
${e.tab==="chat"?qp({sessionKey:e.sessionKey,onSessionKeyChange:d=>{e.sessionKey=d,e.chatMessage="",e.chatAttachments=[],e.chatStream=null,e.chatStreamStartedAt=null,e.chatRunId=null,e.chatQueue=[],e.resetToolStream(),e.resetChatScroll(),e.applySettings({...e.settings,sessionKey:d,lastActiveSessionKey:d}),e.loadAssistantIdentity(),St(e),ms(e)},thinkingLevel:e.chatThinkingLevel,showThinking:r,loading:e.chatLoading,sending:e.chatSending,compactionStatus:e.compactionStatus,assistantAvatarUrl:p,messages:e.chatMessages,toolMessages:e.chatToolMessages,stream:e.chatStream,streamStartedAt:e.chatStreamStartedAt,draft:e.chatMessage,queue:e.chatQueue,connected:e.connected,canSend:e.connected,disabledReason:i,error:e.lastError,sessions:e.sessionsResult,focusMode:o,onRefresh:()=>(e.resetToolStream(),Promise.all([St(e),ms(e)])),onToggleFocusMode:()=>{e.onboarding||e.applySettings({...e.settings,chatFocusMode:!e.settings.chatFocusMode})},onChatScroll:d=>e.handleChatScroll(d),onDraftChange:d=>e.chatMessage=d,attachments:e.chatAttachments,onAttachmentsChange:d=>e.chatAttachments=d,onSend:()=>e.handleSendChat(),canAbort:!!e.chatRunId,onAbort:()=>{e.handleAbortChat()},onQueueRemove:d=>e.removeQueuedMessage(d),onNewSession:()=>e.handleSendChat("/new",{restoreDraft:!0}),sidebarOpen:e.sidebarOpen,sidebarContent:e.sidebarContent,sidebarError:e.sidebarError,splitRatio:e.splitRatio,onOpenSidebar:d=>e.handleOpenSidebar(d),onCloseSidebar:()=>e.handleCloseSidebar(),onSplitRatioChange:d=>e.handleSplitRatioChange(d),assistantName:e.assistantName,assistantAvatar:e.assistantAvatar}):f}
|
|
3150
3180
|
|
|
3151
|
-
${e.tab==="config"?
|
|
3181
|
+
${e.tab==="config"?ch({raw:e.configRaw,originalRaw:e.configRawOriginal,valid:e.configValid,issues:e.configIssues,loading:e.configLoading,saving:e.configSaving,applying:e.configApplying,updating:e.updateRunning,connected:e.connected,schema:e.configSchema,schemaLoading:e.configSchemaLoading,uiHints:e.configUiHints,formMode:e.configFormMode,formValue:e.configForm,originalValue:e.configFormOriginal,searchQuery:e.configSearchQuery,activeSection:e.configActiveSection,activeSubsection:e.configActiveSubsection,onRawChange:d=>{e.configRaw=d},onFormModeChange:d=>e.configFormMode=d,onFormPatch:(d,u)=>Ft(e,d,u),onSearchChange:d=>e.configSearchQuery=d,onSectionChange:d=>{e.configActiveSection=d,e.configActiveSubsection=null},onSubsectionChange:d=>e.configActiveSubsection=d,onReload:()=>ye(e),onSave:()=>ps(e),onApply:()=>rc(e),onUpdate:()=>lc(e)}):f}
|
|
3152
3182
|
|
|
3153
|
-
${e.tab==="debug"?
|
|
3183
|
+
${e.tab==="debug"?Qh({loading:e.debugLoading,status:e.debugStatus,health:e.debugHealth,models:e.debugModels,heartbeat:e.debugHeartbeat,eventLog:e.eventLog,callMethod:e.debugCallMethod,callParams:e.debugCallParams,callResult:e.debugCallResult,callError:e.debugCallError,onCallMethodChange:d=>e.debugCallMethod=d,onCallParamsChange:d=>e.debugCallParams=d,onRefresh:()=>hn(e),onCall:()=>yc(e)}):f}
|
|
3154
3184
|
|
|
3155
|
-
${e.tab==="logs"?
|
|
3185
|
+
${e.tab==="logs"?tf({loading:e.logsLoading,error:e.logsError,file:e.logsFile,entries:e.logsEntries,filterText:e.logsFilterText,levelFilters:e.logsLevelFilters,autoFollow:e.logsAutoFollow,truncated:e.logsTruncated,onFilterTextChange:d=>e.logsFilterText=d,onLevelToggle:(d,u)=>{e.logsLevelFilters={...e.logsLevelFilters,[d]:u}},onToggleAutoFollow:d=>e.logsAutoFollow=d,onRefresh:()=>Fs(e,{reset:!0}),onExport:(d,u)=>e.exportLogs(d,u),onScroll:d=>e.handleLogsScroll(d)}):f}
|
|
3156
3186
|
</main>
|
|
3157
|
-
${
|
|
3187
|
+
${Uf(e)}
|
|
3188
|
+
${Kf(e)}
|
|
3158
3189
|
</div>
|
|
3159
|
-
`}const Jf={trace:!0,debug:!0,info:!0,warn:!0,error:!0,fatal:!0},Xf={name:"",description:"",agentId:"",enabled:!0,scheduleKind:"every",scheduleAt:"",everyAmount:"30",everyUnit:"minutes",cronExpr:"0 7 * * *",cronTz:"",sessionTarget:"main",wakeMode:"next-heartbeat",payloadKind:"systemEvent",payloadText:"",deliver:!1,channel:"last",to:"",timeoutSeconds:"",postToMainPrefix:""};async function eg(e){if(!(!e.client||!e.connected)&&!e.agentsLoading){e.agentsLoading=!0,e.agentsError=null;try{const t=await e.client.request("agents.list",{});t&&(e.agentsList=t)}catch(t){e.agentsError=String(t)}finally{e.agentsLoading=!1}}}const Ar={WEBCHAT_UI:"webchat-ui",CONTROL_UI:"moltbot-control-ui",WEBCHAT:"webchat",CLI:"cli",GATEWAY_CLIENT:"gateway-client",MACOS_APP:"moltbot-macos",IOS_APP:"moltbot-ios",ANDROID_APP:"moltbot-android",NODE_HOST:"node-host",TEST:"test",FINGERPRINT:"fingerprint",PROBE:"moltbot-probe"},Za=Ar,Es={WEBCHAT:"webchat",CLI:"cli",UI:"ui",BACKEND:"backend",NODE:"node",PROBE:"probe",TEST:"test"};new Set(Object.values(Ar));new Set(Object.values(Es));function tg(e){const t=e.version??(e.nonce?"v2":"v1"),n=e.scopes.join(","),s=e.token??"",i=[t,e.deviceId,e.clientId,e.clientMode,e.role,n,String(e.signedAtMs),s];return t==="v2"&&i.push(e.nonce??""),i.join("|")}const ng=4008;class sg{constructor(t){this.opts=t,this.ws=null,this.pending=new Map,this.closed=!1,this.lastSeq=null,this.connectNonce=null,this.connectSent=!1,this.connectTimer=null,this.backoffMs=800}start(){this.closed=!1,this.connect()}stop(){this.closed=!0,this.ws?.close(),this.ws=null,this.flushPending(new Error("gateway client stopped"))}get connected(){return this.ws?.readyState===WebSocket.OPEN}connect(){this.closed||(this.ws=new WebSocket(this.opts.url),this.ws.onopen=()=>this.queueConnect(),this.ws.onmessage=t=>this.handleMessage(String(t.data??"")),this.ws.onclose=t=>{const n=String(t.reason??"");this.ws=null,this.flushPending(new Error(`gateway closed (${t.code}): ${n}`)),this.opts.onClose?.({code:t.code,reason:n}),this.scheduleReconnect()},this.ws.onerror=()=>{})}scheduleReconnect(){if(this.closed)return;const t=this.backoffMs;this.backoffMs=Math.min(this.backoffMs*1.7,15e3),window.setTimeout(()=>this.connect(),t)}flushPending(t){for(const[,n]of this.pending)n.reject(t);this.pending.clear()}async sendConnect(){if(this.connectSent)return;this.connectSent=!0,this.connectTimer!==null&&(window.clearTimeout(this.connectTimer),this.connectTimer=null);const t=typeof crypto<"u"&&!!crypto.subtle,n=["operator.admin","operator.approvals","operator.pairing"],s="operator";let i=null,a=!1,o=this.opts.token;if(t){i=await zs();const d=Vc({deviceId:i.deviceId,role:s})?.token;o=d??this.opts.token,a=!!(d&&this.opts.token)}const l=o||this.opts.password?{token:o,password:this.opts.password}:void 0;let r;if(t&&i){const d=Date.now(),u=this.connectNonce??void 0,g=tg({deviceId:i.deviceId,clientId:this.opts.clientName??Za.CONTROL_UI,clientMode:this.opts.mode??Es.WEBCHAT,role:s,scopes:n,signedAtMs:d,token:o??null,nonce:u}),v=await qc(i.privateKey,g);r={id:i.deviceId,publicKey:i.publicKey,signature:v,signedAt:d,nonce:u}}const p={minProtocol:3,maxProtocol:3,client:{id:this.opts.clientName??Za.CONTROL_UI,version:this.opts.clientVersion??"dev",platform:this.opts.platform??navigator.platform??"web",mode:this.opts.mode??Es.WEBCHAT,instanceId:this.opts.instanceId},role:s,scopes:n,device:r,caps:[],auth:l,userAgent:navigator.userAgent,locale:navigator.language};this.request("connect",p).then(d=>{d?.auth?.deviceToken&&i&&Do({deviceId:i.deviceId,role:d.auth.role??s,token:d.auth.deviceToken,scopes:d.auth.scopes??[]}),this.backoffMs=800,this.opts.onHello?.(d)}).catch(()=>{a&&i&&Bo({deviceId:i.deviceId,role:s}),this.ws?.close(ng,"connect failed")})}handleMessage(t){let n;try{n=JSON.parse(t)}catch{return}const s=n;if(s.type==="event"){const i=n;if(i.event==="connect.challenge"){const o=i.payload,l=o&&typeof o.nonce=="string"?o.nonce:null;l&&(this.connectNonce=l,this.sendConnect());return}const a=typeof i.seq=="number"?i.seq:null;a!==null&&(this.lastSeq!==null&&a>this.lastSeq+1&&this.opts.onGap?.({expected:this.lastSeq+1,received:a}),this.lastSeq=a);try{this.opts.onEvent?.(i)}catch(o){console.error("[gateway] event handler error:",o)}return}if(s.type==="res"){const i=n,a=this.pending.get(i.id);if(!a)return;this.pending.delete(i.id),i.ok?a.resolve(i.payload):a.reject(new Error(i.error?.message??"request failed"));return}}request(t,n){if(!this.ws||this.ws.readyState!==WebSocket.OPEN)return Promise.reject(new Error("gateway not connected"));const s=Bs(),i={type:"req",id:s,method:t,params:n},a=new Promise((o,l)=>{this.pending.set(s,{resolve:r=>o(r),reject:l})});return this.ws.send(JSON.stringify(i)),a}queueConnect(){this.connectNonce=null,this.connectSent=!1,this.connectTimer!==null&&window.clearTimeout(this.connectTimer),this.connectTimer=window.setTimeout(()=>{this.sendConnect()},750)}}function Is(e){return typeof e=="object"&&e!==null}function ig(e){if(!Is(e))return null;const t=typeof e.id=="string"?e.id.trim():"",n=e.request;if(!t||!Is(n))return null;const s=typeof n.command=="string"?n.command.trim():"";if(!s)return null;const i=typeof e.createdAtMs=="number"?e.createdAtMs:0,a=typeof e.expiresAtMs=="number"?e.expiresAtMs:0;return!i||!a?null:{id:t,request:{command:s,cwd:typeof n.cwd=="string"?n.cwd:null,host:typeof n.host=="string"?n.host:null,security:typeof n.security=="string"?n.security:null,ask:typeof n.ask=="string"?n.ask:null,agentId:typeof n.agentId=="string"?n.agentId:null,resolvedPath:typeof n.resolvedPath=="string"?n.resolvedPath:null,sessionKey:typeof n.sessionKey=="string"?n.sessionKey:null},createdAtMs:i,expiresAtMs:a}}function ag(e){if(!Is(e))return null;const t=typeof e.id=="string"?e.id.trim():"";return t?{id:t,decision:typeof e.decision=="string"?e.decision:null,resolvedBy:typeof e.resolvedBy=="string"?e.resolvedBy:null,ts:typeof e.ts=="number"?e.ts:null}:null}function kr(e){const t=Date.now();return e.filter(n=>n.expiresAtMs>t)}function og(e,t){const n=kr(e).filter(s=>s.id!==t.id);return n.push(t),n}function Ja(e,t){return kr(e).filter(n=>n.id!==t)}async function Sr(e,t){if(!e.client||!e.connected)return;const n=e.sessionKey.trim(),s=n?{sessionKey:n}:{};try{const i=await e.client.request("agent.identity.get",s);if(!i)return;const a=os(i);e.assistantName=a.name,e.assistantAvatar=a.avatar,e.assistantAgentId=a.agentId??null}catch{}}function ss(e,t){const n=(e??"").trim(),s=t.mainSessionKey?.trim();if(!s)return n;if(!n)return s;const i=t.mainKey?.trim()||"main",a=t.defaultAgentId?.trim();return n==="main"||n===i||a&&(n===`agent:${a}:main`||n===`agent:${a}:${i}`)?s:n}function rg(e,t){if(!t?.mainSessionKey)return;const n=ss(e.sessionKey,t),s=ss(e.settings.sessionKey,t),i=ss(e.settings.lastActiveSessionKey,t),a=n||s||e.sessionKey,o={...e.settings,sessionKey:s||a,lastActiveSessionKey:i||a},l=o.sessionKey!==e.settings.sessionKey||o.lastActiveSessionKey!==e.settings.lastActiveSessionKey;a!==e.sessionKey&&(e.sessionKey=a),l&&Ae(e,o)}function _r(e){e.lastError=null,e.hello=null,e.connected=!1,e.execApprovalQueue=[],e.execApprovalError=null,e.client?.stop(),e.client=new sg({url:e.settings.gatewayUrl,token:e.settings.token.trim()?e.settings.token:void 0,password:e.password.trim()?e.password:void 0,clientName:"moltbot-control-ui",mode:"webchat",onHello:t=>{e.connected=!0,e.lastError=null,e.hello=t,dg(e,t),e.chatRunId=null,e.chatStream=null,e.chatStreamStartedAt=null,dn(e),Sr(e),eg(e),gn(e,{quiet:!0}),Te(e,{quiet:!0}),Xs(e)},onClose:({code:t,reason:n})=>{e.connected=!1,t!==1012&&(e.lastError=`disconnected (${t}): ${n||"no reason"}`)},onEvent:t=>lg(e,t),onGap:({expected:t,received:n})=>{e.lastError=`event gap detected (expected seq ${t}, got ${n}); refresh recommended`}}),e.client.start()}function lg(e,t){try{cg(e,t)}catch(n){console.error("[gateway] handleGatewayEvent error:",t.event,n)}}function cg(e,t){if(e.eventLogBuffer=[{ts:Date.now(),event:t.event,payload:t.payload},...e.eventLogBuffer].slice(0,250),e.tab==="debug"&&(e.eventLog=e.eventLogBuffer),t.event==="agent"){if(e.onboarding)return;Ql(e,t.payload);return}if(t.event==="chat"){const n=t.payload;n?.sessionKey&&Fo(e,n.sessionKey);const s=Bl(e,n);(s==="final"||s==="error"||s==="aborted")&&(dn(e),Ed(e)),s==="final"&&Xe(e);return}if(t.event==="presence"){const n=t.payload;n?.presence&&Array.isArray(n.presence)&&(e.presenceEntries=n.presence,e.presenceError=null,e.presenceStatus=null);return}if(t.event==="cron"&&e.tab==="cron"&&ei(e),(t.event==="device.pair.requested"||t.event==="device.pair.resolved")&&Te(e,{quiet:!0}),t.event==="exec.approval.requested"){const n=ig(t.payload);if(n){e.execApprovalQueue=og(e.execApprovalQueue,n),e.execApprovalError=null;const s=Math.max(0,n.expiresAtMs-Date.now()+500);window.setTimeout(()=>{e.execApprovalQueue=Ja(e.execApprovalQueue,n.id)},s)}return}if(t.event==="exec.approval.resolved"){const n=ag(t.payload);n&&(e.execApprovalQueue=Ja(e.execApprovalQueue,n.id))}}function dg(e,t){const n=t.snapshot;n?.presence&&Array.isArray(n.presence)&&(e.presenceEntries=n.presence),n?.health&&(e.debugHealth=n.health),n?.sessionDefaults&&rg(e,n.sessionDefaults)}function ug(e){e.basePath=vd(),wd(e,!0),md(e),yd(e),window.addEventListener("popstate",e.popStateHandler),hd(e),_r(e),ud(e),e.tab==="logs"&&Ys(e),e.tab==="debug"&&Zs(e)}function pg(e){tc(e)}function hg(e){window.removeEventListener("popstate",e.popStateHandler),pd(e),Qs(e),Js(e),bd(e),e.topbarObserver?.disconnect(),e.topbarObserver=null}function fg(e,t){if(e.tab==="chat"&&(t.has("chatMessages")||t.has("chatToolMessages")||t.has("chatStream")||t.has("chatLoading")||t.has("tab"))){const n=t.has("tab"),s=t.has("chatLoading")&&t.get("chatLoading")===!0&&e.chatLoading===!1;un(e,n||s||!e.chatHasAutoScrolled)}e.tab==="logs"&&(t.has("logsEntries")||t.has("logsAutoFollow")||t.has("tab"))&&e.logsAutoFollow&&e.logsAtBottom&&vo(e,t.has("tab")||t.has("logsAutoFollow"))}async function gg(e,t){await pc(e,t),await oe(e,!0)}async function vg(e){await hc(e),await oe(e,!0)}async function mg(e){await fc(e),await oe(e,!0)}async function yg(e){await ps(e),await ye(e),await oe(e,!0)}async function bg(e){await ye(e),await oe(e,!0)}function wg(e){if(!Array.isArray(e))return{};const t={};for(const n of e){if(typeof n!="string")continue;const[s,...i]=n.split(":");if(!s||i.length===0)continue;const a=s.trim(),o=i.join(":").trim();a&&o&&(t[a]=o)}return t}function Tr(e){return(e.channelsSnapshot?.channelAccounts?.nostr??[])[0]?.accountId??e.nostrProfileAccountId??"default"}function Cr(e,t=""){return`/api/channels/nostr/${encodeURIComponent(e)}/profile${t}`}function $g(e,t,n){e.nostrProfileAccountId=t,e.nostrProfileFormState=yh(n??void 0)}function xg(e){e.nostrProfileFormState=null,e.nostrProfileAccountId=null}function Ag(e,t,n){const s=e.nostrProfileFormState;s&&(e.nostrProfileFormState={...s,values:{...s.values,[t]:n},fieldErrors:{...s.fieldErrors,[t]:""}})}function kg(e){const t=e.nostrProfileFormState;t&&(e.nostrProfileFormState={...t,showAdvanced:!t.showAdvanced})}async function Sg(e){const t=e.nostrProfileFormState;if(!t||t.saving)return;const n=Tr(e);e.nostrProfileFormState={...t,saving:!0,error:null,success:null,fieldErrors:{}};try{const s=await fetch(Cr(n),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t.values)}),i=await s.json().catch(()=>null);if(!s.ok||i?.ok===!1||!i){const a=i?.error??`Profile update failed (${s.status})`;e.nostrProfileFormState={...t,saving:!1,error:a,success:null,fieldErrors:wg(i?.details)};return}if(!i.persisted){e.nostrProfileFormState={...t,saving:!1,error:"Profile publish failed on all relays.",success:null};return}e.nostrProfileFormState={...t,saving:!1,error:null,success:"Profile published to relays.",fieldErrors:{},original:{...t.values}},await oe(e,!0)}catch(s){e.nostrProfileFormState={...t,saving:!1,error:`Profile update failed: ${String(s)}`,success:null}}}async function _g(e){const t=e.nostrProfileFormState;if(!t||t.importing)return;const n=Tr(e);e.nostrProfileFormState={...t,importing:!0,error:null,success:null};try{const s=await fetch(Cr(n,"/import"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({autoMerge:!0})}),i=await s.json().catch(()=>null);if(!s.ok||i?.ok===!1||!i){const r=i?.error??`Profile import failed (${s.status})`;e.nostrProfileFormState={...t,importing:!1,error:r,success:null};return}const a=i.merged??i.imported??null,o=a?{...t.values,...a}:t.values,l=!!(o.banner||o.website||o.nip05||o.lud16);e.nostrProfileFormState={...t,importing:!1,values:o,error:null,success:i.saved?"Profile imported from relays. Review and publish.":"Profile imported. Review and publish.",showAdvanced:l},i.saved&&await oe(e,!0)}catch(s){e.nostrProfileFormState={...t,importing:!1,error:`Profile import failed: ${String(s)}`,success:null}}}var Tg=Object.defineProperty,Cg=Object.getOwnPropertyDescriptor,b=(e,t,n,s)=>{for(var i=s>1?void 0:s?Cg(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(s?o(t,n,i):o(i))||i);return s&&i&&Tg(t,n,i),i};const is=ml();function Eg(){if(!window.location.search)return!1;const t=new URLSearchParams(window.location.search).get("onboarding");if(!t)return!1;const n=t.trim().toLowerCase();return n==="1"||n==="true"||n==="yes"||n==="on"}let y=class extends Ze{constructor(){super(...arguments),this.settings=yl(),this.password="",this.tab="chat",this.onboarding=Eg(),this.connected=!1,this.theme=this.settings.theme??"system",this.themeResolved="dark",this.hello=null,this.lastError=null,this.eventLog=[],this.eventLogBuffer=[],this.toolStreamSyncTimer=null,this.sidebarCloseTimer=null,this.assistantName=is.name,this.assistantAvatar=is.avatar,this.assistantAgentId=is.agentId??null,this.sessionKey=this.settings.sessionKey,this.chatLoading=!1,this.chatSending=!1,this.chatMessage="",this.chatMessages=[],this.chatToolMessages=[],this.chatStream=null,this.chatStreamStartedAt=null,this.chatRunId=null,this.compactionStatus=null,this.chatAvatarUrl=null,this.chatThinkingLevel=null,this.chatQueue=[],this.chatAttachments=[],this.sidebarOpen=!1,this.sidebarContent=null,this.sidebarError=null,this.splitRatio=this.settings.splitRatio,this.nodesLoading=!1,this.nodes=[],this.devicesLoading=!1,this.devicesError=null,this.devicesList=null,this.execApprovalsLoading=!1,this.execApprovalsSaving=!1,this.execApprovalsDirty=!1,this.execApprovalsSnapshot=null,this.execApprovalsForm=null,this.execApprovalsSelectedAgent=null,this.execApprovalsTarget="gateway",this.execApprovalsTargetNodeId=null,this.execApprovalQueue=[],this.execApprovalBusy=!1,this.execApprovalError=null,this.configLoading=!1,this.configRaw=`{
|
|
3190
|
+
`}const sg={trace:!0,debug:!0,info:!0,warn:!0,error:!0,fatal:!0},ig={name:"",description:"",agentId:"",enabled:!0,scheduleKind:"every",scheduleAt:"",everyAmount:"30",everyUnit:"minutes",cronExpr:"0 7 * * *",cronTz:"",sessionTarget:"main",wakeMode:"next-heartbeat",payloadKind:"systemEvent",payloadText:"",deliver:!1,channel:"last",to:"",timeoutSeconds:"",postToMainPrefix:""};async function ag(e){if(!(!e.client||!e.connected)&&!e.agentsLoading){e.agentsLoading=!0,e.agentsError=null;try{const t=await e.client.request("agents.list",{});t&&(e.agentsList=t)}catch(t){e.agentsError=String(t)}finally{e.agentsLoading=!1}}}const _r={WEBCHAT_UI:"webchat-ui",CONTROL_UI:"openclaw-control-ui",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"},Xa=_r,Es={WEBCHAT:"webchat",CLI:"cli",UI:"ui",BACKEND:"backend",NODE:"node",PROBE:"probe",TEST:"test"};new Set(Object.values(_r));new Set(Object.values(Es));function og(e){const t=e.version??(e.nonce?"v2":"v1"),n=e.scopes.join(","),s=e.token??"",i=[t,e.deviceId,e.clientId,e.clientMode,e.role,n,String(e.signedAtMs),s];return t==="v2"&&i.push(e.nonce??""),i.join("|")}const rg=4008;class lg{constructor(t){this.opts=t,this.ws=null,this.pending=new Map,this.closed=!1,this.lastSeq=null,this.connectNonce=null,this.connectSent=!1,this.connectTimer=null,this.backoffMs=800}start(){this.closed=!1,this.connect()}stop(){this.closed=!0,this.ws?.close(),this.ws=null,this.flushPending(new Error("gateway client stopped"))}get connected(){return this.ws?.readyState===WebSocket.OPEN}connect(){this.closed||(this.ws=new WebSocket(this.opts.url),this.ws.onopen=()=>this.queueConnect(),this.ws.onmessage=t=>this.handleMessage(String(t.data??"")),this.ws.onclose=t=>{const n=String(t.reason??"");this.ws=null,this.flushPending(new Error(`gateway closed (${t.code}): ${n}`)),this.opts.onClose?.({code:t.code,reason:n}),this.scheduleReconnect()},this.ws.onerror=()=>{})}scheduleReconnect(){if(this.closed)return;const t=this.backoffMs;this.backoffMs=Math.min(this.backoffMs*1.7,15e3),window.setTimeout(()=>this.connect(),t)}flushPending(t){for(const[,n]of this.pending)n.reject(t);this.pending.clear()}async sendConnect(){if(this.connectSent)return;this.connectSent=!0,this.connectTimer!==null&&(window.clearTimeout(this.connectTimer),this.connectTimer=null);const t=typeof crypto<"u"&&!!crypto.subtle,n=["operator.admin","operator.approvals","operator.pairing"],s="operator";let i=null,a=!1,o=this.opts.token;if(t){i=await zs();const d=Qc({deviceId:i.deviceId,role:s})?.token;o=d??this.opts.token,a=!!(d&&this.opts.token)}const r=o||this.opts.password?{token:o,password:this.opts.password}:void 0;let l;if(t&&i){const d=Date.now(),u=this.connectNonce??void 0,g=og({deviceId:i.deviceId,clientId:this.opts.clientName??Xa.CONTROL_UI,clientMode:this.opts.mode??Es.WEBCHAT,role:s,scopes:n,signedAtMs:d,token:o??null,nonce:u}),v=await Vc(i.privateKey,g);l={id:i.deviceId,publicKey:i.publicKey,signature:v,signedAt:d,nonce:u}}const p={minProtocol:3,maxProtocol:3,client:{id:this.opts.clientName??Xa.CONTROL_UI,version:this.opts.clientVersion??"dev",platform:this.opts.platform??navigator.platform??"web",mode:this.opts.mode??Es.WEBCHAT,instanceId:this.opts.instanceId},role:s,scopes:n,device:l,caps:[],auth:r,userAgent:navigator.userAgent,locale:navigator.language};this.request("connect",p).then(d=>{d?.auth?.deviceToken&&i&&Fo({deviceId:i.deviceId,role:d.auth.role??s,token:d.auth.deviceToken,scopes:d.auth.scopes??[]}),this.backoffMs=800,this.opts.onHello?.(d)}).catch(()=>{a&&i&&Uo({deviceId:i.deviceId,role:s}),this.ws?.close(rg,"connect failed")})}handleMessage(t){let n;try{n=JSON.parse(t)}catch{return}const s=n;if(s.type==="event"){const i=n;if(i.event==="connect.challenge"){const o=i.payload,r=o&&typeof o.nonce=="string"?o.nonce:null;r&&(this.connectNonce=r,this.sendConnect());return}const a=typeof i.seq=="number"?i.seq:null;a!==null&&(this.lastSeq!==null&&a>this.lastSeq+1&&this.opts.onGap?.({expected:this.lastSeq+1,received:a}),this.lastSeq=a);try{this.opts.onEvent?.(i)}catch(o){console.error("[gateway] event handler error:",o)}return}if(s.type==="res"){const i=n,a=this.pending.get(i.id);if(!a)return;this.pending.delete(i.id),i.ok?a.resolve(i.payload):a.reject(new Error(i.error?.message??"request failed"));return}}request(t,n){if(!this.ws||this.ws.readyState!==WebSocket.OPEN)return Promise.reject(new Error("gateway not connected"));const s=Bs(),i={type:"req",id:s,method:t,params:n},a=new Promise((o,r)=>{this.pending.set(s,{resolve:l=>o(l),reject:r})});return this.ws.send(JSON.stringify(i)),a}queueConnect(){this.connectNonce=null,this.connectSent=!1,this.connectTimer!==null&&window.clearTimeout(this.connectTimer),this.connectTimer=window.setTimeout(()=>{this.sendConnect()},750)}}function Ms(e){return typeof e=="object"&&e!==null}function cg(e){if(!Ms(e))return null;const t=typeof e.id=="string"?e.id.trim():"",n=e.request;if(!t||!Ms(n))return null;const s=typeof n.command=="string"?n.command.trim():"";if(!s)return null;const i=typeof e.createdAtMs=="number"?e.createdAtMs:0,a=typeof e.expiresAtMs=="number"?e.expiresAtMs:0;return!i||!a?null:{id:t,request:{command:s,cwd:typeof n.cwd=="string"?n.cwd:null,host:typeof n.host=="string"?n.host:null,security:typeof n.security=="string"?n.security:null,ask:typeof n.ask=="string"?n.ask:null,agentId:typeof n.agentId=="string"?n.agentId:null,resolvedPath:typeof n.resolvedPath=="string"?n.resolvedPath:null,sessionKey:typeof n.sessionKey=="string"?n.sessionKey:null},createdAtMs:i,expiresAtMs:a}}function dg(e){if(!Ms(e))return null;const t=typeof e.id=="string"?e.id.trim():"";return t?{id:t,decision:typeof e.decision=="string"?e.decision:null,resolvedBy:typeof e.resolvedBy=="string"?e.resolvedBy:null,ts:typeof e.ts=="number"?e.ts:null}:null}function Cr(e){const t=Date.now();return e.filter(n=>n.expiresAtMs>t)}function ug(e,t){const n=Cr(e).filter(s=>s.id!==t.id);return n.push(t),n}function eo(e,t){return Cr(e).filter(n=>n.id!==t)}async function Tr(e,t){if(!e.client||!e.connected)return;const n=e.sessionKey.trim(),s=n?{sessionKey:n}:{};try{const i=await e.client.request("agent.identity.get",s);if(!i)return;const a=os(i);e.assistantName=a.name,e.assistantAvatar=a.avatar,e.assistantAgentId=a.agentId??null}catch{}}function ss(e,t){const n=(e??"").trim(),s=t.mainSessionKey?.trim();if(!s)return n;if(!n)return s;const i=t.mainKey?.trim()||"main",a=t.defaultAgentId?.trim();return n==="main"||n===i||a&&(n===`agent:${a}:main`||n===`agent:${a}:${i}`)?s:n}function pg(e,t){if(!t?.mainSessionKey)return;const n=ss(e.sessionKey,t),s=ss(e.settings.sessionKey,t),i=ss(e.settings.lastActiveSessionKey,t),a=n||s||e.sessionKey,o={...e.settings,sessionKey:s||a,lastActiveSessionKey:i||a},r=o.sessionKey!==e.settings.sessionKey||o.lastActiveSessionKey!==e.settings.lastActiveSessionKey;a!==e.sessionKey&&(e.sessionKey=a),r&&Se(e,o)}function Er(e){e.lastError=null,e.hello=null,e.connected=!1,e.execApprovalQueue=[],e.execApprovalError=null,e.client?.stop(),e.client=new lg({url:e.settings.gatewayUrl,token:e.settings.token.trim()?e.settings.token:void 0,password:e.password.trim()?e.password:void 0,clientName:"openclaw-control-ui",mode:"webchat",onHello:t=>{e.connected=!0,e.lastError=null,e.hello=t,gg(e,t),e.chatRunId=null,e.chatStream=null,e.chatStreamStartedAt=null,dn(e),Tr(e),ag(e),gn(e,{quiet:!0}),Ce(e,{quiet:!0}),Xs(e)},onClose:({code:t,reason:n})=>{e.connected=!1,t!==1012&&(e.lastError=`disconnected (${t}): ${n||"no reason"}`)},onEvent:t=>hg(e,t),onGap:({expected:t,received:n})=>{e.lastError=`event gap detected (expected seq ${t}, got ${n}); refresh recommended`}}),e.client.start()}function hg(e,t){try{fg(e,t)}catch(n){console.error("[gateway] handleGatewayEvent error:",t.event,n)}}function fg(e,t){if(e.eventLogBuffer=[{ts:Date.now(),event:t.event,payload:t.payload},...e.eventLogBuffer].slice(0,250),e.tab==="debug"&&(e.eventLog=e.eventLogBuffer),t.event==="agent"){if(e.onboarding)return;Xl(e,t.payload);return}if(t.event==="chat"){const n=t.payload;n?.sessionKey&&Ko(e,n.sessionKey);const s=Kl(e,n);(s==="final"||s==="error"||s==="aborted")&&(dn(e),Id(e),e.refreshSessionsAfterChat&&(e.refreshSessionsAfterChat=!1,s==="final"&&Ke(e,{activeMinutes:0}))),s==="final"&&St(e);return}if(t.event==="presence"){const n=t.payload;n?.presence&&Array.isArray(n.presence)&&(e.presenceEntries=n.presence,e.presenceError=null,e.presenceStatus=null);return}if(t.event==="cron"&&e.tab==="cron"&&ei(e),(t.event==="device.pair.requested"||t.event==="device.pair.resolved")&&Ce(e,{quiet:!0}),t.event==="exec.approval.requested"){const n=cg(t.payload);if(n){e.execApprovalQueue=ug(e.execApprovalQueue,n),e.execApprovalError=null;const s=Math.max(0,n.expiresAtMs-Date.now()+500);window.setTimeout(()=>{e.execApprovalQueue=eo(e.execApprovalQueue,n.id)},s)}return}if(t.event==="exec.approval.resolved"){const n=dg(t.payload);n&&(e.execApprovalQueue=eo(e.execApprovalQueue,n.id))}}function gg(e,t){const n=t.snapshot;n?.presence&&Array.isArray(n.presence)&&(e.presenceEntries=n.presence),n?.health&&(e.debugHealth=n.health),n?.sessionDefaults&&pg(e,n.sessionDefaults)}function vg(e){e.basePath=bd(),vd(e),Ad(e,!0),wd(e),$d(e),window.addEventListener("popstate",e.popStateHandler),Er(e),fd(e),e.tab==="logs"&&Ys(e),e.tab==="debug"&&Zs(e)}function mg(e){ic(e)}function yg(e){window.removeEventListener("popstate",e.popStateHandler),gd(e),Qs(e),Js(e),xd(e),e.topbarObserver?.disconnect(),e.topbarObserver=null}function bg(e,t){if(e.tab==="chat"&&(t.has("chatMessages")||t.has("chatToolMessages")||t.has("chatStream")||t.has("chatLoading")||t.has("tab"))){const n=t.has("tab"),s=t.has("chatLoading")&&t.get("chatLoading")===!0&&e.chatLoading===!1;un(e,n||s||!e.chatHasAutoScrolled)}e.tab==="logs"&&(t.has("logsEntries")||t.has("logsAutoFollow")||t.has("tab"))&&e.logsAutoFollow&&e.logsAtBottom&&yo(e,t.has("tab")||t.has("logsAutoFollow"))}async function wg(e,t){await gc(e,t),await oe(e,!0)}async function $g(e){await vc(e),await oe(e,!0)}async function xg(e){await mc(e),await oe(e,!0)}async function Ag(e){await ps(e),await ye(e),await oe(e,!0)}async function kg(e){await ye(e),await oe(e,!0)}function Sg(e){if(!Array.isArray(e))return{};const t={};for(const n of e){if(typeof n!="string")continue;const[s,...i]=n.split(":");if(!s||i.length===0)continue;const a=s.trim(),o=i.join(":").trim();a&&o&&(t[a]=o)}return t}function Mr(e){return(e.channelsSnapshot?.channelAccounts?.nostr??[])[0]?.accountId??e.nostrProfileAccountId??"default"}function Lr(e,t=""){return`/api/channels/nostr/${encodeURIComponent(e)}/profile${t}`}function _g(e,t,n){e.nostrProfileAccountId=t,e.nostrProfileFormState=$h(n??void 0)}function Cg(e){e.nostrProfileFormState=null,e.nostrProfileAccountId=null}function Tg(e,t,n){const s=e.nostrProfileFormState;s&&(e.nostrProfileFormState={...s,values:{...s.values,[t]:n},fieldErrors:{...s.fieldErrors,[t]:""}})}function Eg(e){const t=e.nostrProfileFormState;t&&(e.nostrProfileFormState={...t,showAdvanced:!t.showAdvanced})}async function Mg(e){const t=e.nostrProfileFormState;if(!t||t.saving)return;const n=Mr(e);e.nostrProfileFormState={...t,saving:!0,error:null,success:null,fieldErrors:{}};try{const s=await fetch(Lr(n),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t.values)}),i=await s.json().catch(()=>null);if(!s.ok||i?.ok===!1||!i){const a=i?.error??`Profile update failed (${s.status})`;e.nostrProfileFormState={...t,saving:!1,error:a,success:null,fieldErrors:Sg(i?.details)};return}if(!i.persisted){e.nostrProfileFormState={...t,saving:!1,error:"Profile publish failed on all relays.",success:null};return}e.nostrProfileFormState={...t,saving:!1,error:null,success:"Profile published to relays.",fieldErrors:{},original:{...t.values}},await oe(e,!0)}catch(s){e.nostrProfileFormState={...t,saving:!1,error:`Profile update failed: ${String(s)}`,success:null}}}async function Lg(e){const t=e.nostrProfileFormState;if(!t||t.importing)return;const n=Mr(e);e.nostrProfileFormState={...t,importing:!0,error:null,success:null};try{const s=await fetch(Lr(n,"/import"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({autoMerge:!0})}),i=await s.json().catch(()=>null);if(!s.ok||i?.ok===!1||!i){const l=i?.error??`Profile import failed (${s.status})`;e.nostrProfileFormState={...t,importing:!1,error:l,success:null};return}const a=i.merged??i.imported??null,o=a?{...t.values,...a}:t.values,r=!!(o.banner||o.website||o.nip05||o.lud16);e.nostrProfileFormState={...t,importing:!1,values:o,error:null,success:i.saved?"Profile imported from relays. Review and publish.":"Profile imported. Review and publish.",showAdvanced:r},i.saved&&await oe(e,!0)}catch(s){e.nostrProfileFormState={...t,importing:!1,error:`Profile import failed: ${String(s)}`,success:null}}}var Ig=Object.defineProperty,Rg=Object.getOwnPropertyDescriptor,b=(e,t,n,s)=>{for(var i=s>1?void 0:s?Rg(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(s?o(t,n,i):o(i))||i);return s&&i&&Ig(t,n,i),i};const is=wl();function Pg(){if(!window.location.search)return!1;const t=new URLSearchParams(window.location.search).get("onboarding");if(!t)return!1;const n=t.trim().toLowerCase();return n==="1"||n==="true"||n==="yes"||n==="on"}let m=class extends Je{constructor(){super(...arguments),this.settings=$l(),this.password="",this.tab="chat",this.onboarding=Pg(),this.connected=!1,this.theme=this.settings.theme??"system",this.themeResolved="dark",this.hello=null,this.lastError=null,this.eventLog=[],this.eventLogBuffer=[],this.toolStreamSyncTimer=null,this.sidebarCloseTimer=null,this.assistantName=is.name,this.assistantAvatar=is.avatar,this.assistantAgentId=is.agentId??null,this.sessionKey=this.settings.sessionKey,this.chatLoading=!1,this.chatSending=!1,this.chatMessage="",this.chatMessages=[],this.chatToolMessages=[],this.chatStream=null,this.chatStreamStartedAt=null,this.chatRunId=null,this.compactionStatus=null,this.chatAvatarUrl=null,this.chatThinkingLevel=null,this.chatQueue=[],this.chatAttachments=[],this.sidebarOpen=!1,this.sidebarContent=null,this.sidebarError=null,this.splitRatio=this.settings.splitRatio,this.nodesLoading=!1,this.nodes=[],this.devicesLoading=!1,this.devicesError=null,this.devicesList=null,this.execApprovalsLoading=!1,this.execApprovalsSaving=!1,this.execApprovalsDirty=!1,this.execApprovalsSnapshot=null,this.execApprovalsForm=null,this.execApprovalsSelectedAgent=null,this.execApprovalsTarget="gateway",this.execApprovalsTargetNodeId=null,this.execApprovalQueue=[],this.execApprovalBusy=!1,this.execApprovalError=null,this.pendingGatewayUrl=null,this.configLoading=!1,this.configRaw=`{
|
|
3160
3191
|
}
|
|
3161
|
-
`,this.configRawOriginal="",this.configValid=null,this.configIssues=[],this.configSaving=!1,this.configApplying=!1,this.updateRunning=!1,this.applySessionKey=this.settings.lastActiveSessionKey,this.configSnapshot=null,this.configSchema=null,this.configSchemaVersion=null,this.configSchemaLoading=!1,this.configUiHints={},this.configForm=null,this.configFormOriginal=null,this.configFormDirty=!1,this.configFormMode="form",this.configSearchQuery="",this.configActiveSection=null,this.configActiveSubsection=null,this.channelsLoading=!1,this.channelsSnapshot=null,this.channelsError=null,this.channelsLastSuccess=null,this.whatsappLoginMessage=null,this.whatsappLoginQrDataUrl=null,this.whatsappLoginConnected=null,this.whatsappBusy=!1,this.nostrProfileFormState=null,this.nostrProfileAccountId=null,this.presenceLoading=!1,this.presenceEntries=[],this.presenceError=null,this.presenceStatus=null,this.agentsLoading=!1,this.agentsList=null,this.agentsError=null,this.sessionsLoading=!1,this.sessionsResult=null,this.sessionsError=null,this.sessionsFilterActive="",this.sessionsFilterLimit="120",this.sessionsIncludeGlobal=!0,this.sessionsIncludeUnknown=!1,this.cronLoading=!1,this.cronJobs=[],this.cronStatus=null,this.cronError=null,this.cronForm={...
|
|
3162
|
-
//# sourceMappingURL=index-
|
|
3192
|
+
`,this.configRawOriginal="",this.configValid=null,this.configIssues=[],this.configSaving=!1,this.configApplying=!1,this.updateRunning=!1,this.applySessionKey=this.settings.lastActiveSessionKey,this.configSnapshot=null,this.configSchema=null,this.configSchemaVersion=null,this.configSchemaLoading=!1,this.configUiHints={},this.configForm=null,this.configFormOriginal=null,this.configFormDirty=!1,this.configFormMode="form",this.configSearchQuery="",this.configActiveSection=null,this.configActiveSubsection=null,this.channelsLoading=!1,this.channelsSnapshot=null,this.channelsError=null,this.channelsLastSuccess=null,this.whatsappLoginMessage=null,this.whatsappLoginQrDataUrl=null,this.whatsappLoginConnected=null,this.whatsappBusy=!1,this.nostrProfileFormState=null,this.nostrProfileAccountId=null,this.presenceLoading=!1,this.presenceEntries=[],this.presenceError=null,this.presenceStatus=null,this.agentsLoading=!1,this.agentsList=null,this.agentsError=null,this.sessionsLoading=!1,this.sessionsResult=null,this.sessionsError=null,this.sessionsFilterActive="",this.sessionsFilterLimit="120",this.sessionsIncludeGlobal=!0,this.sessionsIncludeUnknown=!1,this.cronLoading=!1,this.cronJobs=[],this.cronStatus=null,this.cronError=null,this.cronForm={...ig},this.cronRunsJobId=null,this.cronRuns=[],this.cronBusy=!1,this.skillsLoading=!1,this.skillsReport=null,this.skillsError=null,this.skillsFilter="",this.skillEdits={},this.skillsBusyKey=null,this.skillMessages={},this.debugLoading=!1,this.debugStatus=null,this.debugHealth=null,this.debugModels=[],this.debugHeartbeat=null,this.debugCallMethod="",this.debugCallParams="{}",this.debugCallResult=null,this.debugCallError=null,this.logsLoading=!1,this.logsError=null,this.logsFile=null,this.logsEntries=[],this.logsFilterText="",this.logsLevelFilters={...sg},this.logsAutoFollow=!0,this.logsTruncated=!1,this.logsCursor=null,this.logsLastFetchAt=null,this.logsLimit=500,this.logsMaxBytes=25e4,this.logsAtBottom=!0,this.client=null,this.chatScrollFrame=null,this.chatScrollTimeout=null,this.chatHasAutoScrolled=!1,this.chatUserNearBottom=!0,this.nodesPollInterval=null,this.logsPollInterval=null,this.debugPollInterval=null,this.logsScrollFrame=null,this.toolStreamById=new Map,this.toolStreamOrder=[],this.refreshSessionsAfterChat=!1,this.basePath="",this.popStateHandler=()=>kd(this),this.themeMedia=null,this.themeMediaHandler=null,this.topbarObserver=null}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),vg(this)}firstUpdated(){mg(this)}disconnectedCallback(){yg(this),super.disconnectedCallback()}updated(e){bg(this,e)}connect(){Er(this)}handleChatScroll(e){ec(this,e)}handleLogsScroll(e){tc(this,e)}exportLogs(e,t){sc(e,t)}resetToolStream(){dn(this)}resetChatScroll(){nc(this)}async loadAssistantIdentity(){await Tr(this)}applySettings(e){Se(this,e)}setTab(e){md(this,e)}setTheme(e,t){yd(this,e,t)}async loadOverview(){await jo(this)}async loadCron(){await ei(this)}async handleAbortChat(){await Go(this)}removeQueuedMessage(e){Md(this,e)}async handleSendChat(e,t){await Ld(this,e,t)}async handleWhatsAppStart(e){await wg(this,e)}async handleWhatsAppWait(){await $g(this)}async handleWhatsAppLogout(){await xg(this)}async handleChannelConfigSave(){await Ag(this)}async handleChannelConfigReload(){await kg(this)}handleNostrProfileEdit(e,t){_g(this,e,t)}handleNostrProfileCancel(){Cg(this)}handleNostrProfileFieldChange(e,t){Tg(this,e,t)}async handleNostrProfileSave(){await Mg(this)}async handleNostrProfileImport(){await Lg(this)}handleNostrProfileToggleAdvanced(){Eg(this)}async handleExecApprovalDecision(e){const t=this.execApprovalQueue[0];if(!(!t||!this.client||this.execApprovalBusy)){this.execApprovalBusy=!0,this.execApprovalError=null;try{await this.client.request("exec.approval.resolve",{id:t.id,decision:e}),this.execApprovalQueue=this.execApprovalQueue.filter(n=>n.id!==t.id)}catch(n){this.execApprovalError=`Exec approval failed: ${String(n)}`}finally{this.execApprovalBusy=!1}}}handleGatewayUrlConfirm(){const e=this.pendingGatewayUrl;e&&(this.pendingGatewayUrl=null,Se(this,{...this.settings,gatewayUrl:e}),this.connect())}handleGatewayUrlCancel(){this.pendingGatewayUrl=null}handleOpenSidebar(e){this.sidebarCloseTimer!=null&&(window.clearTimeout(this.sidebarCloseTimer),this.sidebarCloseTimer=null),this.sidebarContent=e,this.sidebarError=null,this.sidebarOpen=!0}handleCloseSidebar(){this.sidebarOpen=!1,this.sidebarCloseTimer!=null&&window.clearTimeout(this.sidebarCloseTimer),this.sidebarCloseTimer=window.setTimeout(()=>{this.sidebarOpen||(this.sidebarContent=null,this.sidebarError=null,this.sidebarCloseTimer=null)},200)}handleSplitRatioChange(e){const t=Math.max(.4,Math.min(.7,e));this.splitRatio=t,this.applySettings({...this.settings,splitRatio:t})}render(){return ng(this)}};b([w()],m.prototype,"settings",2);b([w()],m.prototype,"password",2);b([w()],m.prototype,"tab",2);b([w()],m.prototype,"onboarding",2);b([w()],m.prototype,"connected",2);b([w()],m.prototype,"theme",2);b([w()],m.prototype,"themeResolved",2);b([w()],m.prototype,"hello",2);b([w()],m.prototype,"lastError",2);b([w()],m.prototype,"eventLog",2);b([w()],m.prototype,"assistantName",2);b([w()],m.prototype,"assistantAvatar",2);b([w()],m.prototype,"assistantAgentId",2);b([w()],m.prototype,"sessionKey",2);b([w()],m.prototype,"chatLoading",2);b([w()],m.prototype,"chatSending",2);b([w()],m.prototype,"chatMessage",2);b([w()],m.prototype,"chatMessages",2);b([w()],m.prototype,"chatToolMessages",2);b([w()],m.prototype,"chatStream",2);b([w()],m.prototype,"chatStreamStartedAt",2);b([w()],m.prototype,"chatRunId",2);b([w()],m.prototype,"compactionStatus",2);b([w()],m.prototype,"chatAvatarUrl",2);b([w()],m.prototype,"chatThinkingLevel",2);b([w()],m.prototype,"chatQueue",2);b([w()],m.prototype,"chatAttachments",2);b([w()],m.prototype,"sidebarOpen",2);b([w()],m.prototype,"sidebarContent",2);b([w()],m.prototype,"sidebarError",2);b([w()],m.prototype,"splitRatio",2);b([w()],m.prototype,"nodesLoading",2);b([w()],m.prototype,"nodes",2);b([w()],m.prototype,"devicesLoading",2);b([w()],m.prototype,"devicesError",2);b([w()],m.prototype,"devicesList",2);b([w()],m.prototype,"execApprovalsLoading",2);b([w()],m.prototype,"execApprovalsSaving",2);b([w()],m.prototype,"execApprovalsDirty",2);b([w()],m.prototype,"execApprovalsSnapshot",2);b([w()],m.prototype,"execApprovalsForm",2);b([w()],m.prototype,"execApprovalsSelectedAgent",2);b([w()],m.prototype,"execApprovalsTarget",2);b([w()],m.prototype,"execApprovalsTargetNodeId",2);b([w()],m.prototype,"execApprovalQueue",2);b([w()],m.prototype,"execApprovalBusy",2);b([w()],m.prototype,"execApprovalError",2);b([w()],m.prototype,"pendingGatewayUrl",2);b([w()],m.prototype,"configLoading",2);b([w()],m.prototype,"configRaw",2);b([w()],m.prototype,"configRawOriginal",2);b([w()],m.prototype,"configValid",2);b([w()],m.prototype,"configIssues",2);b([w()],m.prototype,"configSaving",2);b([w()],m.prototype,"configApplying",2);b([w()],m.prototype,"updateRunning",2);b([w()],m.prototype,"applySessionKey",2);b([w()],m.prototype,"configSnapshot",2);b([w()],m.prototype,"configSchema",2);b([w()],m.prototype,"configSchemaVersion",2);b([w()],m.prototype,"configSchemaLoading",2);b([w()],m.prototype,"configUiHints",2);b([w()],m.prototype,"configForm",2);b([w()],m.prototype,"configFormOriginal",2);b([w()],m.prototype,"configFormDirty",2);b([w()],m.prototype,"configFormMode",2);b([w()],m.prototype,"configSearchQuery",2);b([w()],m.prototype,"configActiveSection",2);b([w()],m.prototype,"configActiveSubsection",2);b([w()],m.prototype,"channelsLoading",2);b([w()],m.prototype,"channelsSnapshot",2);b([w()],m.prototype,"channelsError",2);b([w()],m.prototype,"channelsLastSuccess",2);b([w()],m.prototype,"whatsappLoginMessage",2);b([w()],m.prototype,"whatsappLoginQrDataUrl",2);b([w()],m.prototype,"whatsappLoginConnected",2);b([w()],m.prototype,"whatsappBusy",2);b([w()],m.prototype,"nostrProfileFormState",2);b([w()],m.prototype,"nostrProfileAccountId",2);b([w()],m.prototype,"presenceLoading",2);b([w()],m.prototype,"presenceEntries",2);b([w()],m.prototype,"presenceError",2);b([w()],m.prototype,"presenceStatus",2);b([w()],m.prototype,"agentsLoading",2);b([w()],m.prototype,"agentsList",2);b([w()],m.prototype,"agentsError",2);b([w()],m.prototype,"sessionsLoading",2);b([w()],m.prototype,"sessionsResult",2);b([w()],m.prototype,"sessionsError",2);b([w()],m.prototype,"sessionsFilterActive",2);b([w()],m.prototype,"sessionsFilterLimit",2);b([w()],m.prototype,"sessionsIncludeGlobal",2);b([w()],m.prototype,"sessionsIncludeUnknown",2);b([w()],m.prototype,"cronLoading",2);b([w()],m.prototype,"cronJobs",2);b([w()],m.prototype,"cronStatus",2);b([w()],m.prototype,"cronError",2);b([w()],m.prototype,"cronForm",2);b([w()],m.prototype,"cronRunsJobId",2);b([w()],m.prototype,"cronRuns",2);b([w()],m.prototype,"cronBusy",2);b([w()],m.prototype,"skillsLoading",2);b([w()],m.prototype,"skillsReport",2);b([w()],m.prototype,"skillsError",2);b([w()],m.prototype,"skillsFilter",2);b([w()],m.prototype,"skillEdits",2);b([w()],m.prototype,"skillsBusyKey",2);b([w()],m.prototype,"skillMessages",2);b([w()],m.prototype,"debugLoading",2);b([w()],m.prototype,"debugStatus",2);b([w()],m.prototype,"debugHealth",2);b([w()],m.prototype,"debugModels",2);b([w()],m.prototype,"debugHeartbeat",2);b([w()],m.prototype,"debugCallMethod",2);b([w()],m.prototype,"debugCallParams",2);b([w()],m.prototype,"debugCallResult",2);b([w()],m.prototype,"debugCallError",2);b([w()],m.prototype,"logsLoading",2);b([w()],m.prototype,"logsError",2);b([w()],m.prototype,"logsFile",2);b([w()],m.prototype,"logsEntries",2);b([w()],m.prototype,"logsFilterText",2);b([w()],m.prototype,"logsLevelFilters",2);b([w()],m.prototype,"logsAutoFollow",2);b([w()],m.prototype,"logsTruncated",2);b([w()],m.prototype,"logsCursor",2);b([w()],m.prototype,"logsLastFetchAt",2);b([w()],m.prototype,"logsLimit",2);b([w()],m.prototype,"logsMaxBytes",2);b([w()],m.prototype,"logsAtBottom",2);m=b([lo("openclaw-app")],m);
|
|
3193
|
+
//# sourceMappingURL=index-DFDgq9AK.js.map
|