fengming 0.3.1 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3 -8
- package/LICENSE +0 -0
- package/README.md +0 -0
- package/THIRD_PARTY_NOTICES.md +0 -0
- package/dist/auto-reply/reply/export-html/template.css +0 -0
- package/dist/auto-reply/reply/export-html/template.html +0 -0
- package/dist/auto-reply/reply/export-html/template.js +0 -0
- package/dist/auto-reply/reply/export-html/vendor/highlight.min.js +0 -0
- package/dist/auto-reply/reply/export-html/vendor/marked.min.js +0 -0
- package/dist/build-info.json +2 -2
- package/dist/bundled/boot-md/HOOK.md +0 -0
- package/dist/bundled/bootstrap-extra-files/HOOK.md +0 -0
- package/dist/bundled/command-logger/HOOK.md +0 -0
- package/dist/bundled/compaction-notifier/HOOK.md +0 -0
- package/dist/bundled/session-memory/HOOK.md +0 -0
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/canvas-host/a2ui/a2ui.bundle.js +0 -0
- package/dist/canvas-host/a2ui/index.html +0 -0
- package/dist/cli-startup-metadata.json +8 -8
- package/dist/control-ui/apple-touch-icon.png +0 -0
- package/dist/control-ui/assets/{activity-164wVojz.js → activity-B7yRLbf3.js} +2 -2
- package/dist/control-ui/assets/{agents-B2f8TYRm.js → agents-E-3DAkaW.js} +33 -29
- package/dist/control-ui/assets/{channel-config-extras-Cnty6sJP.js → channel-config-extras-GDGUjA2T.js} +2 -2
- package/dist/control-ui/assets/{channels-DoO-OrjQ.js → channels-D0c7A9OX.js} +7 -7
- package/dist/control-ui/assets/{cron-DTyzT3TV.js → cron-B54j2Vmo.js} +11 -9
- package/dist/control-ui/assets/{debug-DmFMvLdY.js → debug-CRcGYNA9.js} +2 -2
- package/dist/control-ui/assets/i18n-BWPaSddY.js +2 -0
- package/dist/control-ui/assets/{index-nC-y5600.js → index-bZJJ7U8q.js} +104 -91
- package/dist/control-ui/assets/{instances-DWljwzyf.js → instances-RcBeqNzx.js} +2 -2
- package/dist/control-ui/assets/{logs-D7YSLRvz.js → logs-atEFsTJJ.js} +7 -7
- package/dist/control-ui/assets/{nodes-D1vIdMC3.js → nodes-BoWRh42t.js} +63 -55
- package/dist/control-ui/assets/{push-subscription-SK4PlhIV.js → push-subscription-CY8GxC_U.js} +2 -2
- package/dist/control-ui/assets/{sessions-BqzDZWTD.js → sessions-BmRQ932H.js} +3 -3
- package/dist/control-ui/assets/{skills-CAvbfEkF.js → skills-BDn45kHZ.js} +38 -34
- package/dist/control-ui/assets/{skills-shared-KvN3lpfP.js → skills-shared-lQxAuc7D.js} +2 -2
- package/dist/control-ui/assets/{workboard-DsePRAcc.js → workboard-BwbcNuC5.js} +2 -2
- package/dist/control-ui/favicon-32.png +0 -0
- package/dist/control-ui/favicon.ico +0 -0
- package/dist/control-ui/favicon.svg +0 -0
- package/dist/control-ui/index.html +2 -2
- package/dist/control-ui/manifest.webmanifest +0 -0
- package/dist/control-ui/sw.js +1 -1
- package/dist/entry.js +0 -0
- package/dist/extensions/browser/skills/browser-automation/SKILL.md +0 -0
- package/dist/index.js +0 -0
- package/dist/plugin-sdk/.boundary-entry-shims.stamp +1 -1
- package/dist/plugin-sdk/agent-config-primitives.d.ts +1 -1
- package/dist/plugin-sdk/{agent-harness-runtime-Bkrjji63.d.ts → agent-harness-runtime-CgQiThzm.d.ts} +2 -2
- package/dist/plugin-sdk/agent-harness-runtime.d.ts +4 -4
- package/dist/plugin-sdk/agent-harness-task-runtime.d.ts +1 -1
- package/dist/plugin-sdk/agent-harness.d.ts +4 -4
- package/dist/plugin-sdk/agent-runtime.d.ts +1 -1
- package/dist/plugin-sdk/{bundled-channel-config-schema-DcGjByUV.d.ts → bundled-channel-config-schema-C3pWWvwG.d.ts} +26 -26
- package/dist/plugin-sdk/bundled-channel-config-schema.d.ts +3 -3
- package/dist/plugin-sdk/channel-config-primitives.d.ts +2 -2
- package/dist/plugin-sdk/channel-config-schema-legacy.d.ts +3 -3
- package/dist/plugin-sdk/channel-config-schema.d.ts +2 -2
- package/dist/plugin-sdk/channel-core.d.ts +3 -3
- package/dist/plugin-sdk/channel-entry-contract.d.ts +1 -1
- package/dist/plugin-sdk/{channel-pairing-CzsPAHgH.d.ts → channel-pairing-CX6ncj1r.d.ts} +1 -1
- package/dist/plugin-sdk/channel-pairing.d.ts +1 -1
- package/dist/plugin-sdk/channel-plugin-common.d.ts +3 -3
- package/dist/plugin-sdk/cli-backend.d.ts +1 -1
- package/dist/plugin-sdk/compat.d.ts +6 -6
- package/dist/plugin-sdk/{config-schema-DUddICQM.d.ts → config-schema-D7cABQ6o.d.ts} +1 -1
- package/dist/plugin-sdk/{config-schema-N64y7n8C.d.ts → config-schema-DuJUjn6k.d.ts} +1 -1
- package/dist/plugin-sdk/config-schema.d.ts +8 -8
- package/dist/plugin-sdk/{core-BWZB2hNB.d.ts → core-CPtu2Ftl.d.ts} +1 -1
- package/dist/plugin-sdk/core.d.ts +8 -8
- package/dist/plugin-sdk/{delegate-o5xckIuc.d.ts → delegate-uk6vAMkc.d.ts} +1 -1
- package/dist/plugin-sdk/discord.d.ts +4 -4
- package/dist/plugin-sdk/{fengming-runtime-abXAXyq2.d.ts → fengming-runtime-Dt2ZEVYX.d.ts} +1 -1
- package/dist/plugin-sdk/gateway-runtime.d.ts +1 -1
- package/dist/plugin-sdk/{host-compat-D2Ky8seZ.d.ts → host-compat-CM0h9ODw.d.ts} +1 -1
- package/dist/plugin-sdk/{http-registry-oxJbX3E-.d.ts → http-registry-BniL_epL.d.ts} +2 -2
- package/dist/plugin-sdk/image-generation-core.d.ts +4 -4
- package/dist/plugin-sdk/image-generation-runtime.d.ts +3 -3
- package/dist/plugin-sdk/index.d.ts +4 -4
- package/dist/plugin-sdk/lmstudio.d.ts +1 -1
- package/dist/plugin-sdk/{loader-CgJhYjxT.d.ts → loader-aELh60PE.d.ts} +3 -3
- package/dist/plugin-sdk/{logger-CyDIBtoX.d.ts → logger-BpB3--7Z.d.ts} +1 -1
- package/dist/plugin-sdk/logging-core.d.ts +3 -3
- package/dist/plugin-sdk/memory-core-host-engine-embeddings.d.ts +2 -2
- package/dist/plugin-sdk/memory-core-host-engine-foundation.d.ts +3 -3
- package/dist/plugin-sdk/{memory-core-host-engine-storage-DfW7ZqD0.d.ts → memory-core-host-engine-storage-DYPjOQCg.d.ts} +1 -1
- package/dist/plugin-sdk/memory-core-host-engine-storage.d.ts +1 -1
- package/dist/plugin-sdk/memory-core-host-runtime-cli.d.ts +1 -1
- package/dist/plugin-sdk/memory-core-host-runtime-core.d.ts +3 -3
- package/dist/plugin-sdk/memory-core.d.ts +3 -3
- package/dist/plugin-sdk/memory-host-core.d.ts +3 -3
- package/dist/plugin-sdk/migration-runtime.d.ts +1 -1
- package/dist/plugin-sdk/migration.d.ts +1 -1
- package/dist/plugin-sdk/music-generation-core.d.ts +2 -2
- package/dist/plugin-sdk/{plugin-entry-C9xM-ZA9.d.ts → plugin-entry-DO9kQeTr.d.ts} +1 -1
- package/dist/plugin-sdk/plugin-entry.d.ts +3 -3
- package/dist/plugin-sdk/plugin-runtime.d.ts +3 -3
- package/dist/plugin-sdk/{provider-api-key-auth-DOmYPTC2.d.ts → provider-api-key-auth-DvIiojS6.d.ts} +1 -1
- package/dist/plugin-sdk/provider-auth-api-key.d.ts +4 -4
- package/dist/plugin-sdk/{provider-auth-helpers-pqDNrZTd.d.ts → provider-auth-helpers-CYkWZ0vq.d.ts} +1 -1
- package/dist/plugin-sdk/{provider-auth-input-Ckt-cU4H.d.ts → provider-auth-input-DUV6ZTw4.d.ts} +1 -1
- package/dist/plugin-sdk/provider-auth-result.d.ts +1 -1
- package/dist/plugin-sdk/provider-auth-runtime.d.ts +1 -1
- package/dist/plugin-sdk/provider-auth.d.ts +5 -5
- package/dist/plugin-sdk/provider-catalog-runtime.d.ts +2 -2
- package/dist/plugin-sdk/{provider-catalog-shared-QvOT8Wz1.d.ts → provider-catalog-shared-Cm3SyFfL.d.ts} +1 -1
- package/dist/plugin-sdk/provider-catalog-shared.d.ts +2 -2
- package/dist/plugin-sdk/provider-entry.d.ts +3 -3
- package/dist/plugin-sdk/{provider-model-shared-Bnc8IMx5.d.ts → provider-model-shared-D5rgn7Gb.d.ts} +1 -1
- package/dist/plugin-sdk/provider-model-shared.d.ts +2 -2
- package/dist/plugin-sdk/{provider-registry-CxdVib8g.d.ts → provider-registry-D0vmhPWL.d.ts} +1 -1
- package/dist/plugin-sdk/{provider-registry-CqB5bSAD.d.ts → provider-registry-DiKX35tc.d.ts} +1 -1
- package/dist/plugin-sdk/{provider-registry-Ba1nNfhA.d.ts → provider-registry-DxdZT9UN.d.ts} +1 -1
- package/dist/plugin-sdk/{provider-self-hosted-setup-eMoeVPnF.d.ts → provider-self-hosted-setup-BPx7JMDC.d.ts} +1 -1
- package/dist/plugin-sdk/provider-setup.d.ts +2 -2
- package/dist/plugin-sdk/{provider-stream-CGaLae9n.d.ts → provider-stream-DcC2vn_N.d.ts} +1 -1
- package/dist/plugin-sdk/provider-stream-family.d.ts +2 -2
- package/dist/plugin-sdk/{provider-stream-shared-u5mt-8_i.d.ts → provider-stream-shared-ByDv3QKm.d.ts} +1 -1
- package/dist/plugin-sdk/provider-stream-shared.d.ts +1 -1
- package/dist/plugin-sdk/provider-stream.d.ts +2 -2
- package/dist/plugin-sdk/provider-tools.d.ts +1 -1
- package/dist/plugin-sdk/provider-web-fetch-contract.d.ts +1 -1
- package/dist/plugin-sdk/provider-web-fetch.d.ts +1 -1
- package/dist/plugin-sdk/provider-web-search-config-contract.d.ts +2 -2
- package/dist/plugin-sdk/{provider-web-search-contract-fields-BiWOSs_d.d.ts → provider-web-search-contract-fields-CY4v8kS-.d.ts} +1 -1
- package/dist/plugin-sdk/provider-web-search-contract.d.ts +2 -2
- package/dist/plugin-sdk/provider-web-search.d.ts +1 -1
- package/dist/plugin-sdk/realtime-transcription.d.ts +1 -1
- package/dist/plugin-sdk/realtime-voice.d.ts +1 -1
- package/dist/plugin-sdk/{redact-identifier-CVqsKaEK.d.ts → redact-identifier-CVwkabcI.d.ts} +1 -1
- package/dist/plugin-sdk/{registry-Gq9OFlb3.d.ts → registry-CzaGoAKH.d.ts} +2 -2
- package/dist/plugin-sdk/{registry-types-DyBkef1H.d.ts → registry-types-DN1yiH3F.d.ts} +2 -2
- package/dist/plugin-sdk/reply-runtime.d.ts +1 -1
- package/dist/plugin-sdk/runtime-env.d.ts +3 -3
- package/dist/plugin-sdk/runtime-store.d.ts +1 -1
- package/dist/plugin-sdk/runtime.d.ts +3 -3
- package/dist/plugin-sdk/self-hosted-provider-setup.d.ts +2 -2
- package/dist/plugin-sdk/simple-completion-runtime.d.ts +1 -1
- package/dist/plugin-sdk/speech-core.d.ts +2 -2
- package/dist/plugin-sdk/speech.d.ts +2 -2
- package/dist/plugin-sdk/{subsystem-Boo2DQIV.d.ts → subsystem-n4Y4vCcQ.d.ts} +1 -1
- package/dist/plugin-sdk/text-runtime.d.ts +2 -2
- package/dist/plugin-sdk/tool-plugin.d.ts +2 -2
- package/dist/plugin-sdk/tts-runtime.d.ts +1 -1
- package/dist/plugin-sdk/{types-DGF1KeaJ.d.ts → types-BI8R-vGd.d.ts} +2 -2
- package/dist/plugin-sdk/{types-DpaN54PS.d.ts → types-CsqNt0j8.d.ts} +1 -1
- package/dist/plugin-sdk/{unhandled-rejections-Bez6JG0y.d.ts → unhandled-rejections-D9eBl3hT.d.ts} +2 -2
- package/dist/plugin-sdk/video-generation-core.d.ts +3 -3
- package/dist/plugin-sdk/video-generation-runtime.d.ts +3 -3
- package/dist/plugin-sdk/webhook-ingress.d.ts +1 -1
- package/dist/plugin-sdk/webhook-targets.d.ts +1 -1
- package/dist/plugin-sdk/{zod-schema.core-B4_b2R5K.d.ts → zod-schema.core-CwBNqcXp.d.ts} +1 -1
- package/dist/postinstall-inventory.json +50 -50
- package/docs/.i18n/README.md +0 -0
- package/docs/.i18n/ar-navigation.json +0 -0
- package/docs/.i18n/de-navigation.json +0 -0
- package/docs/.i18n/es-navigation.json +0 -0
- package/docs/.i18n/fr-navigation.json +0 -0
- package/docs/.i18n/glossary.ar.json +0 -0
- package/docs/.i18n/glossary.de.json +0 -0
- package/docs/.i18n/glossary.es.json +0 -0
- package/docs/.i18n/glossary.fa.json +0 -0
- package/docs/.i18n/glossary.fr.json +0 -0
- package/docs/.i18n/glossary.id.json +0 -0
- package/docs/.i18n/glossary.it.json +0 -0
- package/docs/.i18n/glossary.ja-JP.json +0 -0
- package/docs/.i18n/glossary.ko.json +0 -0
- package/docs/.i18n/glossary.nl.json +0 -0
- package/docs/.i18n/glossary.pl.json +0 -0
- package/docs/.i18n/glossary.pt-BR.json +0 -0
- package/docs/.i18n/glossary.th.json +0 -0
- package/docs/.i18n/glossary.tr.json +0 -0
- package/docs/.i18n/glossary.uk.json +0 -0
- package/docs/.i18n/glossary.vi.json +0 -0
- package/docs/.i18n/glossary.zh-CN.json +0 -0
- package/docs/.i18n/glossary.zh-TW.json +0 -0
- package/docs/.i18n/id-navigation.json +0 -0
- package/docs/.i18n/it-navigation.json +0 -0
- package/docs/.i18n/ja-navigation.json +0 -0
- package/docs/.i18n/ko-navigation.json +0 -0
- package/docs/.i18n/pl-navigation.json +0 -0
- package/docs/.i18n/pt-BR-navigation.json +0 -0
- package/docs/.i18n/tr-navigation.json +0 -0
- package/docs/.i18n/translation-workflow.md +0 -0
- package/docs/.i18n/zh-Hans-navigation.json +0 -0
- package/docs/AGENTS.md +0 -0
- package/docs/CLAUDE.md +0 -0
- package/docs/agent-runtime-architecture.md +0 -0
- package/docs/announcements/bluebubbles-imessage.md +0 -0
- package/docs/auth-credential-semantics.md +0 -0
- package/docs/automation/auth-monitoring.md +0 -0
- package/docs/automation/clawflow.md +0 -0
- package/docs/automation/cron-jobs.md +0 -0
- package/docs/automation/cron-vs-heartbeat.md +0 -0
- package/docs/automation/gmail-pubsub.md +0 -0
- package/docs/automation/hooks.md +0 -0
- package/docs/automation/index.md +0 -0
- package/docs/automation/poll.md +0 -0
- package/docs/automation/standing-orders.md +0 -0
- package/docs/automation/taskflow.md +0 -0
- package/docs/automation/tasks.md +0 -0
- package/docs/automation/troubleshooting.md +0 -0
- package/docs/automation/webhook.md +0 -0
- package/docs/brave-search.md +0 -0
- package/docs/channels/access-groups.md +0 -0
- package/docs/channels/ambient-room-events.md +0 -0
- package/docs/channels/bot-loop-protection.md +0 -0
- package/docs/channels/broadcast-groups.md +0 -0
- package/docs/channels/channel-routing.md +0 -0
- package/docs/channels/clickclack.md +0 -0
- package/docs/channels/discord.md +0 -0
- package/docs/channels/feishu.md +0 -0
- package/docs/channels/googlechat.md +0 -0
- package/docs/channels/group-messages.md +0 -0
- package/docs/channels/groups.md +0 -0
- package/docs/channels/imessage-from-bluebubbles.md +0 -0
- package/docs/channels/imessage.md +0 -0
- package/docs/channels/index.md +0 -0
- package/docs/channels/irc.md +0 -0
- package/docs/channels/line.md +0 -0
- package/docs/channels/location.md +0 -0
- package/docs/channels/matrix-migration.md +0 -0
- package/docs/channels/matrix-presentation.md +0 -0
- package/docs/channels/matrix-push-rules.md +0 -0
- package/docs/channels/matrix.md +0 -0
- package/docs/channels/mattermost.md +0 -0
- package/docs/channels/msteams.md +0 -0
- package/docs/channels/nextcloud-talk.md +0 -0
- package/docs/channels/nostr.md +0 -0
- package/docs/channels/pairing.md +0 -0
- package/docs/channels/qqbot.md +0 -0
- package/docs/channels/signal.md +0 -0
- package/docs/channels/slack.md +0 -0
- package/docs/channels/synology-chat.md +0 -0
- package/docs/channels/telegram.md +0 -0
- package/docs/channels/tlon.md +0 -0
- package/docs/channels/troubleshooting.md +0 -0
- package/docs/channels/twitch.md +0 -0
- package/docs/channels/wechat.md +0 -0
- package/docs/channels/whatsapp.md +0 -0
- package/docs/channels/yuanbao.md +0 -0
- package/docs/channels/zalo.md +0 -0
- package/docs/channels/zalouser.md +0 -0
- package/docs/ci.md +0 -0
- package/docs/clawhub/publishing.md +0 -0
- package/docs/cli/acp.md +0 -0
- package/docs/cli/agent.md +0 -0
- package/docs/cli/agents.md +0 -0
- package/docs/cli/approvals.md +0 -0
- package/docs/cli/backup.md +0 -0
- package/docs/cli/browser.md +0 -0
- package/docs/cli/channels.md +0 -0
- package/docs/cli/clawbot.md +0 -0
- package/docs/cli/commitments.md +0 -0
- package/docs/cli/completion.md +0 -0
- package/docs/cli/config.md +0 -0
- package/docs/cli/configure.md +0 -0
- package/docs/cli/crestodian.md +0 -0
- package/docs/cli/cron.md +0 -0
- package/docs/cli/daemon.md +0 -0
- package/docs/cli/dashboard.md +0 -0
- package/docs/cli/devices.md +0 -0
- package/docs/cli/directory.md +0 -0
- package/docs/cli/dns.md +0 -0
- package/docs/cli/docs.md +0 -0
- package/docs/cli/doctor.md +0 -0
- package/docs/cli/flows.md +0 -0
- package/docs/cli/gateway.md +0 -0
- package/docs/cli/health.md +0 -0
- package/docs/cli/hooks.md +0 -0
- package/docs/cli/index.md +0 -0
- package/docs/cli/infer.md +0 -0
- package/docs/cli/logs.md +0 -0
- package/docs/cli/mcp.md +0 -0
- package/docs/cli/memory.md +0 -0
- package/docs/cli/message.md +0 -0
- package/docs/cli/migrate.md +0 -0
- package/docs/cli/models.md +0 -0
- package/docs/cli/node.md +0 -0
- package/docs/cli/nodes.md +0 -0
- package/docs/cli/onboard.md +0 -0
- package/docs/cli/pairing.md +0 -0
- package/docs/cli/path.md +0 -0
- package/docs/cli/plugins.md +0 -0
- package/docs/cli/policy.md +0 -0
- package/docs/cli/proxy.md +0 -0
- package/docs/cli/qr.md +0 -0
- package/docs/cli/reset.md +0 -0
- package/docs/cli/sandbox.md +0 -0
- package/docs/cli/secrets.md +0 -0
- package/docs/cli/security.md +0 -0
- package/docs/cli/sessions.md +0 -0
- package/docs/cli/setup.md +0 -0
- package/docs/cli/skills.md +0 -0
- package/docs/cli/status.md +0 -0
- package/docs/cli/system.md +0 -0
- package/docs/cli/tasks.md +0 -0
- package/docs/cli/transcripts.md +0 -0
- package/docs/cli/tui.md +0 -0
- package/docs/cli/uninstall.md +0 -0
- package/docs/cli/update.md +0 -0
- package/docs/cli/voicecall.md +0 -0
- package/docs/cli/webhooks.md +0 -0
- package/docs/cli/wiki.md +0 -0
- package/docs/concepts/active-memory.md +0 -0
- package/docs/concepts/agent-loop.md +0 -0
- package/docs/concepts/agent-runtimes.md +0 -0
- package/docs/concepts/agent-workspace.md +0 -0
- package/docs/concepts/agent.md +0 -0
- package/docs/concepts/architecture.md +0 -0
- package/docs/concepts/channel-docking.md +0 -0
- package/docs/concepts/commitments.md +0 -0
- package/docs/concepts/compaction.md +0 -0
- package/docs/concepts/context-engine.md +0 -0
- package/docs/concepts/context.md +0 -0
- package/docs/concepts/delegate-architecture.md +0 -0
- package/docs/concepts/dreaming.md +0 -0
- package/docs/concepts/experimental-features.md +0 -0
- package/docs/concepts/features.md +0 -0
- package/docs/concepts/fengming-sdk.md +0 -0
- package/docs/concepts/mantis-slack-desktop-runbook.md +0 -0
- package/docs/concepts/mantis.md +0 -0
- package/docs/concepts/markdown-formatting.md +0 -0
- package/docs/concepts/memory-builtin.md +0 -0
- package/docs/concepts/memory-honcho.md +0 -0
- package/docs/concepts/memory-qmd.md +0 -0
- package/docs/concepts/memory-search.md +0 -0
- package/docs/concepts/memory.md +0 -0
- package/docs/concepts/message-lifecycle-refactor.md +0 -0
- package/docs/concepts/messages.md +0 -0
- package/docs/concepts/model-failover.md +0 -0
- package/docs/concepts/model-providers.md +0 -0
- package/docs/concepts/models.md +0 -0
- package/docs/concepts/multi-agent.md +0 -0
- package/docs/concepts/oauth.md +0 -0
- package/docs/concepts/parallel-specialist-lanes.md +0 -0
- package/docs/concepts/personal-agent-benchmark-pack.md +0 -0
- package/docs/concepts/presence.md +0 -0
- package/docs/concepts/progress-drafts.md +0 -0
- package/docs/concepts/qa-e2e-automation.md +0 -0
- package/docs/concepts/qa-matrix.md +0 -0
- package/docs/concepts/queue-steering.md +0 -0
- package/docs/concepts/queue.md +0 -0
- package/docs/concepts/retry.md +0 -0
- package/docs/concepts/session-pruning.md +0 -0
- package/docs/concepts/session-tool.md +0 -0
- package/docs/concepts/session.md +0 -0
- package/docs/concepts/soul.md +0 -0
- package/docs/concepts/streaming.md +0 -0
- package/docs/concepts/system-prompt.md +0 -0
- package/docs/concepts/timezone.md +0 -0
- package/docs/concepts/typebox.md +0 -0
- package/docs/concepts/typing-indicators.md +0 -0
- package/docs/concepts/usage-tracking.md +0 -0
- package/docs/date-time.md +0 -0
- package/docs/debug/node-issue.md +0 -0
- package/docs/diagnostics/flags.md +0 -0
- package/docs/docs.json +0 -0
- package/docs/fengming-agent-runtime.md +0 -0
- package/docs/gateway/authentication.md +0 -0
- package/docs/gateway/background-process.md +0 -0
- package/docs/gateway/bonjour.md +0 -0
- package/docs/gateway/bridge-protocol.md +0 -0
- package/docs/gateway/cli-backends.md +0 -0
- package/docs/gateway/config-agents.md +0 -0
- package/docs/gateway/config-channels.md +0 -0
- package/docs/gateway/config-tools.md +0 -0
- package/docs/gateway/configuration-examples.md +0 -0
- package/docs/gateway/configuration-reference.md +0 -0
- package/docs/gateway/configuration.md +0 -0
- package/docs/gateway/diagnostics.md +0 -0
- package/docs/gateway/discovery.md +0 -0
- package/docs/gateway/doctor.md +0 -0
- package/docs/gateway/gateway-lock.md +0 -0
- package/docs/gateway/health.md +0 -0
- package/docs/gateway/heartbeat.md +0 -0
- package/docs/gateway/index.md +0 -0
- package/docs/gateway/local-model-services.md +0 -0
- package/docs/gateway/local-models.md +0 -0
- package/docs/gateway/logging.md +0 -0
- package/docs/gateway/multiple-gateways.md +0 -0
- package/docs/gateway/network-model.md +0 -0
- package/docs/gateway/openai-http-api.md +0 -0
- package/docs/gateway/openresponses-http-api.md +0 -0
- package/docs/gateway/openshell.md +0 -0
- package/docs/gateway/opentelemetry.md +0 -0
- package/docs/gateway/operator-scopes.md +0 -0
- package/docs/gateway/pairing.md +0 -0
- package/docs/gateway/prometheus.md +0 -0
- package/docs/gateway/protocol.md +0 -0
- package/docs/gateway/remote-gateway-readme.md +0 -0
- package/docs/gateway/remote.md +0 -0
- package/docs/gateway/sandbox-vs-tool-policy-vs-elevated.md +0 -0
- package/docs/gateway/sandboxing.md +0 -0
- package/docs/gateway/secrets-plan-contract.md +0 -0
- package/docs/gateway/secrets.md +0 -0
- package/docs/gateway/security/audit-checks.md +0 -0
- package/docs/gateway/security/exposure-runbook.md +0 -0
- package/docs/gateway/security/index.md +0 -0
- package/docs/gateway/security/secure-file-operations.md +0 -0
- package/docs/gateway/security/shrinkwrap.md +0 -0
- package/docs/gateway/tailscale.md +0 -0
- package/docs/gateway/tools-invoke-http-api.md +0 -0
- package/docs/gateway/troubleshooting.md +0 -0
- package/docs/gateway/trusted-proxy-auth.md +0 -0
- package/docs/help/debugging.md +0 -0
- package/docs/help/environment.md +0 -0
- package/docs/help/faq-first-run.md +0 -0
- package/docs/help/faq-models.md +0 -0
- package/docs/help/faq.md +0 -0
- package/docs/help/index.md +0 -0
- package/docs/help/scripts.md +0 -0
- package/docs/help/testing-live.md +0 -0
- package/docs/help/testing-updates-plugins.md +0 -0
- package/docs/help/testing.md +0 -0
- package/docs/help/troubleshooting.md +0 -0
- package/docs/index.md +0 -0
- package/docs/install/ansible.md +0 -0
- package/docs/install/azure.md +0 -0
- package/docs/install/bun.md +0 -0
- package/docs/install/clawdock.md +0 -0
- package/docs/install/development-channels.md +0 -0
- package/docs/install/digitalocean.md +0 -0
- package/docs/install/docker-vm-runtime.md +0 -0
- package/docs/install/docker.md +0 -0
- package/docs/install/exe-dev.md +0 -0
- package/docs/install/fly.md +0 -0
- package/docs/install/gcp.md +0 -0
- package/docs/install/hetzner.md +0 -0
- package/docs/install/hostinger.md +0 -0
- package/docs/install/index.md +0 -0
- package/docs/install/installer.md +0 -0
- package/docs/install/kubernetes.md +0 -0
- package/docs/install/macos-vm.md +0 -0
- package/docs/install/migrating-claude.md +0 -0
- package/docs/install/migrating-hermes.md +0 -0
- package/docs/install/migrating.md +0 -0
- package/docs/install/nix.md +0 -0
- package/docs/install/node.md +0 -0
- package/docs/install/northflank.mdx +0 -0
- package/docs/install/oracle.md +0 -0
- package/docs/install/podman.md +0 -0
- package/docs/install/railway.mdx +0 -0
- package/docs/install/raspberry-pi.md +0 -0
- package/docs/install/render.mdx +0 -0
- package/docs/install/uninstall.md +0 -0
- package/docs/install/updating.md +0 -0
- package/docs/install/upstash.md +0 -0
- package/docs/logging.md +0 -0
- package/docs/nav-tabs-underline.js +0 -0
- package/docs/network.md +0 -0
- package/docs/nodes/audio.md +0 -0
- package/docs/nodes/camera.md +0 -0
- package/docs/nodes/images.md +0 -0
- package/docs/nodes/index.md +0 -0
- package/docs/nodes/location-command.md +0 -0
- package/docs/nodes/media-understanding.md +0 -0
- package/docs/nodes/talk.md +0 -0
- package/docs/nodes/troubleshooting.md +0 -0
- package/docs/nodes/voicewake.md +0 -0
- package/docs/perplexity.md +0 -0
- package/docs/plan/codex-context-engine-harness.md +0 -0
- package/docs/plan/ui-channels.md +0 -0
- package/docs/platforms/digitalocean.md +0 -0
- package/docs/platforms/easyrunner.md +0 -0
- package/docs/platforms/index.md +0 -0
- package/docs/platforms/linux.md +0 -0
- package/docs/platforms/mac/bundled-gateway.md +0 -0
- package/docs/platforms/mac/canvas.md +0 -0
- package/docs/platforms/mac/child-process.md +0 -0
- package/docs/platforms/mac/dev-setup.md +0 -0
- package/docs/platforms/mac/health.md +0 -0
- package/docs/platforms/mac/icon.md +0 -0
- package/docs/platforms/mac/logging.md +0 -0
- package/docs/platforms/mac/menu-bar.md +0 -0
- package/docs/platforms/mac/peekaboo.md +0 -0
- package/docs/platforms/mac/permissions.md +0 -0
- package/docs/platforms/mac/remote.md +0 -0
- package/docs/platforms/mac/signing.md +0 -0
- package/docs/platforms/mac/skills.md +0 -0
- package/docs/platforms/mac/voice-overlay.md +0 -0
- package/docs/platforms/mac/voicewake.md +0 -0
- package/docs/platforms/mac/webchat.md +0 -0
- package/docs/platforms/mac/xpc.md +0 -0
- package/docs/platforms/oracle.md +0 -0
- package/docs/platforms/raspberry-pi.md +0 -0
- package/docs/platforms/windows.md +0 -0
- package/docs/plugins/adding-capabilities.md +0 -0
- package/docs/plugins/admin-http-rpc.md +0 -0
- package/docs/plugins/agent-tools.md +0 -0
- package/docs/plugins/architecture-internals.md +0 -0
- package/docs/plugins/architecture.md +0 -0
- package/docs/plugins/building-extensions.md +0 -0
- package/docs/plugins/building-plugins.md +0 -0
- package/docs/plugins/bundles.md +0 -0
- package/docs/plugins/cli-backend-plugins.md +0 -0
- package/docs/plugins/codex-computer-use.md +0 -0
- package/docs/plugins/codex-harness-reference.md +0 -0
- package/docs/plugins/codex-harness-runtime.md +0 -0
- package/docs/plugins/codex-harness.md +0 -0
- package/docs/plugins/codex-native-plugins.md +0 -0
- package/docs/plugins/community.md +0 -0
- package/docs/plugins/compatibility.md +0 -0
- package/docs/plugins/copilot.md +0 -0
- package/docs/plugins/dependency-resolution.md +0 -0
- package/docs/plugins/google-meet.md +0 -0
- package/docs/plugins/hooks.md +0 -0
- package/docs/plugins/install-overrides.md +0 -0
- package/docs/plugins/manage-plugins.md +0 -0
- package/docs/plugins/manifest.md +0 -0
- package/docs/plugins/memory-lancedb.md +0 -0
- package/docs/plugins/memory-wiki.md +0 -0
- package/docs/plugins/message-presentation.md +0 -0
- package/docs/plugins/oc-path.md +0 -0
- package/docs/plugins/plugin-inventory.md +0 -0
- package/docs/plugins/plugin-permission-requests.md +0 -0
- package/docs/plugins/reference/acpx.md +0 -0
- package/docs/plugins/reference/admin-http-rpc.md +0 -0
- package/docs/plugins/reference/alibaba.md +0 -0
- package/docs/plugins/reference/amazon-bedrock-mantle.md +0 -0
- package/docs/plugins/reference/amazon-bedrock.md +0 -0
- package/docs/plugins/reference/anthropic-vertex.md +0 -0
- package/docs/plugins/reference/anthropic.md +0 -0
- package/docs/plugins/reference/arcee.md +0 -0
- package/docs/plugins/reference/azure-speech.md +0 -0
- package/docs/plugins/reference/bonjour.md +0 -0
- package/docs/plugins/reference/brave.md +0 -0
- package/docs/plugins/reference/browser.md +0 -0
- package/docs/plugins/reference/byteplus.md +0 -0
- package/docs/plugins/reference/canvas.md +0 -0
- package/docs/plugins/reference/cerebras.md +0 -0
- package/docs/plugins/reference/chutes.md +0 -0
- package/docs/plugins/reference/clickclack.md +0 -0
- package/docs/plugins/reference/cloudflare-ai-gateway.md +0 -0
- package/docs/plugins/reference/codex-supervisor.md +0 -0
- package/docs/plugins/reference/codex.md +0 -0
- package/docs/plugins/reference/comfy.md +0 -0
- package/docs/plugins/reference/copilot-proxy.md +0 -0
- package/docs/plugins/reference/copilot.md +0 -0
- package/docs/plugins/reference/deepgram.md +0 -0
- package/docs/plugins/reference/deepinfra.md +0 -0
- package/docs/plugins/reference/deepseek.md +0 -0
- package/docs/plugins/reference/diagnostics-otel.md +0 -0
- package/docs/plugins/reference/diagnostics-prometheus.md +0 -0
- package/docs/plugins/reference/diffs-language-pack.md +0 -0
- package/docs/plugins/reference/diffs.md +0 -0
- package/docs/plugins/reference/discord.md +0 -0
- package/docs/plugins/reference/document-extract.md +0 -0
- package/docs/plugins/reference/duckduckgo.md +0 -0
- package/docs/plugins/reference/elevenlabs.md +0 -0
- package/docs/plugins/reference/exa.md +0 -0
- package/docs/plugins/reference/fal.md +0 -0
- package/docs/plugins/reference/feishu.md +0 -0
- package/docs/plugins/reference/file-transfer.md +0 -0
- package/docs/plugins/reference/firecrawl.md +0 -0
- package/docs/plugins/reference/fireworks.md +0 -0
- package/docs/plugins/reference/github-copilot.md +0 -0
- package/docs/plugins/reference/gmi.md +0 -0
- package/docs/plugins/reference/google-meet.md +0 -0
- package/docs/plugins/reference/google.md +0 -0
- package/docs/plugins/reference/googlechat.md +0 -0
- package/docs/plugins/reference/gradium.md +0 -0
- package/docs/plugins/reference/groq.md +0 -0
- package/docs/plugins/reference/huggingface.md +0 -0
- package/docs/plugins/reference/imessage.md +0 -0
- package/docs/plugins/reference/inworld.md +0 -0
- package/docs/plugins/reference/irc.md +0 -0
- package/docs/plugins/reference/kilocode.md +0 -0
- package/docs/plugins/reference/kimi.md +0 -0
- package/docs/plugins/reference/line.md +0 -0
- package/docs/plugins/reference/litellm.md +0 -0
- package/docs/plugins/reference/llm-task.md +0 -0
- package/docs/plugins/reference/lmstudio.md +0 -0
- package/docs/plugins/reference/lobster.md +0 -0
- package/docs/plugins/reference/matrix.md +0 -0
- package/docs/plugins/reference/mattermost.md +0 -0
- package/docs/plugins/reference/memory-core.md +0 -0
- package/docs/plugins/reference/memory-lancedb.md +0 -0
- package/docs/plugins/reference/memory-wiki.md +0 -0
- package/docs/plugins/reference/microsoft-foundry.md +0 -0
- package/docs/plugins/reference/microsoft.md +0 -0
- package/docs/plugins/reference/migrate-claude.md +0 -0
- package/docs/plugins/reference/migrate-hermes.md +0 -0
- package/docs/plugins/reference/minimax.md +0 -0
- package/docs/plugins/reference/mistral.md +0 -0
- package/docs/plugins/reference/moonshot.md +0 -0
- package/docs/plugins/reference/msteams.md +0 -0
- package/docs/plugins/reference/nextcloud-talk.md +0 -0
- package/docs/plugins/reference/nostr.md +0 -0
- package/docs/plugins/reference/novita.md +0 -0
- package/docs/plugins/reference/nvidia.md +0 -0
- package/docs/plugins/reference/oc-path.md +0 -0
- package/docs/plugins/reference/ollama.md +0 -0
- package/docs/plugins/reference/open-prose.md +0 -0
- package/docs/plugins/reference/openai.md +0 -0
- package/docs/plugins/reference/opencode-go.md +0 -0
- package/docs/plugins/reference/opencode.md +0 -0
- package/docs/plugins/reference/openrouter.md +0 -0
- package/docs/plugins/reference/openshell.md +0 -0
- package/docs/plugins/reference/perplexity.md +0 -0
- package/docs/plugins/reference/pixverse.md +0 -0
- package/docs/plugins/reference/policy.md +0 -0
- package/docs/plugins/reference/qa-channel.md +0 -0
- package/docs/plugins/reference/qa-lab.md +0 -0
- package/docs/plugins/reference/qa-matrix.md +0 -0
- package/docs/plugins/reference/qianfan.md +0 -0
- package/docs/plugins/reference/qqbot.md +0 -0
- package/docs/plugins/reference/qwen.md +0 -0
- package/docs/plugins/reference/runway.md +0 -0
- package/docs/plugins/reference/searxng.md +0 -0
- package/docs/plugins/reference/senseaudio.md +0 -0
- package/docs/plugins/reference/sglang.md +0 -0
- package/docs/plugins/reference/signal.md +0 -0
- package/docs/plugins/reference/skill-workshop.md +0 -0
- package/docs/plugins/reference/slack.md +0 -0
- package/docs/plugins/reference/stepfun.md +0 -0
- package/docs/plugins/reference/synology-chat.md +0 -0
- package/docs/plugins/reference/synthetic.md +0 -0
- package/docs/plugins/reference/tavily.md +0 -0
- package/docs/plugins/reference/telegram.md +0 -0
- package/docs/plugins/reference/tencent.md +0 -0
- package/docs/plugins/reference/tlon.md +0 -0
- package/docs/plugins/reference/together.md +0 -0
- package/docs/plugins/reference/tokenjuice.md +0 -0
- package/docs/plugins/reference/tts-local-cli.md +0 -0
- package/docs/plugins/reference/twitch.md +0 -0
- package/docs/plugins/reference/venice.md +0 -0
- package/docs/plugins/reference/vercel-ai-gateway.md +0 -0
- package/docs/plugins/reference/vllm.md +0 -0
- package/docs/plugins/reference/voice-call.md +0 -0
- package/docs/plugins/reference/volcengine.md +0 -0
- package/docs/plugins/reference/voyage.md +0 -0
- package/docs/plugins/reference/vydra.md +0 -0
- package/docs/plugins/reference/web-readability.md +0 -0
- package/docs/plugins/reference/webhooks.md +0 -0
- package/docs/plugins/reference/whatsapp.md +0 -0
- package/docs/plugins/reference/workboard.md +0 -0
- package/docs/plugins/reference/xai.md +0 -0
- package/docs/plugins/reference/xiaomi.md +0 -0
- package/docs/plugins/reference/zai.md +0 -0
- package/docs/plugins/reference/zalo.md +0 -0
- package/docs/plugins/reference/zalouser.md +0 -0
- package/docs/plugins/reference.md +0 -0
- package/docs/plugins/sdk-agent-harness.md +0 -0
- package/docs/plugins/sdk-channel-inbound.md +0 -0
- package/docs/plugins/sdk-channel-ingress.md +0 -0
- package/docs/plugins/sdk-channel-message.md +0 -0
- package/docs/plugins/sdk-channel-outbound.md +0 -0
- package/docs/plugins/sdk-channel-plugins.md +0 -0
- package/docs/plugins/sdk-channel-turn.md +0 -0
- package/docs/plugins/sdk-entrypoints.md +0 -0
- package/docs/plugins/sdk-migration.md +0 -0
- package/docs/plugins/sdk-overview.md +0 -0
- package/docs/plugins/sdk-provider-plugins.md +0 -0
- package/docs/plugins/sdk-runtime.md +0 -0
- package/docs/plugins/sdk-setup.md +0 -0
- package/docs/plugins/sdk-subpaths.md +0 -0
- package/docs/plugins/sdk-testing.md +0 -0
- package/docs/plugins/skill-workshop.md +0 -0
- package/docs/plugins/tool-plugins.md +0 -0
- package/docs/plugins/voice-call.md +0 -0
- package/docs/plugins/webhooks.md +0 -0
- package/docs/plugins/workboard.md +0 -0
- package/docs/plugins/zalouser.md +0 -0
- package/docs/prose.md +0 -0
- package/docs/providers/alibaba.md +0 -0
- package/docs/providers/anthropic.md +0 -0
- package/docs/providers/arcee.md +0 -0
- package/docs/providers/azure-speech.md +0 -0
- package/docs/providers/bedrock-mantle.md +0 -0
- package/docs/providers/bedrock.md +0 -0
- package/docs/providers/cerebras.md +0 -0
- package/docs/providers/chutes.md +0 -0
- package/docs/providers/claude-max-api-proxy.md +0 -0
- package/docs/providers/cloudflare-ai-gateway.md +0 -0
- package/docs/providers/comfy.md +0 -0
- package/docs/providers/deepgram.md +0 -0
- package/docs/providers/deepinfra.md +0 -0
- package/docs/providers/deepseek.md +0 -0
- package/docs/providers/ds4.md +0 -0
- package/docs/providers/elevenlabs.md +0 -0
- package/docs/providers/fal.md +0 -0
- package/docs/providers/fireworks.md +0 -0
- package/docs/providers/github-copilot.md +0 -0
- package/docs/providers/gmi.md +0 -0
- package/docs/providers/google.md +0 -0
- package/docs/providers/gradium.md +0 -0
- package/docs/providers/groq.md +0 -0
- package/docs/providers/huggingface.md +0 -0
- package/docs/providers/index.md +0 -0
- package/docs/providers/inferrs.md +0 -0
- package/docs/providers/inworld.md +0 -0
- package/docs/providers/kilocode.md +0 -0
- package/docs/providers/litellm.md +0 -0
- package/docs/providers/lmstudio.md +0 -0
- package/docs/providers/minimax.md +0 -0
- package/docs/providers/mistral.md +0 -0
- package/docs/providers/models.md +0 -0
- package/docs/providers/moonshot.md +0 -0
- package/docs/providers/novita.md +0 -0
- package/docs/providers/nvidia.md +0 -0
- package/docs/providers/ollama-cloud.md +0 -0
- package/docs/providers/ollama.md +0 -0
- package/docs/providers/openai.md +0 -0
- package/docs/providers/opencode-go.md +0 -0
- package/docs/providers/opencode.md +0 -0
- package/docs/providers/openrouter.md +0 -0
- package/docs/providers/perplexity-provider.md +0 -0
- package/docs/providers/pixverse.md +0 -0
- package/docs/providers/qianfan.md +0 -0
- package/docs/providers/qwen-oauth.md +0 -0
- package/docs/providers/qwen.md +0 -0
- package/docs/providers/runway.md +0 -0
- package/docs/providers/senseaudio.md +0 -0
- package/docs/providers/sglang.md +0 -0
- package/docs/providers/stepfun.md +0 -0
- package/docs/providers/synthetic.md +0 -0
- package/docs/providers/tencent.md +0 -0
- package/docs/providers/together.md +0 -0
- package/docs/providers/venice.md +0 -0
- package/docs/providers/vercel-ai-gateway.md +0 -0
- package/docs/providers/vllm.md +0 -0
- package/docs/providers/volcengine.md +0 -0
- package/docs/providers/vydra.md +0 -0
- package/docs/providers/xai.md +0 -0
- package/docs/providers/xiaomi.md +0 -0
- package/docs/providers/zai.md +0 -0
- package/docs/refactor/access.md +0 -0
- package/docs/refactor/acp.md +0 -0
- package/docs/refactor/canvas.md +0 -0
- package/docs/refactor/database-first.md +0 -0
- package/docs/refactor/ingress-core.md +0 -0
- package/docs/reference/AGENTS.default.md +0 -0
- package/docs/reference/RELEASING.md +0 -0
- package/docs/reference/api-usage-costs.md +0 -0
- package/docs/reference/application-modernization-plan.md +0 -0
- package/docs/reference/code-mode.md +0 -0
- package/docs/reference/credits.md +0 -0
- package/docs/reference/device-models.md +0 -0
- package/docs/reference/fengming-sdk-api-design.md +0 -0
- package/docs/reference/full-release-validation.md +0 -0
- package/docs/reference/memory-config.md +0 -0
- package/docs/reference/prompt-caching.md +0 -0
- package/docs/reference/release-performance-sweep.md +0 -0
- package/docs/reference/rich-output-protocol.md +0 -0
- package/docs/reference/rpc.md +0 -0
- package/docs/reference/secret-placeholder-conventions.md +0 -0
- package/docs/reference/secretref-credential-surface.md +0 -0
- package/docs/reference/secretref-user-supplied-credentials-matrix.json +0 -0
- package/docs/reference/session-management-compaction.md +0 -0
- package/docs/reference/templates/AGENTS.dev.md +0 -0
- package/docs/reference/templates/AGENTS.md +0 -0
- package/docs/reference/templates/BOOT.md +0 -0
- package/docs/reference/templates/BOOTSTRAP.md +0 -0
- package/docs/reference/templates/CLAUDE.md +0 -0
- package/docs/reference/templates/HEARTBEAT.md +0 -0
- package/docs/reference/templates/IDENTITY.dev.md +0 -0
- package/docs/reference/templates/IDENTITY.md +0 -0
- package/docs/reference/templates/SOUL.dev.md +0 -0
- package/docs/reference/templates/SOUL.md +0 -0
- package/docs/reference/templates/TOOLS.dev.md +0 -0
- package/docs/reference/templates/TOOLS.md +0 -0
- package/docs/reference/templates/USER.dev.md +0 -0
- package/docs/reference/templates/USER.md +0 -0
- package/docs/reference/test.md +0 -0
- package/docs/reference/token-use.md +0 -0
- package/docs/reference/transcript-hygiene.md +0 -0
- package/docs/reference/wizard.md +0 -0
- package/docs/security/CONTRIBUTING-THREAT-MODEL.md +0 -0
- package/docs/security/THREAT-MODEL-ATLAS.md +0 -0
- package/docs/security/formal-verification.md +0 -0
- package/docs/security/incident-response.md +0 -0
- package/docs/security/network-proxy.md +0 -0
- package/docs/snippets/plugin-publish/minimal-fengming.plugin.json +0 -0
- package/docs/snippets/plugin-publish/minimal-package.json +0 -0
- package/docs/specs/claw-supervisor.md +0 -0
- package/docs/start/bootstrapping.md +0 -0
- package/docs/start/docs-directory.md +0 -0
- package/docs/start/fengming.md +0 -0
- package/docs/start/getting-started.md +0 -0
- package/docs/start/hubs.md +0 -0
- package/docs/start/lore.md +0 -0
- package/docs/start/onboarding-overview.md +0 -0
- package/docs/start/onboarding.md +0 -0
- package/docs/start/quickstart.md +0 -0
- package/docs/start/setup.md +0 -0
- package/docs/start/showcase.md +0 -0
- package/docs/start/wizard-cli-automation.md +0 -0
- package/docs/start/wizard-cli-reference.md +0 -0
- package/docs/start/wizard.md +0 -0
- package/docs/style.css +0 -0
- package/docs/superpowers/specs/2026-04-22-tweakcn-custom-theme-import-design.md +0 -0
- package/docs/tools/acp-agents-setup.md +0 -0
- package/docs/tools/acp-agents.md +0 -0
- package/docs/tools/agent-send.md +0 -0
- package/docs/tools/apply-patch.md +0 -0
- package/docs/tools/brave-search.md +0 -0
- package/docs/tools/browser-control.md +0 -0
- package/docs/tools/browser-linux-troubleshooting.md +0 -0
- package/docs/tools/browser-login.md +0 -0
- package/docs/tools/browser-wsl2-windows-remote-cdp-troubleshooting.md +0 -0
- package/docs/tools/browser.md +0 -0
- package/docs/tools/btw.md +0 -0
- package/docs/tools/capability-cookbook.md +0 -0
- package/docs/tools/clawhub.md +0 -0
- package/docs/tools/code-execution.md +0 -0
- package/docs/tools/creating-skills.md +0 -0
- package/docs/tools/diffs.md +0 -0
- package/docs/tools/duckduckgo-search.md +0 -0
- package/docs/tools/elevated.md +0 -0
- package/docs/tools/exa-search.md +0 -0
- package/docs/tools/exec-approvals-advanced.md +0 -0
- package/docs/tools/exec-approvals.md +0 -0
- package/docs/tools/exec.md +0 -0
- package/docs/tools/firecrawl.md +0 -0
- package/docs/tools/gemini-search.md +0 -0
- package/docs/tools/goal.md +0 -0
- package/docs/tools/grok-search.md +0 -0
- package/docs/tools/image-generation.md +0 -0
- package/docs/tools/index.md +0 -0
- package/docs/tools/kimi-search.md +0 -0
- package/docs/tools/llm-task.md +0 -0
- package/docs/tools/lobster.md +0 -0
- package/docs/tools/loop-detection.md +0 -0
- package/docs/tools/media-overview.md +0 -0
- package/docs/tools/minimax-search.md +0 -0
- package/docs/tools/multi-agent-sandbox-tools.md +0 -0
- package/docs/tools/music-generation.md +0 -0
- package/docs/tools/ollama-search.md +0 -0
- package/docs/tools/pdf.md +0 -0
- package/docs/tools/perplexity-search.md +0 -0
- package/docs/tools/plugin.md +0 -0
- package/docs/tools/reactions.md +0 -0
- package/docs/tools/searxng-search.md +0 -0
- package/docs/tools/skills-config.md +0 -0
- package/docs/tools/skills.md +0 -0
- package/docs/tools/slash-commands.md +0 -0
- package/docs/tools/steer.md +0 -0
- package/docs/tools/subagents.md +0 -0
- package/docs/tools/tavily.md +0 -0
- package/docs/tools/thinking.md +0 -0
- package/docs/tools/tokenjuice.md +0 -0
- package/docs/tools/tool-search.md +0 -0
- package/docs/tools/trajectory.md +0 -0
- package/docs/tools/tts.md +0 -0
- package/docs/tools/video-generation.md +0 -0
- package/docs/tools/web-fetch.md +0 -0
- package/docs/tools/web.md +0 -0
- package/docs/tts.md +0 -0
- package/docs/vps.md +0 -0
- package/docs/web/control-ui.md +0 -0
- package/docs/web/dashboard.md +0 -0
- package/docs/web/index.md +0 -0
- package/docs/web/tui.md +0 -0
- package/docs/web/webchat.md +0 -0
- package/npm-shrinkwrap.json +0 -0
- package/package.json +110 -114
- package/patches/.gitkeep +0 -0
- package/patches/@agentclientprotocol__claude-agent-acp@0.37.0.patch +0 -0
- package/pnpm-workspace.yaml +0 -0
- package/scripts/crabbox-wrapper.mjs +0 -0
- package/scripts/lib/official-external-channel-catalog.json +0 -0
- package/scripts/lib/official-external-plugin-catalog.json +0 -0
- package/scripts/lib/official-external-provider-catalog.json +0 -0
- package/scripts/lib/package-dist-imports.mjs +0 -0
- package/scripts/npm-runner.mjs +0 -0
- package/scripts/postinstall-bundled-plugins.mjs +0 -0
- package/scripts/preinstall-package-manager-warning.mjs +0 -0
- package/scripts/prepare-git-hooks.mjs +0 -0
- package/scripts/windows-cmd-helpers.mjs +0 -0
- package/skills/canvas/SKILL.md +0 -0
- package/skills/clawhub/SKILL.md +0 -0
- package/skills/coding-agent/SKILL.md +0 -0
- package/skills/diagram-maker/SKILL.md +0 -0
- package/skills/diagram-maker/references/excalidraw-patterns.md +0 -0
- package/skills/diagram-maker/references/svg-template.md +0 -0
- package/skills/gemini/SKILL.md +0 -0
- package/skills/gh-issues/SKILL.md +0 -0
- package/skills/gifgrep/SKILL.md +0 -0
- package/skills/github/SKILL.md +0 -0
- package/skills/healthcheck/SKILL.md +0 -0
- package/skills/mcporter/SKILL.md +0 -0
- package/skills/meme-maker/SKILL.md +0 -0
- package/skills/meme-maker/references/templates.json +0 -0
- package/skills/meme-maker/scripts/meme.mjs +0 -0
- package/skills/model-usage/SKILL.md +0 -0
- package/skills/model-usage/references/codexbar-cli.md +0 -0
- package/skills/model-usage/scripts/model_usage.py +0 -0
- package/skills/model-usage/scripts/test_model_usage.py +0 -0
- package/skills/nano-pdf/SKILL.md +0 -0
- package/skills/node-connect/SKILL.md +0 -0
- package/skills/node-inspect-debugger/SKILL.md +0 -0
- package/skills/openai-whisper/SKILL.md +0 -0
- package/skills/openai-whisper-api/SKILL.md +0 -0
- package/skills/openai-whisper-api/scripts/transcribe.sh +0 -0
- package/skills/oracle/SKILL.md +0 -0
- package/skills/pyproject.toml +0 -0
- package/skills/python-debugpy/SKILL.md +0 -0
- package/skills/sag/SKILL.md +0 -0
- package/skills/session-logs/SKILL.md +0 -0
- package/skills/sherpa-onnx-tts/SKILL.md +0 -0
- package/skills/sherpa-onnx-tts/bin/sherpa-onnx-tts +0 -0
- package/skills/skill-creator/SKILL.md +0 -0
- package/skills/skill-creator/license.txt +0 -0
- package/skills/skill-creator/scripts/init_skill.py +0 -0
- package/skills/skill-creator/scripts/package_skill.py +0 -0
- package/skills/skill-creator/scripts/quick_validate.py +0 -0
- package/skills/skill-creator/scripts/test_package_skill.py +0 -0
- package/skills/skill-creator/scripts/test_quick_validate.py +0 -0
- package/skills/spike/SKILL.md +0 -0
- package/skills/summarize/SKILL.md +0 -0
- package/skills/taskflow/SKILL.md +0 -0
- package/skills/taskflow/examples/inbox-triage.lobster +0 -0
- package/skills/taskflow/examples/pr-intake.lobster +0 -0
- package/skills/taskflow-inbox-triage/SKILL.md +0 -0
- package/skills/video-frames/SKILL.md +0 -0
- package/skills/video-frames/scripts/frame.sh +0 -0
- package/skills/voice-call/SKILL.md +0 -0
- package/skills/weather/SKILL.md +0 -0
- package/src/agents/templates/HEARTBEAT.md +0 -0
- package/dist/control-ui/assets/i18n-COx0mMoe.js +0 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./agents-
|
|
2
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{a as t,c as n,d as r,f as i,h as a,i as o,l as s,m as c,n as l,o as u,p as d,r as f,s as p,u as m}from"./lit-runtime-DA0-mbwP.js";import{a as h,i as g,n as _,r as v,t as y}from"./i18n-COx0mMoe.js";import{i as b,n as x,r as S,t as C}from"./gateway-runtime-CMyVbEq5.js";import{n as w,r as T,t as E}from"./string-coerce-BuYUxt7q.js";import{n as D,r as O,t as ee}from"./config-runtime-CCw2hptH.js";import{_ as k,a as te,c as A,d as j,f as M,g as N,h as P,i as F,l as ne,m as re,n as ie,o as ae,p as oe,r as se,s as ce,t as le,u as I,v as ue}from"./markdown-runtime-C9Jq8Bu5.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function de(e){if(typeof e==`string`)return e.trim()||void 0}function fe(e){if(!Array.isArray(e))return;let t=e.map(e=>de(e)).filter(e=>!!e);return t.length>0?t:void 0}var L={AUTH_REQUIRED:`AUTH_REQUIRED`,AUTH_UNAUTHORIZED:`AUTH_UNAUTHORIZED`,AUTH_TOKEN_MISSING:`AUTH_TOKEN_MISSING`,AUTH_TOKEN_MISMATCH:`AUTH_TOKEN_MISMATCH`,AUTH_TOKEN_NOT_CONFIGURED:`AUTH_TOKEN_NOT_CONFIGURED`,AUTH_PASSWORD_MISSING:`AUTH_PASSWORD_MISSING`,AUTH_PASSWORD_MISMATCH:`AUTH_PASSWORD_MISMATCH`,AUTH_PASSWORD_NOT_CONFIGURED:`AUTH_PASSWORD_NOT_CONFIGURED`,AUTH_BOOTSTRAP_TOKEN_INVALID:`AUTH_BOOTSTRAP_TOKEN_INVALID`,AUTH_DEVICE_TOKEN_MISMATCH:`AUTH_DEVICE_TOKEN_MISMATCH`,AUTH_SCOPE_MISMATCH:`AUTH_SCOPE_MISMATCH`,AUTH_RATE_LIMITED:`AUTH_RATE_LIMITED`,AUTH_TAILSCALE_IDENTITY_MISSING:`AUTH_TAILSCALE_IDENTITY_MISSING`,AUTH_TAILSCALE_PROXY_MISSING:`AUTH_TAILSCALE_PROXY_MISSING`,AUTH_TAILSCALE_WHOIS_FAILED:`AUTH_TAILSCALE_WHOIS_FAILED`,AUTH_TAILSCALE_IDENTITY_MISMATCH:`AUTH_TAILSCALE_IDENTITY_MISMATCH`,CONTROL_UI_ORIGIN_NOT_ALLOWED:`CONTROL_UI_ORIGIN_NOT_ALLOWED`,PROTOCOL_MISMATCH:`PROTOCOL_MISMATCH`,CONTROL_UI_DEVICE_IDENTITY_REQUIRED:`CONTROL_UI_DEVICE_IDENTITY_REQUIRED`,DEVICE_IDENTITY_REQUIRED:`DEVICE_IDENTITY_REQUIRED`,DEVICE_AUTH_INVALID:`DEVICE_AUTH_INVALID`,DEVICE_AUTH_DEVICE_ID_MISMATCH:`DEVICE_AUTH_DEVICE_ID_MISMATCH`,DEVICE_AUTH_SIGNATURE_EXPIRED:`DEVICE_AUTH_SIGNATURE_EXPIRED`,DEVICE_AUTH_NONCE_REQUIRED:`DEVICE_AUTH_NONCE_REQUIRED`,DEVICE_AUTH_NONCE_MISMATCH:`DEVICE_AUTH_NONCE_MISMATCH`,DEVICE_AUTH_SIGNATURE_INVALID:`DEVICE_AUTH_SIGNATURE_INVALID`,DEVICE_AUTH_PUBLIC_KEY_INVALID:`DEVICE_AUTH_PUBLIC_KEY_INVALID`,PAIRING_REQUIRED:`PAIRING_REQUIRED`,CLIENT_VERSION_MISMATCH:`CLIENT_VERSION_MISMATCH`},pe={NOT_PAIRED:`not-paired`,ROLE_UPGRADE:`role-upgrade`,SCOPE_UPGRADE:`scope-upgrade`,METADATA_UPGRADE:`metadata-upgrade`},me=new Set([`retry_with_device_token`,`update_auth_configuration`,`update_auth_credentials`,`wait_then_retry`,`review_auth_configuration`]),he=new Set([`not-paired`,`role-upgrade`,`scope-upgrade`,`metadata-upgrade`]),ge=/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/,_e={"not-paired":{requirement:`device is not approved yet`,remediationHint:`Approve this device from the pending pairing requests.`,recoveryTitle:`Gateway pairing approval required.`},"role-upgrade":{requirement:`device is asking for a higher role than currently approved`,remediationHint:`Review the requested role upgrade, then approve the pending request.`,recoveryTitle:`Gateway role upgrade approval required.`},"scope-upgrade":{requirement:`device is asking for more scopes than currently approved`,remediationHint:`Review the requested scopes, then approve the pending upgrade.`,recoveryTitle:`Gateway scope upgrade approval required.`},"metadata-upgrade":{requirement:`device identity changed and must be re-approved`,remediationHint:`Review the refreshed device details, then approve the pending request.`,recoveryTitle:`Gateway device refresh approval required.`}},ve={"not-paired":`device pairing required`,"role-upgrade":`role upgrade pending approval`,"scope-upgrade":`scope upgrade pending approval`,"metadata-upgrade":`device metadata change pending approval`};function ye(e){if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e.code;return typeof t==`string`&&t.trim().length>0?t:null}function be(e){if(!e||typeof e!=`object`||Array.isArray(e))return{};let t=e,n=typeof t.canRetryWithDeviceToken==`boolean`?t.canRetryWithDeviceToken:void 0,r=de(t.recommendedNextStep)??``;return{canRetryWithDeviceToken:n,recommendedNextStep:me.has(r)?r:void 0}}function xe(e){let t=de(e)??``;return he.has(t)?t:void 0}function Se(e){let t=de(e);return t&&ge.test(t)?t:void 0}function Ce(e){return fe(e)}function we(e){return{code:L.PAIRING_REQUIRED,...e.reason?{reason:e.reason}:{},...e.requestId?{requestId:e.requestId}:{},...e.remediationHint?{remediationHint:e.remediationHint}:{},...e.recommendedNextStep?{recommendedNextStep:e.recommendedNextStep}:{},...e.retryable===void 0?{}:{retryable:e.retryable},...e.pauseReconnect===void 0?{}:{pauseReconnect:e.pauseReconnect},...e.deviceId?{deviceId:e.deviceId}:{},...e.requestedRole?{requestedRole:e.requestedRole}:{},...e.requestedScopes?{requestedScopes:e.requestedScopes}:{},...e.approvedRoles?{approvedRoles:e.approvedRoles}:{},...e.approvedScopes?{approvedScopes:e.approvedScopes}:{}}}function Te(e){return e?_e[e].requirement:`device approval is required`}function Ee(e){return e?_e[e].remediationHint:`Approve the pending device request before retrying.`}function De(e){if(ye(e)!==L.PAIRING_REQUIRED||!e||typeof e!=`object`||Array.isArray(e))return null;let t=e,n=xe(t.reason),r=Se(t.requestId),i=de(t.remediationHint)??Ee(n),a=de(t.recommendedNextStep)??``,o=me.has(a)?a:void 0,s=de(t.deviceId),c=de(t.requestedRole),l=Ce(t.requestedScopes),u=Ce(t.approvedRoles),d=Ce(t.approvedScopes);return we({reason:n,requestId:r,remediationHint:i,recommendedNextStep:o,retryable:typeof t.retryable==`boolean`?t.retryable:void 0,pauseReconnect:typeof t.pauseReconnect==`boolean`?t.pauseReconnect:void 0,deviceId:s,requestedRole:c,requestedScopes:l,approvedRoles:u,approvedScopes:d})}function Oe(e){let t=de(e);if(!t)return null;let n=t.trim().toLowerCase(),r;for(let[e,t]of Object.entries(ve))if(n.includes(t)){r=e;break}if(!r&&n.includes(`pairing required`)&&(r=pe.NOT_PAIRED),!r)return null;let i=Se(t.match(/\(requestId:\s*([^\s)]+)\)/i)?.[1]);return{...i?{requestId:i}:{},reason:r}}function ke(e){let t=De(e),n=ve[t?.reason??pe.NOT_PAIRED];return t?.requestId?`${n} (requestId: ${t.requestId})`:n}function Ae(e){return ye(e.details)===L.PAIRING_REQUIRED?ke(e.details):ye(e.details)===L.PROTOCOL_MISMATCH?je(e.message,e.details):de(e.message)??`gateway request failed`}function je(e,t){let n=t,r=Me(n.clientMinProtocol),i=Me(n.clientMaxProtocol),a=Me(n.expectedProtocol),o=Me(n.minimumProbeProtocol),s=[];r!==void 0&&i!==void 0&&s.push(r===i?`Control UI v${r}`:`Control UI v${r}-v${i}`),a!==void 0&&s.push(`Gateway v${a}`),o!==void 0&&s.push(`probe min v${o}`);let c=de(e)??`protocol mismatch`;return s.length>0?`${c}: ${s.join(`, `)}`:c}function Me(e){return typeof e==`number`&&Number.isInteger(e)&&e>0?e:void 0}var Ne={WEBCHAT_UI:`webchat-ui`,CONTROL_UI:`fengming-control-ui`,TUI:`fengming-tui`,WEBCHAT:`webchat`,CLI:`cli`,GATEWAY_CLIENT:`gateway-client`,MACOS_APP:`fengming-macos`,IOS_APP:`fengming-ios`,ANDROID_APP:`fengming-android`,NODE_HOST:`node-host`,TEST:`test`,FINGERPRINT:`fingerprint`,PROBE:`fengming-probe`},Pe=Ne,Fe={WEBCHAT:`webchat`,CLI:`cli`,UI:`ui`,BACKEND:`backend`,NODE:`node`,PROBE:`probe`,TEST:`test`};new Set(Object.values(Ne)),new Set(Object.values(Fe));var Ie=100,Le=2e3;function Re(e){return typeof e==`object`&&!!e&&e.reason===`startup-sidecars`}function ze(e){if(!e||typeof e!=`object`)return!1;let t=e;return(t.gatewayCode??t.code)===`UNAVAILABLE`&&t.retryable===!0&&Re(t.details)}function Be(e){if(!ze(e))return null;let t=e.retryAfterMs;return Math.min(Math.max(Math.floor(typeof t==`number`&&Number.isFinite(t)?t:500),Ie),Le)}function Ve(e){let t=e.scopes.join(`,`),n=e.token??``;return[`v2`,e.deviceId,e.clientId,e.clientMode,e.role,t,String(e.signedAtMs),n,e.nonce].join(`|`)}function He(e){return e.trim()}function Ue(e){if(!Array.isArray(e))return[];let t=new Set;for(let n of e){if(typeof n!=`string`)continue;let e=n.trim();e&&t.add(e)}return t.has(`operator.admin`)?(t.add(`operator.read`),t.add(`operator.write`)):t.has(`operator.write`)&&t.add(`operator.read`),[...t].toSorted()}function We(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Ge(e){return We(e)?e:void 0}function Ke(e){return e&&typeof e==`object`?e:void 0}function qe(e,t){if(!We(t)||typeof t.token!=`string`)return null;let n=typeof t.updatedAtMs==`number`&&Number.isFinite(t.updatedAtMs)?t.updatedAtMs:0;return{token:t.token,role:e,scopes:Ue(Array.isArray(t.scopes)?t.scopes:void 0),updatedAtMs:n}}function Je(e){let t={};for(let[n,r]of Object.entries(e)){let e=He(n);if(!e)continue;let i=qe(e,r);i&&(t[e]=i)}return t}function Ye(e){let t=e.adapter.readStore();if(!t||t.deviceId!==e.deviceId)return null;let n=He(e.role);return qe(n,t.tokens[n])}function Xe(e){let t=He(e.role),n=e.adapter.readStore(),r={version:1,deviceId:e.deviceId,tokens:n&&n.deviceId===e.deviceId&&n.tokens?Je(n.tokens):{}},i={token:e.token,role:t,scopes:Ue(e.scopes),updatedAtMs:Date.now()};return r.tokens[t]=i,e.adapter.writeStore(r),i}function Ze(e){let t=e.adapter.readStore();if(!t||t.deviceId!==e.deviceId)return;let n=He(e.role);if(!t.tokens[n])return;let r={version:1,deviceId:t.deviceId,tokens:Je(t.tokens)};delete r.tokens[n],e.adapter.writeStore(r)}function Qe(e){return!!e&&typeof e.getItem==`function`&&typeof e.setItem==`function`}function $e(e){let t=Object.getOwnPropertyDescriptor(globalThis,e);if(typeof process<`u`&&{}.VITEST)return t&&!t.get&&Qe(t.value)?t.value:null;if(typeof window<`u`&&typeof document<`u`)try{let t=window[e];return Qe(t)?t:null}catch{return null}return t&&!t.get&&Qe(t.value)?t.value:null}function et(){return $e(`localStorage`)}function tt(){return $e(`sessionStorage`)}var nt=`fengming.device.auth.v1`;function rt(){try{let e=et()?.getItem(nt);if(!e)return null;let t=JSON.parse(e);return!t||t.version!==1||!t.deviceId||typeof t.deviceId!=`string`||!t.tokens||typeof t.tokens!=`object`?null:t}catch{return null}}function it(e){try{et()?.setItem(nt,JSON.stringify(e))}catch{}}function at(e){return Ye({adapter:{readStore:rt,writeStore:it},deviceId:e.deviceId,role:e.role})}function ot(e){return Xe({adapter:{readStore:rt,writeStore:it},deviceId:e.deviceId,role:e.role,token:e.token,scopes:e.scopes})}function st(e){Ze({adapter:{readStore:rt,writeStore:it},deviceId:e.deviceId,role:e.role})}var ct=`fengming-device-identity-v1`;function lt(e){let t=``;for(let n of e)t+=String.fromCharCode(n);return btoa(t).replaceAll(`+`,`-`).replaceAll(`/`,`_`).replace(/=+$/g,``)}function ut(e){let t=e.replaceAll(`-`,`+`).replaceAll(`_`,`/`),n=t+`=`.repeat((4-t.length%4)%4),r=atob(n),i=new Uint8Array(r.length);for(let e=0;e<r.length;e+=1)i[e]=r.charCodeAt(e);return i}function dt(e){return Array.from(e).map(e=>e.toString(16).padStart(2,`0`)).join(``)}async function ft(e){let t=await crypto.subtle.digest(`SHA-256`,e.slice().buffer);return dt(new Uint8Array(t))}async function pt(){let e=b.randomSecretKey(),t=await x(e);return{deviceId:await ft(t),publicKey:lt(t),privateKey:lt(e)}}async function mt(){let e=et();try{let t=e?.getItem(ct);if(t){let n=JSON.parse(t);if(n?.version===1&&typeof n.deviceId==`string`&&typeof n.publicKey==`string`&&typeof n.privateKey==`string`){let t=await ft(ut(n.publicKey));if(t!==n.deviceId){let r={...n,deviceId:t};return e?.setItem(ct,JSON.stringify(r)),{deviceId:t,publicKey:n.publicKey,privateKey:n.privateKey}}return{deviceId:n.deviceId,publicKey:n.publicKey,privateKey:n.privateKey}}}}catch{}let t=await pt(),n={version:1,deviceId:t.deviceId,publicKey:t.publicKey,privateKey:t.privateKey,createdAtMs:Date.now()};return e?.setItem(ct,JSON.stringify(n)),t}async function ht(e,t){let n=ut(e);return lt(await S(new TextEncoder().encode(t),n))}var gt=!1;function _t(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 vt(){gt||(gt=!0,console.warn(`[uuid] crypto API missing; refusing insecure UUID generation`))}function yt(e=globalThis.crypto){if(e&&typeof e.randomUUID==`function`)return e.randomUUID();if(e&&typeof e.getRandomValues==`function`){let t=new Uint8Array(16);return e.getRandomValues(t),_t(t)}throw vt(),Error(`Web Crypto is required for UUID generation`)}var bt=class extends Error{constructor(e){super(Ae({message:e.message,details:xt(e.message,e.details)})),this.name=`GatewayRequestError`,this.gatewayCode=e.code,this.details=e.details,this.retryable=e.retryable===!0,this.retryAfterMs=e.retryAfterMs}};function xt(e,t){return ye(t)===L.PROTOCOL_MISMATCH||!e?.toLowerCase().includes(`protocol mismatch`)?t:{code:L.PROTOCOL_MISMATCH,clientMinProtocol:4,clientMaxProtocol:4,...t&&typeof t==`object`&&!Array.isArray(t)?t:{}}}function St(e){return ye(e?.details)}function Ct(e){let t=De(e);return t?.pauseReconnect===!1||t?.recommendedNextStep===`wait_then_retry`}function wt(e){if(!e)return!1;let t=St(e);return t===L.PAIRING_REQUIRED&&Ct(e.details)?!1:t===L.AUTH_TOKEN_MISSING||t===L.AUTH_BOOTSTRAP_TOKEN_INVALID||t===L.AUTH_PASSWORD_MISSING||t===L.AUTH_PASSWORD_MISMATCH||t===L.AUTH_RATE_LIMITED||t===L.AUTH_DEVICE_TOKEN_MISMATCH||t===L.AUTH_SCOPE_MISMATCH||t===L.PAIRING_REQUIRED||t===L.CONTROL_UI_DEVICE_IDENTITY_REQUIRED||t===L.DEVICE_IDENTITY_REQUIRED}function Tt(e){let t=e.split(`.`);return t.length!==4||t[0]!==`127`?!1:t.every(e=>{if(!/^\d+$/.test(e))return!1;let t=Number(e);return t>=0&&t<=255})}function Et(e){try{let t=new URL(e,window.location.href),n=t.hostname.trim().toLowerCase(),r=n===`localhost`||n===`::1`||n===`[::1]`,i=Tt(n);if(r||i)return!0;let a=new URL(window.location.href);return t.host===a.host}catch{return!1}}var Dt=`operator`,Ot=[`operator.admin`,`operator.read`,`operator.write`,`operator.approvals`,`operator.pairing`],kt=4008,At=4013,jt=1006,Mt=`BROWSER_WEBSOCKET_CONSTRUCTOR_ERROR`,Nt=`BROWSER_WEBSOCKET_SECURITY_ERROR`;function Pt(e){let t=e.authToken;if(t||e.authPassword)return{token:t,deviceToken:e.authDeviceToken??e.resolvedDeviceToken,password:e.authPassword}}function Ft(e){return e instanceof Error&&e.message?e.message:String(e)}function It(e){if(e instanceof Error&&e.name)return e.name;if(e&&typeof e==`object`&&`name`in e){let t=e.name;return typeof t==`string`&&t.trim()?t:void 0}}function Lt(e){let t=It(e)?.toLowerCase(),n=Ft(e).toLowerCase();return t===`securityerror`||n.includes(`security error`)||n.includes(`mixed content`)||n.includes(`insecure websocket`)}function Rt(e,t){let n=Lt(e),r=Ft(e),i=t.trim().toLowerCase().startsWith(`ws://`);return n?{code:Nt,message:`Browser refused the Gateway WebSocket for security reasons.`+(i?` Use wss:// when the Control UI is served over HTTPS/Tailscale Serve, or open the loopback dashboard at http://127.0.0.1:18789.`:` Check the Gateway WebSocket URL and browser security policy.`),details:{code:Nt,browserErrorName:It(e),browserMessage:r}}:{code:Mt,message:`Could not create the Gateway WebSocket: ${r}`,details:{code:Mt,browserErrorName:It(e),browserMessage:r}}}function zt(e){return e.storedToken&&(e.resolvedDeviceToken===e.storedToken||e.authDeviceToken===e.storedToken)&&e.storedScopes&&e.storedScopes.length>0?[...e.storedScopes]:[...Ot]}async function Bt(e){let{deviceIdentity:t}=e;if(!t)return;let n=Date.now(),r=e.connectNonce??``,i=Ve({deviceId:t.deviceId,clientId:e.client.id,clientMode:e.client.mode,role:e.role,scopes:e.scopes,signedAtMs:n,token:e.authToken??null,nonce:r}),a=await ht(t.privateKey,i);return{id:t.deviceId,publicKey:t.publicKey,signature:a,signedAt:n,nonce:r}}function Vt(e){return!e.deviceTokenRetryBudgetUsed&&!e.authDeviceToken&&!!e.explicitGatewayToken&&!!e.deviceIdentity&&!!e.storedToken&&e.canRetryWithDeviceTokenHint&&Et(e.url)}var Ht=class{constructor(e){this.opts=e,this.ws=null,this.pending=new Map,this.closed=!1,this.lastSeq=null,this.connectNonce=null,this.connectSent=!1,this.connectTimer=null,this.connectGeneration=0,this.backoffMs=800,this.pendingDeviceTokenRetry=!1,this.deviceTokenRetryBudgetUsed=!1,this.pendingStartupReconnectDelayMs=null,this.eventListeners=new Set}start(){this.closed=!1,this.connect()}stop(){this.closed=!0,this.clearConnectTimer(),this.ws?.close(),this.ws=null,this.pendingConnectError=void 0,this.pendingDeviceTokenRetry=!1,this.deviceTokenRetryBudgetUsed=!1,this.pendingStartupReconnectDelayMs=null,this.flushPending(Error(`网关客户端已停止`))}get connected(){return this.ws?.readyState===WebSocket.OPEN}connect(){if(this.closed)return;let e;try{e=new WebSocket(this.opts.url)}catch(e){let t=Rt(e,this.opts.url);this.ws=null,this.pendingConnectError=void 0,this.pendingDeviceTokenRetry=!1,this.pendingStartupReconnectDelayMs=null,this.flushPending(Error(t.message)),this.opts.onClose?.({code:jt,reason:t.code===Nt?`security error`:`websocket error`,error:t});return}let t=++this.connectGeneration;this.ws=e,e.addEventListener(`open`,()=>this.queueConnect(e,t)),e.addEventListener(`message`,n=>{this.isActiveSocket(e,t)&&this.handleMessage(e,t,String(n.data??``))}),e.addEventListener(`close`,t=>{if(this.ws!==e)return;let n=t.reason??``,r=this.pendingConnectError;if(this.pendingConnectError=void 0,this.ws=null,this.pendingStartupReconnectDelayMs!==null){this.flushPending(Error(`gateway closed (${t.code}): ${n}`)),this.scheduleReconnect();return}if(this.flushPending(Error(`gateway closed (${t.code}): ${n}`)),this.opts.onClose?.({code:t.code,reason:n,error:r}),St(r)===L.AUTH_TOKEN_MISMATCH){this.pendingDeviceTokenRetry&&this.scheduleReconnect();return}wt(r)||this.scheduleReconnect()}),e.addEventListener(`error`,()=>{})}scheduleReconnect(){if(this.closed)return;let e=this.pendingStartupReconnectDelayMs;this.pendingStartupReconnectDelayMs=null;let t=e??this.backoffMs;e===null&&(this.backoffMs=Math.min(this.backoffMs*1.7,15e3)),this.clearConnectTimer(),this.connectTimer=window.setTimeout(()=>{this.connectTimer=null,this.connect()},t)}flushPending(e){for(let[t,n]of this.pending)this.emitRequestTiming(t,n,!1,`CLIENT_CLOSED`),n.reject(e);this.pending.clear()}nowMs(){return typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now()}emitRequestTiming(e,t,n,r){let i=this.nowMs();try{this.opts.onRequestTiming?.({id:e,method:t.method,ok:n,durationMs:Math.max(0,i-t.startedAtMs),startedAtMs:t.startedAtMs,endedAtMs:i,errorCode:r})}catch(e){console.error(`[gateway] request timing handler error:`,e)}}buildConnectClient(){return{id:this.opts.clientName??Pe.CONTROL_UI,version:this.opts.clientVersion??`control-ui`,platform:this.opts.platform??navigator.platform??`web`,mode:this.opts.mode??Fe.WEBCHAT,instanceId:this.opts.instanceId}}buildConnectParams(e){return{minProtocol:4,maxProtocol:4,client:e.client,role:e.role,scopes:e.scopes,device:e.device,caps:[`tool-events`],auth:e.auth,userAgent:navigator.userAgent,locale:navigator.language}}async buildConnectPlan(e){let t=Dt,n=this.buildConnectClient(),r=this.opts.token?.trim()||void 0,i=this.opts.password?.trim()||void 0,a=typeof crypto<`u`&&!!crypto.subtle,o=null,s={authToken:r,authPassword:i,canFallbackToShared:!1};a&&(o=await mt(),s=this.selectConnectAuth({role:t,deviceId:o.deviceId}));let c=zt(s);return{role:t,scopes:c,client:n,explicitGatewayToken:r,selectedAuth:s,auth:Pt(s),deviceIdentity:o,device:await Bt({deviceIdentity:o,client:n,role:t,scopes:c,authToken:s.authToken,connectNonce:e})}}handleConnectHello(e,t,n,r){this.isActiveSocket(n,r)&&(this.pendingDeviceTokenRetry=!1,this.deviceTokenRetryBudgetUsed=!1,this.pendingStartupReconnectDelayMs=null,e?.auth?.deviceToken&&t.deviceIdentity&&ot({deviceId:t.deviceIdentity.deviceId,role:e.auth.role??t.role,token:e.auth.deviceToken,scopes:e.auth.scopes??[]}),this.backoffMs=800,this.opts.onHello?.(e))}handleConnectFailure(e,t,n,r){if(!this.isActiveSocket(n,r))return;let i=e instanceof bt?St(e):null,a=e instanceof bt?be(e.details):{},o=a.recommendedNextStep===`retry_with_device_token`,s=a.canRetryWithDeviceToken===!0||o||i===L.AUTH_TOKEN_MISMATCH;Vt({deviceTokenRetryBudgetUsed:this.deviceTokenRetryBudgetUsed,authDeviceToken:t.selectedAuth.authDeviceToken,explicitGatewayToken:t.explicitGatewayToken,deviceIdentity:t.deviceIdentity,storedToken:t.selectedAuth.storedToken,canRetryWithDeviceTokenHint:s,url:this.opts.url})&&(this.pendingDeviceTokenRetry=!0,this.deviceTokenRetryBudgetUsed=!0),e instanceof bt?this.pendingConnectError={code:e.gatewayCode,message:e.message,details:e.details,retryable:e.retryable,retryAfterMs:e.retryAfterMs}:this.pendingConnectError=void 0,t.selectedAuth.storedToken&&(t.selectedAuth.resolvedDeviceToken===t.selectedAuth.storedToken||t.selectedAuth.authDeviceToken===t.selectedAuth.storedToken)&&t.deviceIdentity&&i===L.AUTH_DEVICE_TOKEN_MISMATCH&&st({deviceId:t.deviceIdentity.deviceId,role:t.role});let c=Be(e);if(c!==null&&(this.pendingStartupReconnectDelayMs=c),ze(e)){n.close(At,`gateway starting`);return}n.close(kt,`connect failed`)}isActiveSocket(e,t){return!this.closed&&this.ws===e&&this.connectGeneration===t}async sendConnect(e,t){if(!this.isActiveSocket(e,t)||e.readyState!==WebSocket.OPEN||this.connectSent)return;this.connectSent=!0,this.clearConnectTimer();let n=await this.buildConnectPlan(this.connectNonce);!this.isActiveSocket(e,t)||e.readyState!==WebSocket.OPEN||(this.pendingDeviceTokenRetry&&n.selectedAuth.authDeviceToken&&(this.pendingDeviceTokenRetry=!1),this.requestOnSocket(e,`connect`,this.buildConnectParams(n)).then(r=>this.handleConnectHello(r,n,e,t)).catch(r=>this.handleConnectFailure(r,n,e,t)))}handleMessage(e,t,n){let r;try{r=JSON.parse(n)}catch{return}let i=r;if(i.type===`event`){let n=r;if(n.event===`connect.challenge`){let r=n.payload,i=r&&typeof r.nonce==`string`?r.nonce:null;i&&(this.connectNonce=i,this.sendConnect(e,t));return}let i=typeof n.seq==`number`?n.seq:null;i!==null&&(this.lastSeq!==null&&i>this.lastSeq+1&&this.opts.onGap?.({expected:this.lastSeq+1,received:i}),this.lastSeq=i);try{this.opts.onEvent?.(n);for(let e of this.eventListeners)e(n)}catch(e){console.error(`[gateway] event handler error:`,e)}return}if(i.type===`res`){let e=r,t=this.pending.get(e.id);if(!t)return;this.pending.delete(e.id),e.ok?(this.emitRequestTiming(e.id,t,!0),t.resolve(e.payload)):(this.emitRequestTiming(e.id,t,!1,e.error?.code),t.reject(new bt({code:e.error?.code??`UNAVAILABLE`,message:e.error?.message??`request failed`,details:e.error?.details,retryable:e.error?.retryable,retryAfterMs:e.error?.retryAfterMs})));return}}selectConnectAuth(e){let t=this.opts.token?.trim()||void 0,n=this.opts.password?.trim()||void 0,r=at({deviceId:e.deviceId,role:e.role}),i=r?.scopes??[],a=e.role!==Dt||i.includes(`operator.read`)||i.includes(`operator.write`)||i.includes(`operator.admin`)?r?.token:void 0,o=this.pendingDeviceTokenRetry&&!!t&&!!a&&Et(this.opts.url),s=t||n?void 0:a??void 0;return{authToken:t??s,authDeviceToken:o?a??void 0:void 0,authPassword:n,resolvedDeviceToken:s,storedToken:a??void 0,storedScopes:r?.scopes??void 0,canFallbackToShared:!!(a&&t)}}request(e,t){return!this.ws||this.ws.readyState!==WebSocket.OPEN?Promise.reject(Error(`网关未连接`)):this.requestOnSocket(this.ws,e,t)}requestOnSocket(e,t,n){if(this.ws!==e||e.readyState!==WebSocket.OPEN)return Promise.reject(Error(`网关未连接`));let r=yt(),i={type:`req`,id:r,method:t,params:n},a=this.nowMs(),o=new Promise((e,n)=>{this.pending.set(r,{resolve:t=>e(t),reject:n,method:t,startedAtMs:a})});return e.send(JSON.stringify(i)),o}addEventListener(e){return this.eventListeners.add(e),()=>{this.eventListeners.delete(e)}}queueConnect(e,t){this.isActiveSocket(e,t)&&(this.connectNonce=null,this.connectSent=!1,this.clearConnectTimer(),this.connectTimer=window.setTimeout(()=>{this.connectTimer=null,this.sendConnect(e,t)},750))}clearConnectTimer(){this.connectTimer!==null&&(window.clearTimeout(this.connectTimer),this.connectTimer=null)}};function Ut(e){return e instanceof bt?St(e)===L.AUTH_UNAUTHORIZED?!0:e.message.includes(`missing scope: operator.read`):!1}function Wt(e){return`This connection is missing operator.read, so ${e} cannot be loaded yet.`}function Gt(e){return new Promise(t=>setTimeout(()=>t(`timeout`),e))}async function Kt(e,t,n={}){if(!e.client||!e.connected||e.channelsLoading&&(!e.channelsLoadingProbe||t))return;let r=(e.channelsRefreshSeq??0)+1;e.channelsRefreshSeq=r,e.channelsLoading=!0,e.channelsLoadingProbe=t,e.channelsError=null;let i=(async()=>{try{let n=await e.client.request(`channels.status`,{probe:t,timeoutMs:8e3});if(e.channelsRefreshSeq!==r)return;e.channelsSnapshot=n,e.channelsLastSuccess=Date.now()}catch(t){if(e.channelsRefreshSeq!==r)return;Ut(t)?(e.channelsSnapshot=null,e.channelsError=Wt(`channel status`)):e.channelsError=String(t)}finally{e.channelsRefreshSeq===r&&(e.channelsLoading=!1,e.channelsLoadingProbe=null)}})(),a=n.softTimeoutMs;if(typeof a==`number`&&a>0)return await Promise.race([i.then(()=>`done`),Gt(a)]),void 0;await i}function qt(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.prototype.toString.call(e)===`[object Object]`}var Jt=new Set([`__proto__`,`prototype`,`constructor`]);function Yt(e){return Jt.has(e)}function Xt(e){return qt(e)?typeof e.id==`string`&&e.id.length>0:!1}function Zt(e,t,n){if(!e.every(Xt))return;let r=[...e],i=new Map;for(let[e,t]of r.entries()){if(!Xt(t))return;i.set(t.id,e)}for(let e of t){if(!Xt(e)){r.push(structuredClone(e));continue}let t=i.get(e.id);if(t===void 0){r.push(structuredClone(e)),i.set(e.id,r.length-1);continue}r[t]=Qt(r[t],e,n)}return r}function Qt(e,t,n={}){if(!qt(t))return t;let r=qt(e)?{...e}:{};for(let[e,i]of Object.entries(t))if(!Yt(e)){if(i===null){delete r[e];continue}if(n.mergeObjectArraysById&&Array.isArray(r[e])&&Array.isArray(i)){let t=Zt(r[e],i,n);if(t){r[e]=t;continue}}if(qt(i)){let t=r[e];r[e]=Qt(qt(t)?t:{},i,n);continue}r[e]=i}return r}function $t(e){return(e??[]).map(e=>T(String(e))??``).filter(Boolean)}function en(e){return[...new Set(e)]}function tn(e){return en(e)}function nn(e){return tn(e).toSorted((e,t)=>e<t?-1:+(e>t))}function rn(e){if(e)return Array.isArray(e.type)?e.type.find(e=>e!==`null`)??e.type[0]:e.type}function an(e){if(!e)return``;if(e.default!==void 0)return e.default;switch(rn(e)){case`object`:return{};case`array`:return[];case`boolean`:return!1;case`number`:case`integer`:return 0;case`string`:return``;default:return``}}function on(e){return e.filter(e=>typeof e==`string`).join(`.`)}function sn(e,t){let n=t[on(e)];if(n)return n;let r=e.map(String);for(let[e,n]of Object.entries(t)){if(!e.includes(`*`))continue;let t=e.split(`.`);if(t.length!==r.length)continue;let i=!0;for(let e=0;e<r.length;e+=1)if(t[e]!==`*`&&t[e]!==r[e]){i=!1;break}if(i)return n}}function cn(e){return e.replace(/_/g,` `).replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/\s+/g,` `).replace(/^./,e=>e.toUpperCase())}var ln=[`maxtokens`,`maxoutputtokens`,`maxinputtokens`,`maxcompletiontokens`,`contexttokens`,`totaltokens`,`tokencount`,`tokenlimit`,`tokenbudget`,`passwordfile`],un=[/token$/i,/password/i,/secret/i,/api.?key/i,/serviceaccount(?:ref)?$/i],dn=/^\$\{[^}]*\}$/,fn=`[redacted - click reveal to view]`,pn=64,mn=2e4;function hn(){return{visited:0}}function gn(e,t){return!(t>pn||(e.visited+=1,e.visited>mn))}function _n(e){return dn.test(e.trim())}function vn(e){let t=E(e);return!ln.some(e=>t.endsWith(e))&&un.some(t=>t.test(e))}function yn(e){return typeof e==`string`?e.trim().length>0&&!_n(e):e!=null}function bn(e){return e?.sensitive??!1}function xn(e,t,n){return Sn(e,t,n,hn(),0)}function Sn(e,t,n,r,i){if(!gn(r,i))return!0;let a=on(t);return(bn(sn(t,n))||vn(a))&&yn(e)?!0:Array.isArray(e)?e.some((e,a)=>Sn(e,[...t,a],n,r,i+1)):e&&typeof e==`object`?Object.entries(e).some(([e,a])=>Sn(a,[...t,e],n,r,i+1)):!1}function Cn(e,t,n){return wn(e,t,n,hn(),0)}function wn(e,t,n,r,i){if(!gn(r,i))return 1;if(e==null)return 0;let a=on(t);return(bn(sn(t,n))||vn(a))&&yn(e)?1:Array.isArray(e)?e.reduce((e,a,o)=>e+wn(a,[...t,o],n,r,i+1),0):e&&typeof e==`object`?Object.entries(e).reduce((e,[a,o])=>e+wn(o,[...t,a],n,r,i+1),0):0}function Tn(e,t){let n=e.trim();if(n===``)return;let r=Number(n);return!Number.isFinite(r)||t&&!Number.isInteger(r)?e:r}function En(e){let t=e.trim();return t===`true`?!0:t===`false`?!1:e}function Dn(e,t){if(e==null)return e;if(t.allOf&&t.allOf.length>0){let n=e;for(let e of t.allOf)n=Dn(n,e);return n}let n=rn(t);if(t.anyOf||t.oneOf){let n=(t.anyOf??t.oneOf??[]).filter(e=>!(e.type===`null`||Array.isArray(e.type)&&e.type.includes(`null`)));if(n.length===1)return Dn(e,n[0]);if(typeof e==`string`)for(let t of n){let n=rn(t);if(n===`number`||n===`integer`){let t=Tn(e,n===`integer`);if(t===void 0||typeof t==`number`)return t}if(n===`boolean`){let t=En(e);if(typeof t==`boolean`)return t}}for(let t of n){let n=rn(t);if(n===`object`&&typeof e==`object`&&!Array.isArray(e)||n===`array`&&Array.isArray(e))return Dn(e,t)}return e}if(n===`number`||n===`integer`){if(typeof e==`string`){let t=Tn(e,n===`integer`);if(t===void 0||typeof t==`number`)return t}return e}if(n===`boolean`){if(typeof e==`string`){let t=En(e);if(typeof t==`boolean`)return t}return e}if(n===`string`)return typeof e==`string`&&e.length===0&&t.minLength?void 0:e;if(n===`object`){if(typeof e!=`object`||Array.isArray(e))return e;let n=e,r=t.properties??{},i=t.additionalProperties&&typeof t.additionalProperties==`object`?t.additionalProperties:null,a={};for(let[e,t]of Object.entries(n)){let n=r[e]??i,o=n?Dn(t,n):t;o!==void 0&&(a[e]=o)}return a}if(n===`array`){if(!Array.isArray(e))return e;if(Array.isArray(t.items)){let n=t.items;return e.map((e,t)=>{let r=t<n.length?n[t]:void 0;return r?Dn(e,r):e})}let n=t.items;return n?e.map(e=>Dn(e,n)).filter(e=>e!==void 0):e}return e}function On(e){return structuredClone(e)}function kn(e){return`${JSON.stringify(e,null,2).trimEnd()}\n`}var An=`__FENGMING_REDACTED__`,jn={omitted:!0};function Mn(e){return{omitted:!1,value:e}}function Nn(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function Pn(e,t){return e!=null&&Object.prototype.hasOwnProperty.call(e,t)}function Fn(e){if(e.value===An)return e.originalFormValue!==An||e.originalRawPathExists?Mn(e.value):e.canOmit?jn:Mn(e.value);if(Array.isArray(e.value)){let t=Array.isArray(e.originalFormValue)?e.originalFormValue:[],n=Array.isArray(e.originalRawValue)?e.originalRawValue:[];return Mn(e.value.map((e,r)=>{let i=Fn({value:e,originalFormValue:t[r],originalRawValue:n[r],originalRawPathExists:r in n,canOmit:!1});return i.omitted?e:i.value}))}if(!Nn(e.value))return Mn(e.value);let t=Nn(e.originalFormValue)?e.originalFormValue:null,n=Nn(e.originalRawValue)?e.originalRawValue:null,r={};for(let[i,a]of Object.entries(e.value)){let e=t!=null&&Object.prototype.hasOwnProperty.call(t,i)?t[i]:void 0,o=Pn(n,i),s=Fn({value:a,originalFormValue:e,originalRawValue:o?n?.[i]:void 0,originalRawPathExists:o,canOmit:!0});s.omitted||(r[i]=s.value)}return e.canOmit&&Object.keys(r).length===0&&!e.originalRawPathExists?jn:Mn(r)}function In(e,t,n){if(!t||!n)return e;let r;try{r=O.parse(n)}catch{return e}if(!Nn(r))return e;let i=Fn({value:e,originalFormValue:t,originalRawValue:r,originalRawPathExists:!0,canOmit:!1});return!i.omitted&&Nn(i.value)?i.value:e}var Ln=new Set([`__proto__`,`prototype`,`constructor`]);function Rn(e){return typeof e==`string`&&Ln.has(e)}function zn(e,t,n){if(t.length===0||t.some(Rn))return null;let r=e;for(let e=0;e<t.length-1;e+=1){let i=t[e],a=t[e+1];if(typeof i==`number`){if(!Array.isArray(r))return null;if(r[i]==null){if(!n)return null;r[i]=typeof a==`number`?[]:{}}r=r[i];continue}if(typeof r!=`object`||!r)return null;let o=r;if(o[i]==null){if(!n)return null;o[i]=typeof a==`number`?[]:{}}r=o[i]}return{current:r,lastKey:t[t.length-1]}}function Bn(e,t,n){let r=zn(e,t,!0);if(r){if(typeof r.lastKey==`number`){Array.isArray(r.current)&&(r.current[r.lastKey]=n);return}typeof r.current==`object`&&r.current!=null&&(r.current[r.lastKey]=n)}}function Vn(e,t){let n=zn(e,t,!1);if(n){if(typeof n.lastKey==`number`){Array.isArray(n.current)&&n.current.splice(n.lastKey,1);return}typeof n.current==`object`&&n.current!=null&&delete n.current[n.lastKey]}}var Hn=new WeakMap;async function Un(e,t={}){if(!(!e.client||!e.connected)){e.configLoading=!0,e.lastError=null;try{Jn(e,await e.client.request(`config.get`,{}),t)}catch(t){e.lastError=String(t)}finally{e.configLoading=!1}}}async function Wn(e){if(!(!e.client||!e.connected)&&!e.configSchemaLoading){e.configSchemaLoading=!0;try{Gn(e,await e.client.request(`config.schema`,{}))}catch(t){e.lastError=String(t)}finally{e.configSchemaLoading=!1}}}function Gn(e,t){e.configSchema=t.schema??null,e.configUiHints=t.uiHints??{},e.configSchemaVersion=t.version??null}function Kn(e){return!e||typeof e!=`object`||Array.isArray(e)?null:e}function qn(e){return Kn(e?.sourceConfig)??Kn(e?.resolved)??Kn(e?.config)}function Jn(e,t,n={}){let r=e.configFormDirty&&n.discardPendingChanges!==!0,i=e.configDraftBaseHash??e.configSnapshot?.hash??null;e.configSnapshot=t;let a=qn(t);!(typeof t.raw==`string`||a||e.configForm)&&e.configFormMode===`raw`&&(e.configFormMode=`form`);let o=typeof t.raw==`string`?t.raw:a?kn(a):e.configRaw;r?e.configFormMode!==`raw`&&e.configForm?e.configRaw=kn(e.configForm):e.configFormMode!==`raw`&&(e.configRaw=o):e.configRaw=o,e.configValid=typeof t.valid==`boolean`?t.valid:null,e.configIssues=Array.isArray(t.issues)?t.issues:[],r?e.configDraftBaseHash=i:(e.configForm=On(a??{}),e.configFormOriginal=On(a??{}),e.configRawOriginal=o,e.configFormDirty=!1,e.configDraftBaseHash=t.hash??null,Hn.delete(e))}function Yn(e){return!e||typeof e!=`object`||Array.isArray(e)?null:e}function Xn(e){if(e.configFormMode!==`form`||!e.configForm)return e.configRaw;let t=Yn(e.configSchema);return kn(In(t?Dn(e.configForm,t):e.configForm,e.configFormOriginal,e.configRawOriginal))}function Zn(e){let t=(e.status??`error`).trim()||`error`,n=(e.reason??`unexpected-error`).trim()||`unexpected-error`;return{tone:t===`skipped`?`warn`:`danger`,text:`Update ${t}: ${n}. ${{dirty:`Commit or stash changes, then retry.`,"no-upstream":`Set an upstream branch, then retry.`,"not-git-install":"Not a git checkout. Run `fengming update` from the CLI for a global reinstall.","not-fengming-root":`Run the update from an FengMing checkout or use the CLI global reinstall path.`,"deps-install-failed":`Dependency install failed. Fix the install error and retry.`,"build-failed":`Build failed. Fix the build error and retry.`,"ui-build-failed":`The control UI rebuild failed. Fix the UI build error and retry.`,"global-install-failed":`The global package install did not verify on disk. Retry or reinstall from the CLI.`,"restart-disabled":"The update was not applied because gateway restarts are disabled. Enable restarts in config, then retry — or run `fengming update` from the CLI.","restart-unavailable":`This global install cannot be safely replaced while restarts are disabled and no supervisor is present.`,"restart-unhealthy":`The replacement process never became healthy. The previous process stayed up so you can recover.`,"doctor-failed":"Doctor repair failed. Run `fengming doctor --non-interactive` and retry."}[n]??`See the gateway logs for the exact failure and retry once the cause is fixed.`}`}}async function Qn(e,t,n,r={}){if(!e.client||!e.connected)return!1;e[n]=!0,e.lastError=null;try{let n=Xn(e),i=e.configDraftBaseHash??e.configSnapshot?.hash;return i?(await e.client.request(t,{raw:n,baseHash:i,...r}),e.configFormDirty=!1,e.configDraftBaseHash=null,Hn.delete(e),await Un(e),!0):(e.lastError=`Config hash missing; reload and retry.`,!1)}catch(t){return e.lastError=String(t),!1}finally{e[n]=!1}}function $n(e,t){let n=On(e.configFormOriginal??qn(e.configSnapshot)??{}),r=kn(t),i=kn(n);e.configForm=t,e.configRaw=r,e.configFormDirty=r!==i}async function er(e){return Qn(e,`config.set`,`configSaving`)}async function tr(e){return Qn(e,`config.apply`,`configApplying`,{sessionKey:e.applySessionKey})}async function nr(e){if(!(!e.client||!e.connected)){e.updateRunning=!0,e.lastError=null,e.updateStatusBanner=null;try{let t=await e.client.request(`update.run`,{sessionKey:e.applySessionKey}),n=t.result?.status??(t.ok===!0?`ok`:`error`);if(n===`ok`&&t.ok===!0){e.pendingUpdateExpectedVersion=t.result?.after?.version??null;return}e.pendingUpdateExpectedVersion=null,e.updateStatusBanner=Zn({status:n,reason:t.result?.reason})}catch(t){e.lastError=String(t),e.pendingUpdateExpectedVersion=null}finally{e.updateRunning=!1}}}function rr(e,t){let n=On(e.configForm??qn(e.configSnapshot)??{});t(n),$n(e,n)}function ir(e,t){let n=Hn.get(e);n?n.add(t):Hn.set(e,new Set([t]))}function ar(e,t){let n=Hn.get(e);n&&(n.delete(t),n.size===0&&Hn.delete(e))}function or(e,t,n,r){if(n.length!==4||n[0]!==`plugins`||n[1]!==`entries`||typeof n[2]!=`string`||n[3]!==`enabled`)return;let i=n[2],a=t.plugins&&typeof t.plugins==`object`&&!Array.isArray(t.plugins)?t.plugins:null,o=Array.isArray(a?.allow)?a.allow:null;if(!o){ar(e,i);return}if(r===!0){if(o.includes(i))return;if(o.length===0){ar(e,i);return}Bn(t,[`plugins`,`allow`],[...o,i]),ir(e,i);return}Hn.get(e)?.has(i)&&(Bn(t,[`plugins`,`allow`],o.filter(e=>e!==i)),ar(e,i))}function sr(e,t,n){rr(e,r=>{if(Bn(r,t,n),t[0]===`plugins`&&t[1]===`allow`){Hn.delete(e);return}or(e,r,t,n)})}function cr(e,t){e.configRaw=t,e.configFormDirty=t!==e.configRawOriginal,e.configFormDirty?e.configDraftBaseHash=e.configDraftBaseHash??e.configSnapshot?.hash??null:e.configDraftBaseHash=e.configSnapshot?.hash??null}function lr(e,t){let n=qn(e.configSnapshot),r=e.configForm??n;if(!r||!e.configForm&&!e.configSnapshot?.hash)return;let i=Qt(On(r),t);!i||typeof i!=`object`||Array.isArray(i)||$n(e,On(i))}function ur(e){let t=qn(e.configSnapshot);e.configForm=On(e.configFormOriginal??t??{}),e.configRaw=e.configRawOriginal??kn(e.configFormOriginal??t??{}),e.configFormDirty=!1,e.configDraftBaseHash=e.configSnapshot?.hash??null,Hn.delete(e)}function dr(e,t){rr(e,e=>Vn(e,t))}function fr(e,t){let n=t.trim();if(!n)return-1;let r=e?.agents?.list;return Array.isArray(r)?r.findIndex(e=>e&&typeof e==`object`&&`id`in e&&e.id===n):-1}function pr(e,t){let n=t.trim();if(!n)return-1;let r=e.configForm??qn(e.configSnapshot),i=fr(r,n);if(i>=0)return i;let a=r?.agents?.list,o=Array.isArray(a)?a.length:0;return sr(e,[`agents`,`list`,o,`id`],n),o}function mr(e,t){let n=t.trim();if(!n)return!1;let r=fr(e.configForm??qn(e.configSnapshot),n);return r<0?!1:(rr(e,e=>{let t=e?.agents?.list;if(Array.isArray(t))for(let e=0;e<t.length;e++){let n=t[e];if(!n||typeof n!=`object`||Array.isArray(n))continue;let i=n;e===r?i.default=!0:delete i.default}}),!0)}async function hr(e){if(!(!e.client||!e.connected)){e.lastError=null;try{let t=await e.client.request(`config.openFile`,{});if(!t.ok){e.lastError=t.error||`Failed to open config file`;let n=t.path||e.configSnapshot?.path;if(n)try{await navigator.clipboard.writeText(n),e.lastError+=`\n\nFile path copied to clipboard: ${n}`}catch{e.lastError+=`\n\nFile path: ${n}`}}}catch(t){let n=e.configSnapshot?.path;if(n)try{await navigator.clipboard.writeText(n)}catch{}e.lastError=String(t)}}}async function gr(e){let t=await er(e),n=e.lastError;if(!t){await Un(e),n&&!e.lastError&&(e.lastError=n);return}await Kt(e,!0)}async function _r(e){await Un(e,{discardPendingChanges:!0}),await Kt(e,!0)}function vr(e,t){let n=t.trim();!n||e.settings.lastActiveSessionKey===n||e.applySettings({...e.settings,lastActiveSessionKey:n})}var yr=new Set([`tweakcn.com`,`www.tweakcn.com`]),br=/^[A-Za-z0-9][A-Za-z0-9_-]{7,127}$/,xr=`fengming-custom-theme`,Sr=2e5,Cr=240,wr=1e4,Tr=`"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif`,Er=`"JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, monospace`,Dr=[`url(`,`image(`,`image-set(`,`-webkit-image-set(`,`cross-fade(`,`element(`,`-moz-element(`,`paint(`,`@import`,`expression(`],Or=new Set([`black`,`white`,`transparent`,`currentcolor`]),kr=/^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([a-z0-9+\-.,/%\s]+\)$/i,Ar=/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,jr=new Set([`,`,`'`,`"`,`.`,`_`,`-`]),Mr=`bg.bg-accent.bg-elevated.bg-hover.bg-muted.bg-content.card.card-foreground.card-highlight.popover.popover-foreground.panel.panel-strong.panel-hover.chrome.chrome-strong.text.text-strong.chat-text.muted.muted-strong.muted-foreground.border.border-strong.border-hover.input.ring.accent.accent-hover.accent-muted.accent-subtle.accent-foreground.accent-glow.primary.primary-foreground.secondary.secondary-foreground.accent-2.accent-2-muted.accent-2-subtle.destructive.destructive-foreground.danger.danger-muted.danger-subtle.focus.focus-ring.focus-glow.font-body.font-display.mono.grid-line`.split(`.`),Nr=[`background`,`foreground`,`card`,`card-foreground`,`popover`,`popover-foreground`,`primary`,`primary-foreground`,`secondary`,`secondary-foreground`,`muted`,`muted-foreground`,`accent`,`accent-foreground`,`destructive`,`destructive-foreground`,`border`,`input`,`ring`],Pr=D().max(Cr);function Fr(e){return Object.fromEntries(e.map(e=>[e,Pr]))}var Ir=ee({name:D().max(80).optional(),cssVars:ee({theme:ee({"font-sans":Pr.optional(),"font-mono":Pr.optional()}).optional(),light:ee(Fr(Nr)),dark:ee(Fr(Nr))})}),Lr=ee({sourceUrl:D(),themeId:D(),label:D(),importedAt:D(),light:ee(Fr(Mr)),dark:ee(Fr(Mr))});function Rr(e){if(!br.test(e))throw Error(`Unsupported tweakcn link. Expected a theme share URL.`)}function zr(e){let t=e.split(`/`).filter(Boolean);return t.length===2&&t[0]===`themes`?(Rr(t[1]),t[1]):t.length===3&&t[0]===`r`&&t[1]===`themes`?(Rr(t[2]),t[2]):null}function Br(e){let t=T(e);if(!t)throw Error(`Paste a tweakcn theme link to import.`);let n=t.replace(/[.,;:]+$/,``);return br.test(n)?`https://tweakcn.com/themes/${n}`:n.startsWith(`/themes/`)||n.startsWith(`/r/themes/`)?`https://tweakcn.com${n}`:/^(?:www\.)?tweakcn\.com\//i.test(n)?`https://${n}`:n.match(/https?:\/\/(?:www\.)?tweakcn\.com\/[^\s<>"')]+/i)?.[0]?.replace(/[.,;:]+$/,``)??n}function Vr(e){let t=zr(e.pathname);if(t)return t;let n=e.searchParams.get(`theme`)??e.searchParams.get(`themeId`)??e.searchParams.get(`id`);if(n)return Rr(n),n;throw Error(`Unsupported tweakcn link. Expected a theme share URL.`)}function Hr(e,t){let n=T(e);if(!n||n.length>Cr)throw Error(`Unsupported tweakcn token: ${t}`);let r=n.toLowerCase();if(Dr.some(e=>r.includes(e))||n.includes(`/*`)||n.includes(`*/`)||n.includes(`\\`))throw Error(`Unsupported tweakcn token: ${t}`);for(let e of n){let n=e.charCodeAt(0);if(n<32||n===127||e===`{`||e===`}`||e===`;`||e===`<`||e===`>`||e==="`")throw Error(`Unsupported tweakcn token: ${t}`)}return n}function Ur(e,t){let n=Hr(e,t),r=n.toLowerCase();if(Or.has(r)||Ar.test(n)||kr.test(n))return n;throw Error(`Unsupported tweakcn token: ${t}`)}function Wr(e){let t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||e===` `||jr.has(e)}function Gr(e,t){let n=Hr(e,t);if(n.includes(`(`)||n.includes(`)`)||!Array.from(n).every(Wr))throw Error(`Unsupported tweakcn token: ${t}`);return n}function Kr(e,t){return t===`font-sans`||t===`font-mono`?Gr(e,t):Ur(e,t)}function qr(e){return Object.fromEntries(e)}function Jr(e){if(!e||typeof e!=`object`)return null;let t=[];for(let n of Mr){let r=n===`font-body`||n===`font-display`||n===`mono`?Gr(e[n],n):Hr(e[n],n);t.push([n,r])}return qr(t)}function R(e,t,n,r){let i=T(e[n]);if(i)return Kr(i,n);let a=T(t?.[n]);if(a)return Kr(a,n);if(r!=null)return n===`font-sans`||n===`font-mono`?Gr(r,n):Hr(r,n);throw Error(`tweakcn theme is missing required token: ${n}`)}function Yr(e,t,n){let r=e===`light`,i=r?`black`:`white`,a=R(t,n,`background`),o=R(t,n,`foreground`),s=R(t,n,`card`),c=R(t,n,`card-foreground`),l=R(t,n,`popover`),u=R(t,n,`popover-foreground`),d=R(t,n,`primary`),f=R(t,n,`primary-foreground`),p=R(t,n,`secondary`),m=R(t,n,`secondary-foreground`),h=R(t,n,`muted`),g=R(t,n,`muted-foreground`),_=R(t,n,`accent`),v=R(t,n,`accent-foreground`),y=R(t,n,`destructive`),b=R(t,n,`destructive-foreground`),x=R(t,n,`border`),S=R(t,n,`input`),C=R(t,n,`ring`),w=R(t,n,`font-sans`,Tr),T=R(t,n,`font-mono`,Er);return qr([[`bg`,a],[`bg-accent`,`color-mix(in srgb, var(--bg) 88%, var(--card) 12%)`],[`bg-elevated`,s],[`bg-hover`,`color-mix(in srgb, var(--muted) 68%, var(--bg) 32%)`],[`bg-muted`,h],[`bg-content`,`color-mix(in srgb, var(--bg) 92%, var(--card) 8%)`],[`card`,s],[`card-foreground`,c],[`card-highlight`,`color-mix(in srgb, var(--text) ${r?`3`:`5`}%, transparent)`],[`popover`,l],[`popover-foreground`,u],[`panel`,a],[`panel-strong`,s],[`panel-hover`,`color-mix(in srgb, var(--card) 76%, var(--muted) 24%)`],[`chrome`,`color-mix(in srgb, var(--bg) 96%, transparent)`],[`chrome-strong`,`color-mix(in srgb, var(--bg) 98%, transparent)`],[`text`,o],[`text-strong`,o],[`chat-text`,o],[`muted`,g],[`muted-strong`,`color-mix(in srgb, var(--muted) 84%, var(--text) 16%)`],[`muted-foreground`,g],[`border`,x],[`border-strong`,`color-mix(in srgb, var(--border) 72%, var(--text) 28%)`],[`border-hover`,`color-mix(in srgb, var(--border) 55%, var(--text) 45%)`],[`input`,S],[`ring`,C],[`accent`,_],[`accent-hover`,`color-mix(in srgb, var(--accent) 82%, ${i} 18%)`],[`accent-muted`,_],[`accent-subtle`,`color-mix(in srgb, var(--accent) ${r?`10`:`16`}%, transparent)`],[`accent-foreground`,v],[`accent-glow`,`color-mix(in srgb, var(--accent) ${r?`18`:`30`}%, transparent)`],[`primary`,d],[`primary-foreground`,f],[`secondary`,p],[`secondary-foreground`,m],[`accent-2`,d],[`accent-2-muted`,`color-mix(in srgb, var(--accent-2) 72%, transparent)`],[`accent-2-subtle`,`color-mix(in srgb, var(--accent-2) ${r?`8`:`12`}%, transparent)`],[`destructive`,y],[`destructive-foreground`,b],[`danger`,y],[`danger-muted`,`color-mix(in srgb, var(--danger) 75%, transparent)`],[`danger-subtle`,`color-mix(in srgb, var(--danger) ${r?`8`:`12`}%, transparent)`],[`focus`,`color-mix(in srgb, var(--ring) ${r?`14`:`22`}%, transparent)`],[`focus-ring`,`0 0 0 2px var(--bg), 0 0 0 3px color-mix(in srgb, var(--ring) ${r?`70`:`80`}%, transparent)`],[`focus-glow`,`0 0 0 2px var(--bg), 0 0 0 3px var(--ring), 0 0 16px var(--accent-glow)`],[`font-body`,w],[`font-display`,w],[`mono`,T],[`grid-line`,`color-mix(in srgb, var(--text) ${r?`4`:`3`}%, transparent)`]])}function Xr(e){let t=T(e);return t?t.slice(0,80):`Custom`}function Zr(e){let t=Br(e),n;try{n=new URL(t)}catch{throw Error(`Paste a full tweakcn URL.`)}if(!yr.has(n.hostname))throw Error(`Only tweakcn.com theme links are supported.`);let r=Vr(n);return{themeId:r,sourceUrl:`https://tweakcn.com/themes/${r}`,fetchUrl:`https://tweakcn.com/r/themes/${r}`}}function Qr(e){let t=Lr.safeParse(e);if(!t.success)return null;try{Rr(t.data.themeId);let e=Jr(t.data.light),n=Jr(t.data.dark);return!e||!n?null:{sourceUrl:t.data.sourceUrl,themeId:t.data.themeId,label:Xr(t.data.label),importedAt:t.data.importedAt,light:e,dark:n}}catch{return null}}function $r(e,t){let n=Ir.safeParse(e);if(!n.success)throw Error(`tweakcn returned an invalid theme payload.`);let r=n.data,i=r.cssVars.theme;return{sourceUrl:t.sourceUrl,themeId:t.themeId,label:Xr(r.name),importedAt:new Date().toISOString(),light:Yr(`light`,r.cssVars.light,i),dark:Yr(`dark`,r.cssVars.dark,i)}}function ei(e){if(!e)return;let t;try{t=new URL(e)}catch{throw Error(`Unexpected tweakcn import response URL.`)}if(t.protocol!==`https:`||!yr.has(t.hostname))throw Error(`Unexpected redirect during tweakcn import.`)}function ti(e){let t=e.get(`content-length`);if(!t)return null;let n=Number(t);return Number.isFinite(n)&&n>=0?n:null}async function ni(e){let t=ti(e.headers);if(t!=null&&t>Sr)throw Error(`tweakcn theme payload is too large.`);if(!e.body)throw Error(`tweakcn returned an unreadable theme payload.`);let n=e.body.getReader(),r=new TextDecoder,i=0,a=``;try{for(;;){let e=await n.read();if(e.done)break;if(i+=e.value.byteLength,i>Sr)throw await n.cancel().catch(()=>void 0),Error(`tweakcn theme payload is too large.`);a+=r.decode(e.value,{stream:!0})}return a+=r.decode(),a}finally{n.releaseLock()}}async function ri(e){let t=await ni(e);try{return JSON.parse(t)}catch{throw Error(`tweakcn returned invalid JSON.`)}}async function ii(e,t=fetch){let n=Zr(e),r=new AbortController,i=setTimeout(()=>r.abort(),wr);try{let e=await t(n.fetchUrl,{headers:{accept:`application/json`},redirect:`error`,signal:r.signal});if(ei(e.url),!e.ok)throw Error(`tweakcn import failed (${e.status}).`);return $r(await ri(e),n)}catch(e){throw r.signal.aborted?Error(`tweakcn import timed out.`,{cause:e}):e}finally{clearTimeout(i)}}function ai(e){let t=Jr(e.light),n=Jr(e.dark);if(!t||!n)throw Error(`存储的自定义主题缺少必需的令牌`);let r=e=>Mr.map(t=>` --${t}: ${e[t]};`).join(`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./agents-E-3DAkaW.js","./lit-runtime-DA0-mbwP.js","./markdown-runtime-C9Jq8Bu5.js","./rolldown-runtime-QTnfLwEv.js","./string-coerce-BuYUxt7q.js","./i18n-BWPaSddY.js","./channel-config-extras-GDGUjA2T.js","./skills-shared-lQxAuc7D.js","./activity-B7yRLbf3.js","./channels-D0c7A9OX.js","./cron-B54j2Vmo.js","./debug-CRcGYNA9.js","./instances-RcBeqNzx.js","./logs-atEFsTJJ.js","./nodes-BoWRh42t.js","./sessions-BmRQ932H.js","./skills-BDn45kHZ.js","./workboard-BwbcNuC5.js","./push-subscription-CY8GxC_U.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{a as t,c as n,d as r,f as i,h as a,i as o,l as s,m as c,n as l,o as u,p as d,r as f,s as p,u as m}from"./lit-runtime-DA0-mbwP.js";import{a as h,i as g,n as _,r as v,t as y}from"./i18n-BWPaSddY.js";import{i as b,n as x,r as S,t as C}from"./gateway-runtime-CMyVbEq5.js";import{n as w,r as T,t as E}from"./string-coerce-BuYUxt7q.js";import{n as D,r as O,t as ee}from"./config-runtime-CCw2hptH.js";import{_ as k,a as te,c as A,d as j,f as M,g as N,h as P,i as F,l as ne,m as re,n as ie,o as ae,p as oe,r as se,s as ce,t as le,u as I,v as ue}from"./markdown-runtime-C9Jq8Bu5.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function de(e){if(typeof e==`string`)return e.trim()||void 0}function fe(e){if(!Array.isArray(e))return;let t=e.map(e=>de(e)).filter(e=>!!e);return t.length>0?t:void 0}var L={AUTH_REQUIRED:`AUTH_REQUIRED`,AUTH_UNAUTHORIZED:`AUTH_UNAUTHORIZED`,AUTH_TOKEN_MISSING:`AUTH_TOKEN_MISSING`,AUTH_TOKEN_MISMATCH:`AUTH_TOKEN_MISMATCH`,AUTH_TOKEN_NOT_CONFIGURED:`AUTH_TOKEN_NOT_CONFIGURED`,AUTH_PASSWORD_MISSING:`AUTH_PASSWORD_MISSING`,AUTH_PASSWORD_MISMATCH:`AUTH_PASSWORD_MISMATCH`,AUTH_PASSWORD_NOT_CONFIGURED:`AUTH_PASSWORD_NOT_CONFIGURED`,AUTH_BOOTSTRAP_TOKEN_INVALID:`AUTH_BOOTSTRAP_TOKEN_INVALID`,AUTH_DEVICE_TOKEN_MISMATCH:`AUTH_DEVICE_TOKEN_MISMATCH`,AUTH_SCOPE_MISMATCH:`AUTH_SCOPE_MISMATCH`,AUTH_RATE_LIMITED:`AUTH_RATE_LIMITED`,AUTH_TAILSCALE_IDENTITY_MISSING:`AUTH_TAILSCALE_IDENTITY_MISSING`,AUTH_TAILSCALE_PROXY_MISSING:`AUTH_TAILSCALE_PROXY_MISSING`,AUTH_TAILSCALE_WHOIS_FAILED:`AUTH_TAILSCALE_WHOIS_FAILED`,AUTH_TAILSCALE_IDENTITY_MISMATCH:`AUTH_TAILSCALE_IDENTITY_MISMATCH`,CONTROL_UI_ORIGIN_NOT_ALLOWED:`CONTROL_UI_ORIGIN_NOT_ALLOWED`,PROTOCOL_MISMATCH:`PROTOCOL_MISMATCH`,CONTROL_UI_DEVICE_IDENTITY_REQUIRED:`CONTROL_UI_DEVICE_IDENTITY_REQUIRED`,DEVICE_IDENTITY_REQUIRED:`DEVICE_IDENTITY_REQUIRED`,DEVICE_AUTH_INVALID:`DEVICE_AUTH_INVALID`,DEVICE_AUTH_DEVICE_ID_MISMATCH:`DEVICE_AUTH_DEVICE_ID_MISMATCH`,DEVICE_AUTH_SIGNATURE_EXPIRED:`DEVICE_AUTH_SIGNATURE_EXPIRED`,DEVICE_AUTH_NONCE_REQUIRED:`DEVICE_AUTH_NONCE_REQUIRED`,DEVICE_AUTH_NONCE_MISMATCH:`DEVICE_AUTH_NONCE_MISMATCH`,DEVICE_AUTH_SIGNATURE_INVALID:`DEVICE_AUTH_SIGNATURE_INVALID`,DEVICE_AUTH_PUBLIC_KEY_INVALID:`DEVICE_AUTH_PUBLIC_KEY_INVALID`,PAIRING_REQUIRED:`PAIRING_REQUIRED`,CLIENT_VERSION_MISMATCH:`CLIENT_VERSION_MISMATCH`},pe={NOT_PAIRED:`not-paired`,ROLE_UPGRADE:`role-upgrade`,SCOPE_UPGRADE:`scope-upgrade`,METADATA_UPGRADE:`metadata-upgrade`},me=new Set([`retry_with_device_token`,`update_auth_configuration`,`update_auth_credentials`,`wait_then_retry`,`review_auth_configuration`]),he=new Set([`not-paired`,`role-upgrade`,`scope-upgrade`,`metadata-upgrade`]),ge=/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/,_e={"not-paired":{requirement:`device is not approved yet`,remediationHint:`Approve this device from the pending pairing requests.`,recoveryTitle:`Gateway pairing approval required.`},"role-upgrade":{requirement:`device is asking for a higher role than currently approved`,remediationHint:`Review the requested role upgrade, then approve the pending request.`,recoveryTitle:`Gateway role upgrade approval required.`},"scope-upgrade":{requirement:`device is asking for more scopes than currently approved`,remediationHint:`Review the requested scopes, then approve the pending upgrade.`,recoveryTitle:`Gateway scope upgrade approval required.`},"metadata-upgrade":{requirement:`device identity changed and must be re-approved`,remediationHint:`Review the refreshed device details, then approve the pending request.`,recoveryTitle:`Gateway device refresh approval required.`}},ve={"not-paired":`device pairing required`,"role-upgrade":`role upgrade pending approval`,"scope-upgrade":`scope upgrade pending approval`,"metadata-upgrade":`device metadata change pending approval`};function ye(e){if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e.code;return typeof t==`string`&&t.trim().length>0?t:null}function be(e){if(!e||typeof e!=`object`||Array.isArray(e))return{};let t=e,n=typeof t.canRetryWithDeviceToken==`boolean`?t.canRetryWithDeviceToken:void 0,r=de(t.recommendedNextStep)??``;return{canRetryWithDeviceToken:n,recommendedNextStep:me.has(r)?r:void 0}}function xe(e){let t=de(e)??``;return he.has(t)?t:void 0}function Se(e){let t=de(e);return t&&ge.test(t)?t:void 0}function Ce(e){return fe(e)}function we(e){return{code:L.PAIRING_REQUIRED,...e.reason?{reason:e.reason}:{},...e.requestId?{requestId:e.requestId}:{},...e.remediationHint?{remediationHint:e.remediationHint}:{},...e.recommendedNextStep?{recommendedNextStep:e.recommendedNextStep}:{},...e.retryable===void 0?{}:{retryable:e.retryable},...e.pauseReconnect===void 0?{}:{pauseReconnect:e.pauseReconnect},...e.deviceId?{deviceId:e.deviceId}:{},...e.requestedRole?{requestedRole:e.requestedRole}:{},...e.requestedScopes?{requestedScopes:e.requestedScopes}:{},...e.approvedRoles?{approvedRoles:e.approvedRoles}:{},...e.approvedScopes?{approvedScopes:e.approvedScopes}:{}}}function Te(e){return e?_e[e].requirement:`device approval is required`}function Ee(e){return e?_e[e].remediationHint:`Approve the pending device request before retrying.`}function De(e){if(ye(e)!==L.PAIRING_REQUIRED||!e||typeof e!=`object`||Array.isArray(e))return null;let t=e,n=xe(t.reason),r=Se(t.requestId),i=de(t.remediationHint)??Ee(n),a=de(t.recommendedNextStep)??``,o=me.has(a)?a:void 0,s=de(t.deviceId),c=de(t.requestedRole),l=Ce(t.requestedScopes),u=Ce(t.approvedRoles),d=Ce(t.approvedScopes);return we({reason:n,requestId:r,remediationHint:i,recommendedNextStep:o,retryable:typeof t.retryable==`boolean`?t.retryable:void 0,pauseReconnect:typeof t.pauseReconnect==`boolean`?t.pauseReconnect:void 0,deviceId:s,requestedRole:c,requestedScopes:l,approvedRoles:u,approvedScopes:d})}function Oe(e){let t=de(e);if(!t)return null;let n=t.trim().toLowerCase(),r;for(let[e,t]of Object.entries(ve))if(n.includes(t)){r=e;break}if(!r&&n.includes(`pairing required`)&&(r=pe.NOT_PAIRED),!r)return null;let i=Se(t.match(/\(requestId:\s*([^\s)]+)\)/i)?.[1]);return{...i?{requestId:i}:{},reason:r}}function ke(e){let t=De(e),n=ve[t?.reason??pe.NOT_PAIRED];return t?.requestId?`${n} (requestId: ${t.requestId})`:n}function Ae(e){return ye(e.details)===L.PAIRING_REQUIRED?ke(e.details):ye(e.details)===L.PROTOCOL_MISMATCH?je(e.message,e.details):de(e.message)??`gateway request failed`}function je(e,t){let n=t,r=Me(n.clientMinProtocol),i=Me(n.clientMaxProtocol),a=Me(n.expectedProtocol),o=Me(n.minimumProbeProtocol),s=[];r!==void 0&&i!==void 0&&s.push(r===i?`Control UI v${r}`:`Control UI v${r}-v${i}`),a!==void 0&&s.push(`Gateway v${a}`),o!==void 0&&s.push(`probe min v${o}`);let c=de(e)??`protocol mismatch`;return s.length>0?`${c}: ${s.join(`, `)}`:c}function Me(e){return typeof e==`number`&&Number.isInteger(e)&&e>0?e:void 0}var Ne={WEBCHAT_UI:`webchat-ui`,CONTROL_UI:`fengming-control-ui`,TUI:`fengming-tui`,WEBCHAT:`webchat`,CLI:`cli`,GATEWAY_CLIENT:`gateway-client`,MACOS_APP:`fengming-macos`,IOS_APP:`fengming-ios`,ANDROID_APP:`fengming-android`,NODE_HOST:`node-host`,TEST:`test`,FINGERPRINT:`fingerprint`,PROBE:`fengming-probe`},Pe=Ne,Fe={WEBCHAT:`webchat`,CLI:`cli`,UI:`ui`,BACKEND:`backend`,NODE:`node`,PROBE:`probe`,TEST:`test`};new Set(Object.values(Ne)),new Set(Object.values(Fe));var Ie=100,Le=2e3;function Re(e){return typeof e==`object`&&!!e&&e.reason===`startup-sidecars`}function ze(e){if(!e||typeof e!=`object`)return!1;let t=e;return(t.gatewayCode??t.code)===`UNAVAILABLE`&&t.retryable===!0&&Re(t.details)}function Be(e){if(!ze(e))return null;let t=e.retryAfterMs;return Math.min(Math.max(Math.floor(typeof t==`number`&&Number.isFinite(t)?t:500),Ie),Le)}function Ve(e){let t=e.scopes.join(`,`),n=e.token??``;return[`v2`,e.deviceId,e.clientId,e.clientMode,e.role,t,String(e.signedAtMs),n,e.nonce].join(`|`)}function He(e){return e.trim()}function Ue(e){if(!Array.isArray(e))return[];let t=new Set;for(let n of e){if(typeof n!=`string`)continue;let e=n.trim();e&&t.add(e)}return t.has(`operator.admin`)?(t.add(`operator.read`),t.add(`operator.write`)):t.has(`operator.write`)&&t.add(`operator.read`),[...t].toSorted()}function We(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Ge(e){return We(e)?e:void 0}function Ke(e){return e&&typeof e==`object`?e:void 0}function qe(e,t){if(!We(t)||typeof t.token!=`string`)return null;let n=typeof t.updatedAtMs==`number`&&Number.isFinite(t.updatedAtMs)?t.updatedAtMs:0;return{token:t.token,role:e,scopes:Ue(Array.isArray(t.scopes)?t.scopes:void 0),updatedAtMs:n}}function Je(e){let t={};for(let[n,r]of Object.entries(e)){let e=He(n);if(!e)continue;let i=qe(e,r);i&&(t[e]=i)}return t}function Ye(e){let t=e.adapter.readStore();if(!t||t.deviceId!==e.deviceId)return null;let n=He(e.role);return qe(n,t.tokens[n])}function Xe(e){let t=He(e.role),n=e.adapter.readStore(),r={version:1,deviceId:e.deviceId,tokens:n&&n.deviceId===e.deviceId&&n.tokens?Je(n.tokens):{}},i={token:e.token,role:t,scopes:Ue(e.scopes),updatedAtMs:Date.now()};return r.tokens[t]=i,e.adapter.writeStore(r),i}function Ze(e){let t=e.adapter.readStore();if(!t||t.deviceId!==e.deviceId)return;let n=He(e.role);if(!t.tokens[n])return;let r={version:1,deviceId:t.deviceId,tokens:Je(t.tokens)};delete r.tokens[n],e.adapter.writeStore(r)}function Qe(e){return!!e&&typeof e.getItem==`function`&&typeof e.setItem==`function`}function $e(e){let t=Object.getOwnPropertyDescriptor(globalThis,e);if(typeof process<`u`&&{}.VITEST)return t&&!t.get&&Qe(t.value)?t.value:null;if(typeof window<`u`&&typeof document<`u`)try{let t=window[e];return Qe(t)?t:null}catch{return null}return t&&!t.get&&Qe(t.value)?t.value:null}function et(){return $e(`localStorage`)}function tt(){return $e(`sessionStorage`)}var nt=`fengming.device.auth.v1`;function rt(){try{let e=et()?.getItem(nt);if(!e)return null;let t=JSON.parse(e);return!t||t.version!==1||!t.deviceId||typeof t.deviceId!=`string`||!t.tokens||typeof t.tokens!=`object`?null:t}catch{return null}}function it(e){try{et()?.setItem(nt,JSON.stringify(e))}catch{}}function at(e){return Ye({adapter:{readStore:rt,writeStore:it},deviceId:e.deviceId,role:e.role})}function ot(e){return Xe({adapter:{readStore:rt,writeStore:it},deviceId:e.deviceId,role:e.role,token:e.token,scopes:e.scopes})}function st(e){Ze({adapter:{readStore:rt,writeStore:it},deviceId:e.deviceId,role:e.role})}var ct=`fengming-device-identity-v1`;function lt(e){let t=``;for(let n of e)t+=String.fromCharCode(n);return btoa(t).replaceAll(`+`,`-`).replaceAll(`/`,`_`).replace(/=+$/g,``)}function ut(e){let t=e.replaceAll(`-`,`+`).replaceAll(`_`,`/`),n=t+`=`.repeat((4-t.length%4)%4),r=atob(n),i=new Uint8Array(r.length);for(let e=0;e<r.length;e+=1)i[e]=r.charCodeAt(e);return i}function dt(e){return Array.from(e).map(e=>e.toString(16).padStart(2,`0`)).join(``)}async function ft(e){let t=await crypto.subtle.digest(`SHA-256`,e.slice().buffer);return dt(new Uint8Array(t))}async function pt(){let e=b.randomSecretKey(),t=await x(e);return{deviceId:await ft(t),publicKey:lt(t),privateKey:lt(e)}}async function mt(){let e=et();try{let t=e?.getItem(ct);if(t){let n=JSON.parse(t);if(n?.version===1&&typeof n.deviceId==`string`&&typeof n.publicKey==`string`&&typeof n.privateKey==`string`){let t=await ft(ut(n.publicKey));if(t!==n.deviceId){let r={...n,deviceId:t};return e?.setItem(ct,JSON.stringify(r)),{deviceId:t,publicKey:n.publicKey,privateKey:n.privateKey}}return{deviceId:n.deviceId,publicKey:n.publicKey,privateKey:n.privateKey}}}}catch{}let t=await pt(),n={version:1,deviceId:t.deviceId,publicKey:t.publicKey,privateKey:t.privateKey,createdAtMs:Date.now()};return e?.setItem(ct,JSON.stringify(n)),t}async function ht(e,t){let n=ut(e);return lt(await S(new TextEncoder().encode(t),n))}var gt=!1;function _t(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 vt(){gt||(gt=!0,console.warn(`[uuid] crypto API missing; refusing insecure UUID generation`))}function yt(e=globalThis.crypto){if(e&&typeof e.randomUUID==`function`)return e.randomUUID();if(e&&typeof e.getRandomValues==`function`){let t=new Uint8Array(16);return e.getRandomValues(t),_t(t)}throw vt(),Error(`Web Crypto is required for UUID generation`)}var bt=class extends Error{constructor(e){super(Ae({message:e.message,details:xt(e.message,e.details)})),this.name=`GatewayRequestError`,this.gatewayCode=e.code,this.details=e.details,this.retryable=e.retryable===!0,this.retryAfterMs=e.retryAfterMs}};function xt(e,t){return ye(t)===L.PROTOCOL_MISMATCH||!e?.toLowerCase().includes(`protocol mismatch`)?t:{code:L.PROTOCOL_MISMATCH,clientMinProtocol:4,clientMaxProtocol:4,...t&&typeof t==`object`&&!Array.isArray(t)?t:{}}}function St(e){return ye(e?.details)}function Ct(e){let t=De(e);return t?.pauseReconnect===!1||t?.recommendedNextStep===`wait_then_retry`}function wt(e){if(!e)return!1;let t=St(e);return t===L.PAIRING_REQUIRED&&Ct(e.details)?!1:t===L.AUTH_TOKEN_MISSING||t===L.AUTH_BOOTSTRAP_TOKEN_INVALID||t===L.AUTH_PASSWORD_MISSING||t===L.AUTH_PASSWORD_MISMATCH||t===L.AUTH_RATE_LIMITED||t===L.AUTH_DEVICE_TOKEN_MISMATCH||t===L.AUTH_SCOPE_MISMATCH||t===L.PAIRING_REQUIRED||t===L.CONTROL_UI_DEVICE_IDENTITY_REQUIRED||t===L.DEVICE_IDENTITY_REQUIRED}function Tt(e){let t=e.split(`.`);return t.length!==4||t[0]!==`127`?!1:t.every(e=>{if(!/^\d+$/.test(e))return!1;let t=Number(e);return t>=0&&t<=255})}function Et(e){try{let t=new URL(e,window.location.href),n=t.hostname.trim().toLowerCase(),r=n===`localhost`||n===`::1`||n===`[::1]`,i=Tt(n);if(r||i)return!0;let a=new URL(window.location.href);return t.host===a.host}catch{return!1}}var Dt=`operator`,Ot=[`operator.admin`,`operator.read`,`operator.write`,`operator.approvals`,`operator.pairing`],kt=4008,At=4013,jt=1006,Mt=`BROWSER_WEBSOCKET_CONSTRUCTOR_ERROR`,Nt=`BROWSER_WEBSOCKET_SECURITY_ERROR`;function Pt(e){let t=e.authToken;if(t||e.authPassword)return{token:t,deviceToken:e.authDeviceToken??e.resolvedDeviceToken,password:e.authPassword}}function Ft(e){return e instanceof Error&&e.message?e.message:String(e)}function It(e){if(e instanceof Error&&e.name)return e.name;if(e&&typeof e==`object`&&`name`in e){let t=e.name;return typeof t==`string`&&t.trim()?t:void 0}}function Lt(e){let t=It(e)?.toLowerCase(),n=Ft(e).toLowerCase();return t===`securityerror`||n.includes(`security error`)||n.includes(`mixed content`)||n.includes(`insecure websocket`)}function Rt(e,t){let n=Lt(e),r=Ft(e),i=t.trim().toLowerCase().startsWith(`ws://`);return n?{code:Nt,message:`Browser refused the Gateway WebSocket for security reasons.`+(i?` Use wss:// when the Control UI is served over HTTPS/Tailscale Serve, or open the loopback dashboard at http://127.0.0.1:18789.`:` Check the Gateway WebSocket URL and browser security policy.`),details:{code:Nt,browserErrorName:It(e),browserMessage:r}}:{code:Mt,message:`Could not create the Gateway WebSocket: ${r}`,details:{code:Mt,browserErrorName:It(e),browserMessage:r}}}function zt(e){return e.storedToken&&(e.resolvedDeviceToken===e.storedToken||e.authDeviceToken===e.storedToken)&&e.storedScopes&&e.storedScopes.length>0?[...e.storedScopes]:[...Ot]}async function Bt(e){let{deviceIdentity:t}=e;if(!t)return;let n=Date.now(),r=e.connectNonce??``,i=Ve({deviceId:t.deviceId,clientId:e.client.id,clientMode:e.client.mode,role:e.role,scopes:e.scopes,signedAtMs:n,token:e.authToken??null,nonce:r}),a=await ht(t.privateKey,i);return{id:t.deviceId,publicKey:t.publicKey,signature:a,signedAt:n,nonce:r}}function Vt(e){return!e.deviceTokenRetryBudgetUsed&&!e.authDeviceToken&&!!e.explicitGatewayToken&&!!e.deviceIdentity&&!!e.storedToken&&e.canRetryWithDeviceTokenHint&&Et(e.url)}var Ht=class{constructor(e){this.opts=e,this.ws=null,this.pending=new Map,this.closed=!1,this.lastSeq=null,this.connectNonce=null,this.connectSent=!1,this.connectTimer=null,this.connectGeneration=0,this.backoffMs=800,this.pendingDeviceTokenRetry=!1,this.deviceTokenRetryBudgetUsed=!1,this.pendingStartupReconnectDelayMs=null,this.eventListeners=new Set}start(){this.closed=!1,this.connect()}stop(){this.closed=!0,this.clearConnectTimer(),this.ws?.close(),this.ws=null,this.pendingConnectError=void 0,this.pendingDeviceTokenRetry=!1,this.deviceTokenRetryBudgetUsed=!1,this.pendingStartupReconnectDelayMs=null,this.flushPending(Error(`网关客户端已停止`))}get connected(){return this.ws?.readyState===WebSocket.OPEN}connect(){if(this.closed)return;let e;try{e=new WebSocket(this.opts.url)}catch(e){let t=Rt(e,this.opts.url);this.ws=null,this.pendingConnectError=void 0,this.pendingDeviceTokenRetry=!1,this.pendingStartupReconnectDelayMs=null,this.flushPending(Error(t.message)),this.opts.onClose?.({code:jt,reason:t.code===Nt?`security error`:`websocket error`,error:t});return}let t=++this.connectGeneration;this.ws=e,e.addEventListener(`open`,()=>this.queueConnect(e,t)),e.addEventListener(`message`,n=>{this.isActiveSocket(e,t)&&this.handleMessage(e,t,String(n.data??``))}),e.addEventListener(`close`,t=>{if(this.ws!==e)return;let n=t.reason??``,r=this.pendingConnectError;if(this.pendingConnectError=void 0,this.ws=null,this.pendingStartupReconnectDelayMs!==null){this.flushPending(Error(`gateway closed (${t.code}): ${n}`)),this.scheduleReconnect();return}if(this.flushPending(Error(`gateway closed (${t.code}): ${n}`)),this.opts.onClose?.({code:t.code,reason:n,error:r}),St(r)===L.AUTH_TOKEN_MISMATCH){this.pendingDeviceTokenRetry&&this.scheduleReconnect();return}wt(r)||this.scheduleReconnect()}),e.addEventListener(`error`,()=>{})}scheduleReconnect(){if(this.closed)return;let e=this.pendingStartupReconnectDelayMs;this.pendingStartupReconnectDelayMs=null;let t=e??this.backoffMs;e===null&&(this.backoffMs=Math.min(this.backoffMs*1.7,15e3)),this.clearConnectTimer(),this.connectTimer=window.setTimeout(()=>{this.connectTimer=null,this.connect()},t)}flushPending(e){for(let[t,n]of this.pending)this.emitRequestTiming(t,n,!1,`CLIENT_CLOSED`),n.reject(e);this.pending.clear()}nowMs(){return typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now()}emitRequestTiming(e,t,n,r){let i=this.nowMs();try{this.opts.onRequestTiming?.({id:e,method:t.method,ok:n,durationMs:Math.max(0,i-t.startedAtMs),startedAtMs:t.startedAtMs,endedAtMs:i,errorCode:r})}catch(e){console.error(`[gateway] request timing handler error:`,e)}}buildConnectClient(){return{id:this.opts.clientName??Pe.CONTROL_UI,version:this.opts.clientVersion??`control-ui`,platform:this.opts.platform??navigator.platform??`web`,mode:this.opts.mode??Fe.WEBCHAT,instanceId:this.opts.instanceId}}buildConnectParams(e){return{minProtocol:4,maxProtocol:4,client:e.client,role:e.role,scopes:e.scopes,device:e.device,caps:[`tool-events`],auth:e.auth,userAgent:navigator.userAgent,locale:navigator.language}}async buildConnectPlan(e){let t=Dt,n=this.buildConnectClient(),r=this.opts.token?.trim()||void 0,i=this.opts.password?.trim()||void 0,a=typeof crypto<`u`&&!!crypto.subtle,o=null,s={authToken:r,authPassword:i,canFallbackToShared:!1};a&&(o=await mt(),s=this.selectConnectAuth({role:t,deviceId:o.deviceId}));let c=zt(s);return{role:t,scopes:c,client:n,explicitGatewayToken:r,selectedAuth:s,auth:Pt(s),deviceIdentity:o,device:await Bt({deviceIdentity:o,client:n,role:t,scopes:c,authToken:s.authToken,connectNonce:e})}}handleConnectHello(e,t,n,r){this.isActiveSocket(n,r)&&(this.pendingDeviceTokenRetry=!1,this.deviceTokenRetryBudgetUsed=!1,this.pendingStartupReconnectDelayMs=null,e?.auth?.deviceToken&&t.deviceIdentity&&ot({deviceId:t.deviceIdentity.deviceId,role:e.auth.role??t.role,token:e.auth.deviceToken,scopes:e.auth.scopes??[]}),this.backoffMs=800,this.opts.onHello?.(e))}handleConnectFailure(e,t,n,r){if(!this.isActiveSocket(n,r))return;let i=e instanceof bt?St(e):null,a=e instanceof bt?be(e.details):{},o=a.recommendedNextStep===`retry_with_device_token`,s=a.canRetryWithDeviceToken===!0||o||i===L.AUTH_TOKEN_MISMATCH;Vt({deviceTokenRetryBudgetUsed:this.deviceTokenRetryBudgetUsed,authDeviceToken:t.selectedAuth.authDeviceToken,explicitGatewayToken:t.explicitGatewayToken,deviceIdentity:t.deviceIdentity,storedToken:t.selectedAuth.storedToken,canRetryWithDeviceTokenHint:s,url:this.opts.url})&&(this.pendingDeviceTokenRetry=!0,this.deviceTokenRetryBudgetUsed=!0),e instanceof bt?this.pendingConnectError={code:e.gatewayCode,message:e.message,details:e.details,retryable:e.retryable,retryAfterMs:e.retryAfterMs}:this.pendingConnectError=void 0,t.selectedAuth.storedToken&&(t.selectedAuth.resolvedDeviceToken===t.selectedAuth.storedToken||t.selectedAuth.authDeviceToken===t.selectedAuth.storedToken)&&t.deviceIdentity&&i===L.AUTH_DEVICE_TOKEN_MISMATCH&&st({deviceId:t.deviceIdentity.deviceId,role:t.role});let c=Be(e);if(c!==null&&(this.pendingStartupReconnectDelayMs=c),ze(e)){n.close(At,`gateway starting`);return}n.close(kt,`connect failed`)}isActiveSocket(e,t){return!this.closed&&this.ws===e&&this.connectGeneration===t}async sendConnect(e,t){if(!this.isActiveSocket(e,t)||e.readyState!==WebSocket.OPEN||this.connectSent)return;this.connectSent=!0,this.clearConnectTimer();let n=await this.buildConnectPlan(this.connectNonce);!this.isActiveSocket(e,t)||e.readyState!==WebSocket.OPEN||(this.pendingDeviceTokenRetry&&n.selectedAuth.authDeviceToken&&(this.pendingDeviceTokenRetry=!1),this.requestOnSocket(e,`connect`,this.buildConnectParams(n)).then(r=>this.handleConnectHello(r,n,e,t)).catch(r=>this.handleConnectFailure(r,n,e,t)))}handleMessage(e,t,n){let r;try{r=JSON.parse(n)}catch{return}let i=r;if(i.type===`event`){let n=r;if(n.event===`connect.challenge`){let r=n.payload,i=r&&typeof r.nonce==`string`?r.nonce:null;i&&(this.connectNonce=i,this.sendConnect(e,t));return}let i=typeof n.seq==`number`?n.seq:null;i!==null&&(this.lastSeq!==null&&i>this.lastSeq+1&&this.opts.onGap?.({expected:this.lastSeq+1,received:i}),this.lastSeq=i);try{this.opts.onEvent?.(n);for(let e of this.eventListeners)e(n)}catch(e){console.error(`[gateway] event handler error:`,e)}return}if(i.type===`res`){let e=r,t=this.pending.get(e.id);if(!t)return;this.pending.delete(e.id),e.ok?(this.emitRequestTiming(e.id,t,!0),t.resolve(e.payload)):(this.emitRequestTiming(e.id,t,!1,e.error?.code),t.reject(new bt({code:e.error?.code??`UNAVAILABLE`,message:e.error?.message??`request failed`,details:e.error?.details,retryable:e.error?.retryable,retryAfterMs:e.error?.retryAfterMs})));return}}selectConnectAuth(e){let t=this.opts.token?.trim()||void 0,n=this.opts.password?.trim()||void 0,r=at({deviceId:e.deviceId,role:e.role}),i=r?.scopes??[],a=e.role!==Dt||i.includes(`operator.read`)||i.includes(`operator.write`)||i.includes(`operator.admin`)?r?.token:void 0,o=this.pendingDeviceTokenRetry&&!!t&&!!a&&Et(this.opts.url),s=t||n?void 0:a??void 0;return{authToken:t??s,authDeviceToken:o?a??void 0:void 0,authPassword:n,resolvedDeviceToken:s,storedToken:a??void 0,storedScopes:r?.scopes??void 0,canFallbackToShared:!!(a&&t)}}request(e,t){return!this.ws||this.ws.readyState!==WebSocket.OPEN?Promise.reject(Error(`网关未连接`)):this.requestOnSocket(this.ws,e,t)}requestOnSocket(e,t,n){if(this.ws!==e||e.readyState!==WebSocket.OPEN)return Promise.reject(Error(`网关未连接`));let r=yt(),i={type:`req`,id:r,method:t,params:n},a=this.nowMs(),o=new Promise((e,n)=>{this.pending.set(r,{resolve:t=>e(t),reject:n,method:t,startedAtMs:a})});return e.send(JSON.stringify(i)),o}addEventListener(e){return this.eventListeners.add(e),()=>{this.eventListeners.delete(e)}}queueConnect(e,t){this.isActiveSocket(e,t)&&(this.connectNonce=null,this.connectSent=!1,this.clearConnectTimer(),this.connectTimer=window.setTimeout(()=>{this.connectTimer=null,this.sendConnect(e,t)},750))}clearConnectTimer(){this.connectTimer!==null&&(window.clearTimeout(this.connectTimer),this.connectTimer=null)}};function Ut(e){return e instanceof bt?St(e)===L.AUTH_UNAUTHORIZED?!0:e.message.includes(`missing scope: operator.read`):!1}function Wt(e){return`This connection is missing operator.read, so ${e} cannot be loaded yet.`}function Gt(e){return new Promise(t=>setTimeout(()=>t(`timeout`),e))}async function Kt(e,t,n={}){if(!e.client||!e.connected||e.channelsLoading&&(!e.channelsLoadingProbe||t))return;let r=(e.channelsRefreshSeq??0)+1;e.channelsRefreshSeq=r,e.channelsLoading=!0,e.channelsLoadingProbe=t,e.channelsError=null;let i=(async()=>{try{let n=await e.client.request(`channels.status`,{probe:t,timeoutMs:8e3});if(e.channelsRefreshSeq!==r)return;e.channelsSnapshot=n,e.channelsLastSuccess=Date.now()}catch(t){if(e.channelsRefreshSeq!==r)return;Ut(t)?(e.channelsSnapshot=null,e.channelsError=Wt(`channel status`)):e.channelsError=String(t)}finally{e.channelsRefreshSeq===r&&(e.channelsLoading=!1,e.channelsLoadingProbe=null)}})(),a=n.softTimeoutMs;if(typeof a==`number`&&a>0)return await Promise.race([i.then(()=>`done`),Gt(a)]),void 0;await i}function qt(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.prototype.toString.call(e)===`[object Object]`}var Jt=new Set([`__proto__`,`prototype`,`constructor`]);function Yt(e){return Jt.has(e)}function Xt(e){return qt(e)?typeof e.id==`string`&&e.id.length>0:!1}function Zt(e,t,n){if(!e.every(Xt))return;let r=[...e],i=new Map;for(let[e,t]of r.entries()){if(!Xt(t))return;i.set(t.id,e)}for(let e of t){if(!Xt(e)){r.push(structuredClone(e));continue}let t=i.get(e.id);if(t===void 0){r.push(structuredClone(e)),i.set(e.id,r.length-1);continue}r[t]=Qt(r[t],e,n)}return r}function Qt(e,t,n={}){if(!qt(t))return t;let r=qt(e)?{...e}:{};for(let[e,i]of Object.entries(t))if(!Yt(e)){if(i===null){delete r[e];continue}if(n.mergeObjectArraysById&&Array.isArray(r[e])&&Array.isArray(i)){let t=Zt(r[e],i,n);if(t){r[e]=t;continue}}if(qt(i)){let t=r[e];r[e]=Qt(qt(t)?t:{},i,n);continue}r[e]=i}return r}function $t(e){return(e??[]).map(e=>T(String(e))??``).filter(Boolean)}function en(e){return[...new Set(e)]}function tn(e){return en(e)}function nn(e){return tn(e).toSorted((e,t)=>e<t?-1:+(e>t))}function rn(e){if(e)return Array.isArray(e.type)?e.type.find(e=>e!==`null`)??e.type[0]:e.type}function an(e){if(!e)return``;if(e.default!==void 0)return e.default;switch(rn(e)){case`object`:return{};case`array`:return[];case`boolean`:return!1;case`number`:case`integer`:return 0;case`string`:return``;default:return``}}function on(e){return e.filter(e=>typeof e==`string`).join(`.`)}function sn(e,t){let n=t[on(e)];if(n)return n;let r=e.map(String);for(let[e,n]of Object.entries(t)){if(!e.includes(`*`))continue;let t=e.split(`.`);if(t.length!==r.length)continue;let i=!0;for(let e=0;e<r.length;e+=1)if(t[e]!==`*`&&t[e]!==r[e]){i=!1;break}if(i)return n}}function cn(e){return e.replace(/_/g,` `).replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/\s+/g,` `).replace(/^./,e=>e.toUpperCase())}var ln=[`maxtokens`,`maxoutputtokens`,`maxinputtokens`,`maxcompletiontokens`,`contexttokens`,`totaltokens`,`tokencount`,`tokenlimit`,`tokenbudget`,`passwordfile`],un=[/token$/i,/password/i,/secret/i,/api.?key/i,/serviceaccount(?:ref)?$/i],dn=/^\$\{[^}]*\}$/,fn=`[redacted - click reveal to view]`,pn=64,mn=2e4;function hn(){return{visited:0}}function gn(e,t){return!(t>pn||(e.visited+=1,e.visited>mn))}function _n(e){return dn.test(e.trim())}function vn(e){let t=E(e);return!ln.some(e=>t.endsWith(e))&&un.some(t=>t.test(e))}function yn(e){return typeof e==`string`?e.trim().length>0&&!_n(e):e!=null}function bn(e){return e?.sensitive??!1}function xn(e,t,n){return Sn(e,t,n,hn(),0)}function Sn(e,t,n,r,i){if(!gn(r,i))return!0;let a=on(t);return(bn(sn(t,n))||vn(a))&&yn(e)?!0:Array.isArray(e)?e.some((e,a)=>Sn(e,[...t,a],n,r,i+1)):e&&typeof e==`object`?Object.entries(e).some(([e,a])=>Sn(a,[...t,e],n,r,i+1)):!1}function Cn(e,t,n){return wn(e,t,n,hn(),0)}function wn(e,t,n,r,i){if(!gn(r,i))return 1;if(e==null)return 0;let a=on(t);return(bn(sn(t,n))||vn(a))&&yn(e)?1:Array.isArray(e)?e.reduce((e,a,o)=>e+wn(a,[...t,o],n,r,i+1),0):e&&typeof e==`object`?Object.entries(e).reduce((e,[a,o])=>e+wn(o,[...t,a],n,r,i+1),0):0}function Tn(e,t){let n=e.trim();if(n===``)return;let r=Number(n);return!Number.isFinite(r)||t&&!Number.isInteger(r)?e:r}function En(e){let t=e.trim();return t===`true`?!0:t===`false`?!1:e}function Dn(e,t){if(e==null)return e;if(t.allOf&&t.allOf.length>0){let n=e;for(let e of t.allOf)n=Dn(n,e);return n}let n=rn(t);if(t.anyOf||t.oneOf){let n=(t.anyOf??t.oneOf??[]).filter(e=>!(e.type===`null`||Array.isArray(e.type)&&e.type.includes(`null`)));if(n.length===1)return Dn(e,n[0]);if(typeof e==`string`)for(let t of n){let n=rn(t);if(n===`number`||n===`integer`){let t=Tn(e,n===`integer`);if(t===void 0||typeof t==`number`)return t}if(n===`boolean`){let t=En(e);if(typeof t==`boolean`)return t}}for(let t of n){let n=rn(t);if(n===`object`&&typeof e==`object`&&!Array.isArray(e)||n===`array`&&Array.isArray(e))return Dn(e,t)}return e}if(n===`number`||n===`integer`){if(typeof e==`string`){let t=Tn(e,n===`integer`);if(t===void 0||typeof t==`number`)return t}return e}if(n===`boolean`){if(typeof e==`string`){let t=En(e);if(typeof t==`boolean`)return t}return e}if(n===`string`)return typeof e==`string`&&e.length===0&&t.minLength?void 0:e;if(n===`object`){if(typeof e!=`object`||Array.isArray(e))return e;let n=e,r=t.properties??{},i=t.additionalProperties&&typeof t.additionalProperties==`object`?t.additionalProperties:null,a={};for(let[e,t]of Object.entries(n)){let n=r[e]??i,o=n?Dn(t,n):t;o!==void 0&&(a[e]=o)}return a}if(n===`array`){if(!Array.isArray(e))return e;if(Array.isArray(t.items)){let n=t.items;return e.map((e,t)=>{let r=t<n.length?n[t]:void 0;return r?Dn(e,r):e})}let n=t.items;return n?e.map(e=>Dn(e,n)).filter(e=>e!==void 0):e}return e}function On(e){return structuredClone(e)}function kn(e){return`${JSON.stringify(e,null,2).trimEnd()}\n`}var An=`__FENGMING_REDACTED__`,jn={omitted:!0};function Mn(e){return{omitted:!1,value:e}}function Nn(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function Pn(e,t){return e!=null&&Object.prototype.hasOwnProperty.call(e,t)}function Fn(e){if(e.value===An)return e.originalFormValue!==An||e.originalRawPathExists?Mn(e.value):e.canOmit?jn:Mn(e.value);if(Array.isArray(e.value)){let t=Array.isArray(e.originalFormValue)?e.originalFormValue:[],n=Array.isArray(e.originalRawValue)?e.originalRawValue:[];return Mn(e.value.map((e,r)=>{let i=Fn({value:e,originalFormValue:t[r],originalRawValue:n[r],originalRawPathExists:r in n,canOmit:!1});return i.omitted?e:i.value}))}if(!Nn(e.value))return Mn(e.value);let t=Nn(e.originalFormValue)?e.originalFormValue:null,n=Nn(e.originalRawValue)?e.originalRawValue:null,r={};for(let[i,a]of Object.entries(e.value)){let e=t!=null&&Object.prototype.hasOwnProperty.call(t,i)?t[i]:void 0,o=Pn(n,i),s=Fn({value:a,originalFormValue:e,originalRawValue:o?n?.[i]:void 0,originalRawPathExists:o,canOmit:!0});s.omitted||(r[i]=s.value)}return e.canOmit&&Object.keys(r).length===0&&!e.originalRawPathExists?jn:Mn(r)}function In(e,t,n){if(!t||!n)return e;let r;try{r=O.parse(n)}catch{return e}if(!Nn(r))return e;let i=Fn({value:e,originalFormValue:t,originalRawValue:r,originalRawPathExists:!0,canOmit:!1});return!i.omitted&&Nn(i.value)?i.value:e}var Ln=new Set([`__proto__`,`prototype`,`constructor`]);function Rn(e){return typeof e==`string`&&Ln.has(e)}function zn(e,t,n){if(t.length===0||t.some(Rn))return null;let r=e;for(let e=0;e<t.length-1;e+=1){let i=t[e],a=t[e+1];if(typeof i==`number`){if(!Array.isArray(r))return null;if(r[i]==null){if(!n)return null;r[i]=typeof a==`number`?[]:{}}r=r[i];continue}if(typeof r!=`object`||!r)return null;let o=r;if(o[i]==null){if(!n)return null;o[i]=typeof a==`number`?[]:{}}r=o[i]}return{current:r,lastKey:t[t.length-1]}}function Bn(e,t,n){let r=zn(e,t,!0);if(r){if(typeof r.lastKey==`number`){Array.isArray(r.current)&&(r.current[r.lastKey]=n);return}typeof r.current==`object`&&r.current!=null&&(r.current[r.lastKey]=n)}}function Vn(e,t){let n=zn(e,t,!1);if(n){if(typeof n.lastKey==`number`){Array.isArray(n.current)&&n.current.splice(n.lastKey,1);return}typeof n.current==`object`&&n.current!=null&&delete n.current[n.lastKey]}}var Hn=new WeakMap;async function Un(e,t={}){if(!(!e.client||!e.connected)){e.configLoading=!0,e.lastError=null;try{Jn(e,await e.client.request(`config.get`,{}),t)}catch(t){e.lastError=String(t)}finally{e.configLoading=!1}}}async function Wn(e){if(!(!e.client||!e.connected)&&!e.configSchemaLoading){e.configSchemaLoading=!0;try{Gn(e,await e.client.request(`config.schema`,{}))}catch(t){e.lastError=String(t)}finally{e.configSchemaLoading=!1}}}function Gn(e,t){e.configSchema=t.schema??null,e.configUiHints=t.uiHints??{},e.configSchemaVersion=t.version??null}function Kn(e){return!e||typeof e!=`object`||Array.isArray(e)?null:e}function qn(e){return Kn(e?.sourceConfig)??Kn(e?.resolved)??Kn(e?.config)}function Jn(e,t,n={}){let r=e.configFormDirty&&n.discardPendingChanges!==!0,i=e.configDraftBaseHash??e.configSnapshot?.hash??null;e.configSnapshot=t;let a=qn(t);!(typeof t.raw==`string`||a||e.configForm)&&e.configFormMode===`raw`&&(e.configFormMode=`form`);let o=typeof t.raw==`string`?t.raw:a?kn(a):e.configRaw;r?e.configFormMode!==`raw`&&e.configForm?e.configRaw=kn(e.configForm):e.configFormMode!==`raw`&&(e.configRaw=o):e.configRaw=o,e.configValid=typeof t.valid==`boolean`?t.valid:null,e.configIssues=Array.isArray(t.issues)?t.issues:[],r?e.configDraftBaseHash=i:(e.configForm=On(a??{}),e.configFormOriginal=On(a??{}),e.configRawOriginal=o,e.configFormDirty=!1,e.configDraftBaseHash=t.hash??null,Hn.delete(e))}function Yn(e){return!e||typeof e!=`object`||Array.isArray(e)?null:e}function Xn(e){if(e.configFormMode!==`form`||!e.configForm)return e.configRaw;let t=Yn(e.configSchema);return kn(In(t?Dn(e.configForm,t):e.configForm,e.configFormOriginal,e.configRawOriginal))}function Zn(e){let t=(e.status??`error`).trim()||`error`,n=(e.reason??`unexpected-error`).trim()||`unexpected-error`;return{tone:t===`skipped`?`warn`:`danger`,text:`Update ${t}: ${n}. ${{dirty:`Commit or stash changes, then retry.`,"no-upstream":`Set an upstream branch, then retry.`,"not-git-install":"Not a git checkout. Run `fengming update` from the CLI for a global reinstall.","not-fengming-root":`Run the update from an FengMing checkout or use the CLI global reinstall path.`,"deps-install-failed":`Dependency install failed. Fix the install error and retry.`,"build-failed":`Build failed. Fix the build error and retry.`,"ui-build-failed":`The control UI rebuild failed. Fix the UI build error and retry.`,"global-install-failed":`The global package install did not verify on disk. Retry or reinstall from the CLI.`,"restart-disabled":"The update was not applied because gateway restarts are disabled. Enable restarts in config, then retry — or run `fengming update` from the CLI.","restart-unavailable":`This global install cannot be safely replaced while restarts are disabled and no supervisor is present.`,"restart-unhealthy":`The replacement process never became healthy. The previous process stayed up so you can recover.`,"doctor-failed":"Doctor repair failed. Run `fengming doctor --non-interactive` and retry."}[n]??`See the gateway logs for the exact failure and retry once the cause is fixed.`}`}}async function Qn(e,t,n,r={}){if(!e.client||!e.connected)return!1;e[n]=!0,e.lastError=null;try{let n=Xn(e),i=e.configDraftBaseHash??e.configSnapshot?.hash;return i?(await e.client.request(t,{raw:n,baseHash:i,...r}),e.configFormDirty=!1,e.configDraftBaseHash=null,Hn.delete(e),await Un(e),!0):(e.lastError=`Config hash missing; reload and retry.`,!1)}catch(t){return e.lastError=String(t),!1}finally{e[n]=!1}}function $n(e,t){let n=On(e.configFormOriginal??qn(e.configSnapshot)??{}),r=kn(t),i=kn(n);e.configForm=t,e.configRaw=r,e.configFormDirty=r!==i}async function er(e){return Qn(e,`config.set`,`configSaving`)}async function tr(e){return Qn(e,`config.apply`,`configApplying`,{sessionKey:e.applySessionKey})}async function nr(e){if(!(!e.client||!e.connected)){e.updateRunning=!0,e.lastError=null,e.updateStatusBanner=null;try{let t=await e.client.request(`update.run`,{sessionKey:e.applySessionKey}),n=t.result?.status??(t.ok===!0?`ok`:`error`);if(n===`ok`&&t.ok===!0){e.pendingUpdateExpectedVersion=t.result?.after?.version??null;return}e.pendingUpdateExpectedVersion=null,e.updateStatusBanner=Zn({status:n,reason:t.result?.reason})}catch(t){e.lastError=String(t),e.pendingUpdateExpectedVersion=null}finally{e.updateRunning=!1}}}function rr(e,t){let n=On(e.configForm??qn(e.configSnapshot)??{});t(n),$n(e,n)}function ir(e,t){let n=Hn.get(e);n?n.add(t):Hn.set(e,new Set([t]))}function ar(e,t){let n=Hn.get(e);n&&(n.delete(t),n.size===0&&Hn.delete(e))}function or(e,t,n,r){if(n.length!==4||n[0]!==`plugins`||n[1]!==`entries`||typeof n[2]!=`string`||n[3]!==`enabled`)return;let i=n[2],a=t.plugins&&typeof t.plugins==`object`&&!Array.isArray(t.plugins)?t.plugins:null,o=Array.isArray(a?.allow)?a.allow:null;if(!o){ar(e,i);return}if(r===!0){if(o.includes(i))return;if(o.length===0){ar(e,i);return}Bn(t,[`plugins`,`allow`],[...o,i]),ir(e,i);return}Hn.get(e)?.has(i)&&(Bn(t,[`plugins`,`allow`],o.filter(e=>e!==i)),ar(e,i))}function sr(e,t,n){rr(e,r=>{if(Bn(r,t,n),t[0]===`plugins`&&t[1]===`allow`){Hn.delete(e);return}or(e,r,t,n)})}function cr(e,t){e.configRaw=t,e.configFormDirty=t!==e.configRawOriginal,e.configFormDirty?e.configDraftBaseHash=e.configDraftBaseHash??e.configSnapshot?.hash??null:e.configDraftBaseHash=e.configSnapshot?.hash??null}function lr(e,t){let n=qn(e.configSnapshot),r=e.configForm??n;if(!r||!e.configForm&&!e.configSnapshot?.hash)return;let i=Qt(On(r),t);!i||typeof i!=`object`||Array.isArray(i)||$n(e,On(i))}function ur(e){let t=qn(e.configSnapshot);e.configForm=On(e.configFormOriginal??t??{}),e.configRaw=e.configRawOriginal??kn(e.configFormOriginal??t??{}),e.configFormDirty=!1,e.configDraftBaseHash=e.configSnapshot?.hash??null,Hn.delete(e)}function dr(e,t){rr(e,e=>Vn(e,t))}function fr(e,t){let n=t.trim();if(!n)return-1;let r=e?.agents?.list;return Array.isArray(r)?r.findIndex(e=>e&&typeof e==`object`&&`id`in e&&e.id===n):-1}function pr(e,t){let n=t.trim();if(!n)return-1;let r=e.configForm??qn(e.configSnapshot),i=fr(r,n);if(i>=0)return i;let a=r?.agents?.list,o=Array.isArray(a)?a.length:0;return sr(e,[`agents`,`list`,o,`id`],n),o}function mr(e,t){let n=t.trim();if(!n)return!1;let r=fr(e.configForm??qn(e.configSnapshot),n);return r<0?!1:(rr(e,e=>{let t=e?.agents?.list;if(Array.isArray(t))for(let e=0;e<t.length;e++){let n=t[e];if(!n||typeof n!=`object`||Array.isArray(n))continue;let i=n;e===r?i.default=!0:delete i.default}}),!0)}async function hr(e){if(!(!e.client||!e.connected)){e.lastError=null;try{let t=await e.client.request(`config.openFile`,{});if(!t.ok){e.lastError=t.error||`Failed to open config file`;let n=t.path||e.configSnapshot?.path;if(n)try{await navigator.clipboard.writeText(n),e.lastError+=`\n\nFile path copied to clipboard: ${n}`}catch{e.lastError+=`\n\nFile path: ${n}`}}}catch(t){let n=e.configSnapshot?.path;if(n)try{await navigator.clipboard.writeText(n)}catch{}e.lastError=String(t)}}}async function gr(e){let t=await er(e),n=e.lastError;if(!t){await Un(e),n&&!e.lastError&&(e.lastError=n);return}await Kt(e,!0)}async function _r(e){await Un(e,{discardPendingChanges:!0}),await Kt(e,!0)}function vr(e,t){let n=t.trim();!n||e.settings.lastActiveSessionKey===n||e.applySettings({...e.settings,lastActiveSessionKey:n})}var yr=new Set([`tweakcn.com`,`www.tweakcn.com`]),br=/^[A-Za-z0-9][A-Za-z0-9_-]{7,127}$/,xr=`fengming-custom-theme`,Sr=2e5,Cr=240,wr=1e4,Tr=`"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif`,Er=`"JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, monospace`,Dr=[`url(`,`image(`,`image-set(`,`-webkit-image-set(`,`cross-fade(`,`element(`,`-moz-element(`,`paint(`,`@import`,`expression(`],Or=new Set([`black`,`white`,`transparent`,`currentcolor`]),kr=/^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([a-z0-9+\-.,/%\s]+\)$/i,Ar=/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,jr=new Set([`,`,`'`,`"`,`.`,`_`,`-`]),Mr=`bg.bg-accent.bg-elevated.bg-hover.bg-muted.bg-content.card.card-foreground.card-highlight.popover.popover-foreground.panel.panel-strong.panel-hover.chrome.chrome-strong.text.text-strong.chat-text.muted.muted-strong.muted-foreground.border.border-strong.border-hover.input.ring.accent.accent-hover.accent-muted.accent-subtle.accent-foreground.accent-glow.primary.primary-foreground.secondary.secondary-foreground.accent-2.accent-2-muted.accent-2-subtle.destructive.destructive-foreground.danger.danger-muted.danger-subtle.focus.focus-ring.focus-glow.font-body.font-display.mono.grid-line`.split(`.`),Nr=[`background`,`foreground`,`card`,`card-foreground`,`popover`,`popover-foreground`,`primary`,`primary-foreground`,`secondary`,`secondary-foreground`,`muted`,`muted-foreground`,`accent`,`accent-foreground`,`destructive`,`destructive-foreground`,`border`,`input`,`ring`],Pr=D().max(Cr);function Fr(e){return Object.fromEntries(e.map(e=>[e,Pr]))}var Ir=ee({name:D().max(80).optional(),cssVars:ee({theme:ee({"font-sans":Pr.optional(),"font-mono":Pr.optional()}).optional(),light:ee(Fr(Nr)),dark:ee(Fr(Nr))})}),Lr=ee({sourceUrl:D(),themeId:D(),label:D(),importedAt:D(),light:ee(Fr(Mr)),dark:ee(Fr(Mr))});function Rr(e){if(!br.test(e))throw Error(`Unsupported tweakcn link. Expected a theme share URL.`)}function zr(e){let t=e.split(`/`).filter(Boolean);return t.length===2&&t[0]===`themes`?(Rr(t[1]),t[1]):t.length===3&&t[0]===`r`&&t[1]===`themes`?(Rr(t[2]),t[2]):null}function Br(e){let t=T(e);if(!t)throw Error(`Paste a tweakcn theme link to import.`);let n=t.replace(/[.,;:]+$/,``);return br.test(n)?`https://tweakcn.com/themes/${n}`:n.startsWith(`/themes/`)||n.startsWith(`/r/themes/`)?`https://tweakcn.com${n}`:/^(?:www\.)?tweakcn\.com\//i.test(n)?`https://${n}`:n.match(/https?:\/\/(?:www\.)?tweakcn\.com\/[^\s<>"')]+/i)?.[0]?.replace(/[.,;:]+$/,``)??n}function Vr(e){let t=zr(e.pathname);if(t)return t;let n=e.searchParams.get(`theme`)??e.searchParams.get(`themeId`)??e.searchParams.get(`id`);if(n)return Rr(n),n;throw Error(`Unsupported tweakcn link. Expected a theme share URL.`)}function Hr(e,t){let n=T(e);if(!n||n.length>Cr)throw Error(`Unsupported tweakcn token: ${t}`);let r=n.toLowerCase();if(Dr.some(e=>r.includes(e))||n.includes(`/*`)||n.includes(`*/`)||n.includes(`\\`))throw Error(`Unsupported tweakcn token: ${t}`);for(let e of n){let n=e.charCodeAt(0);if(n<32||n===127||e===`{`||e===`}`||e===`;`||e===`<`||e===`>`||e==="`")throw Error(`Unsupported tweakcn token: ${t}`)}return n}function Ur(e,t){let n=Hr(e,t),r=n.toLowerCase();if(Or.has(r)||Ar.test(n)||kr.test(n))return n;throw Error(`Unsupported tweakcn token: ${t}`)}function Wr(e){let t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||e===` `||jr.has(e)}function Gr(e,t){let n=Hr(e,t);if(n.includes(`(`)||n.includes(`)`)||!Array.from(n).every(Wr))throw Error(`Unsupported tweakcn token: ${t}`);return n}function Kr(e,t){return t===`font-sans`||t===`font-mono`?Gr(e,t):Ur(e,t)}function qr(e){return Object.fromEntries(e)}function Jr(e){if(!e||typeof e!=`object`)return null;let t=[];for(let n of Mr){let r=n===`font-body`||n===`font-display`||n===`mono`?Gr(e[n],n):Hr(e[n],n);t.push([n,r])}return qr(t)}function R(e,t,n,r){let i=T(e[n]);if(i)return Kr(i,n);let a=T(t?.[n]);if(a)return Kr(a,n);if(r!=null)return n===`font-sans`||n===`font-mono`?Gr(r,n):Hr(r,n);throw Error(`tweakcn theme is missing required token: ${n}`)}function Yr(e,t,n){let r=e===`light`,i=r?`black`:`white`,a=R(t,n,`background`),o=R(t,n,`foreground`),s=R(t,n,`card`),c=R(t,n,`card-foreground`),l=R(t,n,`popover`),u=R(t,n,`popover-foreground`),d=R(t,n,`primary`),f=R(t,n,`primary-foreground`),p=R(t,n,`secondary`),m=R(t,n,`secondary-foreground`),h=R(t,n,`muted`),g=R(t,n,`muted-foreground`),_=R(t,n,`accent`),v=R(t,n,`accent-foreground`),y=R(t,n,`destructive`),b=R(t,n,`destructive-foreground`),x=R(t,n,`border`),S=R(t,n,`input`),C=R(t,n,`ring`),w=R(t,n,`font-sans`,Tr),T=R(t,n,`font-mono`,Er);return qr([[`bg`,a],[`bg-accent`,`color-mix(in srgb, var(--bg) 88%, var(--card) 12%)`],[`bg-elevated`,s],[`bg-hover`,`color-mix(in srgb, var(--muted) 68%, var(--bg) 32%)`],[`bg-muted`,h],[`bg-content`,`color-mix(in srgb, var(--bg) 92%, var(--card) 8%)`],[`card`,s],[`card-foreground`,c],[`card-highlight`,`color-mix(in srgb, var(--text) ${r?`3`:`5`}%, transparent)`],[`popover`,l],[`popover-foreground`,u],[`panel`,a],[`panel-strong`,s],[`panel-hover`,`color-mix(in srgb, var(--card) 76%, var(--muted) 24%)`],[`chrome`,`color-mix(in srgb, var(--bg) 96%, transparent)`],[`chrome-strong`,`color-mix(in srgb, var(--bg) 98%, transparent)`],[`text`,o],[`text-strong`,o],[`chat-text`,o],[`muted`,g],[`muted-strong`,`color-mix(in srgb, var(--muted) 84%, var(--text) 16%)`],[`muted-foreground`,g],[`border`,x],[`border-strong`,`color-mix(in srgb, var(--border) 72%, var(--text) 28%)`],[`border-hover`,`color-mix(in srgb, var(--border) 55%, var(--text) 45%)`],[`input`,S],[`ring`,C],[`accent`,_],[`accent-hover`,`color-mix(in srgb, var(--accent) 82%, ${i} 18%)`],[`accent-muted`,_],[`accent-subtle`,`color-mix(in srgb, var(--accent) ${r?`10`:`16`}%, transparent)`],[`accent-foreground`,v],[`accent-glow`,`color-mix(in srgb, var(--accent) ${r?`18`:`30`}%, transparent)`],[`primary`,d],[`primary-foreground`,f],[`secondary`,p],[`secondary-foreground`,m],[`accent-2`,d],[`accent-2-muted`,`color-mix(in srgb, var(--accent-2) 72%, transparent)`],[`accent-2-subtle`,`color-mix(in srgb, var(--accent-2) ${r?`8`:`12`}%, transparent)`],[`destructive`,y],[`destructive-foreground`,b],[`danger`,y],[`danger-muted`,`color-mix(in srgb, var(--danger) 75%, transparent)`],[`danger-subtle`,`color-mix(in srgb, var(--danger) ${r?`8`:`12`}%, transparent)`],[`focus`,`color-mix(in srgb, var(--ring) ${r?`14`:`22`}%, transparent)`],[`focus-ring`,`0 0 0 2px var(--bg), 0 0 0 3px color-mix(in srgb, var(--ring) ${r?`70`:`80`}%, transparent)`],[`focus-glow`,`0 0 0 2px var(--bg), 0 0 0 3px var(--ring), 0 0 16px var(--accent-glow)`],[`font-body`,w],[`font-display`,w],[`mono`,T],[`grid-line`,`color-mix(in srgb, var(--text) ${r?`4`:`3`}%, transparent)`]])}function Xr(e){let t=T(e);return t?t.slice(0,80):`Custom`}function Zr(e){let t=Br(e),n;try{n=new URL(t)}catch{throw Error(`Paste a full tweakcn URL.`)}if(!yr.has(n.hostname))throw Error(`Only tweakcn.com theme links are supported.`);let r=Vr(n);return{themeId:r,sourceUrl:`https://tweakcn.com/themes/${r}`,fetchUrl:`https://tweakcn.com/r/themes/${r}`}}function Qr(e){let t=Lr.safeParse(e);if(!t.success)return null;try{Rr(t.data.themeId);let e=Jr(t.data.light),n=Jr(t.data.dark);return!e||!n?null:{sourceUrl:t.data.sourceUrl,themeId:t.data.themeId,label:Xr(t.data.label),importedAt:t.data.importedAt,light:e,dark:n}}catch{return null}}function $r(e,t){let n=Ir.safeParse(e);if(!n.success)throw Error(`tweakcn returned an invalid theme payload.`);let r=n.data,i=r.cssVars.theme;return{sourceUrl:t.sourceUrl,themeId:t.themeId,label:Xr(r.name),importedAt:new Date().toISOString(),light:Yr(`light`,r.cssVars.light,i),dark:Yr(`dark`,r.cssVars.dark,i)}}function ei(e){if(!e)return;let t;try{t=new URL(e)}catch{throw Error(`Unexpected tweakcn import response URL.`)}if(t.protocol!==`https:`||!yr.has(t.hostname))throw Error(`Unexpected redirect during tweakcn import.`)}function ti(e){let t=e.get(`content-length`);if(!t)return null;let n=Number(t);return Number.isFinite(n)&&n>=0?n:null}async function ni(e){let t=ti(e.headers);if(t!=null&&t>Sr)throw Error(`tweakcn theme payload is too large.`);if(!e.body)throw Error(`tweakcn returned an unreadable theme payload.`);let n=e.body.getReader(),r=new TextDecoder,i=0,a=``;try{for(;;){let e=await n.read();if(e.done)break;if(i+=e.value.byteLength,i>Sr)throw await n.cancel().catch(()=>void 0),Error(`tweakcn theme payload is too large.`);a+=r.decode(e.value,{stream:!0})}return a+=r.decode(),a}finally{n.releaseLock()}}async function ri(e){let t=await ni(e);try{return JSON.parse(t)}catch{throw Error(`tweakcn returned invalid JSON.`)}}async function ii(e,t=fetch){let n=Zr(e),r=new AbortController,i=setTimeout(()=>r.abort(),wr);try{let e=await t(n.fetchUrl,{headers:{accept:`application/json`},redirect:`error`,signal:r.signal});if(ei(e.url),!e.ok)throw Error(`tweakcn import failed (${e.status}).`);return $r(await ri(e),n)}catch(e){throw r.signal.aborted?Error(`tweakcn import timed out.`,{cause:e}):e}finally{clearTimeout(i)}}function ai(e){let t=Jr(e.light),n=Jr(e.dark);if(!t||!n)throw Error(`存储的自定义主题缺少必需的令牌`);let r=e=>Mr.map(t=>` --${t}: ${e[t]};`).join(`
|
|
3
3
|
`);return[`:root[data-theme="custom"] {`,r(n),`}`,`:root[data-theme="custom-light"] {`,r(t),`}`].join(`
|
|
4
|
-
`)}function oi(e){if(typeof document>`u`)return;let t=document.getElementById(xr);if(!e){t?.remove();return}let n=``;try{n=ai(e)}catch{t?.remove();return}if(!n){t?.remove();return}t||(t=document.createElement(`style`),t.id=xr,document.head.appendChild(t)),t.textContent=n}var si=[{label:`chat`,tabs:[`chat`]},{label:`control`,tabs:[`overview`,`activity`,`workboard`,`instances`,`sessions`,`usage`,`cron`]},{label:`agent`,tabs:[`agents`,`skills`,`nodes`,`dreams`]},{label:`settings`,tabs:[`config`]}],ci=[`config`,`channels`,`communications`,`appearance`,`automation`,`infrastructure`,`aiAgents`,`debug`,`logs`],li={agents:`/agents`,activity:`/activity`,overview:`/overview`,workboard:`/workboard`,channels:`/channels`,instances:`/instances`,sessions:`/sessions`,usage:`/usage`,cron:`/cron`,skills:`/skills`,nodes:`/nodes`,chat:`/chat`,config:`/config`,communications:`/communications`,appearance:`/appearance`,automation:`/automation`,infrastructure:`/infrastructure`,aiAgents:`/ai-agents`,debug:`/debug`,logs:`/logs`,dreams:`/dreaming`},ui={"/dreams":`dreams`},di=new Map([...Object.entries(li).map(([e,t])=>[t,e]),...Object.entries(ui)]);function fi(e){if(!e)return``;let t=e.trim();return t.startsWith(`/`)||(t=`/${t}`),t===`/`?``:(t.endsWith(`/`)&&(t=t.slice(0,-1)),t)}function pi(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 mi(e,t=``){let n=fi(t),r=li[e];return n?`${n}${r}`:r}function hi(e){return ci.includes(e)}function gi(e,t=``){let n=fi(t),r=e||`/`;n&&(r===n?r=`/`:r.startsWith(`${n}/`)&&(r=r.slice(n.length)));let i=E(pi(r));return i.endsWith(`/index.html`)&&(i=`/`),i===`/`?`chat`:di.get(i)??null}function _i(e){let t=pi(e);if(t.endsWith(`/index.html`)&&(t=pi(t.slice(0,-11))),t===`/`)return``;let n=t.split(`/`).filter(Boolean);if(n.length===0)return``;for(let e=0;e<n.length;e++){let t=E(`/${n.slice(e).join(`/`)}`);if(di.has(t)){let t=n.slice(0,e);return t.length?`/${t.join(`/`)}`:``}}return`/${n.join(`/`)}`}function vi(e){switch(e){case`agents`:return`folder`;case`chat`:return`messageSquare`;case`overview`:return`barChart`;case`activity`:return`activity`;case`workboard`:return`folder`;case`channels`:return`link`;case`instances`:return`radio`;case`sessions`:return`fileText`;case`usage`:return`barChart`;case`cron`:return`loader`;case`skills`:return`zap`;case`nodes`:return`monitor`;case`config`:return`settings`;case`communications`:return`send`;case`appearance`:return`spark`;case`automation`:return`terminal`;case`infrastructure`:return`globe`;case`aiAgents`:return`brain`;case`debug`:return`bug`;case`logs`:return`scrollText`;case`dreams`:return`moon`;default:return`folder`}}function yi(e){return v(e===`config`?`nav.settings`:`tabs.${e}`)}function bi(e){return v(`subtitles.${e}`)}var xi=new Set([`claw`,`knot`,`dash`,`custom`]),Si=new Set([`system`,`light`,`dark`]),Ci={defaultTheme:{theme:`claw`,mode:`dark`},docsTheme:{theme:`claw`,mode:`light`},lightTheme:{theme:`knot`,mode:`dark`},landingTheme:{theme:`knot`,mode:`dark`},newTheme:{theme:`knot`,mode:`dark`},dark:{theme:`claw`,mode:`dark`},light:{theme:`claw`,mode:`light`},openknot:{theme:`knot`,mode:`dark`},fieldmanual:{theme:`dash`,mode:`dark`},clawdash:{theme:`dash`,mode:`light`},system:{theme:`claw`,mode:`system`}};function wi(){return typeof globalThis.matchMedia==`function`?globalThis.matchMedia(`(prefers-color-scheme: light)`).matches:!1}function Ti(e,t){let n=typeof e==`string`?e:``,r=typeof t==`string`?t:``;return{theme:xi.has(n)?n:Ci[n]?.theme??`claw`,mode:Si.has(r)?r:Ci[n]?.mode??`system`}}function Ei(e){return e===`system`?wi()?`light`:`dark`:e}function Di(e,t){let n=Ei(t);return e===`claw`?n===`light`?`light`:`dark`:e===`knot`?n===`light`?`openknot-light`:`openknot`:e===`dash`?n===`light`?`dash-light`:`dash`:n===`light`?`custom-light`:`custom`}function Oi(e,t){let n=T(e);if(n)return n.length<=t?n:n.slice(0,t)}var ki=[{id:`read`,label:`read`,description:`Read file contents`,sectionId:`fs`,profiles:[`coding`]},{id:`write`,label:`write`,description:`Create or overwrite files`,sectionId:`fs`,profiles:[`coding`]},{id:`edit`,label:`edit`,description:`Make precise edits`,sectionId:`fs`,profiles:[`coding`]},{id:`apply_patch`,label:`apply_patch`,description:`Patch files`,sectionId:`fs`,profiles:[`coding`]},{id:`exec`,label:`exec`,description:`Run shell now.`,sectionId:`runtime`,profiles:[`coding`]},{id:`process`,label:`process`,description:`Inspect/control exec sessions.`,sectionId:`runtime`,profiles:[`coding`]},{id:`code_execution`,label:`code_execution`,description:`Run sandboxed remote analysis`,sectionId:`runtime`,profiles:[`coding`],includeInFengMingGroup:!0},{id:`web_search`,label:`web_search`,description:`Search the web`,sectionId:`web`,profiles:[`coding`],includeInFengMingGroup:!0},{id:`web_fetch`,label:`web_fetch`,description:`Fetch web content`,sectionId:`web`,profiles:[`coding`],includeInFengMingGroup:!0},{id:`x_search`,label:`x_search`,description:`Search X posts`,sectionId:`web`,profiles:[`coding`],includeInFengMingGroup:!0},{id:`memory_search`,label:`memory_search`,description:`Semantic search`,sectionId:`memory`,profiles:[`coding`],includeInFengMingGroup:!0},{id:`memory_get`,label:`memory_get`,description:`Read memory files`,sectionId:`memory`,profiles:[`coding`],includeInFengMingGroup:!0},{id:`sessions_list`,label:`sessions_list`,description:`List visible sessions; filters/previews.`,sectionId:`sessions`,profiles:[`coding`,`messaging`],includeInFengMingGroup:!0},{id:`sessions_history`,label:`sessions_history`,description:`Read sanitized session history.`,sectionId:`sessions`,profiles:[`coding`,`messaging`],includeInFengMingGroup:!0},{id:`sessions_send`,label:`sessions_send`,description:`Message session or configured agent.`,sectionId:`sessions`,profiles:[`coding`,`messaging`],includeInFengMingGroup:!0},{id:`sessions_spawn`,label:`sessions_spawn`,description:`Spawn subagent or ACP session.`,sectionId:`sessions`,profiles:[`coding`],includeInFengMingGroup:!0},{id:`sessions_yield`,label:`sessions_yield`,description:`End turn to receive sub-agent results`,sectionId:`sessions`,profiles:[`coding`],includeInFengMingGroup:!0},{id:`subagents`,label:`subagents`,description:`Manage sub-agents`,sectionId:`sessions`,profiles:[`coding`],includeInFengMingGroup:!0},{id:`session_status`,label:`session_status`,description:`Show session status/model/usage.`,sectionId:`sessions`,profiles:[`minimal`,`coding`,`messaging`],includeInFengMingGroup:!0},{id:`browser`,label:`browser`,description:`Control web browser`,sectionId:`ui`,profiles:[],includeInFengMingGroup:!0},{id:`canvas`,label:`canvas`,description:`Control node Canvas surfaces when the Canvas plugin is enabled`,sectionId:`ui`,profiles:[]},{id:`message`,label:`message`,description:`Send messages`,sectionId:`messaging`,profiles:[`messaging`],includeInFengMingGroup:!0},{id:`heartbeat_respond`,label:`heartbeat_respond`,description:`Record heartbeat outcomes`,sectionId:`automation`,profiles:[],includeInFengMingGroup:!0},{id:`cron`,label:`cron`,description:`Schedule reminders, cron, wake events.`,sectionId:`automation`,profiles:[`coding`],includeInFengMingGroup:!0},{id:`gateway`,label:`gateway`,description:`Gateway control`,sectionId:`automation`,profiles:[],includeInFengMingGroup:!0},{id:`nodes`,label:`nodes`,description:`Nodes + devices`,sectionId:`nodes`,profiles:[],includeInFengMingGroup:!0},{id:`agents_list`,label:`agents_list`,description:`List agents`,sectionId:`agents`,profiles:[],includeInFengMingGroup:!0},{id:`get_goal`,label:`get_goal`,description:`Get current thread goal`,sectionId:`agents`,profiles:[`coding`],includeInFengMingGroup:!0},{id:`create_goal`,label:`create_goal`,description:`Create a thread goal`,sectionId:`agents`,profiles:[`coding`],includeInFengMingGroup:!0},{id:`update_goal`,label:`update_goal`,description:`Complete or block a thread goal`,sectionId:`agents`,profiles:[`coding`],includeInFengMingGroup:!0},{id:`update_plan`,label:`update_plan`,description:`Track short work plan.`,sectionId:`agents`,profiles:[`coding`],includeInFengMingGroup:!0},{id:`image`,label:`image`,description:`Image understanding`,sectionId:`media`,profiles:[`coding`],includeInFengMingGroup:!0},{id:`image_generate`,label:`image_generate`,description:`Image generation`,sectionId:`media`,profiles:[`coding`],includeInFengMingGroup:!0},{id:`music_generate`,label:`music_generate`,description:`Music generation`,sectionId:`media`,profiles:[`coding`],includeInFengMingGroup:!0},{id:`video_generate`,label:`video_generate`,description:`Video generation`,sectionId:`media`,profiles:[`coding`],includeInFengMingGroup:!0},{id:`tts`,label:`tts`,description:`Text-to-speech conversion`,sectionId:`media`,profiles:[],includeInFengMingGroup:!0}];new Map(ki.map(e=>[e.id,e]));function Ai(e){return ki.filter(t=>t.profiles.includes(e)).map(e=>e.id)}var ji={minimal:{allow:Ai(`minimal`)},coding:{allow:[...Ai(`coding`),`bundle-mcp`]},messaging:{allow:[...Ai(`messaging`),`bundle-mcp`]},full:{allow:[`*`]}};function Mi(){let e=new Map;for(let t of ki){let n=`group:${t.sectionId}`,r=e.get(n)??[];r.push(t.id),e.set(n,r)}return{"group:fengming":ki.filter(e=>e.includeInFengMingGroup).map(e=>e.id),...Object.fromEntries(e.entries())}}var Ni=Mi();function Pi(e){if(!e)return;let t=ji[e];if(t&&!(!t.allow&&!t.deny))return{allow:t.allow?[...t.allow]:void 0,deny:t.deny?[...t.deny]:void 0}}var Fi={bash:`exec`,"apply-patch":`apply_patch`},Ii={...Ni};function Li(e){let t=E(e);return Fi[t]??t}function Ri(e){return e?e.map(Li).filter(Boolean):[]}function zi(e){let t=Ri(e),n=[];for(let e of t){let t=Ii[e];if(t){n.push(...t);continue}n.push(e)}return tn(n)}function Bi(e){return Pi(e)}var Vi=50,Hi=64,Ui=2e6,Wi=500,Gi=200,Ki=/^(data:image\/|\/(?!\/))/i,qi=`Assistant`;function Ji(e){let t=Oi(e??void 0,Ui);return t?Ki.test(t)?t:/[\r\n]/.test(t)?null:t.length<=Hi?t:null:null}function Yi(e){let t=Oi(e?.name,Vi)??qi,n=Ji(e?.avatar),r=Oi(e?.avatarSource??void 0,Wi)??null,i=e?.avatarStatus===`none`||e?.avatarStatus===`local`||e?.avatarStatus===`remote`||e?.avatarStatus===`data`?e.avatarStatus:null,a=Oi(e?.avatarReason??void 0,Gi)??null;return{agentId:typeof e?.agentId==`string`&&e.agentId.trim()?e.agentId.trim():null,name:t,avatar:n,avatarSource:r,avatarStatus:i,avatarReason:a}}function Xi(e,t){let n=e.trim();if(!n)return``;let r=t?.trim();if(!r)return n;let i=`${r.toLowerCase()}/`;return n.toLowerCase().startsWith(i)?n:`${r}/${n}`}function Zi(e){let t=e.trim();return t?t.includes(`/`)?{kind:`qualified`,value:t}:{kind:`raw`,value:t}:null}function Qi(e,t){if(!e)return``;let n=e?.value.trim();return n?e.kind===`qualified`?n:ta(n,t)||n:``}function $i(e,t){if(typeof e!=`string`)return``;let n=e.trim();if(!n)return``;let r=t?.trim();if(!r)return n;let i=`${r.toLowerCase()}/`;return n.toLowerCase().startsWith(i)||n.includes(`/`)?n:Xi(n,r)}function ea(e,t){let n=t.trim().toLowerCase();return n?e.some(e=>oa(e)===n):!1}function ta(e,t){let n=e.trim().toLowerCase();if(!n)return``;let r=``;for(let e of t){if(e.id.trim().toLowerCase()!==n)continue;let t=Xi(e.id,e.provider);if(!r){r=t;continue}if(r.toLowerCase()!==t.toLowerCase())return``}return r}function na(e,t,n){if(typeof e!=`string`)return``;let r=e.trim();if(!r)return``;let i=t?.trim();if(!i)return Qi(Zi(r),n);if(!r.includes(`/`)){let e=Qi(Zi(r),n);return e===r?$i(r,i):e}if(ea(n,r))return r;let a=ta(r,n);if(a)return a;let o=Xi(r,i);return ea(n,o)?o:$i(r,i)}function ra(e){let t=e.trim();if(!t)return``;let n=t.indexOf(`/`);return n<=0?t:`${t.slice(n+1)} · ${t.slice(0,n)}`}function ia(e){let t=e.provider?.trim();return t?`${e.id} · ${t}`:e.id}function aa(e){return e.alias?.trim()||e.name.trim()}function oa(e){return Xi(e.id,e.provider).trim().toLowerCase()}function sa(e,t){return`${e.toLowerCase()}\u0000${t?.trim().toLowerCase()??``}`}function ca(e){let t=new Map,n=new Map;for(let r of e){let e=aa(r);if(!e)continue;let i=oa(r),a=e.toLowerCase(),o=sa(e,r.provider),s=t.get(a)??new Set;s.add(i),t.set(a,s);let c=n.get(o)??new Set;c.add(i),n.set(o,c)}let r=new Map;for(let i of e){let e=oa(i),a=aa(i);if(!a){r.set(e,ia(i));continue}let o=a.toLowerCase();if((t.get(o)?.size??0)<=1){r.set(e,a);continue}let s=i.provider?.trim();if((n.get(sa(a,s))?.size??0)<=1){r.set(e,s?`${a} · ${s}`:`${a} · ${i.id}`);continue}r.set(e,`${a} · ${ia(i)}`)}return r}function la(e,t){return t.get(oa(e))??ia(e)}function ua(e,t){let n=e.trim();return n?t.get(n.toLowerCase())??ra(n):``}function da(e,t){let n=e.provider?.trim();return{value:Xi(e.id,n),label:la(e,t)}}var fa=[{id:`fs`,label:`Files`,tools:[{id:`read`,label:`read`,description:v(`tools.readFiles`)},{id:`write`,label:`write`,description:v(`tools.createFiles`)},{id:`edit`,label:`edit`,description:v(`tools.preciseEdits`)},{id:`apply_patch`,label:`apply_patch`,description:`Patch files (OpenAI)`}]},{id:`runtime`,label:`Runtime`,tools:[{id:`exec`,label:`exec`,description:v(`tools.runShell`)},{id:`process`,label:`process`,description:v(`tools.manageProcesses`)}]},{id:`web`,label:`Web`,tools:[{id:`web_search`,label:`web_search`,description:v(`tools.searchWeb`)},{id:`web_fetch`,label:`web_fetch`,description:v(`tools.fetchWeb`)}]},{id:`memory`,label:`Memory`,tools:[{id:`memory_search`,label:`memory_search`,description:v(`tools.semanticSearch`)},{id:`memory_get`,label:`memory_get`,description:v(`tools.readMemory`)}]},{id:`sessions`,label:`Sessions`,tools:[{id:`sessions_list`,label:`sessions_list`,description:v(`tools.listSessions`)},{id:`sessions_history`,label:`sessions_history`,description:v(`tools.sessionHistory`)},{id:`sessions_send`,label:`sessions_send`,description:v(`tools.sendToSession`)},{id:`sessions_spawn`,label:`sessions_spawn`,description:v(`agents.spawnSubAgent`)},{id:`session_status`,label:`session_status`,description:v(`tools.sessionStatus`)}]},{id:`ui`,label:`UI`,tools:[{id:`browser`,label:`browser`,description:v(`tools.controlBrowser`)},{id:`canvas`,label:`canvas`,description:v(`tools.controlCanvases`)}]},{id:`messaging`,label:`Messaging`,tools:[{id:`message`,label:`message`,description:v(`tools.sendMessages`)}]},{id:`automation`,label:`Automation`,tools:[{id:`cron`,label:`cron`,description:v(`tools.scheduleTasks`)},{id:`gateway`,label:`gateway`,description:v(`tools.gatewayControl`)}]},{id:`nodes`,label:`Nodes`,tools:[{id:`nodes`,label:`nodes`,description:v(`agents.nodesDevices`)}]},{id:`agents`,label:`Agents`,tools:[{id:`agents_list`,label:`agents_list`,description:v(`tools.listAgents`)}]},{id:`media`,label:`Media`,tools:[{id:`image`,label:`image`,description:v(`tools.imageUnderstanding`)}]}],pa=[{id:`minimal`,label:`Minimal`},{id:`coding`,label:`Coding`},{id:`messaging`,label:`Messaging`},{id:`full`,label:`Full`}];function ma(e){return e?.groups?.length?e.groups.map(e=>({id:e.id,label:e.label,source:e.source,pluginId:e.pluginId,tools:e.tools.map(e=>({id:e.id,label:e.label,description:e.description,source:e.source,pluginId:e.pluginId,optional:e.optional,defaultProfiles:[...e.defaultProfiles]}))})):fa}function ha(e){return e?.profiles?.length?e.profiles:pa}function ga(e){return T(e.name)??T(e.identity?.name)??e.id}var _a=/^(data:image\/|\/(?!\/))/i;function va(e){return _a.test(e)}function ya(e,t){let n=[T(t?.avatar),T(e.identity?.avatarUrl),T(e.identity?.avatar)];for(let e of n)if(e&&va(e))return e;return null}function ba(e,t,n){let r=T(e);return r?.startsWith(`blob:`)?r:ya(t,n)}function xa(e){let t=T(e)?.replace(/\/$/,``)??``;return t?`${t}/favicon.svg`:`favicon.svg`}function Sa(e){let t=T(e)?.replace(/\/$/,``)??``;return t?`${t}/apple-touch-icon.png`:`apple-touch-icon.png`}function Ca(e){let t=e.trim();return t.startsWith(`blob:`)||va(t)}var wa=/[\u200B-\u200F\u202A-\u202E\u2060-\u206F\uFEFF]/u;function Ta(e){let t=e?.trim();return!t||t===`A`||Ca(t)||t.length>8||/\s/.test(t)||/[\\/.:]/.test(t)||wa.test(t)?null:t}function Ea(e,t){let n=[T(e.identity?.emoji),T(e.identity?.avatar),T(t?.emoji),T(t?.avatar)];for(let e of n){let t=Ta(e);if(t)return t}return null}function Da(e,t){return t&&e===t?`default`:null}function Oa(e){if(e==null||!Number.isFinite(e))return`-`;if(e<1024)return`${e} B`;let t=[`KB`,`MB`,`GB`,`TB`],n=e/1024,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return`${n.toFixed(+(n<10))} ${t[r]}`}function ka(e,t){let n=e;return{entry:(n?.agents?.list??[]).find(e=>e?.id===t),defaults:n?.agents?.defaults,globalTools:n?.tools}}function Aa(e,t,n,r,i){let a=ka(t,e.id),o=(n&&n.agentId===e.id?n.workspace:null)||a.entry?.workspace||a.defaults?.workspace||e.workspace||`default`,s=a.entry?.model?Ma(a.entry?.model):a.defaults?.model?Ma(a.defaults?.model):Ma(e.model),c=ja(e.agentRuntime),l=T(e.identity?.name)||T(e.name)||T(i?.name)||a.entry?.name||e.id,u=ya(e,i)?`custom`:Ea(e,i)??`—`,d=Array.isArray(a.entry?.skills)?a.entry?.skills:null,f=d?.length??null;return{workspace:o,model:s,runtime:c,identityName:l,identityAvatar:u,skillsLabel:d?`${f} selected`:`all skills`,isDefault:!!(r&&e.id===r)}}function ja(e){let t=T(e?.id)??`pi`,n=T(e?.fallback);return n?`${t} (fallback ${n})`:t}function Ma(e){if(!e)return`-`;if(typeof e==`string`)return T(e)||`-`;if(typeof e==`object`&&e){let t=e,n=T(t.primary);if(n){let e=Array.isArray(t.fallbacks)?t.fallbacks.length:0;return e>0?`${n} (+${e} fallback)`:n}}return`-`}function Na(e){let t=e.match(/^(.+) \(\+\d+ fallback\)$/);return t?t[1]:e}function Pa(e){if(!e)return null;if(typeof e==`string`)return T(e)||null;if(typeof e==`object`&&e){let t=e;return T(typeof t.primary==`string`?t.primary:typeof t.model==`string`?t.model:typeof t.id==`string`?t.id:typeof t.value==`string`?t.value:null)||null}return null}function Fa(e){if(!e||typeof e==`string`)return null;if(typeof e==`object`&&e){let t=e,n=Array.isArray(t.fallbacks)?t.fallbacks:Array.isArray(t.fallback)?t.fallback:null;return n?n.filter(e=>typeof e==`string`):null}return null}function Ia(e,t){return Fa(e)??Fa(t)}function La(e,t){if(typeof t!=`string`)return;let n=t.trim();n&&e.add(n)}function Ra(e,t){if(!t)return;if(typeof t==`string`){La(e,t);return}if(typeof t!=`object`)return;let n=t;La(e,n.primary),La(e,n.model),La(e,n.id),La(e,n.value);let r=Array.isArray(n.fallbacks)?n.fallbacks:Array.isArray(n.fallback)?n.fallback:[];for(let t of r)La(e,t)}function za(e){let t=Array.from(e),n=Array.from({length:t.length},()=>``),r=(e,r,i)=>{let a=e,o=r,s=e;for(;a<r&&o<i;)n[s++]=t[a].localeCompare(t[o])<=0?t[a++]:t[o++];for(;a<r;)n[s++]=t[a++];for(;o<i;)n[s++]=t[o++];for(let r=e;r<i;r+=1)t[r]=n[r]},i=(e,t)=>{if(t-e<=1)return;let n=e+t>>>1;i(e,n),i(n,t),r(e,n,t)};return i(0,t.length),t}function Ba(e){if(!e||typeof e!=`object`)return[];let t=e.agents;if(!t||typeof t!=`object`)return[];let n=new Set,r=t.defaults;if(r&&typeof r==`object`){let e=r;Ra(n,e.model);let t=e.models;if(t&&typeof t==`object`)for(let e of Object.keys(t))La(n,e)}let i=t.list;if(i&&typeof i==`object`)for(let e of Object.values(i))!e||typeof e!=`object`||Ra(n,e.model);return za(n)}function Va(e){return e.split(`,`).map(e=>e.trim()).filter(Boolean)}function Ha(e){let t=e?.agents?.defaults?.models;if(!t||typeof t!=`object`)return[];let n=[];for(let[e,r]of Object.entries(t)){let t=e.trim();if(!t)continue;let i=r&&typeof r==`object`&&`alias`in r&&typeof r.alias==`string`?r.alias?.trim():void 0,a=i&&i!==t?`${i} (${t})`:t;n.push({value:t,label:a})}return n}function Ua(e,t,n,r){let a=new Set,o=[],s=r?E(r):null,c=(e,t)=>{let n=E(e);a.has(n)||(a.add(n),o.push({value:e,label:t}))};for(let t of Ha(e))c(t.value,t.label);if(n)for(let e of n){let t=e.provider?.trim();c(Xi(e.id,t),t?`${e.id} · ${t}`:e.id)}return t&&!a.has(E(t))&&o.unshift({value:t,label:`Current (${t})`}),o.length===0?i:o.map(e=>d`
|
|
4
|
+
`)}function oi(e){if(typeof document>`u`)return;let t=document.getElementById(xr);if(!e){t?.remove();return}let n=``;try{n=ai(e)}catch{t?.remove();return}if(!n){t?.remove();return}t||(t=document.createElement(`style`),t.id=xr,document.head.appendChild(t)),t.textContent=n}var si=[{label:`chat`,tabs:[`chat`]},{label:`control`,tabs:[`overview`,`activity`,`workboard`,`instances`,`sessions`,`usage`,`cron`]},{label:`agent`,tabs:[`agents`,`skills`,`nodes`,`dreams`]},{label:`settings`,tabs:[`config`]}],ci=[`config`,`channels`,`communications`,`appearance`,`automation`,`infrastructure`,`aiAgents`,`debug`,`logs`],li={agents:`/agents`,activity:`/activity`,overview:`/overview`,workboard:`/workboard`,channels:`/channels`,instances:`/instances`,sessions:`/sessions`,usage:`/usage`,cron:`/cron`,skills:`/skills`,nodes:`/nodes`,chat:`/chat`,config:`/config`,communications:`/communications`,appearance:`/appearance`,automation:`/automation`,infrastructure:`/infrastructure`,aiAgents:`/ai-agents`,debug:`/debug`,logs:`/logs`,dreams:`/dreaming`},ui={"/dreams":`dreams`},di=new Map([...Object.entries(li).map(([e,t])=>[t,e]),...Object.entries(ui)]);function fi(e){if(!e)return``;let t=e.trim();return t.startsWith(`/`)||(t=`/${t}`),t===`/`?``:(t.endsWith(`/`)&&(t=t.slice(0,-1)),t)}function pi(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 mi(e,t=``){let n=fi(t),r=li[e];return n?`${n}${r}`:r}function hi(e){return ci.includes(e)}function gi(e,t=``){let n=fi(t),r=e||`/`;n&&(r===n?r=`/`:r.startsWith(`${n}/`)&&(r=r.slice(n.length)));let i=E(pi(r));return i.endsWith(`/index.html`)&&(i=`/`),i===`/`?`chat`:di.get(i)??null}function _i(e){let t=pi(e);if(t.endsWith(`/index.html`)&&(t=pi(t.slice(0,-11))),t===`/`)return``;let n=t.split(`/`).filter(Boolean);if(n.length===0)return``;for(let e=0;e<n.length;e++){let t=E(`/${n.slice(e).join(`/`)}`);if(di.has(t)){let t=n.slice(0,e);return t.length?`/${t.join(`/`)}`:``}}return`/${n.join(`/`)}`}function vi(e){switch(e){case`agents`:return`folder`;case`chat`:return`messageSquare`;case`overview`:return`barChart`;case`activity`:return`activity`;case`workboard`:return`folder`;case`channels`:return`link`;case`instances`:return`radio`;case`sessions`:return`fileText`;case`usage`:return`barChart`;case`cron`:return`loader`;case`skills`:return`zap`;case`nodes`:return`monitor`;case`config`:return`settings`;case`communications`:return`send`;case`appearance`:return`spark`;case`automation`:return`terminal`;case`infrastructure`:return`globe`;case`aiAgents`:return`brain`;case`debug`:return`bug`;case`logs`:return`scrollText`;case`dreams`:return`moon`;default:return`folder`}}function yi(e){return v(e===`config`?`nav.settings`:`tabs.${e}`)}function bi(e){return v(`subtitles.${e}`)}var xi=new Set([`claw`,`knot`,`dash`,`custom`]),Si=new Set([`system`,`light`,`dark`]),Ci={defaultTheme:{theme:`claw`,mode:`dark`},docsTheme:{theme:`claw`,mode:`light`},lightTheme:{theme:`knot`,mode:`dark`},landingTheme:{theme:`knot`,mode:`dark`},newTheme:{theme:`knot`,mode:`dark`},dark:{theme:`claw`,mode:`dark`},light:{theme:`claw`,mode:`light`},openknot:{theme:`knot`,mode:`dark`},fieldmanual:{theme:`dash`,mode:`dark`},clawdash:{theme:`dash`,mode:`light`},system:{theme:`claw`,mode:`system`}};function wi(){return typeof globalThis.matchMedia==`function`?globalThis.matchMedia(`(prefers-color-scheme: light)`).matches:!1}function Ti(e,t){let n=typeof e==`string`?e:``,r=typeof t==`string`?t:``;return{theme:xi.has(n)?n:Ci[n]?.theme??`claw`,mode:Si.has(r)?r:Ci[n]?.mode??`system`}}function Ei(e){return e===`system`?wi()?`light`:`dark`:e}function Di(e,t){let n=Ei(t);return e===`claw`?n===`light`?`light`:`dark`:e===`knot`?n===`light`?`openknot-light`:`openknot`:e===`dash`?n===`light`?`dash-light`:`dash`:n===`light`?`custom-light`:`custom`}function Oi(e,t){let n=T(e);if(n)return n.length<=t?n:n.slice(0,t)}var ki=[{id:`read`,label:`read`,description:`Read file contents`,sectionId:`fs`,profiles:[`coding`]},{id:`write`,label:`write`,description:`Create or overwrite files`,sectionId:`fs`,profiles:[`coding`]},{id:`edit`,label:`edit`,description:`Make precise edits`,sectionId:`fs`,profiles:[`coding`]},{id:`apply_patch`,label:`apply_patch`,description:`Patch files`,sectionId:`fs`,profiles:[`coding`]},{id:`exec`,label:`exec`,description:`Run shell now.`,sectionId:`runtime`,profiles:[`coding`]},{id:`process`,label:`process`,description:`Inspect/control exec sessions.`,sectionId:`runtime`,profiles:[`coding`]},{id:`code_execution`,label:`code_execution`,description:`Run sandboxed remote analysis`,sectionId:`runtime`,profiles:[`coding`],includeInFengMingGroup:!0},{id:`web_search`,label:`web_search`,description:`Search the web`,sectionId:`web`,profiles:[`coding`],includeInFengMingGroup:!0},{id:`web_fetch`,label:`web_fetch`,description:`Fetch web content`,sectionId:`web`,profiles:[`coding`],includeInFengMingGroup:!0},{id:`x_search`,label:`x_search`,description:`Search X posts`,sectionId:`web`,profiles:[`coding`],includeInFengMingGroup:!0},{id:`memory_search`,label:`memory_search`,description:`Semantic search`,sectionId:`memory`,profiles:[`coding`],includeInFengMingGroup:!0},{id:`memory_get`,label:`memory_get`,description:`Read memory files`,sectionId:`memory`,profiles:[`coding`],includeInFengMingGroup:!0},{id:`sessions_list`,label:`sessions_list`,description:`List visible sessions; filters/previews.`,sectionId:`sessions`,profiles:[`coding`,`messaging`],includeInFengMingGroup:!0},{id:`sessions_history`,label:`sessions_history`,description:`Read sanitized session history.`,sectionId:`sessions`,profiles:[`coding`,`messaging`],includeInFengMingGroup:!0},{id:`sessions_send`,label:`sessions_send`,description:`Message session or configured agent.`,sectionId:`sessions`,profiles:[`coding`,`messaging`],includeInFengMingGroup:!0},{id:`sessions_spawn`,label:`sessions_spawn`,description:`Spawn subagent or ACP session.`,sectionId:`sessions`,profiles:[`coding`],includeInFengMingGroup:!0},{id:`sessions_yield`,label:`sessions_yield`,description:`End turn to receive sub-agent results`,sectionId:`sessions`,profiles:[`coding`],includeInFengMingGroup:!0},{id:`subagents`,label:`subagents`,description:`Manage sub-agents`,sectionId:`sessions`,profiles:[`coding`],includeInFengMingGroup:!0},{id:`session_status`,label:`session_status`,description:`Show session status/model/usage.`,sectionId:`sessions`,profiles:[`minimal`,`coding`,`messaging`],includeInFengMingGroup:!0},{id:`browser`,label:`browser`,description:`Control web browser`,sectionId:`ui`,profiles:[],includeInFengMingGroup:!0},{id:`canvas`,label:`canvas`,description:`Control node Canvas surfaces when the Canvas plugin is enabled`,sectionId:`ui`,profiles:[]},{id:`message`,label:`message`,description:`Send messages`,sectionId:`messaging`,profiles:[`messaging`],includeInFengMingGroup:!0},{id:`heartbeat_respond`,label:`heartbeat_respond`,description:`Record heartbeat outcomes`,sectionId:`automation`,profiles:[],includeInFengMingGroup:!0},{id:`cron`,label:`cron`,description:`Schedule reminders, cron, wake events.`,sectionId:`automation`,profiles:[`coding`],includeInFengMingGroup:!0},{id:`gateway`,label:`gateway`,description:`Gateway control`,sectionId:`automation`,profiles:[],includeInFengMingGroup:!0},{id:`nodes`,label:`nodes`,description:`Nodes + devices`,sectionId:`nodes`,profiles:[],includeInFengMingGroup:!0},{id:`agents_list`,label:`agents_list`,description:`List agents`,sectionId:`agents`,profiles:[],includeInFengMingGroup:!0},{id:`get_goal`,label:`get_goal`,description:`Get current thread goal`,sectionId:`agents`,profiles:[`coding`],includeInFengMingGroup:!0},{id:`create_goal`,label:`create_goal`,description:`Create a thread goal`,sectionId:`agents`,profiles:[`coding`],includeInFengMingGroup:!0},{id:`update_goal`,label:`update_goal`,description:`Complete or block a thread goal`,sectionId:`agents`,profiles:[`coding`],includeInFengMingGroup:!0},{id:`update_plan`,label:`update_plan`,description:`Track short work plan.`,sectionId:`agents`,profiles:[`coding`],includeInFengMingGroup:!0},{id:`image`,label:`image`,description:`Image understanding`,sectionId:`media`,profiles:[`coding`],includeInFengMingGroup:!0},{id:`image_generate`,label:`image_generate`,description:`Image generation`,sectionId:`media`,profiles:[`coding`],includeInFengMingGroup:!0},{id:`music_generate`,label:`music_generate`,description:`Music generation`,sectionId:`media`,profiles:[`coding`],includeInFengMingGroup:!0},{id:`video_generate`,label:`video_generate`,description:`Video generation`,sectionId:`media`,profiles:[`coding`],includeInFengMingGroup:!0},{id:`tts`,label:`tts`,description:`Text-to-speech conversion`,sectionId:`media`,profiles:[],includeInFengMingGroup:!0}];new Map(ki.map(e=>[e.id,e]));function Ai(e){return ki.filter(t=>t.profiles.includes(e)).map(e=>e.id)}var ji={minimal:{allow:Ai(`minimal`)},coding:{allow:[...Ai(`coding`),`bundle-mcp`]},messaging:{allow:[...Ai(`messaging`),`bundle-mcp`]},full:{allow:[`*`]}};function Mi(){let e=new Map;for(let t of ki){let n=`group:${t.sectionId}`,r=e.get(n)??[];r.push(t.id),e.set(n,r)}return{"group:fengming":ki.filter(e=>e.includeInFengMingGroup).map(e=>e.id),...Object.fromEntries(e.entries())}}var Ni=Mi();function Pi(e){if(!e)return;let t=ji[e];if(t&&!(!t.allow&&!t.deny))return{allow:t.allow?[...t.allow]:void 0,deny:t.deny?[...t.deny]:void 0}}var Fi={bash:`exec`,"apply-patch":`apply_patch`},Ii={...Ni};function Li(e){let t=E(e);return Fi[t]??t}function Ri(e){return e?e.map(Li).filter(Boolean):[]}function zi(e){let t=Ri(e),n=[];for(let e of t){let t=Ii[e];if(t){n.push(...t);continue}n.push(e)}return tn(n)}function Bi(e){return Pi(e)}var Vi=50,Hi=64,Ui=2e6,Wi=500,Gi=200,Ki=/^(data:image\/|\/(?!\/))/i,qi=`Assistant`;function Ji(e){let t=Oi(e??void 0,Ui);return t?Ki.test(t)?t:/[\r\n]/.test(t)?null:t.length<=Hi?t:null:null}function Yi(e){let t=Oi(e?.name,Vi)??qi,n=Ji(e?.avatar),r=Oi(e?.avatarSource??void 0,Wi)??null,i=e?.avatarStatus===`none`||e?.avatarStatus===`local`||e?.avatarStatus===`remote`||e?.avatarStatus===`data`?e.avatarStatus:null,a=Oi(e?.avatarReason??void 0,Gi)??null;return{agentId:typeof e?.agentId==`string`&&e.agentId.trim()?e.agentId.trim():null,name:t,avatar:n,avatarSource:r,avatarStatus:i,avatarReason:a}}function Xi(e,t){let n=e.trim();if(!n)return``;let r=t?.trim();if(!r)return n;let i=`${r.toLowerCase()}/`;return n.toLowerCase().startsWith(i)?n:`${r}/${n}`}function Zi(e){let t=e.trim();return t?t.includes(`/`)?{kind:`qualified`,value:t}:{kind:`raw`,value:t}:null}function Qi(e,t){if(!e)return``;let n=e?.value.trim();return n?e.kind===`qualified`?n:ta(n,t)||n:``}function $i(e,t){if(typeof e!=`string`)return``;let n=e.trim();if(!n)return``;let r=t?.trim();if(!r)return n;let i=`${r.toLowerCase()}/`;return n.toLowerCase().startsWith(i)||n.includes(`/`)?n:Xi(n,r)}function ea(e,t){let n=t.trim().toLowerCase();return n?e.some(e=>oa(e)===n):!1}function ta(e,t){let n=e.trim().toLowerCase();if(!n)return``;let r=``;for(let e of t){if(e.id.trim().toLowerCase()!==n)continue;let t=Xi(e.id,e.provider);if(!r){r=t;continue}if(r.toLowerCase()!==t.toLowerCase())return``}return r}function na(e,t,n){if(typeof e!=`string`)return``;let r=e.trim();if(!r)return``;let i=t?.trim();if(!i)return Qi(Zi(r),n);if(!r.includes(`/`)){let e=Qi(Zi(r),n);return e===r?$i(r,i):e}if(ea(n,r))return r;let a=ta(r,n);if(a)return a;let o=Xi(r,i);return ea(n,o)?o:$i(r,i)}function ra(e){let t=e.trim();if(!t)return``;let n=t.indexOf(`/`);return n<=0?t:`${t.slice(n+1)} · ${t.slice(0,n)}`}function ia(e){let t=e.provider?.trim();return t?`${e.id} · ${t}`:e.id}function aa(e){return e.alias?.trim()||e.name.trim()}function oa(e){return Xi(e.id,e.provider).trim().toLowerCase()}function sa(e,t){return`${e.toLowerCase()}\u0000${t?.trim().toLowerCase()??``}`}function ca(e){let t=new Map,n=new Map;for(let r of e){let e=aa(r);if(!e)continue;let i=oa(r),a=e.toLowerCase(),o=sa(e,r.provider),s=t.get(a)??new Set;s.add(i),t.set(a,s);let c=n.get(o)??new Set;c.add(i),n.set(o,c)}let r=new Map;for(let i of e){let e=oa(i),a=aa(i);if(!a){r.set(e,ia(i));continue}let o=a.toLowerCase();if((t.get(o)?.size??0)<=1){r.set(e,a);continue}let s=i.provider?.trim();if((n.get(sa(a,s))?.size??0)<=1){r.set(e,s?`${a} · ${s}`:`${a} · ${i.id}`);continue}r.set(e,`${a} · ${ia(i)}`)}return r}function la(e,t){return t.get(oa(e))??ia(e)}function ua(e,t){let n=e.trim();return n?t.get(n.toLowerCase())??ra(n):``}function da(e,t){let n=e.provider?.trim();return{value:Xi(e.id,n),label:la(e,t)}}var fa=[{id:`fs`,label:v(`agents.tools.cat.files`),tools:[{id:`read`,label:`read`,description:v(`tools.readFiles`)},{id:`write`,label:`write`,description:v(`tools.createFiles`)},{id:`edit`,label:`edit`,description:v(`tools.preciseEdits`)},{id:`apply_patch`,label:`apply_patch`,description:v(`agents.tools.desc.patchFiles`)}]},{id:`runtime`,label:v(`agents.tools.cat.runtime`),tools:[{id:`exec`,label:`exec`,description:v(`tools.runShell`)},{id:`process`,label:`process`,description:v(`tools.manageProcesses`)}]},{id:`web`,label:v(`agents.tools.cat.web`),tools:[{id:`web_search`,label:`web_search`,description:v(`tools.searchWeb`)},{id:`web_fetch`,label:`web_fetch`,description:v(`tools.fetchWeb`)}]},{id:`memory`,label:v(`agents.tools.cat.memory`),tools:[{id:`memory_search`,label:`memory_search`,description:v(`tools.semanticSearch`)},{id:`memory_get`,label:`memory_get`,description:v(`tools.readMemory`)}]},{id:`sessions`,label:v(`agents.tools.cat.sessions`),tools:[{id:`sessions_list`,label:`sessions_list`,description:v(`tools.listSessions`)},{id:`sessions_history`,label:`sessions_history`,description:v(`tools.sessionHistory`)},{id:`sessions_send`,label:`sessions_send`,description:v(`tools.sendToSession`)},{id:`sessions_spawn`,label:`sessions_spawn`,description:v(`agents.spawnSubAgent`)},{id:`session_status`,label:`session_status`,description:v(`tools.sessionStatus`)}]},{id:`ui`,label:v(`agents.tools.cat.ui`),tools:[{id:`browser`,label:`browser`,description:v(`tools.controlBrowser`)},{id:`canvas`,label:`canvas`,description:v(`tools.controlCanvases`)}]},{id:`messaging`,label:v(`agents.tools.cat.messaging`),tools:[{id:`message`,label:`message`,description:v(`tools.sendMessages`)}]},{id:`automation`,label:v(`agents.tools.cat.automation`),tools:[{id:`cron`,label:`cron`,description:v(`tools.scheduleTasks`)},{id:`gateway`,label:`gateway`,description:v(`tools.gatewayControl`)}]},{id:`nodes`,label:v(`agents.tools.cat.nodes`),tools:[{id:`nodes`,label:`nodes`,description:v(`agents.nodesDevices`)}]},{id:`agents`,label:v(`agents.tools.cat.agents`),tools:[{id:`agents_list`,label:`agents_list`,description:v(`tools.listAgents`)}]},{id:`media`,label:v(`agents.tools.cat.media`),tools:[{id:`image`,label:`image`,description:v(`tools.imageUnderstanding`)}]}],pa=[{id:`minimal`,label:v(`agents.profile.minimal`)},{id:`coding`,label:v(`agents.profile.coding`)},{id:`messaging`,label:v(`agents.profile.messaging`)},{id:`full`,label:v(`agents.profile.full`)}];function ma(e){return e?.groups?.length?e.groups.map(e=>({id:e.id,label:e.label,source:e.source,pluginId:e.pluginId,tools:e.tools.map(e=>({id:e.id,label:e.label,description:e.description,source:e.source,pluginId:e.pluginId,optional:e.optional,defaultProfiles:[...e.defaultProfiles]}))})):fa}function ha(e){return e?.profiles?.length?e.profiles:pa}function ga(e){return T(e.name)??T(e.identity?.name)??e.id}var _a=/^(data:image\/|\/(?!\/))/i;function va(e){return _a.test(e)}function ya(e,t){let n=[T(t?.avatar),T(e.identity?.avatarUrl),T(e.identity?.avatar)];for(let e of n)if(e&&va(e))return e;return null}function ba(e,t,n){let r=T(e);return r?.startsWith(`blob:`)?r:ya(t,n)}function xa(e){let t=T(e)?.replace(/\/$/,``)??``;return t?`${t}/favicon.svg`:`favicon.svg`}function Sa(e){let t=T(e)?.replace(/\/$/,``)??``;return t?`${t}/apple-touch-icon.png`:`apple-touch-icon.png`}function Ca(e){let t=e.trim();return t.startsWith(`blob:`)||va(t)}var wa=/[\u200B-\u200F\u202A-\u202E\u2060-\u206F\uFEFF]/u;function Ta(e){let t=e?.trim();return!t||t===`A`||Ca(t)||t.length>8||/\s/.test(t)||/[\\/.:]/.test(t)||wa.test(t)?null:t}function Ea(e,t){let n=[T(e.identity?.emoji),T(e.identity?.avatar),T(t?.emoji),T(t?.avatar)];for(let e of n){let t=Ta(e);if(t)return t}return null}function Da(e,t){return t&&e===t?`default`:null}function Oa(e){if(e==null||!Number.isFinite(e))return`-`;if(e<1024)return`${e} B`;let t=[`KB`,`MB`,`GB`,`TB`],n=e/1024,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return`${n.toFixed(+(n<10))} ${t[r]}`}function ka(e,t){let n=e;return{entry:(n?.agents?.list??[]).find(e=>e?.id===t),defaults:n?.agents?.defaults,globalTools:n?.tools}}function Aa(e,t,n,r,i){let a=ka(t,e.id),o=(n&&n.agentId===e.id?n.workspace:null)||a.entry?.workspace||a.defaults?.workspace||e.workspace||`default`,s=a.entry?.model?Ma(a.entry?.model):a.defaults?.model?Ma(a.defaults?.model):Ma(e.model),c=ja(e.agentRuntime),l=T(e.identity?.name)||T(e.name)||T(i?.name)||a.entry?.name||e.id,u=ya(e,i)?`custom`:Ea(e,i)??`—`,d=Array.isArray(a.entry?.skills)?a.entry?.skills:null,f=d?.length??null;return{workspace:o,model:s,runtime:c,identityName:l,identityAvatar:u,skillsLabel:d?`${f} selected`:`all skills`,isDefault:!!(r&&e.id===r)}}function ja(e){let t=T(e?.id)??`pi`,n=T(e?.fallback);return n?`${t} (fallback ${n})`:t}function Ma(e){if(!e)return`-`;if(typeof e==`string`)return T(e)||`-`;if(typeof e==`object`&&e){let t=e,n=T(t.primary);if(n){let e=Array.isArray(t.fallbacks)?t.fallbacks.length:0;return e>0?`${n} (+${e} fallback)`:n}}return`-`}function Na(e){let t=e.match(/^(.+) \(\+\d+ fallback\)$/);return t?t[1]:e}function Pa(e){if(!e)return null;if(typeof e==`string`)return T(e)||null;if(typeof e==`object`&&e){let t=e;return T(typeof t.primary==`string`?t.primary:typeof t.model==`string`?t.model:typeof t.id==`string`?t.id:typeof t.value==`string`?t.value:null)||null}return null}function Fa(e){if(!e||typeof e==`string`)return null;if(typeof e==`object`&&e){let t=e,n=Array.isArray(t.fallbacks)?t.fallbacks:Array.isArray(t.fallback)?t.fallback:null;return n?n.filter(e=>typeof e==`string`):null}return null}function Ia(e,t){return Fa(e)??Fa(t)}function La(e,t){if(typeof t!=`string`)return;let n=t.trim();n&&e.add(n)}function Ra(e,t){if(!t)return;if(typeof t==`string`){La(e,t);return}if(typeof t!=`object`)return;let n=t;La(e,n.primary),La(e,n.model),La(e,n.id),La(e,n.value);let r=Array.isArray(n.fallbacks)?n.fallbacks:Array.isArray(n.fallback)?n.fallback:[];for(let t of r)La(e,t)}function za(e){let t=Array.from(e),n=Array.from({length:t.length},()=>``),r=(e,r,i)=>{let a=e,o=r,s=e;for(;a<r&&o<i;)n[s++]=t[a].localeCompare(t[o])<=0?t[a++]:t[o++];for(;a<r;)n[s++]=t[a++];for(;o<i;)n[s++]=t[o++];for(let r=e;r<i;r+=1)t[r]=n[r]},i=(e,t)=>{if(t-e<=1)return;let n=e+t>>>1;i(e,n),i(n,t),r(e,n,t)};return i(0,t.length),t}function Ba(e){if(!e||typeof e!=`object`)return[];let t=e.agents;if(!t||typeof t!=`object`)return[];let n=new Set,r=t.defaults;if(r&&typeof r==`object`){let e=r;Ra(n,e.model);let t=e.models;if(t&&typeof t==`object`)for(let e of Object.keys(t))La(n,e)}let i=t.list;if(i&&typeof i==`object`)for(let e of Object.values(i))!e||typeof e!=`object`||Ra(n,e.model);return za(n)}function Va(e){return e.split(`,`).map(e=>e.trim()).filter(Boolean)}function Ha(e){let t=e?.agents?.defaults?.models;if(!t||typeof t!=`object`)return[];let n=[];for(let[e,r]of Object.entries(t)){let t=e.trim();if(!t)continue;let i=r&&typeof r==`object`&&`alias`in r&&typeof r.alias==`string`?r.alias?.trim():void 0,a=i&&i!==t?`${i} (${t})`:t;n.push({value:t,label:a})}return n}function Ua(e,t,n,r){let a=new Set,o=[],s=r?E(r):null,c=(e,t)=>{let n=E(e);a.has(n)||(a.add(n),o.push({value:e,label:t}))};for(let t of Ha(e))c(t.value,t.label);if(n)for(let e of n){let t=e.provider?.trim();c(Xi(e.id,t),t?`${e.id} · ${t}`:e.id)}return t&&!a.has(E(t))&&o.unshift({value:t,label:`Current (${t})`}),o.length===0?i:o.map(e=>d`
|
|
5
5
|
<option
|
|
6
6
|
value=${e.value}
|
|
7
7
|
?selected=${s===E(e.value)}
|
|
@@ -1146,14 +1146,14 @@ ${e}
|
|
|
1146
1146
|
<div class="sidebar-panel">
|
|
1147
1147
|
<div class="sidebar-header">
|
|
1148
1148
|
<div class="sidebar-title">
|
|
1149
|
-
${t?.kind===`canvas`?t.title?.trim()
|
|
1149
|
+
${t?.kind===`canvas`?t.title?.trim()||v(`markdownSidebar.renderPreview`):t?.kind===`markdown`?v(`markdownSidebar.markdownPreview`):v(`markdownSidebar.toolDetails`)}
|
|
1150
1150
|
</div>
|
|
1151
1151
|
<button
|
|
1152
1152
|
@click=${e.onClose}
|
|
1153
1153
|
class="btn"
|
|
1154
1154
|
type="button"
|
|
1155
1155
|
title=${v(`nav.collapse`)}
|
|
1156
|
-
aria-label="
|
|
1156
|
+
aria-label="${v(`sidebar.close`)}"
|
|
1157
1157
|
>
|
|
1158
1158
|
${q.x}
|
|
1159
1159
|
</button>
|
|
@@ -1174,7 +1174,7 @@ ${e}
|
|
|
1174
1174
|
<div class="chat-tool-card__preview-panel" data-side="front">
|
|
1175
1175
|
<iframe
|
|
1176
1176
|
class="chat-tool-card__preview-frame"
|
|
1177
|
-
title=${t.title?.trim()
|
|
1177
|
+
title=${t.title?.trim()||v(`markdownSidebar.renderPreviewLower`)}
|
|
1178
1178
|
sandbox=${lk(t,e.embedSandboxMode??`scripts`)}
|
|
1179
1179
|
src=${rw(t.entryUrl,e.canvasPluginSurfaceUrl,e.allowExternalEmbedUrls??!1)??i}
|
|
1180
1180
|
style=${t.preferredHeight?`height:${t.preferredHeight}px`:``}
|
|
@@ -1194,7 +1194,7 @@ ${e}
|
|
|
1194
1194
|
<div class="sidebar-markdown-shell__intro">
|
|
1195
1195
|
<div class="sidebar-markdown-shell__eyebrow">
|
|
1196
1196
|
${q.scrollText}
|
|
1197
|
-
<span
|
|
1197
|
+
<span>${v(`sidebar.renderedMarkdown`)}</span>
|
|
1198
1198
|
</div>
|
|
1199
1199
|
<div class="sidebar-markdown-shell__hint">
|
|
1200
1200
|
Sanitized rich-text preview for quick reading.
|
|
@@ -1208,7 +1208,7 @@ ${e}
|
|
|
1208
1208
|
${o(dD(t.content))}
|
|
1209
1209
|
</article>
|
|
1210
1210
|
</section>
|
|
1211
|
-
`:d` <div class="muted"
|
|
1211
|
+
`:d` <div class="muted">${v(`sidebar.noContent`)}</div> `}
|
|
1212
1212
|
</div>
|
|
1213
1213
|
</div>
|
|
1214
1214
|
`}function J(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var dk=class extends r{constructor(...e){super(...e),this.splitRatio=.6,this.minRatio=.4,this.maxRatio=.7,this.label=v(`chat.resizeSplitView`),this.isDragging=!1,this.startX=0,this.startRatio=0,this.activePointerId=null,this.handlePointerDown=e=>{e.button===0&&(this.isDragging=!0,this.startX=e.clientX,this.startRatio=this.splitRatio,this.classList.add(`dragging`),this.focus(),this.capturePointer(e.pointerId),document.addEventListener(`pointermove`,this.handlePointerMove),document.addEventListener(`pointerup`,this.handlePointerUp),document.addEventListener(`pointercancel`,this.handlePointerUp),e.preventDefault())},this.handlePointerMove=e=>{if(!this.isDragging)return;let t=this.parentElement;if(!t)return;let n=t.getBoundingClientRect().width,r=(e.clientX-this.startX)/n;this.emitResize(this.startRatio+r)},this.handlePointerUp=()=>{this.stopDragging()},this.handleKeyDown=e=>{let t=e.shiftKey?.05:.02,n=null;e.key===`ArrowLeft`?n=this.splitRatio-t:e.key===`ArrowRight`?n=this.splitRatio+t:e.key===`Home`?n=this.minRatio:e.key===`End`&&(n=this.maxRatio),n!=null&&(e.preventDefault(),this.emitResize(n))}}static{this.styles=a`
|
|
@@ -1256,7 +1256,7 @@ ${e}
|
|
|
1256
1256
|
<input
|
|
1257
1257
|
.value=${t.model}
|
|
1258
1258
|
@input=${r(`model`)}
|
|
1259
|
-
placeholder="
|
|
1259
|
+
placeholder="${v(`chat.talk.sensitivityAuto`)}"
|
|
1260
1260
|
spellcheck="false"
|
|
1261
1261
|
/>
|
|
1262
1262
|
</label>
|
|
@@ -1267,7 +1267,7 @@ ${e}
|
|
|
1267
1267
|
<option value="0.65" ?selected=${c===`0.65`}>Low</option>
|
|
1268
1268
|
<option value="0.5" ?selected=${c===`0.5`}>Medium</option>
|
|
1269
1269
|
<option value="0.35" ?selected=${c===`0.35`}>High</option>
|
|
1270
|
-
${s?d`<option value="__custom" selected
|
|
1270
|
+
${s?d`<option value="__custom" selected>${v(`chat.talk.sensitivityCustom`)}</option>`:i}
|
|
1271
1271
|
</select>
|
|
1272
1272
|
</label>
|
|
1273
1273
|
</div>
|
|
@@ -1294,7 +1294,7 @@ ${e}
|
|
|
1294
1294
|
<label>
|
|
1295
1295
|
<span>${v(`chat.talk.reasoning`)}</span>
|
|
1296
1296
|
<select .value=${t.reasoningEffort} @change=${r(`reasoningEffort`)}>
|
|
1297
|
-
<option value=""
|
|
1297
|
+
<option value="">${v(`common.default`)}</option>
|
|
1298
1298
|
<option value="minimal">Minimal</option>
|
|
1299
1299
|
<option value="low">Low</option>
|
|
1300
1300
|
<option value="medium">Medium</option>
|
|
@@ -1427,7 +1427,7 @@ ${e}
|
|
|
1427
1427
|
${o.map(({index:e,text:i,role:a})=>d`
|
|
1428
1428
|
<div class="agent-chat__pinned-item">
|
|
1429
1429
|
<span class="agent-chat__pinned-role"
|
|
1430
|
-
>${a===`user`?r
|
|
1430
|
+
>${a===`user`?r:v(`chat.assistant`)}</span
|
|
1431
1431
|
>
|
|
1432
1432
|
<span class="agent-chat__pinned-text"
|
|
1433
1433
|
>${i.slice(0,100)}${i.length>100?`...`:``}</span
|
|
@@ -1435,7 +1435,7 @@ ${e}
|
|
|
1435
1435
|
<button
|
|
1436
1436
|
class="btn btn--ghost"
|
|
1437
1437
|
@click=${()=>{t.unpin(e),n()}}
|
|
1438
|
-
title="
|
|
1438
|
+
title="${v(`chat.unpin`)}"
|
|
1439
1439
|
>
|
|
1440
1440
|
${q.x}
|
|
1441
1441
|
</button>
|
|
@@ -1495,7 +1495,12 @@ ${e}
|
|
|
1495
1495
|
`)}
|
|
1496
1496
|
</div>
|
|
1497
1497
|
`);let a=Y.slashMenuExpanded?0:hf();return d`
|
|
1498
|
-
<div
|
|
1498
|
+
<div
|
|
1499
|
+
id=${gk}
|
|
1500
|
+
class="slash-menu"
|
|
1501
|
+
role="listbox"
|
|
1502
|
+
aria-label="${v(`chat.slashCommands`)}"
|
|
1503
|
+
>
|
|
1499
1504
|
${r}
|
|
1500
1505
|
${a>0?d`<button
|
|
1501
1506
|
class="slash-menu-show-more"
|
|
@@ -1517,7 +1522,7 @@ ${e}
|
|
|
1517
1522
|
>
|
|
1518
1523
|
<div class="chat-thread-inner">
|
|
1519
1524
|
${te?d`
|
|
1520
|
-
<div class="chat-loading-skeleton" aria-label="
|
|
1525
|
+
<div class="chat-loading-skeleton" aria-label="${v(`chat.loading`)}">
|
|
1521
1526
|
<div class="chat-line assistant">
|
|
1522
1527
|
<div class="chat-msg">
|
|
1523
1528
|
<div class="chat-bubble">
|
|
@@ -1598,7 +1603,7 @@ ${e}
|
|
|
1598
1603
|
class="callout__dismiss"
|
|
1599
1604
|
type="button"
|
|
1600
1605
|
@click=${e.onDismissError}
|
|
1601
|
-
aria-label="
|
|
1606
|
+
aria-label="${v(`chat.dismissError`)}"
|
|
1602
1607
|
title=${v(`chat.controls.dismissError`)}
|
|
1603
1608
|
>
|
|
1604
1609
|
${q.x}
|
|
@@ -1669,7 +1674,7 @@ ${e}
|
|
|
1669
1674
|
${bk(e)}
|
|
1670
1675
|
${e.realtimeTalkActive||e.realtimeTalkDetail||e.realtimeTalkTranscript?d`
|
|
1671
1676
|
<div class="agent-chat__stt-interim agent-chat__talk-status">
|
|
1672
|
-
${e.realtimeTalkDetail??((e.realtimeTalkConversation?.length??0)===0?e.realtimeTalkTranscript:null)??(e.realtimeTalkStatus===`thinking
|
|
1677
|
+
${e.realtimeTalkDetail??((e.realtimeTalkConversation?.length??0)===0?e.realtimeTalkTranscript:null)??(e.realtimeTalkStatus===`thinking`?v(`chat.talk.asking`):e.realtimeTalkStatus===`connecting`?v(`chat.talk.connecting`):v(`chat.talk.live`))}
|
|
1673
1678
|
</div>
|
|
1674
1679
|
`:i}
|
|
1675
1680
|
|
|
@@ -1730,7 +1735,7 @@ ${e}
|
|
|
1730
1735
|
class="agent-chat__input-btn ${e.realtimeTalkOptionsOpen?`agent-chat__input-btn--active`:``}"
|
|
1731
1736
|
@click=${e.onToggleRealtimeTalkOptions}
|
|
1732
1737
|
title=${v(`chat.talk.options`)}
|
|
1733
|
-
aria-label="
|
|
1738
|
+
aria-label="${v(`chat.talkOptions`)}"
|
|
1734
1739
|
?disabled=${!e.connected||e.realtimeTalkActive}
|
|
1735
1740
|
>
|
|
1736
1741
|
${q.settings}
|
|
@@ -3591,7 +3596,7 @@ ${e}
|
|
|
3591
3596
|
<div class="qs-user-avatar qs-user-avatar--default" aria-label=${KI}>
|
|
3592
3597
|
${YI()}
|
|
3593
3598
|
</div>
|
|
3594
|
-
`}function ZI(e){let t=T(e.assistantAvatarOverride);return t?ba(t,{identity:{avatar:t,avatarUrl:t}}):e.assistantAvatarStatus===`none`&&e.assistantAvatarReason===`missing`?null:ba(e.assistantAvatarUrl,{identity:{avatar:e.assistantAvatar??void 0,avatarUrl:e.assistantAvatarUrl??void 0}})}function QI(e){let t=T(e);return t?/^data:image\//i.test(t)?`${t.slice(0,t.indexOf(`,`)>0?t.indexOf(`,`):32)},...`:t.length>72?`${t.slice(0,34)}...${t.slice(-24)}`:t:null}function $I(e,t,n,r=!1){return r?null:e===`remote`?v(`settings.quick.remoteBlocked`):t===`missing`?v(`settings.quick.fileNotFound`):t===`unsupported_extension`?v(`settings.quick.unsupportedImage`):t===`outside_workspace`?v(`settings.quick.outsideWorkspace`):t===`too_large`?v(`settings.quick.imageTooLarge`):t?v(`settings.quick.cannotRenderAvatar`):null}function eL(e){let t=T(e.assistantName)
|
|
3599
|
+
`}function ZI(e){let t=T(e.assistantAvatarOverride);return t?ba(t,{identity:{avatar:t,avatarUrl:t}}):e.assistantAvatarStatus===`none`&&e.assistantAvatarReason===`missing`?null:ba(e.assistantAvatarUrl,{identity:{avatar:e.assistantAvatar??void 0,avatarUrl:e.assistantAvatarUrl??void 0}})}function QI(e){let t=T(e);return t?/^data:image\//i.test(t)?`${t.slice(0,t.indexOf(`,`)>0?t.indexOf(`,`):32)},...`:t.length>72?`${t.slice(0,34)}...${t.slice(-24)}`:t:null}function $I(e,t,n,r=!1){return r?null:e===`remote`?v(`settings.quick.remoteBlocked`):t===`missing`?v(`settings.quick.fileNotFound`):t===`unsupported_extension`?v(`settings.quick.unsupportedImage`):t===`outside_workspace`?v(`settings.quick.outsideWorkspace`):t===`too_large`?v(`settings.quick.imageTooLarge`):t?v(`settings.quick.cannotRenderAvatar`):null}function eL(e){let t=T(e.assistantName)??v(`chat.assistant`),n=T(e.assistantAvatarOverride),r=ZI(e);if(r)return d`<img class="qs-assistant-avatar" src=${r} alt=${t} />`;let i=Ta(n??e.assistantAvatar);return i?d`<div
|
|
3595
3600
|
class="qs-assistant-avatar qs-assistant-avatar--text"
|
|
3596
3601
|
aria-label=${t}
|
|
3597
3602
|
>
|
|
@@ -3623,10 +3628,10 @@ ${e}
|
|
|
3623
3628
|
</div>
|
|
3624
3629
|
`}function dL(e){return d`
|
|
3625
3630
|
<div class="qs-card qs-card--model">
|
|
3626
|
-
${uL(q.brain
|
|
3631
|
+
${uL(q.brain,v(`quickSettings.modelThinking`))}
|
|
3627
3632
|
<div class="qs-card__body">
|
|
3628
3633
|
<div class="qs-row">
|
|
3629
|
-
<span class="qs-row__label"
|
|
3634
|
+
<span class="qs-row__label">${v(`settings.quick.model`)}</span>
|
|
3630
3635
|
<button class="qs-row__value qs-row__value--action" @click=${e.onModelChange}>
|
|
3631
3636
|
<code>${e.currentModel||`default`}</code>
|
|
3632
3637
|
<span class="qs-row__chevron">${q.chevronRight}</span>
|
|
@@ -3659,16 +3664,18 @@ ${e}
|
|
|
3659
3664
|
</div>
|
|
3660
3665
|
`}function fL(e){let t=e.channels.filter(e=>e.connected).length,n=t>0?d`<span class="qs-badge qs-badge--ok">${t} connected</span>`:void 0;return d`
|
|
3661
3666
|
<div class="qs-card qs-card--channels">
|
|
3662
|
-
${uL(q.send
|
|
3667
|
+
${uL(q.send,v(`quickSettings.channels`),n)}
|
|
3663
3668
|
<div class="qs-card__body">
|
|
3664
|
-
${e.channels.length===0?d`<div class="qs-empty muted"
|
|
3669
|
+
${e.channels.length===0?d`<div class="qs-empty muted">${v(`settings.quick.noChannels`)}</div>`:e.channels.map(t=>d`
|
|
3665
3670
|
<div class="qs-row">
|
|
3666
3671
|
<span class="qs-row__label">
|
|
3667
3672
|
<span class="qs-status-dot ${t.connected?`qs-status-dot--ok`:``}"></span>
|
|
3668
3673
|
${t.label}
|
|
3669
3674
|
</span>
|
|
3670
3675
|
<span class="qs-row__value">
|
|
3671
|
-
${t.connected?d`<span class="muted"
|
|
3676
|
+
${t.connected?d`<span class="muted"
|
|
3677
|
+
>${t.detail??v(`quickSettings.connected`)}</span
|
|
3678
|
+
>`:d`<button
|
|
3672
3679
|
class="qs-link-btn"
|
|
3673
3680
|
@click=${()=>e.onChannelConfigure?.(t.id)}
|
|
3674
3681
|
>
|
|
@@ -3687,7 +3694,9 @@ ${e}
|
|
|
3687
3694
|
<span class="qs-row__label">
|
|
3688
3695
|
${t} scheduled task${t===1?``:`s`}
|
|
3689
3696
|
</span>
|
|
3690
|
-
<button class="qs-link-btn" @click=${e.onManageCron}>
|
|
3697
|
+
<button class="qs-link-btn" @click=${e.onManageCron}>
|
|
3698
|
+
${v(`settings.quick.manage`)}
|
|
3699
|
+
</button>
|
|
3691
3700
|
</div>
|
|
3692
3701
|
<div class="qs-row">
|
|
3693
3702
|
<span class="qs-row__label">
|
|
@@ -3707,7 +3716,7 @@ ${e}
|
|
|
3707
3716
|
</div>
|
|
3708
3717
|
`}function mL(e){let{gatewayAuth:t,execPolicy:n,deviceAuth:r,browserEnabled:i,toolProfile:a}=e.security,o=a.trim()||`full`,s=GI.includes(o)?GI:[...GI,o];return d`
|
|
3709
3718
|
<div class="qs-card qs-card--security">
|
|
3710
|
-
${uL(q.eye
|
|
3719
|
+
${uL(q.eye,v(`quickSettings.securityLabel`),d`<button class="qs-link-btn" @click=${e.onSecurityConfigure}>
|
|
3711
3720
|
${v(`overview.quickActions.configure`)}
|
|
3712
3721
|
</button>`)}
|
|
3713
3722
|
<div class="qs-card__body">
|
|
@@ -3732,7 +3741,9 @@ ${e}
|
|
|
3732
3741
|
@change=${t=>e.onBrowserEnabledToggle?.(t.currentTarget.checked)}
|
|
3733
3742
|
/>
|
|
3734
3743
|
<span class="qs-toggle__track"></span>
|
|
3735
|
-
<span class="qs-toggle__hint muted"
|
|
3744
|
+
<span class="qs-toggle__hint muted"
|
|
3745
|
+
>${v(i?`common.enabled`:`common.disabled`)}</span
|
|
3746
|
+
>
|
|
3736
3747
|
</label>
|
|
3737
3748
|
</div>
|
|
3738
3749
|
<div class="qs-row qs-row--tool-profile">
|
|
@@ -3752,18 +3763,18 @@ ${e}
|
|
|
3752
3763
|
<span class="qs-row__label">Device auth</span>
|
|
3753
3764
|
<span class="qs-row__value">
|
|
3754
3765
|
<span class="qs-badge ${r?`qs-badge--ok`:`qs-badge--warn`}"
|
|
3755
|
-
>${r?`
|
|
3766
|
+
>${v(r?`common.enabled`:`common.disabled`)}</span
|
|
3756
3767
|
>
|
|
3757
3768
|
</span>
|
|
3758
3769
|
</div>
|
|
3759
3770
|
</div>
|
|
3760
3771
|
</div>
|
|
3761
|
-
`}function hL(e){let t=e.hasCustomTheme?e.customThemeLabel??v(`settings.actions.importTheme`)
|
|
3772
|
+
`}function hL(e){let t=e.hasCustomTheme?e.customThemeLabel??v(`settings.actions.importTheme`):v(`settings.importBtn`),n=[...VI,{id:`custom`,label:t}];return d`
|
|
3762
3773
|
<div class="qs-card qs-card--appearance">
|
|
3763
|
-
${uL(q.spark
|
|
3774
|
+
${uL(q.spark,v(`quickSettings.appearance`))}
|
|
3764
3775
|
<div class="qs-card__body">
|
|
3765
3776
|
<div class="qs-row">
|
|
3766
|
-
<span class="qs-row__label"
|
|
3777
|
+
<span class="qs-row__label">${v(`settings.quick.theme`)}</span>
|
|
3767
3778
|
<div class="qs-segmented">
|
|
3768
3779
|
${n.map(t=>d`
|
|
3769
3780
|
<button
|
|
@@ -3817,9 +3828,9 @@ ${e}
|
|
|
3817
3828
|
</div>
|
|
3818
3829
|
</div>
|
|
3819
3830
|
</div>
|
|
3820
|
-
`}function gL(e){let t=eo({name:null,avatar:e.userAvatar??null}),n=io(t)??``,r=T(e.assistantName)
|
|
3831
|
+
`}function gL(e){let t=eo({name:null,avatar:e.userAvatar??null}),n=io(t)??``,r=T(e.assistantName)??v(`chat.assistant`),a=!!(ZI(e)||Ta(e.assistantAvatarOverride??e.assistantAvatar)),o=T(e.assistantAvatarOverride),s=QI(o??e.assistantAvatarSource),c=$I(e.assistantAvatarStatus??null,e.assistantAvatarReason,a,!!o),l=o?v(`settings.quick.uiOverride`):`IDENTITY.md`,u=!!e.onAssistantAvatarOverrideChange,f=v(o?`settings.quick.overrideFromSettings`:c?`settings.quick.fallbackAvatar`:a?`quickSettings.fromIdentity`:`settings.quick.fallbackLogo`);return d`
|
|
3821
3832
|
<div class="qs-card qs-card--personal">
|
|
3822
|
-
${uL(q.image
|
|
3833
|
+
${uL(q.image,v(`quickSettings.personal`))}
|
|
3823
3834
|
<div class="qs-card__body">
|
|
3824
3835
|
<div class="qs-identity-grid">
|
|
3825
3836
|
<section class="qs-identity-card" aria-label=t("settings.quick.chatIdentity")>
|
|
@@ -3836,7 +3847,7 @@ ${e}
|
|
|
3836
3847
|
type="text"
|
|
3837
3848
|
maxlength="16"
|
|
3838
3849
|
.value=${n}
|
|
3839
|
-
placeholder="
|
|
3850
|
+
placeholder="${v(`settings.quick.identityPlaceholder`)}"
|
|
3840
3851
|
@input=${t=>{let n=t.target.value;e.onUserAvatarChange?.(n.trim()?n:null)}}
|
|
3841
3852
|
/>
|
|
3842
3853
|
</label>
|
|
@@ -3924,7 +3935,7 @@ ${e}
|
|
|
3924
3935
|
<span class="qs-status-dot"></span>
|
|
3925
3936
|
<div class="qs-profile-state__text">
|
|
3926
3937
|
<span class="qs-profile-state__title"
|
|
3927
|
-
>${o?.label
|
|
3938
|
+
>${o?.label??v(`settings.custom`)} is selected but not saved yet.</span
|
|
3928
3939
|
>
|
|
3929
3940
|
<span class="qs-profile-state__copy">${v(`settings.profiles.saveVsApply`)}</span>
|
|
3930
3941
|
</div>
|
|
@@ -4153,7 +4164,7 @@ ${e}
|
|
|
4153
4164
|
<div class="cfg-tags">${e.map(e=>d`<span class="cfg-tag">${e}</span>`)}</div>
|
|
4154
4165
|
`}function RL(e){let{schema:t,value:n,path:r,hints:a,unsupported:o,disabled:s,onPatch:c}=e,l=e.showLabel??!0,u=rn(t),{label:f,help:p,tags:m}=ML(r,t,a),h=on(r),g=e.searchCriteria;if(o.has(h))return d`<div class="cfg-field cfg-field--error">
|
|
4155
4166
|
<div class="cfg-field__label">${f}</div>
|
|
4156
|
-
<div class="cfg-field__error"
|
|
4167
|
+
<div class="cfg-field__error">${v(`configForm.unsupportedNode`)}</div>
|
|
4157
4168
|
</div>`;if(g&&kL(g)&&!IL({schema:t,value:n,path:r,hints:a,criteria:g}))return i;if(t.anyOf||t.oneOf){let o=(t.anyOf??t.oneOf??[]).filter(e=>!(e.type===`null`||Array.isArray(e.type)&&e.type.includes(`null`)));if(o.length===1)return RL({...e,schema:o[0]});let u=o.map(e=>{if(e.const!==void 0)return e.const;if(e.enum&&e.enum.length===1)return e.enum[0]}),h=u.every(e=>e!==void 0);if(h&&u.length>0&&u.length<=5){let e=n??t.default;return d`
|
|
4158
4169
|
<div class="cfg-field">
|
|
4159
4170
|
${l?d`<label class="cfg-field__label">${f}</label>`:i}
|
|
@@ -4293,7 +4304,7 @@ ${e}
|
|
|
4293
4304
|
<div class="cfg-input-wrap">
|
|
4294
4305
|
<textarea
|
|
4295
4306
|
class="cfg-textarea${m.isRedacted?` cfg-textarea--redacted`:``}"
|
|
4296
|
-
placeholder=${m.isRedacted?fn
|
|
4307
|
+
placeholder=${m.isRedacted?fn:v(`configForm.jsonPlaceholder`)}
|
|
4297
4308
|
rows="3"
|
|
4298
4309
|
.value=${h}
|
|
4299
4310
|
?disabled=${o}
|
|
@@ -4319,33 +4330,33 @@ ${e}
|
|
|
4319
4330
|
${_?d`<div class="cfg-object__help">${_}</div>`:i}
|
|
4320
4331
|
<div class="cfg-object__content">${D}</div>
|
|
4321
4332
|
</details>
|
|
4322
|
-
`:d` <div class="cfg-fields cfg-fields--inline">${D}</div> `}function WL(e){let{schema:t,value:n,path:r,hints:a,unsupported:o,disabled:s,onPatch:c,searchCriteria:l,rawAvailable:u,revealSensitive:f,isSensitivePathRevealed:p,onToggleSensitivePath:m}=e,h=e.showLabel??!0,{label:g,help:_,tags:
|
|
4333
|
+
`:d` <div class="cfg-fields cfg-fields--inline">${D}</div> `}function WL(e){let{schema:t,value:n,path:r,hints:a,unsupported:o,disabled:s,onPatch:c,searchCriteria:l,rawAvailable:u,revealSensitive:f,isSensitivePathRevealed:p,onToggleSensitivePath:m}=e,h=e.showLabel??!0,{label:g,help:_,tags:y}=ML(r,t,a),b=l&&kL(l)&&FL({schema:t,path:r,hints:a,criteria:l})?void 0:l,x=Array.isArray(t.items)?t.items[0]:t.items;if(!x)return d`
|
|
4323
4334
|
<div class="cfg-field cfg-field--error">
|
|
4324
4335
|
<div class="cfg-field__label">${g}</div>
|
|
4325
|
-
<div class="cfg-field__error"
|
|
4336
|
+
<div class="cfg-field__error">${v(`configForm.unsupportedArray`)}</div>
|
|
4326
4337
|
</div>
|
|
4327
|
-
`;let
|
|
4338
|
+
`;let S=Array.isArray(n)?n:Array.isArray(t.default)?t.default:[];return d`
|
|
4328
4339
|
<div class="cfg-array">
|
|
4329
4340
|
<div class="cfg-array__header">
|
|
4330
4341
|
<div class="cfg-array__title">
|
|
4331
4342
|
${h?d`<span class="cfg-array__label">${g}</span>`:i}
|
|
4332
|
-
${LL(
|
|
4343
|
+
${LL(y)}
|
|
4333
4344
|
</div>
|
|
4334
|
-
<span class="cfg-array__count">${
|
|
4345
|
+
<span class="cfg-array__count">${S.length} item${S.length===1?``:`s`}</span>
|
|
4335
4346
|
<button
|
|
4336
4347
|
type="button"
|
|
4337
4348
|
class="cfg-array__add"
|
|
4338
4349
|
?disabled=${s}
|
|
4339
|
-
@click=${()=>{c(r,[...
|
|
4350
|
+
@click=${()=>{c(r,[...S,an(x)])}}
|
|
4340
4351
|
>
|
|
4341
4352
|
<span class="cfg-array__add-icon">${TL.plus}</span>
|
|
4342
4353
|
Add
|
|
4343
4354
|
</button>
|
|
4344
4355
|
</div>
|
|
4345
4356
|
${_?d`<div class="cfg-array__help">${_}</div>`:i}
|
|
4346
|
-
${
|
|
4357
|
+
${S.length===0?d` <div class="cfg-array__empty">${v(`configForm.noItemsClickAdd`)}</div> `:d`
|
|
4347
4358
|
<div class="cfg-array__items">
|
|
4348
|
-
${
|
|
4359
|
+
${S.map((e,t)=>d`
|
|
4349
4360
|
<div class="cfg-array__item">
|
|
4350
4361
|
<div class="cfg-array__item-header">
|
|
4351
4362
|
<span class="cfg-array__item-index">#${t+1}</span>
|
|
@@ -4354,13 +4365,13 @@ ${e}
|
|
|
4354
4365
|
class="cfg-array__item-remove"
|
|
4355
4366
|
title=t("settings.actions.removeItem")
|
|
4356
4367
|
?disabled=${s}
|
|
4357
|
-
@click=${()=>{let e=[...
|
|
4368
|
+
@click=${()=>{let e=[...S];e.splice(t,1),c(r,e)}}
|
|
4358
4369
|
>
|
|
4359
4370
|
${TL.trash}
|
|
4360
4371
|
</button>
|
|
4361
4372
|
</div>
|
|
4362
4373
|
<div class="cfg-array__item-content">
|
|
4363
|
-
${RL({schema:
|
|
4374
|
+
${RL({schema:x,value:e,path:[...r,t],hints:a,rawAvailable:u,unsupported:o,disabled:s,searchCriteria:b,showLabel:!1,revealSensitive:f,isSensitivePathRevealed:p,onToggleSensitivePath:m,onPatch:c})}
|
|
4364
4375
|
</div>
|
|
4365
4376
|
</div>
|
|
4366
4377
|
`)}
|
|
@@ -4370,7 +4381,7 @@ ${e}
|
|
|
4370
4381
|
`}function GL(e){let{schema:t,value:n,path:r,hints:i,rawAvailable:a,unsupported:o,disabled:s,reservedKeys:c,onPatch:l,searchCriteria:u,revealSensitive:f,isSensitivePathRevealed:p,onToggleSensitivePath:m}=e,h=xL(t),g=Object.entries(n??{}).filter(([e])=>!c.has(e)),_=u&&kL(u)?g.filter(([e,n])=>IL({schema:t,value:n,path:[...r,e],hints:i,criteria:u})):g;return d`
|
|
4371
4382
|
<div class="cfg-map">
|
|
4372
4383
|
<div class="cfg-map__header">
|
|
4373
|
-
<span class="cfg-map__label"
|
|
4384
|
+
<span class="cfg-map__label">${v(`configForm.customEntries`)}</span>
|
|
4374
4385
|
<button
|
|
4375
4386
|
type="button"
|
|
4376
4387
|
class="cfg-map__add"
|
|
@@ -4382,16 +4393,16 @@ ${e}
|
|
|
4382
4393
|
</button>
|
|
4383
4394
|
</div>
|
|
4384
4395
|
|
|
4385
|
-
${_.length===0?d` <div class="cfg-map__empty"
|
|
4396
|
+
${_.length===0?d` <div class="cfg-map__empty">${v(`configForm.noCustomEntries`)}</div> `:d`
|
|
4386
4397
|
<div class="cfg-map__items">
|
|
4387
|
-
${_.map(([e,c])=>{let g=[...r,e],_=SL(c),
|
|
4398
|
+
${_.map(([e,c])=>{let g=[...r,e],_=SL(c),y=DL({path:g,value:c,hints:i,revealSensitive:f??!1,isSensitivePathRevealed:p});return d`
|
|
4388
4399
|
<div class="cfg-map__item">
|
|
4389
4400
|
<div class="cfg-map__item-header">
|
|
4390
4401
|
<div class="cfg-map__item-key">
|
|
4391
4402
|
<input
|
|
4392
4403
|
type="text"
|
|
4393
4404
|
class="cfg-input cfg-input--sm"
|
|
4394
|
-
placeholder="
|
|
4405
|
+
placeholder="${v(`configForm.key`)}"
|
|
4395
4406
|
.value=${e}
|
|
4396
4407
|
?disabled=${s}
|
|
4397
4408
|
@change=${t=>{let i=t.target.value.trim();if(!i||i===e)return;let a={...n};i in a||(a[i]=a[e],delete a[e],l(r,a))}}
|
|
@@ -4411,16 +4422,16 @@ ${e}
|
|
|
4411
4422
|
${h?d`
|
|
4412
4423
|
<div class="cfg-input-wrap">
|
|
4413
4424
|
<textarea
|
|
4414
|
-
class="cfg-textarea cfg-textarea--sm${
|
|
4415
|
-
placeholder=${
|
|
4425
|
+
class="cfg-textarea cfg-textarea--sm${y.isRedacted?` cfg-textarea--redacted`:``}"
|
|
4426
|
+
placeholder=${y.isRedacted?fn:v(`configForm.jsonPlaceholder`)}
|
|
4416
4427
|
rows="2"
|
|
4417
|
-
.value=${
|
|
4428
|
+
.value=${y.isRedacted?``:_}
|
|
4418
4429
|
?disabled=${s}
|
|
4419
|
-
?readonly=${
|
|
4420
|
-
@click=${()=>{
|
|
4421
|
-
@change=${e=>{if(
|
|
4430
|
+
?readonly=${y.isRedacted}
|
|
4431
|
+
@click=${()=>{y.isRedacted&&m&&m(g)}}
|
|
4432
|
+
@change=${e=>{if(y.isRedacted)return;let t=e.target,n=t.value.trim();if(!n){l(g,void 0);return}try{l(g,JSON.parse(n))}catch{t.value=_}}}
|
|
4422
4433
|
></textarea>
|
|
4423
|
-
${OL({path:g,state:
|
|
4434
|
+
${OL({path:g,state:y,disabled:s,onToggleSensitivePath:m})}
|
|
4424
4435
|
</div>
|
|
4425
4436
|
`:RL({schema:t,value:c,path:g,hints:i,rawAvailable:a,unsupported:o,disabled:s,searchCriteria:u,showLabel:!1,revealSensitive:f,isSensitivePathRevealed:p,onToggleSensitivePath:m,onPatch:l})}
|
|
4426
4437
|
</div>
|
|
@@ -4906,7 +4917,7 @@ ${e}
|
|
|
4906
4917
|
<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path>
|
|
4907
4918
|
<polyline points="14 2 14 8 20 8"></polyline>
|
|
4908
4919
|
</svg>
|
|
4909
|
-
`},dR=[{id:`core`,label:`Core`,sections:[{key:`env`,label:v(`settings.section.env`)},{key:`auth`,label:v(`settings.section.auth`)},{key:`update`,label:`Updates`},{key:`meta`,label:`Meta`},{key:`logging`,label:`Logging`},{key:`diagnostics`,label:v(`settings.section.diagnostics`)},{key:`cli`,label:`Cli`},{key:`secrets`,label:`Secrets`}]},{id:`ai`,label:`AI & Agents`,sections:[{key:`agents`,label:`Agents`},{key:`models`,label:`Models`},{key:`skills`,label:`Skills`},{key:`tools`,label:`Tools`},{key:`memory`,label:`Memory`},{key:`session`,label:`Session`}]},{id:`communication`,label:v(`settings.section.channels`),sections:[{key:`channels`,label:`Channels`},{key:`messages`,label:`Messages`},{key:`broadcast`,label:`Broadcast`},{key:`talk`,label:`Talk`},{key:`audio`,label:`Audio`}]},{id:`automation`,label:`Automation`,sections:[{key:`commands`,label:`Commands`},{key:`hooks`,label:`Hooks`},{key:`bindings`,label:`Bindings`},{key:`cron`,label:`Cron`},{key:`approvals`,label:`Approvals`},{key:`plugins`,label:`Plugins`}]},{id:`infrastructure`,label:v(`settings.section.web`),sections:[{key:`gateway`,label:`Gateway`},{key:`web`,label:`Web`},{key:`browser`,label:`Browser`},{key:`nodeHost`,label:`NodeHost`},{key:`canvasHost`,label:`CanvasHost`},{key:`discovery`,label:`Discovery`},{key:`media`,label:`Media`},{key:`acp`,label:`Acp`},{key:`mcp`,label:`Mcp`}]},{id:`appearance`,label:v(`tabs.appearance`),sections:[{key:`__appearance__`,label
|
|
4920
|
+
`},dR=[{id:`core`,label:`Core`,sections:[{key:`env`,label:v(`settings.section.env`)},{key:`auth`,label:v(`settings.section.auth`)},{key:`update`,label:`Updates`},{key:`meta`,label:`Meta`},{key:`logging`,label:`Logging`},{key:`diagnostics`,label:v(`settings.section.diagnostics`)},{key:`cli`,label:`Cli`},{key:`secrets`,label:`Secrets`}]},{id:`ai`,label:`AI & Agents`,sections:[{key:`agents`,label:`Agents`},{key:`models`,label:`Models`},{key:`skills`,label:`Skills`},{key:`tools`,label:`Tools`},{key:`memory`,label:`Memory`},{key:`session`,label:`Session`}]},{id:`communication`,label:v(`settings.section.channels`),sections:[{key:`channels`,label:`Channels`},{key:`messages`,label:`Messages`},{key:`broadcast`,label:`Broadcast`},{key:`talk`,label:`Talk`},{key:`audio`,label:`Audio`}]},{id:`automation`,label:`Automation`,sections:[{key:`commands`,label:`Commands`},{key:`hooks`,label:`Hooks`},{key:`bindings`,label:`Bindings`},{key:`cron`,label:`Cron`},{key:`approvals`,label:`Approvals`},{key:`plugins`,label:`Plugins`}]},{id:`infrastructure`,label:v(`settings.section.web`),sections:[{key:`gateway`,label:`Gateway`},{key:`web`,label:`Web`},{key:`browser`,label:`Browser`},{key:`nodeHost`,label:`NodeHost`},{key:`canvasHost`,label:`CanvasHost`},{key:`discovery`,label:`Discovery`},{key:`media`,label:`Media`},{key:`acp`,label:`Acp`},{key:`mcp`,label:`Mcp`}]},{id:`appearance`,label:v(`tabs.appearance`),sections:[{key:`__appearance__`,label:v(`settings.section.appearance`)},{key:`ui`,label:`UI`},{key:`wizard`,label:v(`settings.section.wizard`)}]}],fR=new Set(dR.flatMap(e=>e.sections.map(e=>e.key)));function pR(e){return uR[e]??uR.default}function mR(e,t){if(!e||rn(e)!==`object`||!e.properties)return e;let n=t.include,r=t.exclude,i={};for(let t of Object.keys(e.properties))n&&n.size>0&&!n.has(t)||r&&r.size>0&&r.has(t)||(i[t]=e.properties[t]);return{...e,properties:i}}function hR(e){return!e||typeof e!=`object`||Array.isArray(e)?null:e}function gR(e,t){return qL[e]||{label:t?.title??cn(e),description:t?.description??``}}var _R=64,vR=2e4,yR=1e3,bR=2e3,xR=2e5,SR;function CR(e){return e.length>0?e.join(`.`):`<root>`}function wR(e,t){if(!e||!t)return[];let n=[],r=0;function i(e,t,r){n.length<yR&&n.push({path:e,from:t,to:r})}function a(e,t,n){if(e.length!==t.length||e.length>bR)return!0;for(let r=0;r<e.length;r+=1)if(s(e[r],t[r],n+1))return!0;return!1}function o(e,t,n){let r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!0;for(let i of r)if(!Object.prototype.hasOwnProperty.call(t,i)||s(e[i],t[i],n+1))return!0;return!1}function s(e,t,n){return r+=1,r>vR||n>_R?!0:e===t?!1:typeof e==typeof t?typeof e!=`object`||!e||t===null?e!==t:Array.isArray(e)||Array.isArray(t)?Array.isArray(e)&&Array.isArray(t)?a(e,t,n+1):!0:o(e,t,n+1):!0}function c(e,t,o,s){if(r+=1,r>vR||s>_R||n.length>=yR||e===t)return;if(typeof e!=typeof t){i(o,e,t);return}if(typeof e!=`object`||!e||t===null){e!==t&&i(o,e,t);return}if(Array.isArray(e)||Array.isArray(t)){(Array.isArray(e)&&Array.isArray(t)&&a(e,t,s+1)||!Array.isArray(e)||!Array.isArray(t))&&i(o,e,t);return}let l=e,u=t,d=new Set([...Object.keys(l),...Object.keys(u)]);for(let e of d)c(l[e],u[e],[...o,e],s+1)}return c(e,t,[],0),n}function TR(e,t){if(SR?.original===e&&SR.current===t)return SR.diff;if(e.length>xR||t.length>xR)return SR={original:e,current:t,diff:[]},SR.diff;try{let n=O.parse(e),r=O.parse(t);if(!n||!r||typeof n!=`object`||typeof r!=`object`||Array.isArray(n)||Array.isArray(r))return SR={original:e,current:t,diff:[]},[];let i=wR(n,r);return SR={original:e,current:t,diff:i},i}catch{return SR={original:e,current:t,diff:[]},[]}}function ER(e,t=40){if(Array.isArray(e))return`[${e.length} item${e.length===1?``:`s`}]`;let n;try{n=JSON.stringify(e)??String(e)}catch{n=String(e)}return n.length<=t?n:n.slice(0,t-3)+`...`}function DR(e,t,n){return vn(CR(e))&&t!=null&&ER(t).trim()!==``?fn:ER(t)}function OR(e,t){let n=e.split(`.`);return n.length===t.length?n.every((e,n)=>e===`*`||e===t[n]):!1}function kR(e,t){return Object.entries(t).some(([t,n])=>!!n.sensitive&&OR(t,e))}function AR(e,t){for(let n=1;n<=e.length;n+=1){let r=e.slice(0,n),i=CR(r);if((sn(r,t)?.sensitive??!1)||kR(r,t)||vn(i))return!0}return!1}function jR(e,t,n,r){let i=Cn(t,e,n)>0;return!r&&t!=null&&(AR(e,n)||i)?fn:ER(t)}var MR=[{id:`claw`,label:`Claw`,description:v(`common.theme`),icon:q.zap},{id:`knot`,label:`Knot`,description:v(`settings.themeBlackRed`),icon:q.link},{id:`dash`,label:`Dash`,description:v(`common.theme`),icon:q.barChart}];function NR(e){return e.hasCustomTheme&&e.customThemeLabel?e.customThemeLabel:v(`settings.actions.importTheme`)}function PR(){(typeof requestAnimationFrame==`function`?requestAnimationFrame:e=>window.setTimeout(()=>e(0),0))(()=>{let e=globalThis.document?.querySelector(`[data-custom-theme-import-input]`);e&&(typeof e.scrollIntoView==`function`&&e.scrollIntoView({block:`center`,behavior:`smooth`}),e.focus(),e.select())})}function FR(e){let t=e.webPush;if(!t)return d`
|
|
4910
4921
|
<div class="settings-appearance">
|
|
4911
4922
|
<div class="settings-appearance__section">
|
|
4912
4923
|
<h3 class="settings-appearance__heading">${v(`settings.pushNotifications.title`)}</h3>
|
|
@@ -4937,7 +4948,7 @@ ${e}
|
|
|
4937
4948
|
<span class="settings-info-row__value">${n}</span>
|
|
4938
4949
|
</div>
|
|
4939
4950
|
<div class="settings-info-row">
|
|
4940
|
-
<span class="settings-info-row__label"
|
|
4951
|
+
<span class="settings-info-row__label">${v(`settings.status.label`)}</span>
|
|
4941
4952
|
<span class="settings-info-row__value">
|
|
4942
4953
|
<span class="settings-status-dot ${r}"></span>
|
|
4943
4954
|
${t.subscribed?`Subscribed`:v(`settings.node.notSubscribed`)}
|
|
@@ -4984,10 +4995,10 @@ ${e}
|
|
|
4984
4995
|
</div>
|
|
4985
4996
|
`:i}
|
|
4986
4997
|
</div>
|
|
4987
|
-
`}function IR(e){let t=e.hasCustomTheme||e.customThemeImportExpanded===!0;t&&e.customThemeImportFocusToken!=null&&e.customThemeImportFocusToken!==Q.lastCustomThemeImportFocusToken&&(Q.lastCustomThemeImportFocusToken=e.customThemeImportFocusToken,PR());let n=NR(e),r=[...MR,{id:`custom`,label:e.hasCustomTheme?n
|
|
4998
|
+
`}function IR(e){let t=e.hasCustomTheme||e.customThemeImportExpanded===!0;t&&e.customThemeImportFocusToken!=null&&e.customThemeImportFocusToken!==Q.lastCustomThemeImportFocusToken&&(Q.lastCustomThemeImportFocusToken=e.customThemeImportFocusToken,PR());let n=NR(e),r=[...MR,{id:`custom`,label:e.hasCustomTheme?n:v(`settings.importBtn`),description:e.hasCustomTheme?`Imported from tweakcn: ${n}`:v(`settings.importTheme`),icon:q.spark}];return d`
|
|
4988
4999
|
<div class="settings-appearance">
|
|
4989
5000
|
<div class="settings-appearance__section">
|
|
4990
|
-
<h3 class="settings-appearance__heading"
|
|
5001
|
+
<h3 class="settings-appearance__heading">${v(`settings.section.appearance`)}</h3>
|
|
4991
5002
|
<p class="settings-appearance__hint">${v(`settings.appearance.themeDescription`)}</p>
|
|
4992
5003
|
<div class="settings-theme-grid">
|
|
4993
5004
|
${r.map(t=>d`
|
|
@@ -5007,7 +5018,7 @@ ${e}
|
|
|
5007
5018
|
${t?d`
|
|
5008
5019
|
<div class="settings-theme-import">
|
|
5009
5020
|
<div class="settings-theme-import__copy">
|
|
5010
|
-
<div class="settings-theme-import__title"
|
|
5021
|
+
<div class="settings-theme-import__title">${v(`settings.importFromTweakcn`)}</div>
|
|
5011
5022
|
<p class="settings-theme-import__hint">
|
|
5012
5023
|
Open tweakcn.com, choose or create a theme, click Share, then paste the copied
|
|
5013
5024
|
theme link here. Share links, editor URLs, registry URLs, theme IDs, and default
|
|
@@ -5023,7 +5034,7 @@ ${e}
|
|
|
5023
5034
|
Browse tweakcn themes ${q.externalLink}
|
|
5024
5035
|
</a>
|
|
5025
5036
|
<label class="settings-theme-import__field">
|
|
5026
|
-
<span class="settings-theme-import__label"
|
|
5037
|
+
<span class="settings-theme-import__label">${v(`settings.themeLinkOrId`)}</span>
|
|
5027
5038
|
<input
|
|
5028
5039
|
class="settings-theme-import__input"
|
|
5029
5040
|
data-custom-theme-import-input
|
|
@@ -5050,7 +5061,9 @@ ${e}
|
|
|
5050
5061
|
</div>
|
|
5051
5062
|
${e.hasCustomTheme?d`
|
|
5052
5063
|
<div class="settings-theme-import__meta">
|
|
5053
|
-
<span class="settings-theme-import__meta-label"
|
|
5064
|
+
<span class="settings-theme-import__meta-label"
|
|
5065
|
+
>${v(`settings.loadedLabel`)}</span
|
|
5066
|
+
>
|
|
5054
5067
|
<span class="settings-theme-import__meta-value"
|
|
5055
5068
|
>${n} · ${e.customThemeSourceUrl??`tweakcn`}</span
|
|
5056
5069
|
>
|
|
@@ -5120,7 +5133,7 @@ ${e}
|
|
|
5120
5133
|
<span class="settings-info-row__value mono">${e.gatewayUrl||`-`}</span>
|
|
5121
5134
|
</div>
|
|
5122
5135
|
<div class="settings-info-row">
|
|
5123
|
-
<span class="settings-info-row__label"
|
|
5136
|
+
<span class="settings-info-row__label">${v(`settings.status.label`)}</span>
|
|
5124
5137
|
<span class="settings-info-row__value">
|
|
5125
5138
|
<span
|
|
5126
5139
|
class="settings-status-dot ${e.connected?`settings-status-dot--ok`:``}"
|
|
@@ -5137,7 +5150,7 @@ ${e}
|
|
|
5137
5150
|
</div>
|
|
5138
5151
|
</div>
|
|
5139
5152
|
</div>
|
|
5140
|
-
`}function LR(){return{rawRevealed:!1,rawDiffOpen:!1,envRevealed:!1,validityDismissed:!1,revealedSensitivePaths:new Set,lastCustomThemeImportFocusToken:null}}var Q=LR(),RR=null;function zR(){Object.assign(Q,LR()),SR=void 0}function BR(e){let t=e.includeSections?.join(``)??``,n=e.excludeSections?.join(``)??``;return[e.configPath??``,e.gatewayUrl,e.navRootLabel??``,t,n].join(``)}function VR(e){let t=on(e);return t?Q.revealedSensitivePaths.has(t):!1}function HR(e){let t=on(e);t&&(Q.revealedSensitivePaths.has(t)?Q.revealedSensitivePaths.delete(t):Q.revealedSensitivePaths.add(t))}function UR(e){let t=e.showModeToggle??!1,n=e.showRootTab??!0,r=e.valid==null?`unknown`:e.valid?`valid`:`invalid`,a=e.includeVirtualSections??!0,o=e.includeSections?.length?new Set(e.includeSections):null,s=e.excludeSections?.length?new Set(e.excludeSections):null,c=nR(mR(hR(e.schema),{include:o,exclude:s})),l=c.schema?c.unsupportedPaths.length>0:!1,u=e.rawAvailable??!0,f=t&&u?e.formMode:`form`,p=e.onRequestUpdate??(()=>{}),m=BR(e);RR!==m&&(zR(),RR=m);let h=Q.envRevealed,g=c.schema?.properties??{},_=new Set([`__appearance__`,`__notifications__`]),y=dR.map(e=>Object.assign({},e,{sections:e.sections.filter(e=>(a&&_.has(e.key)||e.key in g)&&(!o||o.has(e.key))&&(!s||!s.has(e.key)))})).filter(e=>e.sections.length>0),b=Object.keys(g).filter(e=>!fR.has(e)).map(e=>({key:e,label:e.charAt(0).toUpperCase()+e.slice(1)})),x=b.length>0?{id:`other`,label:`Other`,sections:b}:null,S=a&&e.activeSection!=null&&_.has(e.activeSection),C=e.activeSection&&!S&&c.schema&&rn(c.schema)===`object`?c.schema.properties?.[e.activeSection]:void 0,w=e.activeSection&&!S?gR(e.activeSection,C):null,T=[...n?[{key:null,label:e.navRootLabel
|
|
5153
|
+
`}function LR(){return{rawRevealed:!1,rawDiffOpen:!1,envRevealed:!1,validityDismissed:!1,revealedSensitivePaths:new Set,lastCustomThemeImportFocusToken:null}}var Q=LR(),RR=null;function zR(){Object.assign(Q,LR()),SR=void 0}function BR(e){let t=e.includeSections?.join(``)??``,n=e.excludeSections?.join(``)??``;return[e.configPath??``,e.gatewayUrl,e.navRootLabel??``,t,n].join(``)}function VR(e){let t=on(e);return t?Q.revealedSensitivePaths.has(t):!1}function HR(e){let t=on(e);t&&(Q.revealedSensitivePaths.has(t)?Q.revealedSensitivePaths.delete(t):Q.revealedSensitivePaths.add(t))}function UR(e){let t=e.showModeToggle??!1,n=e.showRootTab??!0,r=e.valid==null?`unknown`:e.valid?`valid`:`invalid`,a=e.includeVirtualSections??!0,o=e.includeSections?.length?new Set(e.includeSections):null,s=e.excludeSections?.length?new Set(e.excludeSections):null,c=nR(mR(hR(e.schema),{include:o,exclude:s})),l=c.schema?c.unsupportedPaths.length>0:!1,u=e.rawAvailable??!0,f=t&&u?e.formMode:`form`,p=e.onRequestUpdate??(()=>{}),m=BR(e);RR!==m&&(zR(),RR=m);let h=Q.envRevealed,g=c.schema?.properties??{},_=new Set([`__appearance__`,`__notifications__`]),y=dR.map(e=>Object.assign({},e,{sections:e.sections.filter(e=>(a&&_.has(e.key)||e.key in g)&&(!o||o.has(e.key))&&(!s||!s.has(e.key)))})).filter(e=>e.sections.length>0),b=Object.keys(g).filter(e=>!fR.has(e)).map(e=>({key:e,label:e.charAt(0).toUpperCase()+e.slice(1)})),x=b.length>0?{id:`other`,label:`Other`,sections:b}:null,S=a&&e.activeSection!=null&&_.has(e.activeSection),C=e.activeSection&&!S&&c.schema&&rn(c.schema)===`object`?c.schema.properties?.[e.activeSection]:void 0,w=e.activeSection&&!S?gR(e.activeSection,C):null,T=[...n?[{key:null,label:e.navRootLabel??v(`settings.title`)}]:[],...[...y,...x?[x]:[]].flatMap(e=>e.sections.map(e=>({key:e.key,label:e.label})))],E=e.settingsLayout??`tabs`,D=[...y,...x?[x]:[]],O=e=>{queueMicrotask(()=>{let t=(e instanceof Element?e:null)?.closest(`.config-main`)?.querySelector(`.config-content`);if(t){if(typeof t.scrollTo==`function`){t.scrollTo({top:0,left:0,behavior:`auto`});return}t.scrollTop=0,t.scrollLeft=0}})};function ee(){return d`
|
|
5141
5154
|
<div class="config-accordion-nav">
|
|
5142
5155
|
${e.onBackToQuick?d`
|
|
5143
5156
|
<button class="config-accordion-nav__back" @click=${e.onBackToQuick}>
|
|
@@ -5224,7 +5237,7 @@ ${e}
|
|
|
5224
5237
|
<span class="config-changes-badge"
|
|
5225
5238
|
>${f===`raw`?v(`common.unsavedChanges`):`${k.length} unsaved change${k.length===1?``:`s`}`}</span
|
|
5226
5239
|
>
|
|
5227
|
-
`:d` <span class="config-status muted"
|
|
5240
|
+
`:d` <span class="config-status muted">${v(`settings.noChanges`)}</span> `}
|
|
5228
5241
|
</div>
|
|
5229
5242
|
<div class="config-actions__right">
|
|
5230
5243
|
${u?i:d`
|
|
@@ -5294,7 +5307,7 @@ ${e}
|
|
|
5294
5307
|
<input
|
|
5295
5308
|
type="text"
|
|
5296
5309
|
class="config-search__input"
|
|
5297
|
-
placeholder="
|
|
5310
|
+
placeholder="${v(`settings.searchSettingsPlaceholder`)}"
|
|
5298
5311
|
aria-label=t("settings.actions.searchSettings")
|
|
5299
5312
|
.value=${e.searchQuery}
|
|
5300
5313
|
@input=${t=>e.onSearchChange(t.target.value)}
|
|
@@ -5477,7 +5490,7 @@ ${e}
|
|
|
5477
5490
|
${e.schemaLoading?d`
|
|
5478
5491
|
<div class="config-loading">
|
|
5479
5492
|
<div class="config-loading__spinner"></div>
|
|
5480
|
-
<span
|
|
5493
|
+
<span>${v(`settings.loadingSchema`)}</span>
|
|
5481
5494
|
</div>
|
|
5482
5495
|
`:XL({schema:c.schema,uiHints:e.uiHints,value:e.formValue,rawAvailable:u,disabled:e.loading||!e.formValue,unsupportedPaths:c.unsupportedPaths,onPatch:e.onFormPatch,searchQuery:e.searchQuery,activeSection:e.activeSection,activeSubsection:null,revealSensitive:e.activeSection===`env`?h:!1,isSensitivePathRevealed:VR,onToggleSensitivePath:e=>{HR(e),p()}})}
|
|
5483
5496
|
`:(()=>{let t=Cn(e.formValue,[],e.uiHints),n=t>0&&!Q.rawRevealed;return d`
|
|
@@ -5513,7 +5526,7 @@ ${e}
|
|
|
5513
5526
|
</div>
|
|
5514
5527
|
`:d`
|
|
5515
5528
|
<textarea
|
|
5516
|
-
placeholder="
|
|
5529
|
+
placeholder="${v(`settings.rawConfigPlaceholder`)}"
|
|
5517
5530
|
.value=${e.raw}
|
|
5518
5531
|
@input=${t=>{e.onRawChange(t.target.value)}}
|
|
5519
5532
|
></textarea>
|
|
@@ -5881,7 +5894,7 @@ ${e}
|
|
|
5881
5894
|
|
|
5882
5895
|
${e.statusError?d`<div class="dreams__controls-error">${e.statusError}</div>`:i}
|
|
5883
5896
|
</section>
|
|
5884
|
-
`}function Vz(e,t,n){return t===n?`${e}:${t}`:`${e}:${t}-${n}`}function Hz(e){let t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString([],{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`}):e}function Uz(e){return e.replace(/\\/g,`/`).split(`/`).findLast(Boolean)??e}function Wz(e){switch(e){case`entity`:return`entity`;case`concept`:return`concept`;case`source`:return`source`;case`synthesis`:return`synthesis`;case`report`:return`report`}return e}function Gz(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}var Kz=[`source`,`synthesis`,`report`,`entity`,`concept`];function qz(e){switch(e){case`source`:return v(`dreaming.memoryPalace.pageLabels.sources`);case`synthesis`:return v(`dreaming.memoryPalace.pageLabels.syntheses`);case`report`:return v(`dreaming.memoryPalace.pageLabels.reports`);case`entity`:return v(`dreaming.memoryPalace.pageLabels.entities`);case`concept`:return v(`dreaming.memoryPalace.pageLabels.concepts`)}return e}function Jz(e){let t=Kz.map(t=>{let n=e[t];return n>0?`${qz(t)} · ${Gz(n,`page`)}`:null}).filter(e=>e!==null);return t.length>0?t.join(`; `):v(`dreaming.noPagesYet`)}function Yz(e){let t=[`${e.label}: ${Gz(e.itemCount,`page`)}`];if(e.claimCount>0&&t.push(Gz(e.claimCount,`claim row`)),e.questionCount>0){let n=e.items.filter(e=>e.questionCount>0).length,r=n>0?` on ${Gz(n,`page`)}`:``;t.push(`${Gz(e.questionCount,`open question`)}${r}`)}return e.contradictionCount>0&&t.push(Gz(e.contradictionCount,`contradiction`)),t.join(` · `)}function Xz(e){if(e.digestStatus===`withheld`)return`
|
|
5897
|
+
`}function Vz(e,t,n){return t===n?`${e}:${t}`:`${e}:${t}-${n}`}function Hz(e){let t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString([],{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`}):e}function Uz(e){return e.replace(/\\/g,`/`).split(`/`).findLast(Boolean)??e}function Wz(e){switch(e){case`entity`:return`entity`;case`concept`:return`concept`;case`source`:return`source`;case`synthesis`:return`synthesis`;case`report`:return`report`}return e}function Gz(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}var Kz=[`source`,`synthesis`,`report`,`entity`,`concept`];function qz(e){switch(e){case`source`:return v(`dreaming.memoryPalace.pageLabels.sources`);case`synthesis`:return v(`dreaming.memoryPalace.pageLabels.syntheses`);case`report`:return v(`dreaming.memoryPalace.pageLabels.reports`);case`entity`:return v(`dreaming.memoryPalace.pageLabels.entities`);case`concept`:return v(`dreaming.memoryPalace.pageLabels.concepts`)}return e}function Jz(e){let t=Kz.map(t=>{let n=e[t];return n>0?`${qz(t)} · ${Gz(n,`page`)}`:null}).filter(e=>e!==null);return t.length>0?t.join(`; `):v(`dreaming.noPagesYet`)}function Yz(e){let t=[`${e.label}: ${Gz(e.itemCount,`page`)}`];if(e.claimCount>0&&t.push(Gz(e.claimCount,`claim row`)),e.questionCount>0){let n=e.items.filter(e=>e.questionCount>0).length,r=n>0?` on ${Gz(n,`page`)}`:``;t.push(`${Gz(e.questionCount,`open question`)}${r}`)}return e.contradictionCount>0&&t.push(Gz(e.contradictionCount,`contradiction`)),t.join(` · `)}function Xz(e){if(e.digestStatus===`withheld`)return v(`dreaming.risk.needsReview`);switch(e.riskLevel){case`low`:return v(`dreaming.risk.low`);case`medium`:return v(`dreaming.risk.medium`);case`high`:return v(`dreaming.risk.high`);case`unknown`:return v(`dreaming.risk.unknown`)}return v(`dreaming.risk.unknown`)}function Zz(e,t,n){e.has(t)?e.delete(t):e.add(t),n?.()}function Qz(e,t){if(e.kind===`report`){$z(e.pagePath,t);return}Zz(xz,e.pagePath,t.onRequestUpdate)}async function $z(e,t){Sz=!0,Cz=!0,wz=Uz(e),Tz=e,Ez=null,Dz=``,Oz=null,kz=!1,Az=null,t.onRequestUpdate?.();try{let n=await t.onOpenWikiPage(e);if(!n){Az=`No wiki page found for ${e}.`;return}wz=n.title,Tz=n.path,Ez=n.updatedAt??null,Dz=n.content,Oz=typeof n.totalLines==`number`?n.totalLines:null,kz=n.truncated===!0}catch(e){Az=String(e)}finally{Cz=!1,t.onRequestUpdate?.()}}function eB(e){Sz=!1,Cz=!1,wz=``,Tz=``,Ez=null,Dz=``,Oz=null,kz=!1,Az=null,e?.()}function tB(e){return Sz?d`
|
|
5885
5898
|
<div
|
|
5886
5899
|
class="dreams-diary__preview-backdrop"
|
|
5887
5900
|
@click=${()=>eB(e.onRequestUpdate)}
|
|
@@ -5904,7 +5917,7 @@ ${e}
|
|
|
5904
5917
|
</button>
|
|
5905
5918
|
</div>
|
|
5906
5919
|
<div class="dreams-diary__preview-body">
|
|
5907
|
-
${Cz?d`<div class="dreams-diary__empty-text"
|
|
5920
|
+
${Cz?d`<div class="dreams-diary__empty-text">${v(`dreaming.loadingWiki`)}</div>`:Az?d`<div class="dreams-diary__error">${Az}</div>`:d`
|
|
5908
5921
|
${kz?d`
|
|
5909
5922
|
<div class="dreams-diary__preview-hint">
|
|
5910
5923
|
Showing the first chunk of this
|
|
@@ -6062,11 +6075,11 @@ ${e}
|
|
|
6062
6075
|
</section>
|
|
6063
6076
|
`}function uB(e){let t=e.wikiImportInsights?.clusters??[];if(e.wikiImportInsightsLoading&&t.length===0)return d`
|
|
6064
6077
|
<div class="dreams-diary__empty">
|
|
6065
|
-
<div class="dreams-diary__empty-text"
|
|
6078
|
+
<div class="dreams-diary__empty-text">${v(`dreaming.loadingImportedInsights`)}</div>
|
|
6066
6079
|
</div>
|
|
6067
6080
|
`;if(t.length===0)return d`
|
|
6068
6081
|
<div class="dreams-diary__empty">
|
|
6069
|
-
<div class="dreams-diary__empty-text"
|
|
6082
|
+
<div class="dreams-diary__empty-text">${v(`dreaming.noImportedInsights`)}</div>
|
|
6070
6083
|
<div class="dreams-diary__empty-hint">
|
|
6071
6084
|
Run a ChatGPT import with apply to surface clustered imported insights here.
|
|
6072
6085
|
</div>
|
|
@@ -6130,15 +6143,15 @@ ${e}
|
|
|
6130
6143
|
`:i}
|
|
6131
6144
|
${n?d`
|
|
6132
6145
|
<div class="dreams-diary__insight-list">
|
|
6133
|
-
<strong
|
|
6146
|
+
<strong>${v(`dreaming.importDetails`)}</strong>
|
|
6134
6147
|
${t.firstUserLine?d`
|
|
6135
6148
|
<p class="dreams-diary__insight-line">
|
|
6136
|
-
<strong
|
|
6149
|
+
<strong>${v(`dreaming.startedWith`)}</strong> ${t.firstUserLine}
|
|
6137
6150
|
</p>
|
|
6138
6151
|
`:i}
|
|
6139
6152
|
${t.lastUserLine&&t.lastUserLine!==t.firstUserLine?d`
|
|
6140
6153
|
<p class="dreams-diary__insight-line">
|
|
6141
|
-
<strong
|
|
6154
|
+
<strong>${v(`dreaming.endedOn`)}</strong> ${t.lastUserLine}
|
|
6142
6155
|
</p>
|
|
6143
6156
|
`:i}
|
|
6144
6157
|
<p class="dreams-diary__insight-line">
|
|
@@ -6147,12 +6160,12 @@ ${e}
|
|
|
6147
6160
|
</p>
|
|
6148
6161
|
${t.riskReasons.length>0?d`
|
|
6149
6162
|
<p class="dreams-diary__insight-line">
|
|
6150
|
-
<strong
|
|
6163
|
+
<strong>${v(`dreaming.riskReasons`)}</strong> ${t.riskReasons.join(`, `)}
|
|
6151
6164
|
</p>
|
|
6152
6165
|
`:i}
|
|
6153
6166
|
${t.labels.length>0?d`
|
|
6154
6167
|
<p class="dreams-diary__insight-line">
|
|
6155
|
-
<strong
|
|
6168
|
+
<strong>${v(`dreaming.labels`)}</strong> ${t.labels.join(`, `)}
|
|
6156
6169
|
</p>
|
|
6157
6170
|
`:i}
|
|
6158
6171
|
</div>
|
|
@@ -6182,11 +6195,11 @@ ${e}
|
|
|
6182
6195
|
</article>
|
|
6183
6196
|
`}function dB(e){let t=e.wikiMemoryPalace,n=t?.clusters??[];if(e.wikiMemoryPalaceLoading&&n.length===0)return d`
|
|
6184
6197
|
<div class="dreams-diary__empty">
|
|
6185
|
-
<div class="dreams-diary__empty-text"
|
|
6198
|
+
<div class="dreams-diary__empty-text">${v(`dreaming.loadingMemoryPalace`)}</div>
|
|
6186
6199
|
</div>
|
|
6187
6200
|
`;if(n.length===0)return d`
|
|
6188
6201
|
<div class="dreams-diary__empty">
|
|
6189
|
-
<div class="dreams-diary__empty-text"
|
|
6202
|
+
<div class="dreams-diary__empty-text">${v(`dreaming.memoryPalaceNotPopulated`)}</div>
|
|
6190
6203
|
<div class="dreams-diary__empty-hint">
|
|
6191
6204
|
Right now the wiki mostly has raw source imports and operational reports. This tab becomes
|
|
6192
6205
|
useful once syntheses, entities, or concepts start getting written.
|
|
@@ -6239,31 +6252,31 @@ ${e}
|
|
|
6239
6252
|
${t.snippet?d`<p class="dreams-diary__insight-line">${t.snippet}</p>`:i}
|
|
6240
6253
|
${t.claims.length>0?d`
|
|
6241
6254
|
<div class="dreams-diary__insight-list">
|
|
6242
|
-
<strong
|
|
6255
|
+
<strong>${v(`dreaming.claims`)}</strong>
|
|
6243
6256
|
${t.claims.map(e=>d`<p class="dreams-diary__insight-line">• ${e}</p>`)}
|
|
6244
6257
|
</div>
|
|
6245
6258
|
`:i}
|
|
6246
6259
|
${t.questions.length>0?d`
|
|
6247
6260
|
<div class="dreams-diary__insight-list">
|
|
6248
|
-
<strong
|
|
6261
|
+
<strong>${v(`dreaming.openQuestions`)}</strong>
|
|
6249
6262
|
${t.questions.map(e=>d`<p class="dreams-diary__insight-line">• ${e}</p>`)}
|
|
6250
6263
|
</div>
|
|
6251
6264
|
`:i}
|
|
6252
6265
|
${t.contradictions.length>0?d`
|
|
6253
6266
|
<div class="dreams-diary__insight-list">
|
|
6254
|
-
<strong
|
|
6267
|
+
<strong>${v(`dreaming.contradictions`)}</strong>
|
|
6255
6268
|
${t.contradictions.map(e=>d`<p class="dreams-diary__insight-line">• ${e}</p>`)}
|
|
6256
6269
|
</div>
|
|
6257
6270
|
`:i}
|
|
6258
6271
|
${n?d`
|
|
6259
6272
|
<div class="dreams-diary__insight-list">
|
|
6260
|
-
<strong
|
|
6273
|
+
<strong>${v(`dreaming.pageDetails`)}</strong>
|
|
6261
6274
|
<p class="dreams-diary__insight-line">
|
|
6262
6275
|
<strong>Wiki page:</strong> ${t.pagePath}
|
|
6263
6276
|
</p>
|
|
6264
6277
|
${t.id?d`
|
|
6265
6278
|
<p class="dreams-diary__insight-line">
|
|
6266
|
-
<strong
|
|
6279
|
+
<strong>${v(`dreaming.id`)}</strong> ${t.id}
|
|
6267
6280
|
</p>
|
|
6268
6281
|
`:i}
|
|
6269
6282
|
</div>
|
|
@@ -6364,7 +6377,7 @@ ${e}
|
|
|
6364
6377
|
|
|
6365
6378
|
${t?d`
|
|
6366
6379
|
<div class="dreams-diary__empty">
|
|
6367
|
-
<div class="dreams-diary__empty-text"
|
|
6380
|
+
<div class="dreams-diary__empty-text">${v(`dreaming.memoryWikiNotEnabled`)}</div>
|
|
6368
6381
|
<div class="dreams-diary__empty-hint">
|
|
6369
6382
|
Imported Insights and Memory Palace are provided by the bundled
|
|
6370
6383
|
<code>memory-wiki</code> plugin.
|
|
@@ -6991,7 +7004,7 @@ ${e.pluginDescription}</pre
|
|
|
6991
7004
|
aria-label=${v(`sessions.sessionDetails.activeRun`)}
|
|
6992
7005
|
></span>`:i}
|
|
6993
7006
|
</a>
|
|
6994
|
-
`}var wV=dI(()=>hV(()=>import(`./agents-B2f8TYRm.js`),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url),_V),TV=dI(()=>hV(()=>import(`./activity-164wVojz.js`),__vite__mapDeps([8,1,4,5]),import.meta.url),_V),EV=dI(()=>hV(()=>import(`./channels-DoO-OrjQ.js`),__vite__mapDeps([9,1,5,6]),import.meta.url),_V),DV=dI(()=>hV(()=>import(`./cron-DTyzT3TV.js`),__vite__mapDeps([10,1,5]),import.meta.url),_V),OV=dI(()=>hV(()=>import(`./debug-DmFMvLdY.js`),__vite__mapDeps([11,1,5]),import.meta.url),_V),kV=dI(()=>hV(()=>import(`./instances-DWljwzyf.js`),__vite__mapDeps([12,1,5]),import.meta.url),_V),AV=dI(()=>hV(()=>import(`./logs-D7YSLRvz.js`),__vite__mapDeps([13,1,4,5]),import.meta.url),_V),jV=dI(()=>hV(()=>import(`./nodes-D1vIdMC3.js`),__vite__mapDeps([14,1,4,5]),import.meta.url),_V),MV=dI(()=>hV(()=>import(`./sessions-BqzDZWTD.js`),__vite__mapDeps([15,1,4,5]),import.meta.url),_V),NV=dI(()=>hV(()=>import(`./skills-CAvbfEkF.js`),__vite__mapDeps([16,1,4,5,7]),import.meta.url),_V),PV=dI(()=>hV(()=>import(`./workboard-DsePRAcc.js`),__vite__mapDeps([17,1,5]),import.meta.url),_V);function FV(e){return typeof e!=`number`||!Number.isFinite(e)?null:new Date(e).toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`})}function IV(e){if(!e?.phases)return null;let t;for(let n of Object.values(e.phases))!n.enabled||typeof n.nextRunAtMs!=`number`||(t===void 0||n.nextRunAtMs<t)&&(t=n.nextRunAtMs);return FV(t)}var LV=null,RV=`fengming:control-ui:update-banner-dismissed:v1`,zV=[`off`,`minimal`,`low`,`medium`,`high`],BV=[`UTC`,`America/Los_Angeles`,`America/Denver`,`America/Chicago`,`America/New_York`,`Europe/London`,`Europe/Berlin`,`Asia/Tokyo`];function VV(e){return/^https?:\/\//i.test(e.trim())}function HV(e){return typeof e==`string`?e.trim():``}function UV(e){let t=new Set,n=[];for(let r of e){let e=r.trim();if(!e)continue;let i=e.toLowerCase();t.has(i)||(t.add(i),n.push(e))}return n}function WV(){try{let e=et()?.getItem(RV);if(!e)return null;let t=JSON.parse(e);return!t||typeof t.latestVersion!=`string`?null:{latestVersion:t.latestVersion,channel:typeof t.channel==`string`?t.channel:null,dismissedAtMs:typeof t.dismissedAtMs==`number`?t.dismissedAtMs:Date.now()}}catch{return null}}function GV(e){let t=WV();if(!t)return!1;let n=e,r=n&&typeof n.latestVersion==`string`?n.latestVersion:null,i=n&&typeof n.channel==`string`?n.channel:null;return!!(r&&t.latestVersion===r&&t.channel===i)}function KV(e){let t=e,n=t&&typeof t.latestVersion==`string`?t.latestVersion:null;if(!n)return;let r={latestVersion:n,channel:t&&typeof t.channel==`string`?t.channel:null,dismissedAtMs:Date.now()};try{et()?.setItem(RV,JSON.stringify(r))}catch{}}var qV=[`messages`,`broadcast`,`__notifications__`,`talk`,`audio`,`channels`],JV=[`__appearance__`,`ui`,`wizard`],YV=[`commands`,`hooks`,`bindings`,`cron`,`approvals`,`plugins`],XV=[`gateway`,`web`,`browser`,`nodeHost`,`canvasHost`,`discovery`,`media`,`acp`,`mcp`],ZV=[`agents`,`models`,`skills`,`tools`,`memory`,`session`],QV=new Set([...qV,...JV,...YV,...XV,...ZV]);function $V(e,t){return e&&QV.has(e)?{activeSection:null,activeSubsection:null}:{activeSection:e,activeSubsection:t}}function eH(e,t,n){return e&&!n.includes(e)?{activeSection:null,activeSubsection:null}:{activeSection:e,activeSubsection:t}}function tH(e,t,n){if(!e||typeof e!=`object`||Array.isArray(e))return 0;let r=e.properties;if(!r||typeof r!=`object`||Array.isArray(r))return 0;let i=t?.length?new Set(t):null,a=n?.length?new Set(n):null;return Object.keys(r).filter(e=>!(i&&!i.has(e)||a?.has(e))).length}function nH(e,t,n,r){let i=Qg(),a=r();return u_(e,t,{...n,durationMs:$g(Qg()-i)}),a}function rH(e){let t=e.agentsList?.agents??[],n=z(e.sessionKey)?.agentId??e.agentsList?.defaultId??`main`,r=t.find(e=>e.id===n)?.identity,i=r?.avatarUrl??r?.avatar;if(i&&va(i))return i}function iH(e){if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e.ui;if(!t||typeof t!=`object`||Array.isArray(t))return null;let n=t.assistant;return!n||typeof n!=`object`||Array.isArray(n)?null:T(n.avatar)??null}function aH(e,t){let n=fi(e??``),r=encodeURIComponent(t);return n?`${n}/avatar/${r}`:`/avatar/${r}`}var oH=[{id:`weixin`,label:`微信`},{id:`qqbot`,label:`QQ`},{id:`feishu`,label:`飞书`},{id:`webhooks`,label:`Webhooks`}];function sH(e){let t=e.trim();return t?t.split(/[-_]+/).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `):`Unknown`}function cH(e){let t=e.configForm??e.configSnapshot?.config;if(!t||typeof t!=`object`)return[];let n=`channels`in t&&t.channels&&typeof t.channels==`object`?t.channels:{},r=Object.keys(n).filter(e=>e.trim().length>0),i=r.length>0?r.toSorted((e,t)=>e.localeCompare(t)):oH.map(({id:e})=>e),a=new Map(oH.map(({id:e,label:t})=>[e,t])),o=[];for(let e of i){let t=n[e],r=typeof t==`object`&&!!t&&Object.keys(t).length>0;o.push({id:e,label:a.get(e)??sH(e),connected:r,detail:r?`Configured`:void 0})}return o}function lH(e){let t=e.configForm??e.configSnapshot?.config;if(!t||typeof t!=`object`)return 0;let n=t.mcp;if(!n||typeof n!=`object`)return 0;let r=`servers`in n&&n.servers&&typeof n.servers==`object`?n.servers:{};return Object.keys(r).length}function uH(e){let t=e.configForm??e.configSnapshot?.config;if(!t||typeof t!=`object`)return{gatewayAuth:`unknown`,execPolicy:`unknown`,deviceAuth:!1,browserEnabled:!0,toolProfile:`full`};let n=t,r=`gateway`in n&&n.gateway&&typeof n.gateway==`object`?n.gateway:null,i=r&&`auth`in r&&r.auth&&typeof r.auth==`object`?r.auth:null,a=`unknown`;i&&(a=(typeof i.mode==`string`?i.mode.trim():``)||(i.password?`password`:i.token?`token`:i.trustedProxy?`trusted-proxy`:`none`));let o=`allowlist`,s=`full`,c=n.tools;if(c&&typeof c==`object`){let e=c.profile;if(typeof e==`string`){let t=e.trim();t&&(s=t)}let t=c.exec;if(t&&typeof t==`object`){let e=t.security;if(typeof e==`string`){let t=e.trim();t&&(o=t)}}}let l=!0,u=`browser`in n&&n.browser&&typeof n.browser==`object`?n.browser:null;u&&typeof u.enabled==`boolean`&&(l=u.enabled);let d=!0;return r&&(`controlUi`in r&&r.controlUi&&typeof r.controlUi==`object`?r.controlUi:null)?.dangerouslyDisableDeviceAuth===!0&&(d=!1),{gatewayAuth:a,execPolicy:o,deviceAuth:d,browserEnabled:l,toolProfile:s}}function dH(e){return e.sessionsResult?.sessions?.find(t=>t.key===e.sessionKey)}function fH(e,t){return nz({open:e.cronQuickCreateOpen,step:e.cronQuickCreateStep,draft:e.cronQuickCreateDraft??KR(),onDraftChange:n=>{e.cronQuickCreateDraft={...e.cronQuickCreateDraft??KR(),...n},t?.()},onStepChange:n=>{e.cronQuickCreateStep=n,t?.()},onCreate:()=>{let n=JR(e.cronQuickCreateDraft??KR());e.cronEditingJobId=null,e.cronForm={...hg,...n},t?.(),(async()=>{if(!await cv(e)){t?.();return}e.cronQuickCreateOpen=!1,e.cronQuickCreateStep=`what`,e.cronQuickCreateDraft=null,t?.()})()},onAdvancedCreate:()=>{let n=JR(e.cronQuickCreateDraft??KR());e.cronEditingJobId=null,e.cronForm=B_({...hg,...n}),e.cronFieldErrors=V_(e.cronForm),e.cronQuickCreateOpen=!1,e.cronQuickCreateStep=`what`,e.cronQuickCreateDraft=null,e.cronFormCollapsed=!1,t?.()},onCancel:()=>{e.cronQuickCreateOpen=!1,e.cronQuickCreateStep=`what`,e.cronQuickCreateDraft=null,t?.()}})}function pH(e){let t=e,n=typeof t.requestUpdate==`function`?()=>t.requestUpdate?.():void 0;if(gV=n,!e.connected)return d` ${HB(e)} ${kB(e)} `;let r=e.presenceEntries.length,a=e.sessionsResult?.count??null,o=e.cronStatus?.nextWakeAtMs??null,s=e.connected?null:v(`chat.disconnected`),c=e.tab===`chat`,u=c&&(e.settings.chatFocusMode||e.onboarding),f=c&&(u||e.chatHeaderControlsHidden),p=e.navDrawerOpen&&!u&&!e.onboarding,m=e.settings.navCollapsed&&!p,h=WN(e),g=e.onboarding?!1:e.settings.chatShowThinking,_=e.onboarding?!0:e.settings.chatShowToolCalls,y=T(Mo().avatar)??null,b=rH(e),x=y?`data`:e.chatAvatarStatus??e.assistantAvatarStatus??null,S=y?null:e.chatAvatarReason??e.assistantAvatarReason??null,C=x===`none`&&S===`missing`,w=y??(C?null:e.assistantAvatar),E=y??e.chatAvatarUrl??(C?null:b??null),D=y?`data`:e.assistantAvatarStatus??e.chatAvatarStatus??null,O=y?null:e.assistantAvatarReason??e.chatAvatarReason??null,ee=y??e.assistantAvatarSource??e.chatAvatarSource??null,k=D===`none`&&O===`missing`,te=y??(k||D===`local`?null:e.assistantAvatar),A=y??(D===`local`&&e.assistantAgentId?aH(e.basePath,e.assistantAgentId):e.chatAvatarUrl??(k?null:b??null)),j=e.configForm??e.configSnapshot?.config,M=zv(j),N=e.dreamingStatus?.enabled??M.enabled,P=IV(e.dreamingStatus),F=e.dreamingStatusLoading||e.dreamingModeSaving,ne=e.dreamingStatusLoading||e.dreamDiaryLoading,re=()=>{(async()=>{await Un(e),await Promise.all([ey(e),ty(e),ny(e),ry(e)])})()},ie=async t=>{if(!e.client||!e.connected)return null;let n=await e.client.request(`wiki.get`,{lookup:t,fromLine:1,lineCount:5e3}),r=typeof n?.title==`string`&&n.title.trim()?n.title.trim():t,i=typeof n?.path==`string`&&n.path.trim()?n.path.trim():t,a=typeof n?.content==`string`&&n.content.length>0?n.content:v(`wiki.noContent`),o=typeof n?.updatedAt==`string`&&n.updatedAt.trim()?n.updatedAt.trim():void 0,s=typeof n?.totalLines==`number`&&Number.isFinite(n.totalLines)?Math.max(0,Math.floor(n.totalLines)):void 0,c=n?.truncated===!0;return{title:r,path:i,content:a,...s===void 0?{}:{totalLines:s},...c?{truncated:c}:{},...o?{updatedAt:o}:{}}},ae=t=>{e.dreamingModeSaving||e.dreamingRestartConfirmLoading||e.dreamingRestartConfirmOpen||N===t||(e.dreamingPendingEnabled=t,e.dreamingRestartConfirmOpen=!0,e.dreamingStatusError=null)},oe=()=>{e.dreamingRestartConfirmLoading||(e.dreamingRestartConfirmOpen=!1,e.dreamingPendingEnabled=null,e.dreamingStatusError=null)},se=()=>{let t=e.dreamingPendingEnabled;t==null||e.dreamingRestartConfirmLoading||(async()=>{e.dreamingRestartConfirmLoading=!0,e.dreamingStatusError=null;try{if(!await hy(e,t)){e.dreamingStatusError||=v(`dreaming.restartConfirmation.failed`);return}await Un(e),await ey(e),e.dreamingRestartConfirmOpen=!1,e.dreamingPendingEnabled=null}finally{e.dreamingRestartConfirmLoading=!1}})()},ce=fi(e.basePath??``),le=()=>e.agentsSelectedId??e.agentsList?.defaultId??e.agentsList?.agents?.[0]?.id??null,I=le(),ue=Xc(e.sessionKey),de=!!(I&&ue&&I===ue),fe=()=>e.configForm??e.configSnapshot?.config,L=e=>fr(fe(),e),pe=t=>pr(e,t),me=(e,t)=>{let n=t?pe(e):L(e);return n>=0?[`agents`,`list`,n,`tools`]:null},he=e=>{let t=fe()?.agents?.list,n=Array.isArray(t)?t[e]?.model:void 0;return{basePath:[`agents`,`list`,e,`model`],existing:n}},ge=za(new Set([...e.agentsList?.agents?.map(e=>e.id.trim())??[],...e.cronJobs.map(e=>typeof e.agentId==`string`?e.agentId.trim():``).filter(Boolean)].filter(Boolean))),_e=za(new Set([...e.cronModelSuggestions,...Ba(j),...e.cronJobs.map(e=>{let t=F_(e);return t?.kind!==`agentTurn`||typeof t.model!=`string`?``:t.model.trim()}).filter(Boolean)].filter(Boolean))),ve=Y_(e),ye=e.cronForm.deliveryChannel&&e.cronForm.deliveryChannel.trim()?e.cronForm.deliveryChannel.trim():`last`,be=e.cronJobs.map(e=>HV(e.delivery?.to)).filter(Boolean),xe=(ye===`last`?Object.values(e.channelsSnapshot?.channelAccounts??{}).flat():e.channelsSnapshot?.channelAccounts?.[ye]??[]).flatMap(e=>[HV(e.accountId),HV(e.name)]).filter(Boolean),Se=UV([...be,...xe]),Ce=UV(xe),we=e.cronForm.deliveryMode===`webhook`?Se.filter(e=>VV(e)):Se,Te={raw:e.configRaw,originalRaw:e.configRawOriginal,valid:e.configValid,issues:e.configIssues,loading:e.configLoading,saving:e.configSaving,applying:e.configApplying,updating:e.updateRunning,connected:e.connected,schema:e.configSchema,schemaLoading:e.configSchemaLoading,uiHints:e.configUiHints,formValue:e.configForm,originalValue:e.configFormOriginal,onRawChange:t=>{cr(e,t)},onRequestUpdate:n,onFormPatch:(t,n)=>sr(e,t,n),onReload:()=>Un(e,{discardPendingChanges:!0}),onReset:()=>ur(e),onSave:()=>er(e),onApply:()=>tr(e),onUpdate:()=>nr(e),onOpenFile:()=>hr(e),version:e.hello?.server?.version??``,theme:e.theme,themeMode:e.themeMode,setTheme:(t,n)=>e.setTheme(t,n),setThemeMode:(t,n)=>e.setThemeMode(t,n),hasCustomTheme:!!e.settings.customTheme,customThemeLabel:e.settings.customTheme?.label??null,customThemeSourceUrl:e.settings.customTheme?.sourceUrl??null,customThemeImportUrl:e.customThemeImportUrl,customThemeImportBusy:e.customThemeImportBusy,customThemeImportMessage:e.customThemeImportMessage,customThemeImportExpanded:e.customThemeImportExpanded,customThemeImportFocusToken:e.customThemeImportFocusToken,onCustomThemeImportUrlChange:t=>e.setCustomThemeImportUrl(t),onOpenCustomThemeImport:()=>e.openCustomThemeImport(),onImportCustomTheme:()=>void e.importCustomTheme(),onClearCustomTheme:()=>e.clearCustomTheme(),borderRadius:e.settings.borderRadius,setBorderRadius:t=>e.setBorderRadius(t),textScale:e.settings.textScale??100,setTextScale:t=>e.setTextScale(t),gatewayUrl:e.settings.gatewayUrl,assistantName:e.assistantName,configPath:e.configSnapshot?.path??null,rawAvailable:typeof e.configSnapshot?.raw==`string`||!!e.configSnapshot?.config||!!e.configForm},Ee=t=>{let n=t.includeSections?.[0]??null,r=t.activeSection??n,i=t.showRootTab??!t.includeSections?.length;return nH(e,`config`,{tab:e.tab,formMode:t.formMode,activeSection:r,activeSubsection:t.activeSubsection,schemaSectionCount:tH(Te.schema,t.includeSections,t.excludeSections),hasSearch:!!t.searchQuery?.trim()},()=>UR({...Te,includeVirtualSections:!1,...t,activeSection:r,showRootTab:i}))},De=$V(e.configActiveSection,e.configActiveSubsection),Oe=eH(e.communicationsActiveSection,e.communicationsActiveSubsection,qV),ke=eH(e.appearanceActiveSection,e.appearanceActiveSubsection,JV),Ae=eH(e.automationActiveSection,e.automationActiveSubsection,YV),je=eH(e.infrastructureActiveSection,e.infrastructureActiveSubsection,XV),Me=eH(e.aiAgentsActiveSection,e.aiAgentsActiveSubsection,ZV),Ne=()=>{switch(e.tab){case`config`:if(e.configSettingsMode===`quick`){let t=e.configForm??e.configSnapshot?.config??{},r=y??iH(t),i=t.agents?.defaults??{},a=dH(e),o=typeof a?.model==`string`?a.model:typeof i.model==`string`?i.model:`default`,s=typeof a?.thinkingLevel==`string`?a.thinkingLevel:typeof i.thinkingLevel==`string`?i.thinkingLevel:`off`,c=typeof a?.fastMode==`boolean`?a.fastMode:i.fastMode===!0;return yL({currentModel:o,thinkingLevel:s,fastMode:c,onModelChange:()=>{e.configSettingsMode=`advanced`,e.aiAgentsActiveSection=`models`,e.setTab(`aiAgents`)},onThinkingChange:t=>{qm(e,e.sessionKey,{thinkingLevel:t}).then(()=>n?.())},onFastModeToggle:()=>{qm(e,e.sessionKey,{fastMode:!c}).then(()=>n?.())},channels:cH(e),onChannelConfigure:()=>{e.setTab(`channels`)},automation:{cronJobCount:e.cronJobs?.length??0,skillCount:e.skillsReport?.skills?.length??0,mcpServerCount:lH(e)},onManageCron:()=>{e.setTab(`cron`)},onBrowseSkills:()=>{e.setTab(`skills`)},onConfigureMcp:()=>{e.infrastructureActiveSection=`mcp`,e.setTab(`infrastructure`)},security:uH(e),onSecurityConfigure:()=>{e.configSettingsMode=`advanced`,e.configActiveSection=`auth`,n?.()},onBrowserEnabledToggle:t=>{sr(e,[`browser`,`enabled`],t),n?.()},onToolProfileChange:t=>{sr(e,[`tools`,`profile`],t),n?.()},theme:e.theme,themeMode:e.themeMode,hasCustomTheme:!!e.settings.customTheme,customThemeLabel:e.settings.customTheme?.label??null,borderRadius:e.settings.borderRadius,textScale:e.settings.textScale??100,setTheme:(t,n)=>e.setTheme(t,n),onOpenCustomThemeImport:()=>{e.setTab(`appearance`),e.appearanceFormMode=`form`,e.appearanceSearchQuery=``,e.appearanceActiveSection=`__appearance__`,e.appearanceActiveSubsection=null,e.openCustomThemeImport(),n?.()},setThemeMode:(t,n)=>e.setThemeMode(t,n),setBorderRadius:t=>e.setBorderRadius(t),setTextScale:t=>e.setTextScale(t),userAvatar:e.userAvatar??null,onUserAvatarChange:t=>e.applyLocalUserIdentity?.({avatar:t}),assistantAvatar:te,assistantAvatarUrl:A,assistantAvatarSource:ee,assistantAvatarStatus:D,assistantAvatarReason:O,assistantAvatarOverride:r,assistantAvatarUploadBusy:e.assistantAvatarUploadBusy,assistantAvatarUploadError:e.assistantAvatarUploadError,onAssistantAvatarOverrideChange:t=>{GA(e,t),e.chatAvatarUrl=t,e.chatAvatarSource=t,e.chatAvatarStatus=`data`,e.chatAvatarReason=null,e.assistantAvatarUploadError=null,n?.()},onAssistantAvatarClearOverride:()=>{GA(e,null),e.chatAvatarUrl=null,e.chatAvatarSource=null,e.chatAvatarStatus=null,e.chatAvatarReason=null,e.assistantAvatarUploadError=null,e.loadAssistantIdentity?.().finally(()=>n?.()),n?.()},basePath:e.basePath??``,configObject:t,savedConfigObject:e.configSnapshot?.config??{},configDirty:e.configFormDirty,configSaving:e.configSaving,configApplying:e.configApplying,configReady:!!e.configSnapshot?.hash,onSelectPreset:t=>{let r=zI(t);r&&(lr(e,r.patch),n?.())},onResetConfig:()=>ur(e),onSaveConfig:()=>er(e),onApplyConfig:()=>tr(e),onAdvancedSettings:()=>{e.configSettingsMode=`advanced`,n?.()},connected:e.connected,gatewayUrl:e.settings.gatewayUrl,assistantName:e.assistantName,version:e.hello?.server?.version??``})}return Ee({formMode:e.configFormMode,searchQuery:e.configSearchQuery,activeSection:De.activeSection,activeSubsection:De.activeSubsection,onFormModeChange:t=>e.configFormMode=t,onSearchChange:t=>e.configSearchQuery=t,onSectionChange:t=>{e.configActiveSection=t,e.configActiveSubsection=null},onSubsectionChange:t=>e.configActiveSubsection=t,showModeToggle:!0,settingsLayout:`accordion`,onBackToQuick:()=>{e.configSettingsMode=`quick`,n?.()},excludeSections:[...qV,...YV,...XV,...ZV,`ui`,`wizard`]});case`channels`:return pI(EV,t=>t.renderChannels({connected:e.connected,loading:e.channelsLoading,snapshot:e.channelsSnapshot,lastError:e.channelsError,lastSuccessAt:e.channelsLastSuccess,configSchema:e.configSchema,configSchemaLoading:e.configSchemaLoading,configForm:e.configForm,configUiHints:e.configUiHints,configSaving:e.configSaving,configFormDirty:e.configFormDirty,onRefresh:t=>Kt(e,t),onConfigPatch:(t,n)=>sr(e,t,n),onConfigSave:()=>e.handleChannelConfigSave(),onConfigReload:()=>e.handleChannelConfigReload()}));case`communications`:return Ee({formMode:e.communicationsFormMode,searchQuery:e.communicationsSearchQuery,activeSection:Oe.activeSection,activeSubsection:Oe.activeSubsection,onFormModeChange:t=>e.communicationsFormMode=t,onSearchChange:t=>e.communicationsSearchQuery=t,onSectionChange:t=>{e.communicationsActiveSection=t,e.communicationsActiveSubsection=null},onSubsectionChange:t=>e.communicationsActiveSubsection=t,navRootLabel:`Communication`,includeSections:[...qV],includeVirtualSections:!0,webPush:{supported:e.webPushSupported,permission:e.webPushPermission,subscribed:e.webPushSubscribed,loading:e.webPushLoading},onWebPushSubscribe:()=>e.handleWebPushSubscribe(),onWebPushUnsubscribe:()=>e.handleWebPushUnsubscribe(),onWebPushTest:()=>e.handleWebPushTest()});case`appearance`:return Ee({formMode:e.appearanceFormMode,searchQuery:e.appearanceSearchQuery,activeSection:ke.activeSection,activeSubsection:ke.activeSubsection,onFormModeChange:t=>e.appearanceFormMode=t,onSearchChange:t=>e.appearanceSearchQuery=t,onSectionChange:t=>{e.appearanceActiveSection=t,e.appearanceActiveSubsection=null},onSubsectionChange:t=>e.appearanceActiveSubsection=t,navRootLabel:v(`tabs.appearance`),includeSections:[...JV],includeVirtualSections:!0});case`automation`:return Ee({formMode:e.automationFormMode,searchQuery:e.automationSearchQuery,activeSection:Ae.activeSection,activeSubsection:Ae.activeSubsection,onFormModeChange:t=>e.automationFormMode=t,onSearchChange:t=>e.automationSearchQuery=t,onSectionChange:t=>{e.automationActiveSection=t,e.automationActiveSubsection=null},onSubsectionChange:t=>e.automationActiveSubsection=t,navRootLabel:`Automation`,includeSections:[...YV]});case`infrastructure`:return Ee({formMode:e.infrastructureFormMode,searchQuery:e.infrastructureSearchQuery,activeSection:je.activeSection,activeSubsection:je.activeSubsection,onFormModeChange:t=>e.infrastructureFormMode=t,onSearchChange:t=>e.infrastructureSearchQuery=t,onSectionChange:t=>{e.infrastructureActiveSection=t,e.infrastructureActiveSubsection=null},onSubsectionChange:t=>e.infrastructureActiveSubsection=t,navRootLabel:v(`settings.section.web`),includeSections:[...XV]});case`aiAgents`:return Ee({formMode:e.aiAgentsFormMode,searchQuery:e.aiAgentsSearchQuery,activeSection:Me.activeSection,activeSubsection:Me.activeSubsection,onFormModeChange:t=>e.aiAgentsFormMode=t,onSearchChange:t=>e.aiAgentsSearchQuery=t,onSectionChange:t=>{e.aiAgentsActiveSection=t,e.aiAgentsActiveSubsection=null},onSubsectionChange:t=>e.aiAgentsActiveSubsection=t,navRootLabel:`AI & Agents`,includeSections:[...ZV]});default:return i}},Pe=t=>{if(t)switch(e.agentsPanel){case`files`:__(e,t);return;case`skills`:S_(e,t);return;case`tools`:E_(e,t),A_(e);return;case`overview`:case`channels`:case`cron`:return}},Fe=t=>{if(t===`channels`){Kt(e,!1);return}t===`cron`&&e.loadCron()},Ie=(t=!1)=>{e.agentFilesList=null,e.agentFilesError=null,e.agentFileActive=null,e.agentFileContents={},e.agentFileDrafts={},t&&(e.agentFilesLoading=!1)},Le=()=>{Ie(!0),e.agentSkillsReport=null,e.agentSkillsError=null,e.agentSkillsAgentId=null,e.toolsCatalogResult=null,e.toolsCatalogError=null,e.toolsCatalogLoading=!1,O_(e)};return d`
|
|
7007
|
+
`}var wV=dI(()=>hV(()=>import(`./agents-E-3DAkaW.js`),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url),_V),TV=dI(()=>hV(()=>import(`./activity-B7yRLbf3.js`),__vite__mapDeps([8,1,4,5]),import.meta.url),_V),EV=dI(()=>hV(()=>import(`./channels-D0c7A9OX.js`),__vite__mapDeps([9,1,5,6]),import.meta.url),_V),DV=dI(()=>hV(()=>import(`./cron-B54j2Vmo.js`),__vite__mapDeps([10,1,5]),import.meta.url),_V),OV=dI(()=>hV(()=>import(`./debug-CRcGYNA9.js`),__vite__mapDeps([11,1,5]),import.meta.url),_V),kV=dI(()=>hV(()=>import(`./instances-RcBeqNzx.js`),__vite__mapDeps([12,1,5]),import.meta.url),_V),AV=dI(()=>hV(()=>import(`./logs-atEFsTJJ.js`),__vite__mapDeps([13,1,4,5]),import.meta.url),_V),jV=dI(()=>hV(()=>import(`./nodes-BoWRh42t.js`),__vite__mapDeps([14,1,4,5]),import.meta.url),_V),MV=dI(()=>hV(()=>import(`./sessions-BmRQ932H.js`),__vite__mapDeps([15,1,4,5]),import.meta.url),_V),NV=dI(()=>hV(()=>import(`./skills-BDn45kHZ.js`),__vite__mapDeps([16,1,4,5,7]),import.meta.url),_V),PV=dI(()=>hV(()=>import(`./workboard-BwbcNuC5.js`),__vite__mapDeps([17,1,5]),import.meta.url),_V);function FV(e){return typeof e!=`number`||!Number.isFinite(e)?null:new Date(e).toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`})}function IV(e){if(!e?.phases)return null;let t;for(let n of Object.values(e.phases))!n.enabled||typeof n.nextRunAtMs!=`number`||(t===void 0||n.nextRunAtMs<t)&&(t=n.nextRunAtMs);return FV(t)}var LV=null,RV=`fengming:control-ui:update-banner-dismissed:v1`,zV=[`off`,`minimal`,`low`,`medium`,`high`],BV=[`UTC`,`America/Los_Angeles`,`America/Denver`,`America/Chicago`,`America/New_York`,`Europe/London`,`Europe/Berlin`,`Asia/Tokyo`];function VV(e){return/^https?:\/\//i.test(e.trim())}function HV(e){return typeof e==`string`?e.trim():``}function UV(e){let t=new Set,n=[];for(let r of e){let e=r.trim();if(!e)continue;let i=e.toLowerCase();t.has(i)||(t.add(i),n.push(e))}return n}function WV(){try{let e=et()?.getItem(RV);if(!e)return null;let t=JSON.parse(e);return!t||typeof t.latestVersion!=`string`?null:{latestVersion:t.latestVersion,channel:typeof t.channel==`string`?t.channel:null,dismissedAtMs:typeof t.dismissedAtMs==`number`?t.dismissedAtMs:Date.now()}}catch{return null}}function GV(e){let t=WV();if(!t)return!1;let n=e,r=n&&typeof n.latestVersion==`string`?n.latestVersion:null,i=n&&typeof n.channel==`string`?n.channel:null;return!!(r&&t.latestVersion===r&&t.channel===i)}function KV(e){let t=e,n=t&&typeof t.latestVersion==`string`?t.latestVersion:null;if(!n)return;let r={latestVersion:n,channel:t&&typeof t.channel==`string`?t.channel:null,dismissedAtMs:Date.now()};try{et()?.setItem(RV,JSON.stringify(r))}catch{}}var qV=[`messages`,`broadcast`,`__notifications__`,`talk`,`audio`,`channels`],JV=[`__appearance__`,`ui`,`wizard`],YV=[`commands`,`hooks`,`bindings`,`cron`,`approvals`,`plugins`],XV=[`gateway`,`web`,`browser`,`nodeHost`,`canvasHost`,`discovery`,`media`,`acp`,`mcp`],ZV=[`agents`,`models`,`skills`,`tools`,`memory`,`session`],QV=new Set([...qV,...JV,...YV,...XV,...ZV]);function $V(e,t){return e&&QV.has(e)?{activeSection:null,activeSubsection:null}:{activeSection:e,activeSubsection:t}}function eH(e,t,n){return e&&!n.includes(e)?{activeSection:null,activeSubsection:null}:{activeSection:e,activeSubsection:t}}function tH(e,t,n){if(!e||typeof e!=`object`||Array.isArray(e))return 0;let r=e.properties;if(!r||typeof r!=`object`||Array.isArray(r))return 0;let i=t?.length?new Set(t):null,a=n?.length?new Set(n):null;return Object.keys(r).filter(e=>!(i&&!i.has(e)||a?.has(e))).length}function nH(e,t,n,r){let i=Qg(),a=r();return u_(e,t,{...n,durationMs:$g(Qg()-i)}),a}function rH(e){let t=e.agentsList?.agents??[],n=z(e.sessionKey)?.agentId??e.agentsList?.defaultId??`main`,r=t.find(e=>e.id===n)?.identity,i=r?.avatarUrl??r?.avatar;if(i&&va(i))return i}function iH(e){if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e.ui;if(!t||typeof t!=`object`||Array.isArray(t))return null;let n=t.assistant;return!n||typeof n!=`object`||Array.isArray(n)?null:T(n.avatar)??null}function aH(e,t){let n=fi(e??``),r=encodeURIComponent(t);return n?`${n}/avatar/${r}`:`/avatar/${r}`}var oH=[{id:`weixin`,label:`微信`},{id:`qqbot`,label:`QQ`},{id:`feishu`,label:`飞书`},{id:`webhooks`,label:`Webhooks`}];function sH(e){let t=e.trim();return t?t.split(/[-_]+/).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `):`Unknown`}function cH(e){let t=e.configForm??e.configSnapshot?.config;if(!t||typeof t!=`object`)return[];let n=`channels`in t&&t.channels&&typeof t.channels==`object`?t.channels:{},r=Object.keys(n).filter(e=>e.trim().length>0),i=r.length>0?r.toSorted((e,t)=>e.localeCompare(t)):oH.map(({id:e})=>e),a=new Map(oH.map(({id:e,label:t})=>[e,t])),o=[];for(let e of i){let t=n[e],r=typeof t==`object`&&!!t&&Object.keys(t).length>0;o.push({id:e,label:a.get(e)??sH(e),connected:r,detail:r?`Configured`:void 0})}return o}function lH(e){let t=e.configForm??e.configSnapshot?.config;if(!t||typeof t!=`object`)return 0;let n=t.mcp;if(!n||typeof n!=`object`)return 0;let r=`servers`in n&&n.servers&&typeof n.servers==`object`?n.servers:{};return Object.keys(r).length}function uH(e){let t=e.configForm??e.configSnapshot?.config;if(!t||typeof t!=`object`)return{gatewayAuth:`unknown`,execPolicy:`unknown`,deviceAuth:!1,browserEnabled:!0,toolProfile:`full`};let n=t,r=`gateway`in n&&n.gateway&&typeof n.gateway==`object`?n.gateway:null,i=r&&`auth`in r&&r.auth&&typeof r.auth==`object`?r.auth:null,a=`unknown`;i&&(a=(typeof i.mode==`string`?i.mode.trim():``)||(i.password?`password`:i.token?`token`:i.trustedProxy?`trusted-proxy`:`none`));let o=`allowlist`,s=`full`,c=n.tools;if(c&&typeof c==`object`){let e=c.profile;if(typeof e==`string`){let t=e.trim();t&&(s=t)}let t=c.exec;if(t&&typeof t==`object`){let e=t.security;if(typeof e==`string`){let t=e.trim();t&&(o=t)}}}let l=!0,u=`browser`in n&&n.browser&&typeof n.browser==`object`?n.browser:null;u&&typeof u.enabled==`boolean`&&(l=u.enabled);let d=!0;return r&&(`controlUi`in r&&r.controlUi&&typeof r.controlUi==`object`?r.controlUi:null)?.dangerouslyDisableDeviceAuth===!0&&(d=!1),{gatewayAuth:a,execPolicy:o,deviceAuth:d,browserEnabled:l,toolProfile:s}}function dH(e){return e.sessionsResult?.sessions?.find(t=>t.key===e.sessionKey)}function fH(e,t){return nz({open:e.cronQuickCreateOpen,step:e.cronQuickCreateStep,draft:e.cronQuickCreateDraft??KR(),onDraftChange:n=>{e.cronQuickCreateDraft={...e.cronQuickCreateDraft??KR(),...n},t?.()},onStepChange:n=>{e.cronQuickCreateStep=n,t?.()},onCreate:()=>{let n=JR(e.cronQuickCreateDraft??KR());e.cronEditingJobId=null,e.cronForm={...hg,...n},t?.(),(async()=>{if(!await cv(e)){t?.();return}e.cronQuickCreateOpen=!1,e.cronQuickCreateStep=`what`,e.cronQuickCreateDraft=null,t?.()})()},onAdvancedCreate:()=>{let n=JR(e.cronQuickCreateDraft??KR());e.cronEditingJobId=null,e.cronForm=B_({...hg,...n}),e.cronFieldErrors=V_(e.cronForm),e.cronQuickCreateOpen=!1,e.cronQuickCreateStep=`what`,e.cronQuickCreateDraft=null,e.cronFormCollapsed=!1,t?.()},onCancel:()=>{e.cronQuickCreateOpen=!1,e.cronQuickCreateStep=`what`,e.cronQuickCreateDraft=null,t?.()}})}function pH(e){let t=e,n=typeof t.requestUpdate==`function`?()=>t.requestUpdate?.():void 0;if(gV=n,!e.connected)return d` ${HB(e)} ${kB(e)} `;let r=e.presenceEntries.length,a=e.sessionsResult?.count??null,o=e.cronStatus?.nextWakeAtMs??null,s=e.connected?null:v(`chat.disconnected`),c=e.tab===`chat`,u=c&&(e.settings.chatFocusMode||e.onboarding),f=c&&(u||e.chatHeaderControlsHidden),p=e.navDrawerOpen&&!u&&!e.onboarding,m=e.settings.navCollapsed&&!p,h=WN(e),g=e.onboarding?!1:e.settings.chatShowThinking,_=e.onboarding?!0:e.settings.chatShowToolCalls,y=T(Mo().avatar)??null,b=rH(e),x=y?`data`:e.chatAvatarStatus??e.assistantAvatarStatus??null,S=y?null:e.chatAvatarReason??e.assistantAvatarReason??null,C=x===`none`&&S===`missing`,w=y??(C?null:e.assistantAvatar),E=y??e.chatAvatarUrl??(C?null:b??null),D=y?`data`:e.assistantAvatarStatus??e.chatAvatarStatus??null,O=y?null:e.assistantAvatarReason??e.chatAvatarReason??null,ee=y??e.assistantAvatarSource??e.chatAvatarSource??null,k=D===`none`&&O===`missing`,te=y??(k||D===`local`?null:e.assistantAvatar),A=y??(D===`local`&&e.assistantAgentId?aH(e.basePath,e.assistantAgentId):e.chatAvatarUrl??(k?null:b??null)),j=e.configForm??e.configSnapshot?.config,M=zv(j),N=e.dreamingStatus?.enabled??M.enabled,P=IV(e.dreamingStatus),F=e.dreamingStatusLoading||e.dreamingModeSaving,ne=e.dreamingStatusLoading||e.dreamDiaryLoading,re=()=>{(async()=>{await Un(e),await Promise.all([ey(e),ty(e),ny(e),ry(e)])})()},ie=async t=>{if(!e.client||!e.connected)return null;let n=await e.client.request(`wiki.get`,{lookup:t,fromLine:1,lineCount:5e3}),r=typeof n?.title==`string`&&n.title.trim()?n.title.trim():t,i=typeof n?.path==`string`&&n.path.trim()?n.path.trim():t,a=typeof n?.content==`string`&&n.content.length>0?n.content:v(`wiki.noContent`),o=typeof n?.updatedAt==`string`&&n.updatedAt.trim()?n.updatedAt.trim():void 0,s=typeof n?.totalLines==`number`&&Number.isFinite(n.totalLines)?Math.max(0,Math.floor(n.totalLines)):void 0,c=n?.truncated===!0;return{title:r,path:i,content:a,...s===void 0?{}:{totalLines:s},...c?{truncated:c}:{},...o?{updatedAt:o}:{}}},ae=t=>{e.dreamingModeSaving||e.dreamingRestartConfirmLoading||e.dreamingRestartConfirmOpen||N===t||(e.dreamingPendingEnabled=t,e.dreamingRestartConfirmOpen=!0,e.dreamingStatusError=null)},oe=()=>{e.dreamingRestartConfirmLoading||(e.dreamingRestartConfirmOpen=!1,e.dreamingPendingEnabled=null,e.dreamingStatusError=null)},se=()=>{let t=e.dreamingPendingEnabled;t==null||e.dreamingRestartConfirmLoading||(async()=>{e.dreamingRestartConfirmLoading=!0,e.dreamingStatusError=null;try{if(!await hy(e,t)){e.dreamingStatusError||=v(`dreaming.restartConfirmation.failed`);return}await Un(e),await ey(e),e.dreamingRestartConfirmOpen=!1,e.dreamingPendingEnabled=null}finally{e.dreamingRestartConfirmLoading=!1}})()},ce=fi(e.basePath??``),le=()=>e.agentsSelectedId??e.agentsList?.defaultId??e.agentsList?.agents?.[0]?.id??null,I=le(),ue=Xc(e.sessionKey),de=!!(I&&ue&&I===ue),fe=()=>e.configForm??e.configSnapshot?.config,L=e=>fr(fe(),e),pe=t=>pr(e,t),me=(e,t)=>{let n=t?pe(e):L(e);return n>=0?[`agents`,`list`,n,`tools`]:null},he=e=>{let t=fe()?.agents?.list,n=Array.isArray(t)?t[e]?.model:void 0;return{basePath:[`agents`,`list`,e,`model`],existing:n}},ge=za(new Set([...e.agentsList?.agents?.map(e=>e.id.trim())??[],...e.cronJobs.map(e=>typeof e.agentId==`string`?e.agentId.trim():``).filter(Boolean)].filter(Boolean))),_e=za(new Set([...e.cronModelSuggestions,...Ba(j),...e.cronJobs.map(e=>{let t=F_(e);return t?.kind!==`agentTurn`||typeof t.model!=`string`?``:t.model.trim()}).filter(Boolean)].filter(Boolean))),ve=Y_(e),ye=e.cronForm.deliveryChannel&&e.cronForm.deliveryChannel.trim()?e.cronForm.deliveryChannel.trim():`last`,be=e.cronJobs.map(e=>HV(e.delivery?.to)).filter(Boolean),xe=(ye===`last`?Object.values(e.channelsSnapshot?.channelAccounts??{}).flat():e.channelsSnapshot?.channelAccounts?.[ye]??[]).flatMap(e=>[HV(e.accountId),HV(e.name)]).filter(Boolean),Se=UV([...be,...xe]),Ce=UV(xe),we=e.cronForm.deliveryMode===`webhook`?Se.filter(e=>VV(e)):Se,Te={raw:e.configRaw,originalRaw:e.configRawOriginal,valid:e.configValid,issues:e.configIssues,loading:e.configLoading,saving:e.configSaving,applying:e.configApplying,updating:e.updateRunning,connected:e.connected,schema:e.configSchema,schemaLoading:e.configSchemaLoading,uiHints:e.configUiHints,formValue:e.configForm,originalValue:e.configFormOriginal,onRawChange:t=>{cr(e,t)},onRequestUpdate:n,onFormPatch:(t,n)=>sr(e,t,n),onReload:()=>Un(e,{discardPendingChanges:!0}),onReset:()=>ur(e),onSave:()=>er(e),onApply:()=>tr(e),onUpdate:()=>nr(e),onOpenFile:()=>hr(e),version:e.hello?.server?.version??``,theme:e.theme,themeMode:e.themeMode,setTheme:(t,n)=>e.setTheme(t,n),setThemeMode:(t,n)=>e.setThemeMode(t,n),hasCustomTheme:!!e.settings.customTheme,customThemeLabel:e.settings.customTheme?.label??null,customThemeSourceUrl:e.settings.customTheme?.sourceUrl??null,customThemeImportUrl:e.customThemeImportUrl,customThemeImportBusy:e.customThemeImportBusy,customThemeImportMessage:e.customThemeImportMessage,customThemeImportExpanded:e.customThemeImportExpanded,customThemeImportFocusToken:e.customThemeImportFocusToken,onCustomThemeImportUrlChange:t=>e.setCustomThemeImportUrl(t),onOpenCustomThemeImport:()=>e.openCustomThemeImport(),onImportCustomTheme:()=>void e.importCustomTheme(),onClearCustomTheme:()=>e.clearCustomTheme(),borderRadius:e.settings.borderRadius,setBorderRadius:t=>e.setBorderRadius(t),textScale:e.settings.textScale??100,setTextScale:t=>e.setTextScale(t),gatewayUrl:e.settings.gatewayUrl,assistantName:e.assistantName,configPath:e.configSnapshot?.path??null,rawAvailable:typeof e.configSnapshot?.raw==`string`||!!e.configSnapshot?.config||!!e.configForm},Ee=t=>{let n=t.includeSections?.[0]??null,r=t.activeSection??n,i=t.showRootTab??!t.includeSections?.length;return nH(e,`config`,{tab:e.tab,formMode:t.formMode,activeSection:r,activeSubsection:t.activeSubsection,schemaSectionCount:tH(Te.schema,t.includeSections,t.excludeSections),hasSearch:!!t.searchQuery?.trim()},()=>UR({...Te,includeVirtualSections:!1,...t,activeSection:r,showRootTab:i}))},De=$V(e.configActiveSection,e.configActiveSubsection),Oe=eH(e.communicationsActiveSection,e.communicationsActiveSubsection,qV),ke=eH(e.appearanceActiveSection,e.appearanceActiveSubsection,JV),Ae=eH(e.automationActiveSection,e.automationActiveSubsection,YV),je=eH(e.infrastructureActiveSection,e.infrastructureActiveSubsection,XV),Me=eH(e.aiAgentsActiveSection,e.aiAgentsActiveSubsection,ZV),Ne=()=>{switch(e.tab){case`config`:if(e.configSettingsMode===`quick`){let t=e.configForm??e.configSnapshot?.config??{},r=y??iH(t),i=t.agents?.defaults??{},a=dH(e),o=typeof a?.model==`string`?a.model:typeof i.model==`string`?i.model:`default`,s=typeof a?.thinkingLevel==`string`?a.thinkingLevel:typeof i.thinkingLevel==`string`?i.thinkingLevel:`off`,c=typeof a?.fastMode==`boolean`?a.fastMode:i.fastMode===!0;return yL({currentModel:o,thinkingLevel:s,fastMode:c,onModelChange:()=>{e.configSettingsMode=`advanced`,e.aiAgentsActiveSection=`models`,e.setTab(`aiAgents`)},onThinkingChange:t=>{qm(e,e.sessionKey,{thinkingLevel:t}).then(()=>n?.())},onFastModeToggle:()=>{qm(e,e.sessionKey,{fastMode:!c}).then(()=>n?.())},channels:cH(e),onChannelConfigure:()=>{e.setTab(`channels`)},automation:{cronJobCount:e.cronJobs?.length??0,skillCount:e.skillsReport?.skills?.length??0,mcpServerCount:lH(e)},onManageCron:()=>{e.setTab(`cron`)},onBrowseSkills:()=>{e.setTab(`skills`)},onConfigureMcp:()=>{e.infrastructureActiveSection=`mcp`,e.setTab(`infrastructure`)},security:uH(e),onSecurityConfigure:()=>{e.configSettingsMode=`advanced`,e.configActiveSection=`auth`,n?.()},onBrowserEnabledToggle:t=>{sr(e,[`browser`,`enabled`],t),n?.()},onToolProfileChange:t=>{sr(e,[`tools`,`profile`],t),n?.()},theme:e.theme,themeMode:e.themeMode,hasCustomTheme:!!e.settings.customTheme,customThemeLabel:e.settings.customTheme?.label??null,borderRadius:e.settings.borderRadius,textScale:e.settings.textScale??100,setTheme:(t,n)=>e.setTheme(t,n),onOpenCustomThemeImport:()=>{e.setTab(`appearance`),e.appearanceFormMode=`form`,e.appearanceSearchQuery=``,e.appearanceActiveSection=`__appearance__`,e.appearanceActiveSubsection=null,e.openCustomThemeImport(),n?.()},setThemeMode:(t,n)=>e.setThemeMode(t,n),setBorderRadius:t=>e.setBorderRadius(t),setTextScale:t=>e.setTextScale(t),userAvatar:e.userAvatar??null,onUserAvatarChange:t=>e.applyLocalUserIdentity?.({avatar:t}),assistantAvatar:te,assistantAvatarUrl:A,assistantAvatarSource:ee,assistantAvatarStatus:D,assistantAvatarReason:O,assistantAvatarOverride:r,assistantAvatarUploadBusy:e.assistantAvatarUploadBusy,assistantAvatarUploadError:e.assistantAvatarUploadError,onAssistantAvatarOverrideChange:t=>{GA(e,t),e.chatAvatarUrl=t,e.chatAvatarSource=t,e.chatAvatarStatus=`data`,e.chatAvatarReason=null,e.assistantAvatarUploadError=null,n?.()},onAssistantAvatarClearOverride:()=>{GA(e,null),e.chatAvatarUrl=null,e.chatAvatarSource=null,e.chatAvatarStatus=null,e.chatAvatarReason=null,e.assistantAvatarUploadError=null,e.loadAssistantIdentity?.().finally(()=>n?.()),n?.()},basePath:e.basePath??``,configObject:t,savedConfigObject:e.configSnapshot?.config??{},configDirty:e.configFormDirty,configSaving:e.configSaving,configApplying:e.configApplying,configReady:!!e.configSnapshot?.hash,onSelectPreset:t=>{let r=zI(t);r&&(lr(e,r.patch),n?.())},onResetConfig:()=>ur(e),onSaveConfig:()=>er(e),onApplyConfig:()=>tr(e),onAdvancedSettings:()=>{e.configSettingsMode=`advanced`,n?.()},connected:e.connected,gatewayUrl:e.settings.gatewayUrl,assistantName:e.assistantName,version:e.hello?.server?.version??``})}return Ee({formMode:e.configFormMode,searchQuery:e.configSearchQuery,activeSection:De.activeSection,activeSubsection:De.activeSubsection,onFormModeChange:t=>e.configFormMode=t,onSearchChange:t=>e.configSearchQuery=t,onSectionChange:t=>{e.configActiveSection=t,e.configActiveSubsection=null},onSubsectionChange:t=>e.configActiveSubsection=t,showModeToggle:!0,settingsLayout:`accordion`,onBackToQuick:()=>{e.configSettingsMode=`quick`,n?.()},excludeSections:[...qV,...YV,...XV,...ZV,`ui`,`wizard`]});case`channels`:return pI(EV,t=>t.renderChannels({connected:e.connected,loading:e.channelsLoading,snapshot:e.channelsSnapshot,lastError:e.channelsError,lastSuccessAt:e.channelsLastSuccess,configSchema:e.configSchema,configSchemaLoading:e.configSchemaLoading,configForm:e.configForm,configUiHints:e.configUiHints,configSaving:e.configSaving,configFormDirty:e.configFormDirty,onRefresh:t=>Kt(e,t),onConfigPatch:(t,n)=>sr(e,t,n),onConfigSave:()=>e.handleChannelConfigSave(),onConfigReload:()=>e.handleChannelConfigReload()}));case`communications`:return Ee({formMode:e.communicationsFormMode,searchQuery:e.communicationsSearchQuery,activeSection:Oe.activeSection,activeSubsection:Oe.activeSubsection,onFormModeChange:t=>e.communicationsFormMode=t,onSearchChange:t=>e.communicationsSearchQuery=t,onSectionChange:t=>{e.communicationsActiveSection=t,e.communicationsActiveSubsection=null},onSubsectionChange:t=>e.communicationsActiveSubsection=t,navRootLabel:`Communication`,includeSections:[...qV],includeVirtualSections:!0,webPush:{supported:e.webPushSupported,permission:e.webPushPermission,subscribed:e.webPushSubscribed,loading:e.webPushLoading},onWebPushSubscribe:()=>e.handleWebPushSubscribe(),onWebPushUnsubscribe:()=>e.handleWebPushUnsubscribe(),onWebPushTest:()=>e.handleWebPushTest()});case`appearance`:return Ee({formMode:e.appearanceFormMode,searchQuery:e.appearanceSearchQuery,activeSection:ke.activeSection,activeSubsection:ke.activeSubsection,onFormModeChange:t=>e.appearanceFormMode=t,onSearchChange:t=>e.appearanceSearchQuery=t,onSectionChange:t=>{e.appearanceActiveSection=t,e.appearanceActiveSubsection=null},onSubsectionChange:t=>e.appearanceActiveSubsection=t,navRootLabel:v(`tabs.appearance`),includeSections:[...JV],includeVirtualSections:!0});case`automation`:return Ee({formMode:e.automationFormMode,searchQuery:e.automationSearchQuery,activeSection:Ae.activeSection,activeSubsection:Ae.activeSubsection,onFormModeChange:t=>e.automationFormMode=t,onSearchChange:t=>e.automationSearchQuery=t,onSectionChange:t=>{e.automationActiveSection=t,e.automationActiveSubsection=null},onSubsectionChange:t=>e.automationActiveSubsection=t,navRootLabel:`Automation`,includeSections:[...YV]});case`infrastructure`:return Ee({formMode:e.infrastructureFormMode,searchQuery:e.infrastructureSearchQuery,activeSection:je.activeSection,activeSubsection:je.activeSubsection,onFormModeChange:t=>e.infrastructureFormMode=t,onSearchChange:t=>e.infrastructureSearchQuery=t,onSectionChange:t=>{e.infrastructureActiveSection=t,e.infrastructureActiveSubsection=null},onSubsectionChange:t=>e.infrastructureActiveSubsection=t,navRootLabel:v(`settings.section.web`),includeSections:[...XV]});case`aiAgents`:return Ee({formMode:e.aiAgentsFormMode,searchQuery:e.aiAgentsSearchQuery,activeSection:Me.activeSection,activeSubsection:Me.activeSubsection,onFormModeChange:t=>e.aiAgentsFormMode=t,onSearchChange:t=>e.aiAgentsSearchQuery=t,onSectionChange:t=>{e.aiAgentsActiveSection=t,e.aiAgentsActiveSubsection=null},onSubsectionChange:t=>e.aiAgentsActiveSubsection=t,navRootLabel:`AI & Agents`,includeSections:[...ZV]});default:return i}},Pe=t=>{if(t)switch(e.agentsPanel){case`files`:__(e,t);return;case`skills`:S_(e,t);return;case`tools`:E_(e,t),A_(e);return;case`overview`:case`channels`:case`cron`:return}},Fe=t=>{if(t===`channels`){Kt(e,!1);return}t===`cron`&&e.loadCron()},Ie=(t=!1)=>{e.agentFilesList=null,e.agentFilesError=null,e.agentFileActive=null,e.agentFileContents={},e.agentFileDrafts={},t&&(e.agentFilesLoading=!1)},Le=()=>{Ie(!0),e.agentSkillsReport=null,e.agentSkillsError=null,e.agentSkillsAgentId=null,e.toolsCatalogResult=null,e.toolsCatalogError=null,e.toolsCatalogLoading=!1,O_(e)};return d`
|
|
6995
7008
|
${LI({open:e.paletteOpen,query:e.paletteQuery,activeIndex:e.paletteActiveIndex,onToggle:()=>{e.paletteOpen=!e.paletteOpen},onQueryChange:t=>{e.paletteQuery=t},onActiveIndexChange:t=>{e.paletteActiveIndex=t},onNavigate:t=>{e.setTab(t)},onSlashCommand:t=>{e.setTab(`chat`),e.handleChatDraftChange(t.endsWith(` `)?t:`${t} `)}})}
|
|
6996
7009
|
<div
|
|
6997
7010
|
class="shell ${c?`shell--chat`:``} ${u?`shell--chat-focus`:``} ${m?`shell--nav-collapsed`:``} ${p?`shell--nav-drawer-open`:``} ${e.onboarding?`shell--onboarding`:``}"
|
|
@@ -7197,5 +7210,5 @@ ${e.pluginDescription}</pre
|
|
|
7197
7210
|
|
|
7198
7211
|
`).trim()}function eU(e){return new Promise((t,n)=>{if(e.signal?.aborted){n(new DOMException(`FengMing tool call aborted`,`AbortError`));return}let r=window.setTimeout(()=>{o(),n(Error(`FengMing tool call timed out`))},e.timeoutMs),i=()=>{o(),n(new DOMException(`FengMing tool call aborted`,`AbortError`))};e.signal?.addEventListener(`abort`,i,{once:!0});let a=()=>void 0;a=e.client.addEventListener(r=>{if(r.event!==`chat`)return;let i=r.payload;!i||i.runId!==e.runId||(tU(e.emitTalkEvent,i),i.state===`final`?(o(),t($H(i.message)||`FengMing finished with no text.`)):i.state===`aborted`?(o(),n(new DOMException(i.errorMessage??`FengMing tool call aborted`,`AbortError`))):i.state===`error`&&(o(),n(Error(i.errorMessage??`FengMing tool call failed`))))});function o(){window.clearTimeout(r),e.signal?.removeEventListener(`abort`,i),a()}})}function tU(e,t){if(!e||t.stream!==`tool`)return;let n=t.data&&typeof t.data==`object`?t.data:{},r=typeof n.phase==`string`?n.phase:void 0,i=typeof n.name==`string`?n.name:void 0;e({type:`tool.progress`,callId:typeof n.toolCallId==`string`?n.toolCallId:void 0,payload:{runId:t.runId,...i?{name:i}:{},...r?{phase:r}:{}}})}async function nU(e){let t=e.text.trim();if(!t)return;let n=e.sessionId&&e.sessionId.trim()?e.ctx.client.request(`talk.session.steer`,{sessionId:e.sessionId,sessionKey:e.ctx.sessionKey,text:t,...e.mode?{mode:e.mode}:{}}):e.ctx.client.request(`talk.client.steer`,{sessionKey:e.ctx.sessionKey,text:t,...e.mode?{mode:e.mode}:{}});try{let t=await n;e.onControlResult?.(t),iU(t,e.speakControlResult,e.suppressSpeechForModes),e.emitTalkEvent?.({type:`tool.progress`,payload:{name:`fengming_agent_control`,result:t},final:t&&typeof t==`object`&&`mode`in t?t.mode===`status`||t.mode===`cancel`:void 0})}catch(t){e.emitTalkEvent?.({type:`tool.error`,payload:{message:t instanceof Error?t.message:String(t)},final:!0})}}async function rU(e){try{let t=KH(e.args),n=e.sessionId&&e.sessionId.trim()?await e.ctx.client.request(`talk.session.steer`,{sessionId:e.sessionId,sessionKey:e.ctx.sessionKey,text:t.text,mode:t.mode}):await e.ctx.client.request(`talk.client.steer`,{sessionKey:e.ctx.sessionKey,text:t.text,mode:t.mode});e.emitTalkEvent?.({type:`tool.progress`,callId:e.callId,payload:{name:`fengming_agent_control`,result:n},final:n&&typeof n==`object`&&`mode`in n?n.mode===`status`||n.mode===`cancel`:void 0}),e.submit(e.callId,n)}catch(t){let n=t instanceof Error?t.message:String(t);e.emitTalkEvent?.({type:`tool.error`,callId:e.callId,payload:{message:n},final:!0}),e.submit(e.callId,{error:n})}}function iU(e,t,n){if(!t||!e||typeof e!=`object`)return;let r=e,i=typeof r.mode==`string`?r.mode:void 0;if(i&&n?.includes(i))return;let a=typeof r.message==`string`?r.message.trim():``;(r.speak===!0&&r.suppress!==!0||r.ok===!0&&i===`steer`&&r.suppress===!0)&&a&&t(JH(a))}async function aU(e){let{ctx:t,callId:n,submit:r}=e;t.callbacks.onStatus?.(`thinking`);let i,a=!1,o=!1,s=e=>{o||(o=!0,r(n,e))},c=()=>{e.submitAbortResult!==!1&&s(YH())},l=()=>{a=!0,i&&t.client.request(`chat.abort`,{sessionKey:t.sessionKey,runId:i})};if(e.signal?.aborted){c();return}e.signal?.addEventListener(`abort`,l,{once:!0});try{let r=typeof e.args==`string`?JSON.parse(e.args||`{}`):e.args??{},a=await t.client.request(`talk.client.toolCall`,{sessionKey:t.sessionKey,callId:n,name:PH,args:r,...e.relaySessionId?{relaySessionId:e.relaySessionId}:{}});if(i=a.runId??a.idempotencyKey,!i)throw Error(`FengMing realtime tool call did not return a run id`);if(e.signal?.aborted){l(),c();return}s({result:await eU({client:t.client,runId:i,timeoutMs:12e4,emitTalkEvent:e.emitTalkEvent,signal:e.signal})})}catch(t){if(a||e.signal?.aborted||oU(t)){c();return}s({error:t instanceof Error?t.message:String(t)})}finally{e.signal?.removeEventListener(`abort`,l),!a&&!e.signal?.aborted&&t.callbacks.onStatus?.(`listening`)}}function oU(e){return typeof DOMException<`u`&&e instanceof DOMException&&e.name===`AbortError`}var sU=.02,cU=.08,lU=2,uU=class{constructor(e,t){this.session=e,this.ctx=t,this.media=null,this.inputContext=null,this.outputContext=null,this.inputSource=null,this.inputProcessor=null,this.unsubscribe=null,this.closed=!1,this.outputQueue=new NH,this.consultAbortControllers=new Map,this.completedToolCalls=new Set,this.cancelRequestedForPlayback=!1,this.speechFramesDuringPlayback=0}async start(){if(!navigator.mediaDevices?.getUserMedia)throw Error(`实时通话需要浏览器麦克风访问`);if(this.session.audio.inputEncoding!==`pcm16`||this.session.audio.outputEncoding!==`pcm16`)throw Error(`网关中继实时通话目前需要 PCM16 音频`);this.closed=!1,this.unsubscribe=this.ctx.client.addEventListener(e=>{e.event===`talk.event`&&this.handleRelayEvent(e.payload)}),this.media=await navigator.mediaDevices.getUserMedia({audio:{autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0}}),this.inputContext=new AudioContext({sampleRate:this.session.audio.inputSampleRateHz}),this.outputContext=new AudioContext({sampleRate:this.session.audio.outputSampleRateHz}),this.startMicrophonePump()}stop(){let e=this.closed;this.stopLocal(),e||this.ctx.client.request(`talk.session.close`,{sessionId:this.session.relaySessionId}).catch(()=>void 0)}stopLocal(){this.closed=!0,this.unsubscribe?.(),this.unsubscribe=null,this.inputProcessor?.disconnect(),this.inputProcessor=null,this.inputSource?.disconnect(),this.inputSource=null,this.abortConsults(),this.media?.getTracks().forEach(e=>e.stop()),this.media=null,this.stopOutput(),this.inputContext?.close(),this.inputContext=null,this.outputContext?.close(),this.outputContext=null}startMicrophonePump(){!this.media||!this.inputContext||(this.inputSource=this.inputContext.createMediaStreamSource(this.media),this.inputProcessor=this.inputContext.createScriptProcessor(4096,1,1),this.inputProcessor.onaudioprocess=e=>{if(this.closed)return;let t=e.inputBuffer.getChannelData(0),n=jH(t);this.detectBargeInSpeech(t)&&this.cancelOutputForBargeIn(),this.ctx.client.request(`talk.session.appendAudio`,{sessionId:this.session.relaySessionId,audioBase64:kH(n),timestamp:Math.round((this.inputContext?.currentTime??0)*1e3)}).catch(e=>{this.closed||(this.ctx.callbacks.onStatus?.(`error`,e instanceof Error?e.message:String(e)),this.stop())})},this.inputSource.connect(this.inputProcessor),this.inputProcessor.connect(this.inputContext.destination))}handleRelayEvent(e){if(!(e.relaySessionId!==this.session.relaySessionId||this.closed))switch(e.talkEvent&&this.ctx.callbacks.onTalkEvent?.(e.talkEvent),e.type){case`ready`:this.ctx.callbacks.onStatus?.(`listening`);return;case`audio`:e.audioBase64&&(this.cancelRequestedForPlayback=!1,this.speechFramesDuringPlayback=0,this.playPcm16(e.audioBase64));return;case`clear`:this.stopOutput();return;case`mark`:this.scheduleMarkAck();return;case`transcript`:e.role&&e.text&&this.ctx.callbacks.onTranscript?.({role:e.role,text:e.text,final:e.final??!1});return;case`toolCall`:this.handleToolCall(e);return;case`toolResult`:this.isFinalToolResult(e)&&this.completeToolCall(e.callId);return;case`error`:this.lastRelayError=e.message??v(`chat.realtimeRelayFailed`),this.ctx.callbacks.onStatus?.(`error`,this.lastRelayError);return;case`close`:this.abortConsults(),this.closed||(this.ctx.callbacks.onStatus?.(e.reason===`error`?`error`:`idle`,e.reason===`error`?this.lastRelayError??v(`chat.realtimeRelayClosed`):void 0),this.stopLocal());return;default:return}}playPcm16(e){this.outputQueue.play(e,this.outputContext,this.session.audio.outputSampleRateHz)}stopOutput(){this.outputQueue.stop(this.outputContext),this.speechFramesDuringPlayback=0}scheduleMarkAck(){let e=Math.max(0,Math.ceil(((this.outputQueue.queuedUntil||this.outputContext?.currentTime||0)-(this.outputContext?.currentTime??0))*1e3));window.setTimeout(()=>{this.closed},e)}async handleToolCall(e){let t=e.callId?.trim(),n=e.name?.trim();if(!t||!n)return;if(n===`fengming_agent_control`){await rU({ctx:this.ctx,callId:t,args:e.args??{},sessionId:this.session.relaySessionId,submit:(e,t)=>this.submitToolResult(e,t)});return}if(n!==`fengming_agent_consult`){this.submitToolResult(t,{error:`Tool "${n}" not available in browser Talk`});return}let r=new AbortController;this.consultAbortControllers.set(t,r);try{e.forced&&this.submitToolResult(t,{status:`working`,tool:PH,message:`Tell the person briefly that you are checking, then wait for the final FengMing result before answering with the actual result.`},{willContinue:!0}),await aU({ctx:this.ctx,callId:t,args:e.args??{},relaySessionId:this.session.relaySessionId,signal:r.signal,submit:(e,t)=>this.submitToolResult(e,t)})}finally{this.consultAbortControllers.delete(t)}}submitToolResult(e,t,n){this.completedToolCalls.has(e)||this.ctx.client.request(`talk.session.submitToolResult`,{sessionId:this.session.relaySessionId,callId:e,result:t,...n?{options:n}:{}})}completeToolCall(e){let t=e?.trim();t&&(this.completedToolCalls.add(t),this.consultAbortControllers.get(t)?.abort(),this.consultAbortControllers.delete(t))}isFinalToolResult(e){let t=e.talkEvent;return!(t?.type===`tool.progress`||t?.type===`tool.result`&&t.final===!1)}cancelOutputForBargeIn(){!this.outputQueue.isPlaying||this.cancelRequestedForPlayback||(this.cancelRequestedForPlayback=!0,this.stopOutput(),this.ctx.client.request(`talk.session.cancelOutput`,{sessionId:this.session.relaySessionId,reason:`barge-in`}))}abortConsults(){for(let e of this.consultAbortControllers.values())e.abort();this.consultAbortControllers.clear()}detectBargeInSpeech(e){if(!this.outputQueue.isPlaying||this.cancelRequestedForPlayback||e.length===0)return this.speechFramesDuringPlayback=0,!1;let t=0,n=0;for(let r of e)n=Math.max(n,Math.abs(r)),t+=r*r;return Math.sqrt(t/e.length)>=sU&&n>=cU?this.speechFramesDuringPlayback+=1:this.speechFramesDuringPlayback=0,this.speechFramesDuringPlayback>=lU}},dU=class{constructor(e,t){this.session=e,this.ctx=t,this.peer=null,this.channel=null,this.media=null,this.audio=null,this.closed=!1,this.responseActive=!1,this.responseCreateInFlight=!1,this.responseCreatePending=!1,this.toolBuffers=new Map,this.consultAbortControllers=new Set,this.emitTalkEvent=XH(t,e)}async start(){if(!navigator.mediaDevices?.getUserMedia||typeof RTCPeerConnection>`u`)throw Error(`实时通话需要浏览器 WebRTC 和麦克风访问`);this.closed=!1,this.peer=new RTCPeerConnection,this.audio=document.createElement(`audio`),this.audio.autoplay=!0,this.audio.style.display=`none`,document.body.append(this.audio),this.peer.addEventListener(`track`,e=>{this.audio&&(this.audio.srcObject=e.streams[0])}),this.media=await navigator.mediaDevices.getUserMedia({audio:!0});for(let e of this.media.getAudioTracks())this.peer.addTrack(e,this.media);this.channel=this.peer.createDataChannel(`oai-events`),this.channel.addEventListener(`open`,()=>{this.ctx.callbacks.onStatus?.(`listening`),this.emitTalkEvent({type:`session.ready`})}),this.channel.addEventListener(`message`,e=>this.handleRealtimeEvent(e.data)),this.peer.addEventListener(`connectionstatechange`,()=>{this.closed||(this.peer?.connectionState===`failed`||this.peer?.connectionState===`closed`)&&this.ctx.callbacks.onStatus?.(`error`,v(`chat.realtimeConnectionClosed`))});let e=await this.peer.createOffer();await this.peer.setLocalDescription(e);let t=await fetch(this.session.offerUrl??`https://api.openai.com/v1/realtime/calls`,{method:`POST`,body:e.sdp,headers:{...this.session.offerHeaders,Authorization:`Bearer ${this.session.clientSecret}`,"Content-Type":`application/sdp`}});if(!t.ok)throw Error(`Realtime WebRTC setup failed (${t.status})`);await this.peer.setRemoteDescription({type:`answer`,sdp:await t.text()})}stop(){this.closed||this.emitTalkEvent({type:`session.closed`,final:!0}),this.closed=!0,this.channel?.close(),this.channel=null,this.peer?.close(),this.peer=null,this.media?.getTracks().forEach(e=>e.stop()),this.media=null,this.audio?.remove(),this.audio=null;for(let e of this.consultAbortControllers)e.abort();this.consultAbortControllers.clear(),this.toolBuffers.clear(),this.responseActive=!1,this.responseCreateInFlight=!1,this.responseCreatePending=!1}send(e){this.channel?.readyState===`open`&&this.channel.send(JSON.stringify(e))}handleRealtimeEvent(e){if(this.closed)return;let t;try{t=JSON.parse(String(e))}catch{return}switch(t.type){case`conversation.item.input_audio_transcription.completed`:t.transcript&&(this.ctx.callbacks.onTranscript?.({role:`user`,text:t.transcript,final:!0}),this.emitTalkEvent({type:`transcript.done`,final:!0,itemId:t.item_id,payload:{role:`user`,text:t.transcript}}),this.consultAbortControllers.size>0&&GH(t.transcript)&&nU({ctx:this.ctx,text:t.transcript,emitTalkEvent:this.emitTalkEvent,onControlResult:e=>this.interruptSuppressedControlResponse(e),speakControlResult:e=>this.sendControlSpeechMessage(e),suppressSpeechForModes:[`cancel`]}));return;case`response.audio_transcript.done`:t.transcript&&(this.ctx.callbacks.onTranscript?.({role:`assistant`,text:t.transcript,final:!0}),this.emitTalkEvent({type:`output.text.done`,final:!0,itemId:t.item_id,payload:{text:t.transcript}}));return;case`response.function_call_arguments.delta`:this.bufferToolDelta(t);return;case`response.function_call_arguments.done`:this.handleToolCall(t);return;case`input_audio_buffer.speech_started`:this.ctx.callbacks.onStatus?.(`listening`,v(`chat.speechDetected`)),this.emitTalkEvent({type:`turn.started`,payload:{source:t.type}});return;case`input_audio_buffer.speech_stopped`:this.ctx.callbacks.onStatus?.(`thinking`,v(`chat.processingSpeech`)),this.emitTalkEvent({type:`input.audio.committed`,final:!0});return;case`response.created`:this.responseActive=!0,this.responseCreateInFlight=!1,this.ctx.callbacks.onStatus?.(`thinking`,v(`chat.generatingResponse`));return;case`response.cancelled`:case`response.done`:this.responseActive=!1,this.responseCreateInFlight=!1,this.ctx.callbacks.onStatus?.(`listening`,this.extractResponseStatus(t)),this.emitTalkEvent({type:`turn.ended`,final:!0,payload:{status:t.response?.status??(t.type===`response.cancelled`?`cancelled`:`completed`)}}),this.flushPendingResponseCreate();return;case`error`:this.responseCreateInFlight=!1,this.ctx.callbacks.onStatus?.(`error`,this.extractErrorDetail(t.error)),this.emitTalkEvent({type:`session.error`,final:!0,payload:{message:this.extractErrorDetail(t.error)}});return;default:return}}extractResponseStatus(e){let t=e.response?.status;return t&&t!==`completed`?`Response ${t}`:void 0}extractErrorDetail(e){if(!e||typeof e!=`object`)return v(`chat.realtimeProviderError`);let t=e,n=typeof t.message==`string`?t.message.trim():``,r=typeof t.code==`string`?t.code.trim():``,i=typeof t.type==`string`?t.type.trim():``;return n||r||i||v(`chat.realtimeProviderError`)}bufferToolDelta(e){let t=e.item_id??`unknown`,n=this.toolBuffers.get(t);if(n){n.args+=e.delta??``;return}this.toolBuffers.set(t,{name:e.name??``,callId:e.call_id??``,args:e.delta??``})}async handleToolCall(e){let t=e.item_id??`unknown`,n=this.toolBuffers.get(t);this.toolBuffers.delete(t);let r=n?.name||e.name||``,i=n?.callId||e.call_id||``;if(!i)return;if(r===`fengming_agent_control`){await rU({ctx:this.ctx,callId:i,args:n?.args||e.arguments||`{}`,emitTalkEvent:this.emitTalkEvent,submit:(e,t)=>this.submitToolResult(e,t)});return}if(r!==`fengming_agent_consult`)return;this.emitTalkEvent({type:`tool.call`,callId:i,itemId:t,payload:{name:r,args:n?.args||e.arguments||`{}`}});let a=new AbortController;this.consultAbortControllers.add(a);try{await aU({ctx:this.ctx,callId:i,args:n?.args||e.arguments||`{}`,signal:a.signal,emitTalkEvent:this.emitTalkEvent,submit:(e,t)=>this.submitToolResult(e,t)})}finally{this.consultAbortControllers.delete(a)}}submitToolResult(e,t){this.send({type:`conversation.item.create`,item:{type:`function_call_output`,call_id:e,output:JSON.stringify(t)}}),this.requestResponseCreate()}sendControlSpeechMessage(e){this.responseActive&&this.send({type:`response.cancel`}),this.send({type:`conversation.item.create`,item:{type:`message`,role:`user`,content:[{type:`input_text`,text:e}]}}),this.requestResponseCreate()}interruptSuppressedControlResponse(e){if(!this.responseActive||!e||typeof e!=`object`)return;let t=e;t.ok===!0&&(t.mode===`cancel`||t.suppress===!0&&t.mode!==`steer`)&&this.send({type:`response.cancel`})}requestResponseCreate(){if(this.responseActive||this.responseCreateInFlight){this.responseCreatePending=!0;return}this.responseCreatePending=!1,this.responseCreateInFlight=!0,this.send({type:`response.create`})}flushPendingResponseCreate(){this.responseCreatePending&&(this.responseCreatePending=!1,this.requestResponseCreate())}};function fU(e,t){let n=pU(e);if(n===`webrtc`)return new dU(e,t);if(n===`gateway-relay`)return new uU(e,t);if(n===`managed-room`)throw Error(`托管房间实时通话会话在此界面中尚不可用`);let r=e.transport??`unknown`;throw Error(`Unsupported realtime Talk transport: ${r}`)}function pU(e){return OH(e.transport)??`webrtc`}function mU(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0))}var hU=class{constructor(e,t,n={},r={}){this.client=e,this.sessionKey=t,this.callbacks=n,this.options=r,this.transport=null,this.closed=!1}async start(){this.closed=!1,this.callbacks.onStatus?.(`connecting`);let e=await this.createSession();this.closed||(this.transport=fU(e,{client:this.client,sessionKey:this.sessionKey,callbacks:this.callbacks,consultThinkingLevel:e.consultThinkingLevel,consultFastMode:e.consultFastMode}),await this.transport.start())}async createSession(){try{return await this.client.request(`talk.client.create`,mU({sessionKey:this.sessionKey,...this.options}))}catch(e){if(this.options.transport&&this.options.transport!==`gateway-relay`)throw e;try{return await this.client.request(`talk.session.create`,mU({sessionKey:this.sessionKey,...this.options,mode:`realtime`,transport:this.options.transport??`gateway-relay`,brain:`agent-consult`}))}catch{throw e}}}stop(){this.closed=!0,this.callbacks.onStatus?.(`idle`),this.transport?.stop(),this.transport=null}},gU=Yi({}),_U=Ao();function vU(){if(!window.location.search)return!1;let e=new URLSearchParams(window.location.search).get(`onboarding`);if(!e)return!1;let t=e.trim().toLowerCase();return t===`1`||t===`true`||t===`yes`||t===`on`}var $=class extends r{constructor(){super(),this.i18nController=new y(this),this.clientInstanceId=yt(),this.connectGeneration=0,this.settings=Oo(),this.password=``,this.loginShowGatewayToken=!1,this.loginShowGatewayPassword=!1,this.tab=`chat`,this.onboarding=vU(),this.connected=!1,this.theme=this.settings.theme??`claw`,this.themeMode=this.settings.themeMode??`system`,this.themeResolved=`dark`,this.themeOrder=this.buildThemeOrder(this.theme),this.customThemeImportUrl=``,this.customThemeImportBusy=!1,this.customThemeImportMessage=null,this.customThemeImportExpanded=!1,this.customThemeImportFocusToken=0,this.customThemeImportSelectOnSuccess=!1,this.hello=null,this.lastError=null,this.lastErrorCode=null,this.eventLog=[],this.eventLogBuffer=[],this.toolStreamSyncTimer=null,this.sidebarCloseTimer=null,this.assistantName=gU.name,this.assistantAvatar=gU.avatar,this.assistantAvatarSource=gU.avatarSource??null,this.assistantAvatarStatus=gU.avatarStatus??null,this.assistantAvatarReason=gU.avatarReason??null,this.assistantAvatarUploadBusy=!1,this.assistantAvatarUploadError=null,this.assistantAgentId=gU.agentId??null,this.userName=_U.name,this.userAvatar=_U.avatar,this.localMediaPreviewRoots=[],this.embedSandboxMode=`scripts`,this.allowExternalEmbedUrls=!1,this.chatMessageMaxWidth=null,this.serverVersion=null,this.sessionKey=this.settings.sessionKey,this.chatSessionMessageSubscriptionKey=null,this.chatSessionMessageSubscriptionRequestedKey=null,this.currentSessionId=null,this.chatLoading=!1,this.chatSending=!1,this.chatMessage=``,this.chatMessages=[],this.chatToolMessages=[],this.activityEntries=[],this.activityFilterText=``,this.activityStatusFilters={running:!0,done:!0,error:!0},this.activityToolFilter=``,this.activityExpandedIds=new Set,this.activityAutoFollow=!0,this.activityAtBottom=!0,this.chatStreamSegments=[],this.chatStream=null,this.chatStreamStartedAt=null,this.chatRunId=null,this.chatSideResult=null,this.compactionStatus=null,this.fallbackStatus=null,this.chatRunStatus=null,this.chatRunStatusClearTimer=null,this.chatAvatarUrl=null,this.chatAvatarSource=null,this.chatAvatarStatus=null,this.chatAvatarReason=null,this.chatThinkingLevel=null,this.chatModelOverrides={},this.chatModelSwitchPromises={},this.chatModelsLoading=!1,this.chatModelCatalog=[],this.sessionSwitchNotice=null,this.sessionSwitchFlashKey=null,this.chatSessionPickerOpen=!1,this.chatSessionPickerSurface=null,this.chatSessionPickerQuery=``,this.chatSessionPickerAppliedQuery=``,this.chatSessionPickerLoading=!1,this.chatSessionPickerError=null,this.chatSessionPickerResult=null,this.sessionSwitchNoticeSeq=0,this.sessionSwitchNoticeTimer=null,this.sessionSwitchFlashTimer=null,this.chatQueue=[],this.chatQueueBySession={},this.chatAttachments=[],this.realtimeTalkActive=!1,this.realtimeTalkStatus=`idle`,this.realtimeTalkDetail=null,this.realtimeTalkTranscript=null,this.realtimeTalkConversation=[],this.realtimeTalkOptionsOpen=!1,this.realtimeTalkOptions={provider:``,model:``,voice:``,transport:``,vadThreshold:``,silenceDurationMs:``,prefixPaddingMs:``,reasoningEffort:``},this.realtimeTalkSession=null,this.realtimeTalkConversationState=hH(),this.nativeBridgeCleanup=null,this.chatManualRefreshInFlight=!1,this.chatHeaderControlsHidden=!1,this.chatMobileControlsOpen=!1,this.chatMobileControlsTrigger=null,this.navDrawerOpen=!1,this.chatLocalInputHistoryBySession={},this.chatInputHistorySessionKey=null,this.chatInputHistoryItems=null,this.chatInputHistoryIndex=-1,this.chatDraftBeforeHistory=null,this.sidebarOpen=!1,this.sidebarContent=null,this.sidebarError=null,this.splitRatio=this.settings.splitRatio,this.nodesLoading=!1,this.nodes=[],this.devicesLoading=!1,this.devicesError=null,this.devicesList=null,this.execApprovalsLoading=!1,this.execApprovalsSaving=!1,this.execApprovalsDirty=!1,this.execApprovalsSnapshot=null,this.execApprovalsForm=null,this.execApprovalsSelectedAgent=null,this.execApprovalsTarget=`gateway`,this.execApprovalsTargetNodeId=null,this.execApprovalQueue=[],this.execApprovalBusy=!1,this.execApprovalError=null,this.pendingGatewayUrl=null,this.pendingGatewayToken=null,this.configLoading=!1,this.configRaw=`{
|
|
7199
7212
|
}
|
|
7200
|
-
`,this.configRawOriginal=``,this.configValid=null,this.configIssues=[],this.configSaving=!1,this.configApplying=!1,this.updateRunning=!1,this.applySessionKey=this.settings.lastActiveSessionKey,this.configSnapshot=null,this.configSchema=null,this.configSchemaVersion=null,this.configSchemaLoading=!1,this.configUiHints={},this.configForm=null,this.configFormOriginal=null,this.dreamingStatusLoading=!1,this.dreamingStatusError=null,this.dreamingStatus=null,this.dreamingModeSaving=!1,this.dreamingRestartConfirmOpen=!1,this.dreamingRestartConfirmLoading=!1,this.dreamingPendingEnabled=null,this.dreamDiaryLoading=!1,this.dreamDiaryActionLoading=!1,this.dreamDiaryActionMessage=null,this.dreamDiaryActionArchivePath=null,this.dreamDiaryError=null,this.dreamDiaryPath=null,this.dreamDiaryContent=null,this.wikiImportInsightsLoading=!1,this.wikiImportInsightsError=null,this.wikiImportInsights=null,this.wikiMemoryPalaceLoading=!1,this.wikiMemoryPalaceError=null,this.wikiMemoryPalace=null,this.configFormDirty=!1,this.configSettingsMode=`quick`,this.configFormMode=`form`,this.configSearchQuery=``,this.configActiveSection=null,this.configActiveSubsection=null,this.pendingUpdateExpectedVersion=null,this.updateStatusBanner=null,this.communicationsFormMode=`form`,this.communicationsSearchQuery=``,this.communicationsActiveSection=null,this.communicationsActiveSubsection=null,this.appearanceFormMode=`form`,this.appearanceSearchQuery=``,this.appearanceActiveSection=null,this.appearanceActiveSubsection=null,this.automationFormMode=`form`,this.automationSearchQuery=``,this.automationActiveSection=null,this.automationActiveSubsection=null,this.infrastructureFormMode=`form`,this.infrastructureSearchQuery=``,this.infrastructureActiveSection=null,this.infrastructureActiveSubsection=null,this.aiAgentsFormMode=`form`,this.aiAgentsSearchQuery=``,this.aiAgentsActiveSection=null,this.aiAgentsActiveSubsection=null,this.channelsLoading=!1,this.channelsSnapshot=null,this.channelsError=null,this.channelsLastSuccess=null,this.presenceLoading=!1,this.presenceEntries=[],this.presenceError=null,this.presenceStatus=null,this.agentsLoading=!1,this.agentsList=null,this.agentsError=null,this.agentsSelectedId=null,this.toolsCatalogLoading=!1,this.toolsCatalogError=null,this.toolsCatalogResult=null,this.toolsEffectiveLoading=!1,this.toolsEffectiveLoadingKey=null,this.toolsEffectiveResultKey=null,this.toolsEffectiveError=null,this.toolsEffectiveResult=null,this.agentsPanel=`files`,this.agentFilesLoading=!1,this.agentFilesError=null,this.agentFilesList=null,this.agentFileContents={},this.agentFileDrafts={},this.agentFileActive=null,this.agentFileSaving=!1,this.agentIdentityLoading=!1,this.agentIdentityError=null,this.agentIdentityById={},this.agentSkillsLoading=!1,this.agentSkillsError=null,this.agentSkillsReport=null,this.agentSkillsAgentId=null,this.sessionsLoading=!1,this.sessionsResult=null,this.sessionsError=null,this.sessionsFilterActive=mg.activeMinutes,this.sessionsFilterLimit=mg.limit,this.sessionsIncludeGlobal=!0,this.sessionsIncludeUnknown=!1,this.sessionsShowArchived=!1,this.sessionsFiltersCollapsed=!1,this.sessionsHideCron=!0,this.sessionsSearchQuery=``,this.sessionsSortColumn=`updated`,this.sessionsSortDir=`desc`,this.sessionsPage=0,this.sessionsPageSize=25,this.sessionsSelectedKeys=new Set,this.sessionsExpandedCheckpointKey=null,this.sessionsCheckpointItemsByKey={},this.sessionsCheckpointLoadingKey=null,this.sessionsCheckpointBusyKey=null,this.sessionsCheckpointErrorByKey={},this.usageLoading=!1,this.usageResult=null,this.usageCostSummary=null,this.usageError=null,this.usageStartDate=(()=>{let e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`})(),this.usageEndDate=(()=>{let e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`})(),this.usageScope=`family`,this.usageAgentId=null,this.usageSelectedSessions=[],this.usageSelectedDays=[],this.usageSelectedHours=[],this.usageChartMode=`tokens`,this.usageDailyChartMode=`by-type`,this.usageTimeSeriesMode=`per-turn`,this.usageTimeSeriesBreakdownMode=`by-type`,this.usageTimeSeries=null,this.usageTimeSeriesLoading=!1,this.usageTimeSeriesCursorStart=null,this.usageTimeSeriesCursorEnd=null,this.usageSessionLogs=null,this.usageSessionLogsLoading=!1,this.usageSessionLogsExpanded=!1,this.usageQuery=``,this.usageQueryDraft=``,this.usageSessionSort=`recent`,this.usageSessionSortDir=`desc`,this.usageRecentSessions=[],this.usageTimeZone=`local`,this.usageContextExpanded=!1,this.usageHeaderPinned=!1,this.usageSessionsTab=`all`,this.usageVisibleColumns=[`channel`,`agent`,`provider`,`model`,`messages`,`tools`,`errors`,`duration`],this.usageLogFilterRoles=[],this.usageLogFilterTools=[],this.usageLogFilterHasTools=!1,this.usageLogFilterQuery=``,this.usageQueryDebounceTimer=null,this.cronLoading=!1,this.cronQuickCreateOpen=!1,this.cronQuickCreateStep=`what`,this.cronQuickCreateDraft=null,this.cronJobsLoadingMore=!1,this.cronJobsReloadPending=!1,this.cronJobsReloadPendingTableFilters=!1,this.cronJobs=[],this.cronJobsTotal=0,this.cronJobsHasMore=!1,this.cronJobsNextOffset=null,this.cronJobsLimit=50,this.cronJobsQuery=``,this.cronJobsEnabledFilter=`all`,this.cronJobsScheduleKindFilter=`all`,this.cronJobsLastStatusFilter=`all`,this.cronJobsSortBy=`nextRunAtMs`,this.cronJobsSortDir=`asc`,this.cronStatus=null,this.cronError=null,this.cronForm={...hg},this.cronFormCollapsed=!0,this.cronFieldErrors={},this.cronEditingJobId=null,this.cronRunsJobId=null,this.cronRunsLoadingMore=!1,this.cronRuns=[],this.cronRunsTotal=0,this.cronRunsHasMore=!1,this.cronRunsNextOffset=null,this.cronRunsLimit=50,this.cronRunsScope=`all`,this.cronRunsStatuses=[],this.cronRunsDeliveryStatuses=[],this.cronRunsStatusFilter=`all`,this.cronRunsQuery=``,this.cronRunsSortDir=`desc`,this.cronModelSuggestions=[],this.cronBusy=!1,this.updateAvailable=null,this.attentionItems=[],this.paletteOpen=!1,this.paletteQuery=``,this.paletteActiveIndex=0,this.overviewShowGatewayToken=!1,this.overviewShowGatewayPassword=!1,this.overviewLogLines=[],this.overviewLogCursor=0,this.skillsLoading=!1,this.skillsReport=null,this.skillsError=null,this.skillsFilter=``,this.skillsStatusFilter=`all`,this.skillEdits={},this.skillsBusyKey=null,this.skillMessages={},this.skillsDetailKey=null,this.skillsDetailTab=`overview`,this.clawhubSearchQuery=``,this.clawhubSearchResults=null,this.clawhubSearchLoading=!1,this.clawhubSearchError=null,this.clawhubDetail=null,this.clawhubDetailSlug=null,this.clawhubDetailLoading=!1,this.clawhubDetailError=null,this.clawhubInstallSlug=null,this.clawhubInstallMessage=null,this.clawhubVerdicts={},this.clawhubVerdictsLoading=!1,this.clawhubVerdictsError=null,this.skillCardContents={},this.skillCardContentKeys={},this.skillCardLoadingKey=null,this.skillCardErrors={},this.healthLoading=!1,this.healthResult=null,this.healthError=null,this.modelAuthStatusLoading=!1,this.modelAuthStatusResult=null,this.modelAuthStatusError=null,this.debugLoading=!1,this.debugStatus=null,this.debugHealth=null,this.debugModels=[],this.debugHeartbeat=null,this.debugCallMethod=``,this.debugCallParams=`{}`,this.debugCallResult=null,this.debugCallError=null,this.webPushSupported=!1,this.webPushPermission=`unsupported`,this.webPushSubscribed=!1,this.webPushLoading=!1,this.logsLoading=!1,this.logsError=null,this.logsFile=null,this.logsEntries=[],this.logsFilterText=``,this.logsLevelFilters={...pg},this.logsAutoFollow=!0,this.logsTruncated=!1,this.logsCursor=null,this.logsLastFetchAt=null,this.logsLimit=500,this.logsMaxBytes=25e4,this.logsAtBottom=!0,this.client=null,this.chatScrollFrame=null,this.chatScrollTimeout=null,this.chatLastScrollTop=0,this.chatHasAutoScrolled=!1,this.chatUserNearBottom=!0,this.chatIsProgrammaticScroll=!1,this.chatProgrammaticScrollTarget=0,this.chatNewMessagesBelow=!1,this.nodesPollInterval=null,this.logsPollInterval=null,this.debugPollInterval=null,this.sessionsChangedReloadTimer=null,this.logsScrollFrame=null,this.activityScrollFrame=null,this.controlUiResponsivenessObserver=null,this.toolStreamById=new Map,this.toolStreamOrder=[],this.refreshSessionsAfterChat=new Set,this.chatSideResultTerminalRuns=new Set,this.basePath=``,this.popStateHandler=()=>SA(this),this.topbarObserver=null,this.globalKeydownHandler=e=>{(e.metaKey||e.ctrlKey)&&!e.shiftKey&&e.key===`k`&&(e.preventDefault(),this.paletteOpen=!this.paletteOpen,this.paletteOpen&&(this.paletteQuery=``,this.paletteActiveIndex=0))},this.chatMobileControlsKeydownHandler=e=>{if(e.key===`Escape`){if(this.chatSessionPickerOpen){e.preventDefault(),this.chatSessionPickerOpen=!1,this.chatSessionPickerSurface=null;return}this.chatMobileControlsOpen&&(e.preventDefault(),this.setChatMobileControlsOpen(!1,{restoreFocus:!0}))}},this.chatMobileControlsPointerdownHandler=e=>{let t=e.composedPath();if(this.chatSessionPickerOpen&&(Array.from(this.querySelectorAll(`.chat-controls__session-picker`)).some(e=>t.includes(e))||(this.chatSessionPickerOpen=!1,this.chatSessionPickerSurface=null)),!this.chatMobileControlsOpen)return;let n=this.querySelector(`.chat-mobile-controls-wrapper`);n&&t.includes(n)||this.setChatMobileControlsOpen(!1)},h(this.settings.locale)&&_.setLocale(this.settings.locale)}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.onSlashAction=async e=>{switch(e){case`new-session`:await lP(this);break;case`toggle-focus`:this.applySettings({...this.settings,chatFocusMode:!this.settings.chatFocusMode});break;case`export`:FE(this.chatMessages,this.assistantName);break;case`refresh-tools-effective`:await A_(this);break}},document.addEventListener(`keydown`,this.globalKeydownHandler),document.addEventListener(`keydown`,this.chatMobileControlsKeydownHandler),document.addEventListener(`pointerdown`,this.chatMobileControlsPointerdownHandler),dM(this),this.nativeBridgeCleanup=xM(this),this.initWebPushState()}firstUpdated(){fM(this)}disconnectedCallback(){document.removeEventListener(`keydown`,this.globalKeydownHandler),this.nativeBridgeCleanup?.(),this.nativeBridgeCleanup=null,document.removeEventListener(`keydown`,this.chatMobileControlsKeydownHandler),document.removeEventListener(`pointerdown`,this.chatMobileControlsPointerdownHandler),this.sessionSwitchNoticeTimer!==null&&(window.clearTimeout(this.sessionSwitchNoticeTimer),this.sessionSwitchNoticeTimer=null),this.sessionSwitchFlashTimer!==null&&(window.clearTimeout(this.sessionSwitchFlashTimer),this.sessionSwitchFlashTimer=null),this.chatMobileControlsTrigger=null,gM(this),super.disconnectedCallback()}updated(e){if(_M(this,e),e.has(`tab`)&&this.tab!==`chat`&&this.chatMobileControlsOpen&&this.setChatMobileControlsOpen(!1),!e.has(`sessionKey`)||this.agentsPanel!==`tools`)return;let t=Xc(this.sessionKey);if(this.agentsSelectedId&&this.agentsSelectedId===t){D_(this,{agentId:this.agentsSelectedId,sessionKey:this.sessionKey});return}this.toolsEffectiveResult=null,this.toolsEffectiveResultKey=null,this.toolsEffectiveError=null,this.toolsEffectiveLoading=!1,this.toolsEffectiveLoadingKey=null}connect(){tM(this)}handleChatScroll(e){Ho(this,e)}handleLogsScroll(e){Uo(this,e)}handleActivityScroll(e){Wo(this,e)}scheduleActivityScroll(e=!1){Vo(this,e)}exportLogs(e,t){Ko(e,t)}resetToolStream(){wl(this)}resetChatScroll(){Go(this)}scrollToBottom(e){Go(this),zo(this,!0,!!e?.smooth,{source:`manual`})}async loadAssistantIdentity(){await WA(this)}applySettings(e){eA(this,e)}applyLocalUserIdentity(e){tA(this,e)}setTab(e){oA(this,e),e!==`chat`&&this.setChatMobileControlsOpen(!1),this.navDrawerOpen=!1}setChatMobileControlsOpen(e,t){if(e){this.chatMobileControlsTrigger=t?.trigger??this.chatMobileControlsTrigger,this.chatMobileControlsOpen=!0;return}let n=t?.restoreFocus?this.chatMobileControlsTrigger:null;this.chatMobileControlsOpen=!1,this.chatSessionPickerSurface===`mobile`&&(this.chatSessionPickerOpen=!1,this.chatSessionPickerSurface=null),this.chatMobileControlsTrigger=null,!(!(n instanceof HTMLElement)||!n.isConnected)&&requestAnimationFrame(()=>{n.isConnected&&n.focus()})}setTheme(e,t){cA(this,e,t),this.themeOrder=this.buildThemeOrder(e)}setThemeMode(e,t){lA(this,e,t)}setCustomThemeImportUrl(e){this.customThemeImportUrl=e,this.customThemeImportMessage?.kind===`error`&&(this.customThemeImportMessage=null)}openCustomThemeImport(){this.customThemeImportExpanded=!0,this.customThemeImportFocusToken+=1,this.settings.customTheme||(this.customThemeImportSelectOnSuccess=!0)}async importCustomTheme(){if(!this.customThemeImportBusy){this.customThemeImportExpanded=!0,this.customThemeImportBusy=!0,this.customThemeImportMessage=null;try{let e=await ii(this.customThemeImportUrl),t=this.theme===`custom`||!this.settings.customTheme||this.customThemeImportSelectOnSuccess;eA(this,{...this.settings,theme:t?`custom`:this.settings.theme,customTheme:e}),this.themeOrder=this.buildThemeOrder(t?`custom`:this.theme),this.customThemeImportUrl=``,this.customThemeImportSelectOnSuccess=!1,this.customThemeImportMessage={kind:`success`,text:`Imported ${e.label}.`}}catch(e){this.customThemeImportMessage={kind:`error`,text:e instanceof Error?e.message:v(`settings.quick.importThemeFailed`)}}finally{this.customThemeImportBusy=!1}}}clearCustomTheme(){let e=this.theme===`custom`?`claw`:this.theme;this.customThemeImportExpanded=!0,this.customThemeImportSelectOnSuccess=!1,eA(this,{...this.settings,theme:e,customTheme:void 0}),this.themeOrder=this.buildThemeOrder(e),this.customThemeImportMessage={kind:`success`,text:v(`settings.quick.clearedTheme`)}}setBorderRadius(e){eA(this,{...this.settings,borderRadius:e}),this.requestUpdate()}setTextScale(e){eA(this,{...this.settings,textScale:e}),this.requestUpdate()}announceSessionSwitch(e,t){let n=++this.sessionSwitchNoticeSeq;this.sessionSwitchNoticeTimer!==null&&window.clearTimeout(this.sessionSwitchNoticeTimer),this.sessionSwitchFlashTimer!==null&&window.clearTimeout(this.sessionSwitchFlashTimer),this.sessionSwitchNotice={id:n,text:v(`chat.switchedSession`,{session:t})},this.sessionSwitchFlashKey=e,this.sessionSwitchFlashTimer=window.setTimeout(()=>{this.sessionSwitchNotice?.id===n&&(this.sessionSwitchFlashKey=null),this.sessionSwitchFlashTimer=null},200),this.sessionSwitchNoticeTimer=window.setTimeout(()=>{this.sessionSwitchNotice?.id===n&&(this.sessionSwitchNotice=null),this.sessionSwitchNoticeTimer=null},2800)}buildThemeOrder(e){return[e,...[...xi].filter(t=>t!==e)]}async loadOverview(e){await kA(this,e)}async loadCron(){await IA(this)}async handleAbortChat(e){await mh(this,e)}handleChatDraftChange(e){Wu(this,e)}handleChatInputHistoryKey(e){return Ju(this,e)}resetChatInputHistoryNavigation(){Uu(this)}removeQueuedMessage(e){Rh(this,e)}async retryQueuedChatMessage(e){await Wh(this,e)}async handleSendChat(e,t){await Gh(this,e,t)}updateRealtimeTalkOptions(e){this.realtimeTalkOptions={...this.realtimeTalkOptions,...e}}buildRealtimeTalkLaunchOptions(){let e=this.realtimeTalkOptions??{provider:``,model:``,voice:``,transport:``,vadThreshold:``,silenceDurationMs:``,prefixPaddingMs:``,reasoningEffort:``},t=e=>e.trim()||void 0,n=e=>{let t=e.trim();if(!t)return;let n=Number(t);return Number.isFinite(n)?n:void 0},r=t(e.transport);return{provider:t(e.provider),model:t(e.model),voice:t(e.voice),transport:r,vadThreshold:n(e.vadThreshold),silenceDurationMs:n(e.silenceDurationMs),prefixPaddingMs:n(e.prefixPaddingMs),reasoningEffort:t(e.reasoningEffort)}}async toggleRealtimeTalk(){if(this.realtimeTalkSession)if(this.realtimeTalkStatus===`error`)this.realtimeTalkSession.stop(),this.realtimeTalkSession=null;else{this.realtimeTalkSession.stop(),this.realtimeTalkSession=null,this.realtimeTalkActive=!1,this.realtimeTalkStatus=`idle`,this.realtimeTalkDetail=null,this.realtimeTalkTranscript=null,this.resetRealtimeTalkConversation();return}if(!this.client||!this.connected){this.lastError=v(`chat.gatewayNotConnected`);return}this.realtimeTalkActive=!0,this.realtimeTalkStatus=`connecting`,this.realtimeTalkDetail=null,this.realtimeTalkTranscript=null,this.resetRealtimeTalkConversation();let e=new hU(this.client,this.sessionKey,{onStatus:(e,t)=>{this.realtimeTalkStatus=e,this.realtimeTalkDetail=t??null,(e===`idle`||e===`error`)&&(this.realtimeTalkActive=e!==`idle`)},onTranscript:e=>{this.realtimeTalkTranscript=`${e.role===`user`?`You`:`FengMing`}: ${e.text}`,this.realtimeTalkConversationState=gH(this.realtimeTalkConversationState,e),this.realtimeTalkConversation=this.realtimeTalkConversationState.entries}},this.buildRealtimeTalkLaunchOptions());this.realtimeTalkSession=e;try{await e.start()}catch(t){e.stop(),this.realtimeTalkSession===e&&(this.realtimeTalkSession=null),this.realtimeTalkActive=!1,this.realtimeTalkStatus=`error`,this.realtimeTalkDetail=t instanceof Error?t.message:String(t),this.lastError=this.realtimeTalkDetail}}resetRealtimeTalkConversation(){this.realtimeTalkConversationState=hH(),this.realtimeTalkConversation=[]}async steerQueuedChatMessage(e){await Ih(this,e)}async handleChannelConfigSave(){await gr(this)}async handleChannelConfigReload(){await _r(this)}async handleExecApprovalDecision(e){let t=this.execApprovalQueue[0];if(!(!t||!this.client||this.execApprovalBusy)){this.execApprovalBusy=!0,this.execApprovalError=null;try{let n=t.kind===`plugin`?`plugin.approval.resolve`:`exec.approval.resolve`;await this.client.request(n,{id:t.id,decision:e}),yj(this,t.id)}catch(e){if(uj(e)){yj(this,t.id),await vj(this);return}if(!this.execApprovalQueue.some(e=>e.id===t.id))return;this.execApprovalError=`Approval failed: ${String(e)}`}finally{this.execApprovalBusy=!1}}}handleGatewayUrlConfirm(){let e=this.pendingGatewayUrl;if(!e)return;let t=this.pendingGatewayToken?.trim()||``;this.pendingGatewayUrl=null,this.pendingGatewayToken=null,eA(this,{...this.settings,gatewayUrl:e,token:t}),this.connect()}handleGatewayUrlCancel(){this.pendingGatewayUrl=null,this.pendingGatewayToken=null}handleOpenSidebar(e){this.sidebarCloseTimer!=null&&(window.clearTimeout(this.sidebarCloseTimer),this.sidebarCloseTimer=null),this.sidebarContent=e,this.sidebarError=null,this.sidebarOpen=!0}handleCloseSidebar(){this.sidebarOpen=!1,this.sidebarCloseTimer!=null&&window.clearTimeout(this.sidebarCloseTimer),this.sidebarCloseTimer=window.setTimeout(()=>{this.sidebarOpen||(this.sidebarContent=null,this.sidebarError=null,this.sidebarCloseTimer=null)},200)}handleSplitRatioChange(e){let t=Math.max(.4,Math.min(.7,e));this.splitRatio=t,this.applySettings({...this.settings,splitRatio:t})}async initWebPushState(){let e=`serviceWorker`in navigator&&`PushManager`in window&&`Notification`in window;if(this.webPushSupported=e,this.webPushPermission=e?Notification.permission:`unsupported`,e)try{let{getExistingSubscription:e}=await hV(async()=>{let{getExistingSubscription:e}=await import(`./push-subscription-SK4PlhIV.js`);return{getExistingSubscription:e}},__vite__mapDeps([18,5]),import.meta.url),t=await e();this.webPushSubscribed=t!==null}catch{}}async reconcileWebPushState(){if(this.client)try{let{getExistingSubscription:e}=await hV(async()=>{let{getExistingSubscription:e}=await import(`./push-subscription-SK4PlhIV.js`);return{getExistingSubscription:e}},__vite__mapDeps([18,5]),import.meta.url),t=await e();if(!t)return;this.webPushSubscribed=!0;let n=t.toJSON();n.endpoint&&n.keys?.p256dh&&n.keys?.auth&&await this.client.request(`push.web.subscribe`,{endpoint:n.endpoint,keys:{p256dh:n.keys.p256dh,auth:n.keys.auth}})}catch{}}async handleWebPushSubscribe(){if(!(!this.client||this.webPushLoading)){this.webPushLoading=!0;try{let{subscribeToWebPush:e}=await hV(async()=>{let{subscribeToWebPush:e}=await import(`./push-subscription-SK4PlhIV.js`);return{subscribeToWebPush:e}},__vite__mapDeps([18,5]),import.meta.url);await e(this.client),this.webPushSubscribed=!0,this.webPushPermission=Notification.permission}catch(e){this.lastError=String(e)}finally{this.webPushLoading=!1,`Notification`in window&&(this.webPushPermission=Notification.permission)}}}async handleWebPushUnsubscribe(){if(!(!this.client||this.webPushLoading)){this.webPushLoading=!0;try{let{unsubscribeFromWebPush:e}=await hV(async()=>{let{unsubscribeFromWebPush:e}=await import(`./push-subscription-SK4PlhIV.js`);return{unsubscribeFromWebPush:e}},__vite__mapDeps([18,5]),import.meta.url);await e(this.client),this.webPushSubscribed=!1}catch(e){this.lastError=String(e)}finally{this.webPushLoading=!1}}}async handleWebPushTest(){if(this.client)try{let{sendTestWebPush:e}=await hV(async()=>{let{sendTestWebPush:e}=await import(`./push-subscription-SK4PlhIV.js`);return{sendTestWebPush:e}},__vite__mapDeps([18,5]),import.meta.url);await e(this.client)}catch(e){this.lastError=String(e)}}render(){return pH(this)}};if(J([s()],$.prototype,`settings`,void 0),J([s()],$.prototype,`password`,void 0),J([s()],$.prototype,`loginShowGatewayToken`,void 0),J([s()],$.prototype,`loginShowGatewayPassword`,void 0),J([s()],$.prototype,`tab`,void 0),J([s()],$.prototype,`onboarding`,void 0),J([s()],$.prototype,`connected`,void 0),J([s()],$.prototype,`theme`,void 0),J([s()],$.prototype,`themeMode`,void 0),J([s()],$.prototype,`themeResolved`,void 0),J([s()],$.prototype,`themeOrder`,void 0),J([s()],$.prototype,`customThemeImportUrl`,void 0),J([s()],$.prototype,`customThemeImportBusy`,void 0),J([s()],$.prototype,`customThemeImportMessage`,void 0),J([s()],$.prototype,`customThemeImportExpanded`,void 0),J([s()],$.prototype,`customThemeImportFocusToken`,void 0),J([s()],$.prototype,`hello`,void 0),J([s()],$.prototype,`lastError`,void 0),J([s()],$.prototype,`lastErrorCode`,void 0),J([s()],$.prototype,`eventLog`,void 0),J([s()],$.prototype,`assistantName`,void 0),J([s()],$.prototype,`assistantAvatar`,void 0),J([s()],$.prototype,`assistantAvatarSource`,void 0),J([s()],$.prototype,`assistantAvatarStatus`,void 0),J([s()],$.prototype,`assistantAvatarReason`,void 0),J([s()],$.prototype,`assistantAvatarUploadBusy`,void 0),J([s()],$.prototype,`assistantAvatarUploadError`,void 0),J([s()],$.prototype,`assistantAgentId`,void 0),J([s()],$.prototype,`userName`,void 0),J([s()],$.prototype,`userAvatar`,void 0),J([s()],$.prototype,`localMediaPreviewRoots`,void 0),J([s()],$.prototype,`embedSandboxMode`,void 0),J([s()],$.prototype,`allowExternalEmbedUrls`,void 0),J([s()],$.prototype,`chatMessageMaxWidth`,void 0),J([s()],$.prototype,`serverVersion`,void 0),J([s()],$.prototype,`sessionKey`,void 0),J([s()],$.prototype,`chatLoading`,void 0),J([s()],$.prototype,`chatSending`,void 0),J([s()],$.prototype,`chatMessage`,void 0),J([s()],$.prototype,`chatMessages`,void 0),J([s()],$.prototype,`chatToolMessages`,void 0),J([s()],$.prototype,`activityEntries`,void 0),J([s()],$.prototype,`activityFilterText`,void 0),J([s()],$.prototype,`activityStatusFilters`,void 0),J([s()],$.prototype,`activityToolFilter`,void 0),J([s()],$.prototype,`activityExpandedIds`,void 0),J([s()],$.prototype,`activityAutoFollow`,void 0),J([s()],$.prototype,`activityAtBottom`,void 0),J([s()],$.prototype,`chatStreamSegments`,void 0),J([s()],$.prototype,`chatStream`,void 0),J([s()],$.prototype,`chatStreamStartedAt`,void 0),J([s()],$.prototype,`chatRunId`,void 0),J([s()],$.prototype,`chatSideResult`,void 0),J([s()],$.prototype,`compactionStatus`,void 0),J([s()],$.prototype,`fallbackStatus`,void 0),J([s()],$.prototype,`chatRunStatus`,void 0),J([s()],$.prototype,`chatAvatarUrl`,void 0),J([s()],$.prototype,`chatAvatarSource`,void 0),J([s()],$.prototype,`chatAvatarStatus`,void 0),J([s()],$.prototype,`chatAvatarReason`,void 0),J([s()],$.prototype,`chatThinkingLevel`,void 0),J([s()],$.prototype,`chatModelOverrides`,void 0),J([s()],$.prototype,`chatModelSwitchPromises`,void 0),J([s()],$.prototype,`chatModelsLoading`,void 0),J([s()],$.prototype,`chatModelCatalog`,void 0),J([s()],$.prototype,`sessionSwitchNotice`,void 0),J([s()],$.prototype,`sessionSwitchFlashKey`,void 0),J([s()],$.prototype,`chatSessionPickerOpen`,void 0),J([s()],$.prototype,`chatSessionPickerSurface`,void 0),J([s()],$.prototype,`chatSessionPickerQuery`,void 0),J([s()],$.prototype,`chatSessionPickerAppliedQuery`,void 0),J([s()],$.prototype,`chatSessionPickerLoading`,void 0),J([s()],$.prototype,`chatSessionPickerError`,void 0),J([s()],$.prototype,`chatSessionPickerResult`,void 0),J([s()],$.prototype,`chatQueue`,void 0),J([s()],$.prototype,`chatQueueBySession`,void 0),J([s()],$.prototype,`chatAttachments`,void 0),J([s()],$.prototype,`realtimeTalkActive`,void 0),J([s()],$.prototype,`realtimeTalkStatus`,void 0),J([s()],$.prototype,`realtimeTalkDetail`,void 0),J([s()],$.prototype,`realtimeTalkTranscript`,void 0),J([s()],$.prototype,`realtimeTalkConversation`,void 0),J([s()],$.prototype,`realtimeTalkOptionsOpen`,void 0),J([s()],$.prototype,`realtimeTalkOptions`,void 0),J([s()],$.prototype,`chatManualRefreshInFlight`,void 0),J([s()],$.prototype,`chatHeaderControlsHidden`,void 0),J([s()],$.prototype,`chatMobileControlsOpen`,void 0),J([s()],$.prototype,`navDrawerOpen`,void 0),J([s()],$.prototype,`chatInputHistoryIndex`,void 0),J([s()],$.prototype,`sidebarOpen`,void 0),J([s()],$.prototype,`sidebarContent`,void 0),J([s()],$.prototype,`sidebarError`,void 0),J([s()],$.prototype,`splitRatio`,void 0),J([s()],$.prototype,`nodesLoading`,void 0),J([s()],$.prototype,`nodes`,void 0),J([s()],$.prototype,`devicesLoading`,void 0),J([s()],$.prototype,`devicesError`,void 0),J([s()],$.prototype,`devicesList`,void 0),J([s()],$.prototype,`execApprovalsLoading`,void 0),J([s()],$.prototype,`execApprovalsSaving`,void 0),J([s()],$.prototype,`execApprovalsDirty`,void 0),J([s()],$.prototype,`execApprovalsSnapshot`,void 0),J([s()],$.prototype,`execApprovalsForm`,void 0),J([s()],$.prototype,`execApprovalsSelectedAgent`,void 0),J([s()],$.prototype,`execApprovalsTarget`,void 0),J([s()],$.prototype,`execApprovalsTargetNodeId`,void 0),J([s()],$.prototype,`execApprovalQueue`,void 0),J([s()],$.prototype,`execApprovalBusy`,void 0),J([s()],$.prototype,`execApprovalError`,void 0),J([s()],$.prototype,`pendingGatewayUrl`,void 0),J([s()],$.prototype,`configLoading`,void 0),J([s()],$.prototype,`configRaw`,void 0),J([s()],$.prototype,`configRawOriginal`,void 0),J([s()],$.prototype,`configValid`,void 0),J([s()],$.prototype,`configIssues`,void 0),J([s()],$.prototype,`configSaving`,void 0),J([s()],$.prototype,`configApplying`,void 0),J([s()],$.prototype,`updateRunning`,void 0),J([s()],$.prototype,`applySessionKey`,void 0),J([s()],$.prototype,`configSnapshot`,void 0),J([s()],$.prototype,`configSchema`,void 0),J([s()],$.prototype,`configSchemaVersion`,void 0),J([s()],$.prototype,`configSchemaLoading`,void 0),J([s()],$.prototype,`configUiHints`,void 0),J([s()],$.prototype,`configForm`,void 0),J([s()],$.prototype,`configFormOriginal`,void 0),J([s()],$.prototype,`dreamingStatusLoading`,void 0),J([s()],$.prototype,`dreamingStatusError`,void 0),J([s()],$.prototype,`dreamingStatus`,void 0),J([s()],$.prototype,`dreamingModeSaving`,void 0),J([s()],$.prototype,`dreamingRestartConfirmOpen`,void 0),J([s()],$.prototype,`dreamingRestartConfirmLoading`,void 0),J([s()],$.prototype,`dreamingPendingEnabled`,void 0),J([s()],$.prototype,`dreamDiaryLoading`,void 0),J([s()],$.prototype,`dreamDiaryActionLoading`,void 0),J([s()],$.prototype,`dreamDiaryActionMessage`,void 0),J([s()],$.prototype,`dreamDiaryActionArchivePath`,void 0),J([s()],$.prototype,`dreamDiaryError`,void 0),J([s()],$.prototype,`dreamDiaryPath`,void 0),J([s()],$.prototype,`dreamDiaryContent`,void 0),J([s()],$.prototype,`wikiImportInsightsLoading`,void 0),J([s()],$.prototype,`wikiImportInsightsError`,void 0),J([s()],$.prototype,`wikiImportInsights`,void 0),J([s()],$.prototype,`wikiMemoryPalaceLoading`,void 0),J([s()],$.prototype,`wikiMemoryPalaceError`,void 0),J([s()],$.prototype,`wikiMemoryPalace`,void 0),J([s()],$.prototype,`configFormDirty`,void 0),J([s()],$.prototype,`configSettingsMode`,void 0),J([s()],$.prototype,`configFormMode`,void 0),J([s()],$.prototype,`configSearchQuery`,void 0),J([s()],$.prototype,`configActiveSection`,void 0),J([s()],$.prototype,`configActiveSubsection`,void 0),J([s()],$.prototype,`pendingUpdateExpectedVersion`,void 0),J([s()],$.prototype,`updateStatusBanner`,void 0),J([s()],$.prototype,`communicationsFormMode`,void 0),J([s()],$.prototype,`communicationsSearchQuery`,void 0),J([s()],$.prototype,`communicationsActiveSection`,void 0),J([s()],$.prototype,`communicationsActiveSubsection`,void 0),J([s()],$.prototype,`appearanceFormMode`,void 0),J([s()],$.prototype,`appearanceSearchQuery`,void 0),J([s()],$.prototype,`appearanceActiveSection`,void 0),J([s()],$.prototype,`appearanceActiveSubsection`,void 0),J([s()],$.prototype,`automationFormMode`,void 0),J([s()],$.prototype,`automationSearchQuery`,void 0),J([s()],$.prototype,`automationActiveSection`,void 0),J([s()],$.prototype,`automationActiveSubsection`,void 0),J([s()],$.prototype,`infrastructureFormMode`,void 0),J([s()],$.prototype,`infrastructureSearchQuery`,void 0),J([s()],$.prototype,`infrastructureActiveSection`,void 0),J([s()],$.prototype,`infrastructureActiveSubsection`,void 0),J([s()],$.prototype,`aiAgentsFormMode`,void 0),J([s()],$.prototype,`aiAgentsSearchQuery`,void 0),J([s()],$.prototype,`aiAgentsActiveSection`,void 0),J([s()],$.prototype,`aiAgentsActiveSubsection`,void 0),J([s()],$.prototype,`channelsLoading`,void 0),J([s()],$.prototype,`channelsSnapshot`,void 0),J([s()],$.prototype,`channelsError`,void 0),J([s()],$.prototype,`channelsLastSuccess`,void 0),J([s()],$.prototype,`presenceLoading`,void 0),J([s()],$.prototype,`presenceEntries`,void 0),J([s()],$.prototype,`presenceError`,void 0),J([s()],$.prototype,`presenceStatus`,void 0),J([s()],$.prototype,`agentsLoading`,void 0),J([s()],$.prototype,`agentsList`,void 0),J([s()],$.prototype,`agentsError`,void 0),J([s()],$.prototype,`agentsSelectedId`,void 0),J([s()],$.prototype,`toolsCatalogLoading`,void 0),J([s()],$.prototype,`toolsCatalogError`,void 0),J([s()],$.prototype,`toolsCatalogResult`,void 0),J([s()],$.prototype,`toolsEffectiveLoading`,void 0),J([s()],$.prototype,`toolsEffectiveLoadingKey`,void 0),J([s()],$.prototype,`toolsEffectiveResultKey`,void 0),J([s()],$.prototype,`toolsEffectiveError`,void 0),J([s()],$.prototype,`toolsEffectiveResult`,void 0),J([s()],$.prototype,`agentsPanel`,void 0),J([s()],$.prototype,`agentFilesLoading`,void 0),J([s()],$.prototype,`agentFilesError`,void 0),J([s()],$.prototype,`agentFilesList`,void 0),J([s()],$.prototype,`agentFileContents`,void 0),J([s()],$.prototype,`agentFileDrafts`,void 0),J([s()],$.prototype,`agentFileActive`,void 0),J([s()],$.prototype,`agentFileSaving`,void 0),J([s()],$.prototype,`agentIdentityLoading`,void 0),J([s()],$.prototype,`agentIdentityError`,void 0),J([s()],$.prototype,`agentIdentityById`,void 0),J([s()],$.prototype,`agentSkillsLoading`,void 0),J([s()],$.prototype,`agentSkillsError`,void 0),J([s()],$.prototype,`agentSkillsReport`,void 0),J([s()],$.prototype,`agentSkillsAgentId`,void 0),J([s()],$.prototype,`sessionsLoading`,void 0),J([s()],$.prototype,`sessionsResult`,void 0),J([s()],$.prototype,`sessionsError`,void 0),J([s()],$.prototype,`sessionsFilterActive`,void 0),J([s()],$.prototype,`sessionsFilterLimit`,void 0),J([s()],$.prototype,`sessionsIncludeGlobal`,void 0),J([s()],$.prototype,`sessionsIncludeUnknown`,void 0),J([s()],$.prototype,`sessionsShowArchived`,void 0),J([s()],$.prototype,`sessionsFiltersCollapsed`,void 0),J([s()],$.prototype,`sessionsHideCron`,void 0),J([s()],$.prototype,`sessionsSearchQuery`,void 0),J([s()],$.prototype,`sessionsSortColumn`,void 0),J([s()],$.prototype,`sessionsSortDir`,void 0),J([s()],$.prototype,`sessionsPage`,void 0),J([s()],$.prototype,`sessionsPageSize`,void 0),J([s()],$.prototype,`sessionsSelectedKeys`,void 0),J([s()],$.prototype,`sessionsExpandedCheckpointKey`,void 0),J([s()],$.prototype,`sessionsCheckpointItemsByKey`,void 0),J([s()],$.prototype,`sessionsCheckpointLoadingKey`,void 0),J([s()],$.prototype,`sessionsCheckpointBusyKey`,void 0),J([s()],$.prototype,`sessionsCheckpointErrorByKey`,void 0),J([s()],$.prototype,`usageLoading`,void 0),J([s()],$.prototype,`usageResult`,void 0),J([s()],$.prototype,`usageCostSummary`,void 0),J([s()],$.prototype,`usageError`,void 0),J([s()],$.prototype,`usageStartDate`,void 0),J([s()],$.prototype,`usageEndDate`,void 0),J([s()],$.prototype,`usageScope`,void 0),J([s()],$.prototype,`usageAgentId`,void 0),J([s()],$.prototype,`usageSelectedSessions`,void 0),J([s()],$.prototype,`usageSelectedDays`,void 0),J([s()],$.prototype,`usageSelectedHours`,void 0),J([s()],$.prototype,`usageChartMode`,void 0),J([s()],$.prototype,`usageDailyChartMode`,void 0),J([s()],$.prototype,`usageTimeSeriesMode`,void 0),J([s()],$.prototype,`usageTimeSeriesBreakdownMode`,void 0),J([s()],$.prototype,`usageTimeSeries`,void 0),J([s()],$.prototype,`usageTimeSeriesLoading`,void 0),J([s()],$.prototype,`usageTimeSeriesCursorStart`,void 0),J([s()],$.prototype,`usageTimeSeriesCursorEnd`,void 0),J([s()],$.prototype,`usageSessionLogs`,void 0),J([s()],$.prototype,`usageSessionLogsLoading`,void 0),J([s()],$.prototype,`usageSessionLogsExpanded`,void 0),J([s()],$.prototype,`usageQuery`,void 0),J([s()],$.prototype,`usageQueryDraft`,void 0),J([s()],$.prototype,`usageSessionSort`,void 0),J([s()],$.prototype,`usageSessionSortDir`,void 0),J([s()],$.prototype,`usageRecentSessions`,void 0),J([s()],$.prototype,`usageTimeZone`,void 0),J([s()],$.prototype,`usageContextExpanded`,void 0),J([s()],$.prototype,`usageHeaderPinned`,void 0),J([s()],$.prototype,`usageSessionsTab`,void 0),J([s()],$.prototype,`usageVisibleColumns`,void 0),J([s()],$.prototype,`usageLogFilterRoles`,void 0),J([s()],$.prototype,`usageLogFilterTools`,void 0),J([s()],$.prototype,`usageLogFilterHasTools`,void 0),J([s()],$.prototype,`usageLogFilterQuery`,void 0),J([s()],$.prototype,`cronLoading`,void 0),J([s()],$.prototype,`cronQuickCreateOpen`,void 0),J([s()],$.prototype,`cronQuickCreateStep`,void 0),J([s()],$.prototype,`cronQuickCreateDraft`,void 0),J([s()],$.prototype,`cronJobsLoadingMore`,void 0),J([s()],$.prototype,`cronJobs`,void 0),J([s()],$.prototype,`cronJobsTotal`,void 0),J([s()],$.prototype,`cronJobsHasMore`,void 0),J([s()],$.prototype,`cronJobsNextOffset`,void 0),J([s()],$.prototype,`cronJobsLimit`,void 0),J([s()],$.prototype,`cronJobsQuery`,void 0),J([s()],$.prototype,`cronJobsEnabledFilter`,void 0),J([s()],$.prototype,`cronJobsScheduleKindFilter`,void 0),J([s()],$.prototype,`cronJobsLastStatusFilter`,void 0),J([s()],$.prototype,`cronJobsSortBy`,void 0),J([s()],$.prototype,`cronJobsSortDir`,void 0),J([s()],$.prototype,`cronStatus`,void 0),J([s()],$.prototype,`cronError`,void 0),J([s()],$.prototype,`cronForm`,void 0),J([s()],$.prototype,`cronFormCollapsed`,void 0),J([s()],$.prototype,`cronFieldErrors`,void 0),J([s()],$.prototype,`cronEditingJobId`,void 0),J([s()],$.prototype,`cronRunsJobId`,void 0),J([s()],$.prototype,`cronRunsLoadingMore`,void 0),J([s()],$.prototype,`cronRuns`,void 0),J([s()],$.prototype,`cronRunsTotal`,void 0),J([s()],$.prototype,`cronRunsHasMore`,void 0),J([s()],$.prototype,`cronRunsNextOffset`,void 0),J([s()],$.prototype,`cronRunsLimit`,void 0),J([s()],$.prototype,`cronRunsScope`,void 0),J([s()],$.prototype,`cronRunsStatuses`,void 0),J([s()],$.prototype,`cronRunsDeliveryStatuses`,void 0),J([s()],$.prototype,`cronRunsStatusFilter`,void 0),J([s()],$.prototype,`cronRunsQuery`,void 0),J([s()],$.prototype,`cronRunsSortDir`,void 0),J([s()],$.prototype,`cronModelSuggestions`,void 0),J([s()],$.prototype,`cronBusy`,void 0),J([s()],$.prototype,`updateAvailable`,void 0),J([s()],$.prototype,`attentionItems`,void 0),J([s()],$.prototype,`paletteOpen`,void 0),J([s()],$.prototype,`paletteQuery`,void 0),J([s()],$.prototype,`paletteActiveIndex`,void 0),J([s()],$.prototype,`overviewShowGatewayToken`,void 0),J([s()],$.prototype,`overviewShowGatewayPassword`,void 0),J([s()],$.prototype,`overviewLogLines`,void 0),J([s()],$.prototype,`overviewLogCursor`,void 0),J([s()],$.prototype,`skillsLoading`,void 0),J([s()],$.prototype,`skillsReport`,void 0),J([s()],$.prototype,`skillsError`,void 0),J([s()],$.prototype,`skillsFilter`,void 0),J([s()],$.prototype,`skillsStatusFilter`,void 0),J([s()],$.prototype,`skillEdits`,void 0),J([s()],$.prototype,`skillsBusyKey`,void 0),J([s()],$.prototype,`skillMessages`,void 0),J([s()],$.prototype,`skillsDetailKey`,void 0),J([s()],$.prototype,`skillsDetailTab`,void 0),J([s()],$.prototype,`clawhubSearchQuery`,void 0),J([s()],$.prototype,`clawhubSearchResults`,void 0),J([s()],$.prototype,`clawhubSearchLoading`,void 0),J([s()],$.prototype,`clawhubSearchError`,void 0),J([s()],$.prototype,`clawhubDetail`,void 0),J([s()],$.prototype,`clawhubDetailSlug`,void 0),J([s()],$.prototype,`clawhubDetailLoading`,void 0),J([s()],$.prototype,`clawhubDetailError`,void 0),J([s()],$.prototype,`clawhubInstallSlug`,void 0),J([s()],$.prototype,`clawhubInstallMessage`,void 0),J([s()],$.prototype,`clawhubVerdicts`,void 0),J([s()],$.prototype,`clawhubVerdictsLoading`,void 0),J([s()],$.prototype,`clawhubVerdictsError`,void 0),J([s()],$.prototype,`skillCardContents`,void 0),J([s()],$.prototype,`skillCardContentKeys`,void 0),J([s()],$.prototype,`skillCardLoadingKey`,void 0),J([s()],$.prototype,`skillCardErrors`,void 0),J([s()],$.prototype,`healthLoading`,void 0),J([s()],$.prototype,`healthResult`,void 0),J([s()],$.prototype,`healthError`,void 0),J([s()],$.prototype,`modelAuthStatusLoading`,void 0),J([s()],$.prototype,`modelAuthStatusResult`,void 0),J([s()],$.prototype,`modelAuthStatusError`,void 0),J([s()],$.prototype,`debugLoading`,void 0),J([s()],$.prototype,`debugStatus`,void 0),J([s()],$.prototype,`debugHealth`,void 0),J([s()],$.prototype,`debugModels`,void 0),J([s()],$.prototype,`debugHeartbeat`,void 0),J([s()],$.prototype,`debugCallMethod`,void 0),J([s()],$.prototype,`debugCallParams`,void 0),J([s()],$.prototype,`debugCallResult`,void 0),J([s()],$.prototype,`debugCallError`,void 0),J([s()],$.prototype,`webPushSupported`,void 0),J([s()],$.prototype,`webPushPermission`,void 0),J([s()],$.prototype,`webPushSubscribed`,void 0),J([s()],$.prototype,`webPushLoading`,void 0),J([s()],$.prototype,`logsLoading`,void 0),J([s()],$.prototype,`logsError`,void 0),J([s()],$.prototype,`logsFile`,void 0),J([s()],$.prototype,`logsEntries`,void 0),J([s()],$.prototype,`logsFilterText`,void 0),J([s()],$.prototype,`logsLevelFilters`,void 0),J([s()],$.prototype,`logsAutoFollow`,void 0),J([s()],$.prototype,`logsTruncated`,void 0),J([s()],$.prototype,`logsCursor`,void 0),J([s()],$.prototype,`logsLastFetchAt`,void 0),J([s()],$.prototype,`logsLimit`,void 0),J([s()],$.prototype,`logsMaxBytes`,void 0),J([s()],$.prototype,`logsAtBottom`,void 0),J([s()],$.prototype,`chatNewMessagesBelow`,void 0),customElements.get(`fengming-app`)||customElements.define(`fengming-app`,$),`serviceWorker`in navigator){let e=new URL(`./sw.js`,window.location.href);e.searchParams.set(`v`,`0.3.1-510c148491f0`),navigator.serviceWorker.register(e,{updateViaCache:`none`})}export{Pa as $,Hx as A,Da as B,Tx as C,Wx as D,Gx as E,yc as F,Ja as G,Ua as H,vc as I,Va as J,ga as K,_c as L,L_ as M,F_ as N,$x as O,Yu as P,Ma as Q,wc as R,tS as S,hx as T,Oa as U,Aa as V,qa as W,ja as X,ka as Y,Fa as Z,dD as _,ZB as a,rn as at,qx as b,XB as c,tn as ct,RM as d,Ya as et,zM as f,_D as g,sk as h,QB as i,mi as it,ky as j,eS as k,nR as l,Ue as lt,ck as m,eV as n,ma as nt,YB as o,$t as ot,LM as p,Na as q,$B as r,Li as rt,JB as s,nn as st,hV as t,ha as tt,RL as u,q as v,ix as w,Kx as x,Rb as y,Xo as z};
|
|
7201
|
-
//# sourceMappingURL=index-
|
|
7213
|
+
`,this.configRawOriginal=``,this.configValid=null,this.configIssues=[],this.configSaving=!1,this.configApplying=!1,this.updateRunning=!1,this.applySessionKey=this.settings.lastActiveSessionKey,this.configSnapshot=null,this.configSchema=null,this.configSchemaVersion=null,this.configSchemaLoading=!1,this.configUiHints={},this.configForm=null,this.configFormOriginal=null,this.dreamingStatusLoading=!1,this.dreamingStatusError=null,this.dreamingStatus=null,this.dreamingModeSaving=!1,this.dreamingRestartConfirmOpen=!1,this.dreamingRestartConfirmLoading=!1,this.dreamingPendingEnabled=null,this.dreamDiaryLoading=!1,this.dreamDiaryActionLoading=!1,this.dreamDiaryActionMessage=null,this.dreamDiaryActionArchivePath=null,this.dreamDiaryError=null,this.dreamDiaryPath=null,this.dreamDiaryContent=null,this.wikiImportInsightsLoading=!1,this.wikiImportInsightsError=null,this.wikiImportInsights=null,this.wikiMemoryPalaceLoading=!1,this.wikiMemoryPalaceError=null,this.wikiMemoryPalace=null,this.configFormDirty=!1,this.configSettingsMode=`quick`,this.configFormMode=`form`,this.configSearchQuery=``,this.configActiveSection=null,this.configActiveSubsection=null,this.pendingUpdateExpectedVersion=null,this.updateStatusBanner=null,this.communicationsFormMode=`form`,this.communicationsSearchQuery=``,this.communicationsActiveSection=null,this.communicationsActiveSubsection=null,this.appearanceFormMode=`form`,this.appearanceSearchQuery=``,this.appearanceActiveSection=null,this.appearanceActiveSubsection=null,this.automationFormMode=`form`,this.automationSearchQuery=``,this.automationActiveSection=null,this.automationActiveSubsection=null,this.infrastructureFormMode=`form`,this.infrastructureSearchQuery=``,this.infrastructureActiveSection=null,this.infrastructureActiveSubsection=null,this.aiAgentsFormMode=`form`,this.aiAgentsSearchQuery=``,this.aiAgentsActiveSection=null,this.aiAgentsActiveSubsection=null,this.channelsLoading=!1,this.channelsSnapshot=null,this.channelsError=null,this.channelsLastSuccess=null,this.presenceLoading=!1,this.presenceEntries=[],this.presenceError=null,this.presenceStatus=null,this.agentsLoading=!1,this.agentsList=null,this.agentsError=null,this.agentsSelectedId=null,this.toolsCatalogLoading=!1,this.toolsCatalogError=null,this.toolsCatalogResult=null,this.toolsEffectiveLoading=!1,this.toolsEffectiveLoadingKey=null,this.toolsEffectiveResultKey=null,this.toolsEffectiveError=null,this.toolsEffectiveResult=null,this.agentsPanel=`files`,this.agentFilesLoading=!1,this.agentFilesError=null,this.agentFilesList=null,this.agentFileContents={},this.agentFileDrafts={},this.agentFileActive=null,this.agentFileSaving=!1,this.agentIdentityLoading=!1,this.agentIdentityError=null,this.agentIdentityById={},this.agentSkillsLoading=!1,this.agentSkillsError=null,this.agentSkillsReport=null,this.agentSkillsAgentId=null,this.sessionsLoading=!1,this.sessionsResult=null,this.sessionsError=null,this.sessionsFilterActive=mg.activeMinutes,this.sessionsFilterLimit=mg.limit,this.sessionsIncludeGlobal=!0,this.sessionsIncludeUnknown=!1,this.sessionsShowArchived=!1,this.sessionsFiltersCollapsed=!1,this.sessionsHideCron=!0,this.sessionsSearchQuery=``,this.sessionsSortColumn=`updated`,this.sessionsSortDir=`desc`,this.sessionsPage=0,this.sessionsPageSize=25,this.sessionsSelectedKeys=new Set,this.sessionsExpandedCheckpointKey=null,this.sessionsCheckpointItemsByKey={},this.sessionsCheckpointLoadingKey=null,this.sessionsCheckpointBusyKey=null,this.sessionsCheckpointErrorByKey={},this.usageLoading=!1,this.usageResult=null,this.usageCostSummary=null,this.usageError=null,this.usageStartDate=(()=>{let e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`})(),this.usageEndDate=(()=>{let e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`})(),this.usageScope=`family`,this.usageAgentId=null,this.usageSelectedSessions=[],this.usageSelectedDays=[],this.usageSelectedHours=[],this.usageChartMode=`tokens`,this.usageDailyChartMode=`by-type`,this.usageTimeSeriesMode=`per-turn`,this.usageTimeSeriesBreakdownMode=`by-type`,this.usageTimeSeries=null,this.usageTimeSeriesLoading=!1,this.usageTimeSeriesCursorStart=null,this.usageTimeSeriesCursorEnd=null,this.usageSessionLogs=null,this.usageSessionLogsLoading=!1,this.usageSessionLogsExpanded=!1,this.usageQuery=``,this.usageQueryDraft=``,this.usageSessionSort=`recent`,this.usageSessionSortDir=`desc`,this.usageRecentSessions=[],this.usageTimeZone=`local`,this.usageContextExpanded=!1,this.usageHeaderPinned=!1,this.usageSessionsTab=`all`,this.usageVisibleColumns=[`channel`,`agent`,`provider`,`model`,`messages`,`tools`,`errors`,`duration`],this.usageLogFilterRoles=[],this.usageLogFilterTools=[],this.usageLogFilterHasTools=!1,this.usageLogFilterQuery=``,this.usageQueryDebounceTimer=null,this.cronLoading=!1,this.cronQuickCreateOpen=!1,this.cronQuickCreateStep=`what`,this.cronQuickCreateDraft=null,this.cronJobsLoadingMore=!1,this.cronJobsReloadPending=!1,this.cronJobsReloadPendingTableFilters=!1,this.cronJobs=[],this.cronJobsTotal=0,this.cronJobsHasMore=!1,this.cronJobsNextOffset=null,this.cronJobsLimit=50,this.cronJobsQuery=``,this.cronJobsEnabledFilter=`all`,this.cronJobsScheduleKindFilter=`all`,this.cronJobsLastStatusFilter=`all`,this.cronJobsSortBy=`nextRunAtMs`,this.cronJobsSortDir=`asc`,this.cronStatus=null,this.cronError=null,this.cronForm={...hg},this.cronFormCollapsed=!0,this.cronFieldErrors={},this.cronEditingJobId=null,this.cronRunsJobId=null,this.cronRunsLoadingMore=!1,this.cronRuns=[],this.cronRunsTotal=0,this.cronRunsHasMore=!1,this.cronRunsNextOffset=null,this.cronRunsLimit=50,this.cronRunsScope=`all`,this.cronRunsStatuses=[],this.cronRunsDeliveryStatuses=[],this.cronRunsStatusFilter=`all`,this.cronRunsQuery=``,this.cronRunsSortDir=`desc`,this.cronModelSuggestions=[],this.cronBusy=!1,this.updateAvailable=null,this.attentionItems=[],this.paletteOpen=!1,this.paletteQuery=``,this.paletteActiveIndex=0,this.overviewShowGatewayToken=!1,this.overviewShowGatewayPassword=!1,this.overviewLogLines=[],this.overviewLogCursor=0,this.skillsLoading=!1,this.skillsReport=null,this.skillsError=null,this.skillsFilter=``,this.skillsStatusFilter=`all`,this.skillEdits={},this.skillsBusyKey=null,this.skillMessages={},this.skillsDetailKey=null,this.skillsDetailTab=`overview`,this.clawhubSearchQuery=``,this.clawhubSearchResults=null,this.clawhubSearchLoading=!1,this.clawhubSearchError=null,this.clawhubDetail=null,this.clawhubDetailSlug=null,this.clawhubDetailLoading=!1,this.clawhubDetailError=null,this.clawhubInstallSlug=null,this.clawhubInstallMessage=null,this.clawhubVerdicts={},this.clawhubVerdictsLoading=!1,this.clawhubVerdictsError=null,this.skillCardContents={},this.skillCardContentKeys={},this.skillCardLoadingKey=null,this.skillCardErrors={},this.healthLoading=!1,this.healthResult=null,this.healthError=null,this.modelAuthStatusLoading=!1,this.modelAuthStatusResult=null,this.modelAuthStatusError=null,this.debugLoading=!1,this.debugStatus=null,this.debugHealth=null,this.debugModels=[],this.debugHeartbeat=null,this.debugCallMethod=``,this.debugCallParams=`{}`,this.debugCallResult=null,this.debugCallError=null,this.webPushSupported=!1,this.webPushPermission=`unsupported`,this.webPushSubscribed=!1,this.webPushLoading=!1,this.logsLoading=!1,this.logsError=null,this.logsFile=null,this.logsEntries=[],this.logsFilterText=``,this.logsLevelFilters={...pg},this.logsAutoFollow=!0,this.logsTruncated=!1,this.logsCursor=null,this.logsLastFetchAt=null,this.logsLimit=500,this.logsMaxBytes=25e4,this.logsAtBottom=!0,this.client=null,this.chatScrollFrame=null,this.chatScrollTimeout=null,this.chatLastScrollTop=0,this.chatHasAutoScrolled=!1,this.chatUserNearBottom=!0,this.chatIsProgrammaticScroll=!1,this.chatProgrammaticScrollTarget=0,this.chatNewMessagesBelow=!1,this.nodesPollInterval=null,this.logsPollInterval=null,this.debugPollInterval=null,this.sessionsChangedReloadTimer=null,this.logsScrollFrame=null,this.activityScrollFrame=null,this.controlUiResponsivenessObserver=null,this.toolStreamById=new Map,this.toolStreamOrder=[],this.refreshSessionsAfterChat=new Set,this.chatSideResultTerminalRuns=new Set,this.basePath=``,this.popStateHandler=()=>SA(this),this.topbarObserver=null,this.globalKeydownHandler=e=>{(e.metaKey||e.ctrlKey)&&!e.shiftKey&&e.key===`k`&&(e.preventDefault(),this.paletteOpen=!this.paletteOpen,this.paletteOpen&&(this.paletteQuery=``,this.paletteActiveIndex=0))},this.chatMobileControlsKeydownHandler=e=>{if(e.key===`Escape`){if(this.chatSessionPickerOpen){e.preventDefault(),this.chatSessionPickerOpen=!1,this.chatSessionPickerSurface=null;return}this.chatMobileControlsOpen&&(e.preventDefault(),this.setChatMobileControlsOpen(!1,{restoreFocus:!0}))}},this.chatMobileControlsPointerdownHandler=e=>{let t=e.composedPath();if(this.chatSessionPickerOpen&&(Array.from(this.querySelectorAll(`.chat-controls__session-picker`)).some(e=>t.includes(e))||(this.chatSessionPickerOpen=!1,this.chatSessionPickerSurface=null)),!this.chatMobileControlsOpen)return;let n=this.querySelector(`.chat-mobile-controls-wrapper`);n&&t.includes(n)||this.setChatMobileControlsOpen(!1)},h(this.settings.locale)&&_.setLocale(this.settings.locale)}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.onSlashAction=async e=>{switch(e){case`new-session`:await lP(this);break;case`toggle-focus`:this.applySettings({...this.settings,chatFocusMode:!this.settings.chatFocusMode});break;case`export`:FE(this.chatMessages,this.assistantName);break;case`refresh-tools-effective`:await A_(this);break}},document.addEventListener(`keydown`,this.globalKeydownHandler),document.addEventListener(`keydown`,this.chatMobileControlsKeydownHandler),document.addEventListener(`pointerdown`,this.chatMobileControlsPointerdownHandler),dM(this),this.nativeBridgeCleanup=xM(this),this.initWebPushState()}firstUpdated(){fM(this)}disconnectedCallback(){document.removeEventListener(`keydown`,this.globalKeydownHandler),this.nativeBridgeCleanup?.(),this.nativeBridgeCleanup=null,document.removeEventListener(`keydown`,this.chatMobileControlsKeydownHandler),document.removeEventListener(`pointerdown`,this.chatMobileControlsPointerdownHandler),this.sessionSwitchNoticeTimer!==null&&(window.clearTimeout(this.sessionSwitchNoticeTimer),this.sessionSwitchNoticeTimer=null),this.sessionSwitchFlashTimer!==null&&(window.clearTimeout(this.sessionSwitchFlashTimer),this.sessionSwitchFlashTimer=null),this.chatMobileControlsTrigger=null,gM(this),super.disconnectedCallback()}updated(e){if(_M(this,e),e.has(`tab`)&&this.tab!==`chat`&&this.chatMobileControlsOpen&&this.setChatMobileControlsOpen(!1),!e.has(`sessionKey`)||this.agentsPanel!==`tools`)return;let t=Xc(this.sessionKey);if(this.agentsSelectedId&&this.agentsSelectedId===t){D_(this,{agentId:this.agentsSelectedId,sessionKey:this.sessionKey});return}this.toolsEffectiveResult=null,this.toolsEffectiveResultKey=null,this.toolsEffectiveError=null,this.toolsEffectiveLoading=!1,this.toolsEffectiveLoadingKey=null}connect(){tM(this)}handleChatScroll(e){Ho(this,e)}handleLogsScroll(e){Uo(this,e)}handleActivityScroll(e){Wo(this,e)}scheduleActivityScroll(e=!1){Vo(this,e)}exportLogs(e,t){Ko(e,t)}resetToolStream(){wl(this)}resetChatScroll(){Go(this)}scrollToBottom(e){Go(this),zo(this,!0,!!e?.smooth,{source:`manual`})}async loadAssistantIdentity(){await WA(this)}applySettings(e){eA(this,e)}applyLocalUserIdentity(e){tA(this,e)}setTab(e){oA(this,e),e!==`chat`&&this.setChatMobileControlsOpen(!1),this.navDrawerOpen=!1}setChatMobileControlsOpen(e,t){if(e){this.chatMobileControlsTrigger=t?.trigger??this.chatMobileControlsTrigger,this.chatMobileControlsOpen=!0;return}let n=t?.restoreFocus?this.chatMobileControlsTrigger:null;this.chatMobileControlsOpen=!1,this.chatSessionPickerSurface===`mobile`&&(this.chatSessionPickerOpen=!1,this.chatSessionPickerSurface=null),this.chatMobileControlsTrigger=null,!(!(n instanceof HTMLElement)||!n.isConnected)&&requestAnimationFrame(()=>{n.isConnected&&n.focus()})}setTheme(e,t){cA(this,e,t),this.themeOrder=this.buildThemeOrder(e)}setThemeMode(e,t){lA(this,e,t)}setCustomThemeImportUrl(e){this.customThemeImportUrl=e,this.customThemeImportMessage?.kind===`error`&&(this.customThemeImportMessage=null)}openCustomThemeImport(){this.customThemeImportExpanded=!0,this.customThemeImportFocusToken+=1,this.settings.customTheme||(this.customThemeImportSelectOnSuccess=!0)}async importCustomTheme(){if(!this.customThemeImportBusy){this.customThemeImportExpanded=!0,this.customThemeImportBusy=!0,this.customThemeImportMessage=null;try{let e=await ii(this.customThemeImportUrl),t=this.theme===`custom`||!this.settings.customTheme||this.customThemeImportSelectOnSuccess;eA(this,{...this.settings,theme:t?`custom`:this.settings.theme,customTheme:e}),this.themeOrder=this.buildThemeOrder(t?`custom`:this.theme),this.customThemeImportUrl=``,this.customThemeImportSelectOnSuccess=!1,this.customThemeImportMessage={kind:`success`,text:`Imported ${e.label}.`}}catch(e){this.customThemeImportMessage={kind:`error`,text:e instanceof Error?e.message:v(`settings.quick.importThemeFailed`)}}finally{this.customThemeImportBusy=!1}}}clearCustomTheme(){let e=this.theme===`custom`?`claw`:this.theme;this.customThemeImportExpanded=!0,this.customThemeImportSelectOnSuccess=!1,eA(this,{...this.settings,theme:e,customTheme:void 0}),this.themeOrder=this.buildThemeOrder(e),this.customThemeImportMessage={kind:`success`,text:v(`settings.quick.clearedTheme`)}}setBorderRadius(e){eA(this,{...this.settings,borderRadius:e}),this.requestUpdate()}setTextScale(e){eA(this,{...this.settings,textScale:e}),this.requestUpdate()}announceSessionSwitch(e,t){let n=++this.sessionSwitchNoticeSeq;this.sessionSwitchNoticeTimer!==null&&window.clearTimeout(this.sessionSwitchNoticeTimer),this.sessionSwitchFlashTimer!==null&&window.clearTimeout(this.sessionSwitchFlashTimer),this.sessionSwitchNotice={id:n,text:v(`chat.switchedSession`,{session:t})},this.sessionSwitchFlashKey=e,this.sessionSwitchFlashTimer=window.setTimeout(()=>{this.sessionSwitchNotice?.id===n&&(this.sessionSwitchFlashKey=null),this.sessionSwitchFlashTimer=null},200),this.sessionSwitchNoticeTimer=window.setTimeout(()=>{this.sessionSwitchNotice?.id===n&&(this.sessionSwitchNotice=null),this.sessionSwitchNoticeTimer=null},2800)}buildThemeOrder(e){return[e,...[...xi].filter(t=>t!==e)]}async loadOverview(e){await kA(this,e)}async loadCron(){await IA(this)}async handleAbortChat(e){await mh(this,e)}handleChatDraftChange(e){Wu(this,e)}handleChatInputHistoryKey(e){return Ju(this,e)}resetChatInputHistoryNavigation(){Uu(this)}removeQueuedMessage(e){Rh(this,e)}async retryQueuedChatMessage(e){await Wh(this,e)}async handleSendChat(e,t){await Gh(this,e,t)}updateRealtimeTalkOptions(e){this.realtimeTalkOptions={...this.realtimeTalkOptions,...e}}buildRealtimeTalkLaunchOptions(){let e=this.realtimeTalkOptions??{provider:``,model:``,voice:``,transport:``,vadThreshold:``,silenceDurationMs:``,prefixPaddingMs:``,reasoningEffort:``},t=e=>e.trim()||void 0,n=e=>{let t=e.trim();if(!t)return;let n=Number(t);return Number.isFinite(n)?n:void 0},r=t(e.transport);return{provider:t(e.provider),model:t(e.model),voice:t(e.voice),transport:r,vadThreshold:n(e.vadThreshold),silenceDurationMs:n(e.silenceDurationMs),prefixPaddingMs:n(e.prefixPaddingMs),reasoningEffort:t(e.reasoningEffort)}}async toggleRealtimeTalk(){if(this.realtimeTalkSession)if(this.realtimeTalkStatus===`error`)this.realtimeTalkSession.stop(),this.realtimeTalkSession=null;else{this.realtimeTalkSession.stop(),this.realtimeTalkSession=null,this.realtimeTalkActive=!1,this.realtimeTalkStatus=`idle`,this.realtimeTalkDetail=null,this.realtimeTalkTranscript=null,this.resetRealtimeTalkConversation();return}if(!this.client||!this.connected){this.lastError=v(`chat.gatewayNotConnected`);return}this.realtimeTalkActive=!0,this.realtimeTalkStatus=`connecting`,this.realtimeTalkDetail=null,this.realtimeTalkTranscript=null,this.resetRealtimeTalkConversation();let e=new hU(this.client,this.sessionKey,{onStatus:(e,t)=>{this.realtimeTalkStatus=e,this.realtimeTalkDetail=t??null,(e===`idle`||e===`error`)&&(this.realtimeTalkActive=e!==`idle`)},onTranscript:e=>{this.realtimeTalkTranscript=`${e.role===`user`?`You`:`FengMing`}: ${e.text}`,this.realtimeTalkConversationState=gH(this.realtimeTalkConversationState,e),this.realtimeTalkConversation=this.realtimeTalkConversationState.entries}},this.buildRealtimeTalkLaunchOptions());this.realtimeTalkSession=e;try{await e.start()}catch(t){e.stop(),this.realtimeTalkSession===e&&(this.realtimeTalkSession=null),this.realtimeTalkActive=!1,this.realtimeTalkStatus=`error`,this.realtimeTalkDetail=t instanceof Error?t.message:String(t),this.lastError=this.realtimeTalkDetail}}resetRealtimeTalkConversation(){this.realtimeTalkConversationState=hH(),this.realtimeTalkConversation=[]}async steerQueuedChatMessage(e){await Ih(this,e)}async handleChannelConfigSave(){await gr(this)}async handleChannelConfigReload(){await _r(this)}async handleExecApprovalDecision(e){let t=this.execApprovalQueue[0];if(!(!t||!this.client||this.execApprovalBusy)){this.execApprovalBusy=!0,this.execApprovalError=null;try{let n=t.kind===`plugin`?`plugin.approval.resolve`:`exec.approval.resolve`;await this.client.request(n,{id:t.id,decision:e}),yj(this,t.id)}catch(e){if(uj(e)){yj(this,t.id),await vj(this);return}if(!this.execApprovalQueue.some(e=>e.id===t.id))return;this.execApprovalError=`Approval failed: ${String(e)}`}finally{this.execApprovalBusy=!1}}}handleGatewayUrlConfirm(){let e=this.pendingGatewayUrl;if(!e)return;let t=this.pendingGatewayToken?.trim()||``;this.pendingGatewayUrl=null,this.pendingGatewayToken=null,eA(this,{...this.settings,gatewayUrl:e,token:t}),this.connect()}handleGatewayUrlCancel(){this.pendingGatewayUrl=null,this.pendingGatewayToken=null}handleOpenSidebar(e){this.sidebarCloseTimer!=null&&(window.clearTimeout(this.sidebarCloseTimer),this.sidebarCloseTimer=null),this.sidebarContent=e,this.sidebarError=null,this.sidebarOpen=!0}handleCloseSidebar(){this.sidebarOpen=!1,this.sidebarCloseTimer!=null&&window.clearTimeout(this.sidebarCloseTimer),this.sidebarCloseTimer=window.setTimeout(()=>{this.sidebarOpen||(this.sidebarContent=null,this.sidebarError=null,this.sidebarCloseTimer=null)},200)}handleSplitRatioChange(e){let t=Math.max(.4,Math.min(.7,e));this.splitRatio=t,this.applySettings({...this.settings,splitRatio:t})}async initWebPushState(){let e=`serviceWorker`in navigator&&`PushManager`in window&&`Notification`in window;if(this.webPushSupported=e,this.webPushPermission=e?Notification.permission:`unsupported`,e)try{let{getExistingSubscription:e}=await hV(async()=>{let{getExistingSubscription:e}=await import(`./push-subscription-CY8GxC_U.js`);return{getExistingSubscription:e}},__vite__mapDeps([18,5]),import.meta.url),t=await e();this.webPushSubscribed=t!==null}catch{}}async reconcileWebPushState(){if(this.client)try{let{getExistingSubscription:e}=await hV(async()=>{let{getExistingSubscription:e}=await import(`./push-subscription-CY8GxC_U.js`);return{getExistingSubscription:e}},__vite__mapDeps([18,5]),import.meta.url),t=await e();if(!t)return;this.webPushSubscribed=!0;let n=t.toJSON();n.endpoint&&n.keys?.p256dh&&n.keys?.auth&&await this.client.request(`push.web.subscribe`,{endpoint:n.endpoint,keys:{p256dh:n.keys.p256dh,auth:n.keys.auth}})}catch{}}async handleWebPushSubscribe(){if(!(!this.client||this.webPushLoading)){this.webPushLoading=!0;try{let{subscribeToWebPush:e}=await hV(async()=>{let{subscribeToWebPush:e}=await import(`./push-subscription-CY8GxC_U.js`);return{subscribeToWebPush:e}},__vite__mapDeps([18,5]),import.meta.url);await e(this.client),this.webPushSubscribed=!0,this.webPushPermission=Notification.permission}catch(e){this.lastError=String(e)}finally{this.webPushLoading=!1,`Notification`in window&&(this.webPushPermission=Notification.permission)}}}async handleWebPushUnsubscribe(){if(!(!this.client||this.webPushLoading)){this.webPushLoading=!0;try{let{unsubscribeFromWebPush:e}=await hV(async()=>{let{unsubscribeFromWebPush:e}=await import(`./push-subscription-CY8GxC_U.js`);return{unsubscribeFromWebPush:e}},__vite__mapDeps([18,5]),import.meta.url);await e(this.client),this.webPushSubscribed=!1}catch(e){this.lastError=String(e)}finally{this.webPushLoading=!1}}}async handleWebPushTest(){if(this.client)try{let{sendTestWebPush:e}=await hV(async()=>{let{sendTestWebPush:e}=await import(`./push-subscription-CY8GxC_U.js`);return{sendTestWebPush:e}},__vite__mapDeps([18,5]),import.meta.url);await e(this.client)}catch(e){this.lastError=String(e)}}render(){return pH(this)}};if(J([s()],$.prototype,`settings`,void 0),J([s()],$.prototype,`password`,void 0),J([s()],$.prototype,`loginShowGatewayToken`,void 0),J([s()],$.prototype,`loginShowGatewayPassword`,void 0),J([s()],$.prototype,`tab`,void 0),J([s()],$.prototype,`onboarding`,void 0),J([s()],$.prototype,`connected`,void 0),J([s()],$.prototype,`theme`,void 0),J([s()],$.prototype,`themeMode`,void 0),J([s()],$.prototype,`themeResolved`,void 0),J([s()],$.prototype,`themeOrder`,void 0),J([s()],$.prototype,`customThemeImportUrl`,void 0),J([s()],$.prototype,`customThemeImportBusy`,void 0),J([s()],$.prototype,`customThemeImportMessage`,void 0),J([s()],$.prototype,`customThemeImportExpanded`,void 0),J([s()],$.prototype,`customThemeImportFocusToken`,void 0),J([s()],$.prototype,`hello`,void 0),J([s()],$.prototype,`lastError`,void 0),J([s()],$.prototype,`lastErrorCode`,void 0),J([s()],$.prototype,`eventLog`,void 0),J([s()],$.prototype,`assistantName`,void 0),J([s()],$.prototype,`assistantAvatar`,void 0),J([s()],$.prototype,`assistantAvatarSource`,void 0),J([s()],$.prototype,`assistantAvatarStatus`,void 0),J([s()],$.prototype,`assistantAvatarReason`,void 0),J([s()],$.prototype,`assistantAvatarUploadBusy`,void 0),J([s()],$.prototype,`assistantAvatarUploadError`,void 0),J([s()],$.prototype,`assistantAgentId`,void 0),J([s()],$.prototype,`userName`,void 0),J([s()],$.prototype,`userAvatar`,void 0),J([s()],$.prototype,`localMediaPreviewRoots`,void 0),J([s()],$.prototype,`embedSandboxMode`,void 0),J([s()],$.prototype,`allowExternalEmbedUrls`,void 0),J([s()],$.prototype,`chatMessageMaxWidth`,void 0),J([s()],$.prototype,`serverVersion`,void 0),J([s()],$.prototype,`sessionKey`,void 0),J([s()],$.prototype,`chatLoading`,void 0),J([s()],$.prototype,`chatSending`,void 0),J([s()],$.prototype,`chatMessage`,void 0),J([s()],$.prototype,`chatMessages`,void 0),J([s()],$.prototype,`chatToolMessages`,void 0),J([s()],$.prototype,`activityEntries`,void 0),J([s()],$.prototype,`activityFilterText`,void 0),J([s()],$.prototype,`activityStatusFilters`,void 0),J([s()],$.prototype,`activityToolFilter`,void 0),J([s()],$.prototype,`activityExpandedIds`,void 0),J([s()],$.prototype,`activityAutoFollow`,void 0),J([s()],$.prototype,`activityAtBottom`,void 0),J([s()],$.prototype,`chatStreamSegments`,void 0),J([s()],$.prototype,`chatStream`,void 0),J([s()],$.prototype,`chatStreamStartedAt`,void 0),J([s()],$.prototype,`chatRunId`,void 0),J([s()],$.prototype,`chatSideResult`,void 0),J([s()],$.prototype,`compactionStatus`,void 0),J([s()],$.prototype,`fallbackStatus`,void 0),J([s()],$.prototype,`chatRunStatus`,void 0),J([s()],$.prototype,`chatAvatarUrl`,void 0),J([s()],$.prototype,`chatAvatarSource`,void 0),J([s()],$.prototype,`chatAvatarStatus`,void 0),J([s()],$.prototype,`chatAvatarReason`,void 0),J([s()],$.prototype,`chatThinkingLevel`,void 0),J([s()],$.prototype,`chatModelOverrides`,void 0),J([s()],$.prototype,`chatModelSwitchPromises`,void 0),J([s()],$.prototype,`chatModelsLoading`,void 0),J([s()],$.prototype,`chatModelCatalog`,void 0),J([s()],$.prototype,`sessionSwitchNotice`,void 0),J([s()],$.prototype,`sessionSwitchFlashKey`,void 0),J([s()],$.prototype,`chatSessionPickerOpen`,void 0),J([s()],$.prototype,`chatSessionPickerSurface`,void 0),J([s()],$.prototype,`chatSessionPickerQuery`,void 0),J([s()],$.prototype,`chatSessionPickerAppliedQuery`,void 0),J([s()],$.prototype,`chatSessionPickerLoading`,void 0),J([s()],$.prototype,`chatSessionPickerError`,void 0),J([s()],$.prototype,`chatSessionPickerResult`,void 0),J([s()],$.prototype,`chatQueue`,void 0),J([s()],$.prototype,`chatQueueBySession`,void 0),J([s()],$.prototype,`chatAttachments`,void 0),J([s()],$.prototype,`realtimeTalkActive`,void 0),J([s()],$.prototype,`realtimeTalkStatus`,void 0),J([s()],$.prototype,`realtimeTalkDetail`,void 0),J([s()],$.prototype,`realtimeTalkTranscript`,void 0),J([s()],$.prototype,`realtimeTalkConversation`,void 0),J([s()],$.prototype,`realtimeTalkOptionsOpen`,void 0),J([s()],$.prototype,`realtimeTalkOptions`,void 0),J([s()],$.prototype,`chatManualRefreshInFlight`,void 0),J([s()],$.prototype,`chatHeaderControlsHidden`,void 0),J([s()],$.prototype,`chatMobileControlsOpen`,void 0),J([s()],$.prototype,`navDrawerOpen`,void 0),J([s()],$.prototype,`chatInputHistoryIndex`,void 0),J([s()],$.prototype,`sidebarOpen`,void 0),J([s()],$.prototype,`sidebarContent`,void 0),J([s()],$.prototype,`sidebarError`,void 0),J([s()],$.prototype,`splitRatio`,void 0),J([s()],$.prototype,`nodesLoading`,void 0),J([s()],$.prototype,`nodes`,void 0),J([s()],$.prototype,`devicesLoading`,void 0),J([s()],$.prototype,`devicesError`,void 0),J([s()],$.prototype,`devicesList`,void 0),J([s()],$.prototype,`execApprovalsLoading`,void 0),J([s()],$.prototype,`execApprovalsSaving`,void 0),J([s()],$.prototype,`execApprovalsDirty`,void 0),J([s()],$.prototype,`execApprovalsSnapshot`,void 0),J([s()],$.prototype,`execApprovalsForm`,void 0),J([s()],$.prototype,`execApprovalsSelectedAgent`,void 0),J([s()],$.prototype,`execApprovalsTarget`,void 0),J([s()],$.prototype,`execApprovalsTargetNodeId`,void 0),J([s()],$.prototype,`execApprovalQueue`,void 0),J([s()],$.prototype,`execApprovalBusy`,void 0),J([s()],$.prototype,`execApprovalError`,void 0),J([s()],$.prototype,`pendingGatewayUrl`,void 0),J([s()],$.prototype,`configLoading`,void 0),J([s()],$.prototype,`configRaw`,void 0),J([s()],$.prototype,`configRawOriginal`,void 0),J([s()],$.prototype,`configValid`,void 0),J([s()],$.prototype,`configIssues`,void 0),J([s()],$.prototype,`configSaving`,void 0),J([s()],$.prototype,`configApplying`,void 0),J([s()],$.prototype,`updateRunning`,void 0),J([s()],$.prototype,`applySessionKey`,void 0),J([s()],$.prototype,`configSnapshot`,void 0),J([s()],$.prototype,`configSchema`,void 0),J([s()],$.prototype,`configSchemaVersion`,void 0),J([s()],$.prototype,`configSchemaLoading`,void 0),J([s()],$.prototype,`configUiHints`,void 0),J([s()],$.prototype,`configForm`,void 0),J([s()],$.prototype,`configFormOriginal`,void 0),J([s()],$.prototype,`dreamingStatusLoading`,void 0),J([s()],$.prototype,`dreamingStatusError`,void 0),J([s()],$.prototype,`dreamingStatus`,void 0),J([s()],$.prototype,`dreamingModeSaving`,void 0),J([s()],$.prototype,`dreamingRestartConfirmOpen`,void 0),J([s()],$.prototype,`dreamingRestartConfirmLoading`,void 0),J([s()],$.prototype,`dreamingPendingEnabled`,void 0),J([s()],$.prototype,`dreamDiaryLoading`,void 0),J([s()],$.prototype,`dreamDiaryActionLoading`,void 0),J([s()],$.prototype,`dreamDiaryActionMessage`,void 0),J([s()],$.prototype,`dreamDiaryActionArchivePath`,void 0),J([s()],$.prototype,`dreamDiaryError`,void 0),J([s()],$.prototype,`dreamDiaryPath`,void 0),J([s()],$.prototype,`dreamDiaryContent`,void 0),J([s()],$.prototype,`wikiImportInsightsLoading`,void 0),J([s()],$.prototype,`wikiImportInsightsError`,void 0),J([s()],$.prototype,`wikiImportInsights`,void 0),J([s()],$.prototype,`wikiMemoryPalaceLoading`,void 0),J([s()],$.prototype,`wikiMemoryPalaceError`,void 0),J([s()],$.prototype,`wikiMemoryPalace`,void 0),J([s()],$.prototype,`configFormDirty`,void 0),J([s()],$.prototype,`configSettingsMode`,void 0),J([s()],$.prototype,`configFormMode`,void 0),J([s()],$.prototype,`configSearchQuery`,void 0),J([s()],$.prototype,`configActiveSection`,void 0),J([s()],$.prototype,`configActiveSubsection`,void 0),J([s()],$.prototype,`pendingUpdateExpectedVersion`,void 0),J([s()],$.prototype,`updateStatusBanner`,void 0),J([s()],$.prototype,`communicationsFormMode`,void 0),J([s()],$.prototype,`communicationsSearchQuery`,void 0),J([s()],$.prototype,`communicationsActiveSection`,void 0),J([s()],$.prototype,`communicationsActiveSubsection`,void 0),J([s()],$.prototype,`appearanceFormMode`,void 0),J([s()],$.prototype,`appearanceSearchQuery`,void 0),J([s()],$.prototype,`appearanceActiveSection`,void 0),J([s()],$.prototype,`appearanceActiveSubsection`,void 0),J([s()],$.prototype,`automationFormMode`,void 0),J([s()],$.prototype,`automationSearchQuery`,void 0),J([s()],$.prototype,`automationActiveSection`,void 0),J([s()],$.prototype,`automationActiveSubsection`,void 0),J([s()],$.prototype,`infrastructureFormMode`,void 0),J([s()],$.prototype,`infrastructureSearchQuery`,void 0),J([s()],$.prototype,`infrastructureActiveSection`,void 0),J([s()],$.prototype,`infrastructureActiveSubsection`,void 0),J([s()],$.prototype,`aiAgentsFormMode`,void 0),J([s()],$.prototype,`aiAgentsSearchQuery`,void 0),J([s()],$.prototype,`aiAgentsActiveSection`,void 0),J([s()],$.prototype,`aiAgentsActiveSubsection`,void 0),J([s()],$.prototype,`channelsLoading`,void 0),J([s()],$.prototype,`channelsSnapshot`,void 0),J([s()],$.prototype,`channelsError`,void 0),J([s()],$.prototype,`channelsLastSuccess`,void 0),J([s()],$.prototype,`presenceLoading`,void 0),J([s()],$.prototype,`presenceEntries`,void 0),J([s()],$.prototype,`presenceError`,void 0),J([s()],$.prototype,`presenceStatus`,void 0),J([s()],$.prototype,`agentsLoading`,void 0),J([s()],$.prototype,`agentsList`,void 0),J([s()],$.prototype,`agentsError`,void 0),J([s()],$.prototype,`agentsSelectedId`,void 0),J([s()],$.prototype,`toolsCatalogLoading`,void 0),J([s()],$.prototype,`toolsCatalogError`,void 0),J([s()],$.prototype,`toolsCatalogResult`,void 0),J([s()],$.prototype,`toolsEffectiveLoading`,void 0),J([s()],$.prototype,`toolsEffectiveLoadingKey`,void 0),J([s()],$.prototype,`toolsEffectiveResultKey`,void 0),J([s()],$.prototype,`toolsEffectiveError`,void 0),J([s()],$.prototype,`toolsEffectiveResult`,void 0),J([s()],$.prototype,`agentsPanel`,void 0),J([s()],$.prototype,`agentFilesLoading`,void 0),J([s()],$.prototype,`agentFilesError`,void 0),J([s()],$.prototype,`agentFilesList`,void 0),J([s()],$.prototype,`agentFileContents`,void 0),J([s()],$.prototype,`agentFileDrafts`,void 0),J([s()],$.prototype,`agentFileActive`,void 0),J([s()],$.prototype,`agentFileSaving`,void 0),J([s()],$.prototype,`agentIdentityLoading`,void 0),J([s()],$.prototype,`agentIdentityError`,void 0),J([s()],$.prototype,`agentIdentityById`,void 0),J([s()],$.prototype,`agentSkillsLoading`,void 0),J([s()],$.prototype,`agentSkillsError`,void 0),J([s()],$.prototype,`agentSkillsReport`,void 0),J([s()],$.prototype,`agentSkillsAgentId`,void 0),J([s()],$.prototype,`sessionsLoading`,void 0),J([s()],$.prototype,`sessionsResult`,void 0),J([s()],$.prototype,`sessionsError`,void 0),J([s()],$.prototype,`sessionsFilterActive`,void 0),J([s()],$.prototype,`sessionsFilterLimit`,void 0),J([s()],$.prototype,`sessionsIncludeGlobal`,void 0),J([s()],$.prototype,`sessionsIncludeUnknown`,void 0),J([s()],$.prototype,`sessionsShowArchived`,void 0),J([s()],$.prototype,`sessionsFiltersCollapsed`,void 0),J([s()],$.prototype,`sessionsHideCron`,void 0),J([s()],$.prototype,`sessionsSearchQuery`,void 0),J([s()],$.prototype,`sessionsSortColumn`,void 0),J([s()],$.prototype,`sessionsSortDir`,void 0),J([s()],$.prototype,`sessionsPage`,void 0),J([s()],$.prototype,`sessionsPageSize`,void 0),J([s()],$.prototype,`sessionsSelectedKeys`,void 0),J([s()],$.prototype,`sessionsExpandedCheckpointKey`,void 0),J([s()],$.prototype,`sessionsCheckpointItemsByKey`,void 0),J([s()],$.prototype,`sessionsCheckpointLoadingKey`,void 0),J([s()],$.prototype,`sessionsCheckpointBusyKey`,void 0),J([s()],$.prototype,`sessionsCheckpointErrorByKey`,void 0),J([s()],$.prototype,`usageLoading`,void 0),J([s()],$.prototype,`usageResult`,void 0),J([s()],$.prototype,`usageCostSummary`,void 0),J([s()],$.prototype,`usageError`,void 0),J([s()],$.prototype,`usageStartDate`,void 0),J([s()],$.prototype,`usageEndDate`,void 0),J([s()],$.prototype,`usageScope`,void 0),J([s()],$.prototype,`usageAgentId`,void 0),J([s()],$.prototype,`usageSelectedSessions`,void 0),J([s()],$.prototype,`usageSelectedDays`,void 0),J([s()],$.prototype,`usageSelectedHours`,void 0),J([s()],$.prototype,`usageChartMode`,void 0),J([s()],$.prototype,`usageDailyChartMode`,void 0),J([s()],$.prototype,`usageTimeSeriesMode`,void 0),J([s()],$.prototype,`usageTimeSeriesBreakdownMode`,void 0),J([s()],$.prototype,`usageTimeSeries`,void 0),J([s()],$.prototype,`usageTimeSeriesLoading`,void 0),J([s()],$.prototype,`usageTimeSeriesCursorStart`,void 0),J([s()],$.prototype,`usageTimeSeriesCursorEnd`,void 0),J([s()],$.prototype,`usageSessionLogs`,void 0),J([s()],$.prototype,`usageSessionLogsLoading`,void 0),J([s()],$.prototype,`usageSessionLogsExpanded`,void 0),J([s()],$.prototype,`usageQuery`,void 0),J([s()],$.prototype,`usageQueryDraft`,void 0),J([s()],$.prototype,`usageSessionSort`,void 0),J([s()],$.prototype,`usageSessionSortDir`,void 0),J([s()],$.prototype,`usageRecentSessions`,void 0),J([s()],$.prototype,`usageTimeZone`,void 0),J([s()],$.prototype,`usageContextExpanded`,void 0),J([s()],$.prototype,`usageHeaderPinned`,void 0),J([s()],$.prototype,`usageSessionsTab`,void 0),J([s()],$.prototype,`usageVisibleColumns`,void 0),J([s()],$.prototype,`usageLogFilterRoles`,void 0),J([s()],$.prototype,`usageLogFilterTools`,void 0),J([s()],$.prototype,`usageLogFilterHasTools`,void 0),J([s()],$.prototype,`usageLogFilterQuery`,void 0),J([s()],$.prototype,`cronLoading`,void 0),J([s()],$.prototype,`cronQuickCreateOpen`,void 0),J([s()],$.prototype,`cronQuickCreateStep`,void 0),J([s()],$.prototype,`cronQuickCreateDraft`,void 0),J([s()],$.prototype,`cronJobsLoadingMore`,void 0),J([s()],$.prototype,`cronJobs`,void 0),J([s()],$.prototype,`cronJobsTotal`,void 0),J([s()],$.prototype,`cronJobsHasMore`,void 0),J([s()],$.prototype,`cronJobsNextOffset`,void 0),J([s()],$.prototype,`cronJobsLimit`,void 0),J([s()],$.prototype,`cronJobsQuery`,void 0),J([s()],$.prototype,`cronJobsEnabledFilter`,void 0),J([s()],$.prototype,`cronJobsScheduleKindFilter`,void 0),J([s()],$.prototype,`cronJobsLastStatusFilter`,void 0),J([s()],$.prototype,`cronJobsSortBy`,void 0),J([s()],$.prototype,`cronJobsSortDir`,void 0),J([s()],$.prototype,`cronStatus`,void 0),J([s()],$.prototype,`cronError`,void 0),J([s()],$.prototype,`cronForm`,void 0),J([s()],$.prototype,`cronFormCollapsed`,void 0),J([s()],$.prototype,`cronFieldErrors`,void 0),J([s()],$.prototype,`cronEditingJobId`,void 0),J([s()],$.prototype,`cronRunsJobId`,void 0),J([s()],$.prototype,`cronRunsLoadingMore`,void 0),J([s()],$.prototype,`cronRuns`,void 0),J([s()],$.prototype,`cronRunsTotal`,void 0),J([s()],$.prototype,`cronRunsHasMore`,void 0),J([s()],$.prototype,`cronRunsNextOffset`,void 0),J([s()],$.prototype,`cronRunsLimit`,void 0),J([s()],$.prototype,`cronRunsScope`,void 0),J([s()],$.prototype,`cronRunsStatuses`,void 0),J([s()],$.prototype,`cronRunsDeliveryStatuses`,void 0),J([s()],$.prototype,`cronRunsStatusFilter`,void 0),J([s()],$.prototype,`cronRunsQuery`,void 0),J([s()],$.prototype,`cronRunsSortDir`,void 0),J([s()],$.prototype,`cronModelSuggestions`,void 0),J([s()],$.prototype,`cronBusy`,void 0),J([s()],$.prototype,`updateAvailable`,void 0),J([s()],$.prototype,`attentionItems`,void 0),J([s()],$.prototype,`paletteOpen`,void 0),J([s()],$.prototype,`paletteQuery`,void 0),J([s()],$.prototype,`paletteActiveIndex`,void 0),J([s()],$.prototype,`overviewShowGatewayToken`,void 0),J([s()],$.prototype,`overviewShowGatewayPassword`,void 0),J([s()],$.prototype,`overviewLogLines`,void 0),J([s()],$.prototype,`overviewLogCursor`,void 0),J([s()],$.prototype,`skillsLoading`,void 0),J([s()],$.prototype,`skillsReport`,void 0),J([s()],$.prototype,`skillsError`,void 0),J([s()],$.prototype,`skillsFilter`,void 0),J([s()],$.prototype,`skillsStatusFilter`,void 0),J([s()],$.prototype,`skillEdits`,void 0),J([s()],$.prototype,`skillsBusyKey`,void 0),J([s()],$.prototype,`skillMessages`,void 0),J([s()],$.prototype,`skillsDetailKey`,void 0),J([s()],$.prototype,`skillsDetailTab`,void 0),J([s()],$.prototype,`clawhubSearchQuery`,void 0),J([s()],$.prototype,`clawhubSearchResults`,void 0),J([s()],$.prototype,`clawhubSearchLoading`,void 0),J([s()],$.prototype,`clawhubSearchError`,void 0),J([s()],$.prototype,`clawhubDetail`,void 0),J([s()],$.prototype,`clawhubDetailSlug`,void 0),J([s()],$.prototype,`clawhubDetailLoading`,void 0),J([s()],$.prototype,`clawhubDetailError`,void 0),J([s()],$.prototype,`clawhubInstallSlug`,void 0),J([s()],$.prototype,`clawhubInstallMessage`,void 0),J([s()],$.prototype,`clawhubVerdicts`,void 0),J([s()],$.prototype,`clawhubVerdictsLoading`,void 0),J([s()],$.prototype,`clawhubVerdictsError`,void 0),J([s()],$.prototype,`skillCardContents`,void 0),J([s()],$.prototype,`skillCardContentKeys`,void 0),J([s()],$.prototype,`skillCardLoadingKey`,void 0),J([s()],$.prototype,`skillCardErrors`,void 0),J([s()],$.prototype,`healthLoading`,void 0),J([s()],$.prototype,`healthResult`,void 0),J([s()],$.prototype,`healthError`,void 0),J([s()],$.prototype,`modelAuthStatusLoading`,void 0),J([s()],$.prototype,`modelAuthStatusResult`,void 0),J([s()],$.prototype,`modelAuthStatusError`,void 0),J([s()],$.prototype,`debugLoading`,void 0),J([s()],$.prototype,`debugStatus`,void 0),J([s()],$.prototype,`debugHealth`,void 0),J([s()],$.prototype,`debugModels`,void 0),J([s()],$.prototype,`debugHeartbeat`,void 0),J([s()],$.prototype,`debugCallMethod`,void 0),J([s()],$.prototype,`debugCallParams`,void 0),J([s()],$.prototype,`debugCallResult`,void 0),J([s()],$.prototype,`debugCallError`,void 0),J([s()],$.prototype,`webPushSupported`,void 0),J([s()],$.prototype,`webPushPermission`,void 0),J([s()],$.prototype,`webPushSubscribed`,void 0),J([s()],$.prototype,`webPushLoading`,void 0),J([s()],$.prototype,`logsLoading`,void 0),J([s()],$.prototype,`logsError`,void 0),J([s()],$.prototype,`logsFile`,void 0),J([s()],$.prototype,`logsEntries`,void 0),J([s()],$.prototype,`logsFilterText`,void 0),J([s()],$.prototype,`logsLevelFilters`,void 0),J([s()],$.prototype,`logsAutoFollow`,void 0),J([s()],$.prototype,`logsTruncated`,void 0),J([s()],$.prototype,`logsCursor`,void 0),J([s()],$.prototype,`logsLastFetchAt`,void 0),J([s()],$.prototype,`logsLimit`,void 0),J([s()],$.prototype,`logsMaxBytes`,void 0),J([s()],$.prototype,`logsAtBottom`,void 0),J([s()],$.prototype,`chatNewMessagesBelow`,void 0),customElements.get(`fengming-app`)||customElements.define(`fengming-app`,$),`serviceWorker`in navigator){let e=new URL(`./sw.js`,window.location.href);e.searchParams.set(`v`,`0.3.3-510c148491f0`),navigator.serviceWorker.register(e,{updateViaCache:`none`})}export{Pa as $,Hx as A,Da as B,Tx as C,Wx as D,Gx as E,yc as F,Ja as G,Ua as H,vc as I,Va as J,ga as K,_c as L,L_ as M,F_ as N,$x as O,Yu as P,Ma as Q,wc as R,tS as S,hx as T,Oa as U,Aa as V,qa as W,ja as X,ka as Y,Fa as Z,dD as _,ZB as a,rn as at,qx as b,XB as c,tn as ct,RM as d,Ya as et,zM as f,_D as g,sk as h,QB as i,mi as it,ky as j,eS as k,nR as l,Ue as lt,ck as m,eV as n,ma as nt,YB as o,$t as ot,LM as p,Na as q,$B as r,Li as rt,JB as s,nn as st,hV as t,ha as tt,RL as u,q as v,ix as w,Kx as x,Rb as y,Xo as z};
|
|
7214
|
+
//# sourceMappingURL=index-bZJJ7U8q.js.map
|