@xopcai/xopc 0.0.29 → 0.0.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/extensions/telegram/src/adapters/config-surface.js +3 -1
- package/dist/extensions/telegram/src/adapters/config-surface.js.map +1 -1
- package/dist/extensions/telegram/src/adapters/onboard-cli.js +23 -21
- package/dist/extensions/telegram/src/adapters/onboard-cli.js.map +1 -1
- package/dist/extensions/telegram/src/adapters/setup-wizard.js +3 -4
- package/dist/extensions/telegram/src/adapters/setup-wizard.js.map +1 -1
- package/dist/extensions/telegram/src/config-schema.d.ts +0 -1
- package/dist/extensions/telegram/src/config-schema.js +17 -4
- package/dist/extensions/telegram/src/config-schema.js.map +1 -1
- package/dist/extensions/telegram/src/plugin.js +4 -17
- package/dist/extensions/telegram/src/plugin.js.map +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/extensions/weixin/src/cdn/upload.js +1 -1
- package/dist/extensions/weixin/src/media/data-url.js +1 -1
- package/dist/extensions/weixin/src/messaging/process-message.js +1 -1
- package/dist/gateway/static/root/assets/agents-3u63Fw2Y.js +216 -0
- package/dist/gateway/static/root/assets/agents-3u63Fw2Y.js.map +1 -0
- package/dist/gateway/static/root/assets/{apps-page-Bmq19MS-.js → apps-page-CWegY6Kp.js} +2 -2
- package/dist/gateway/static/root/assets/{apps-page-Bmq19MS-.js.map → apps-page-CWegY6Kp.js.map} +1 -1
- package/dist/gateway/static/root/assets/channels-settings-CiyeXcTK.js +9 -0
- package/dist/gateway/static/root/assets/channels-settings-CiyeXcTK.js.map +1 -0
- package/dist/gateway/static/root/assets/cron-api-_j_79Zf5.js +3 -0
- package/dist/gateway/static/root/assets/cron-api-_j_79Zf5.js.map +1 -0
- package/dist/gateway/static/root/assets/cron-page-S86YNTtI.js +2 -0
- package/dist/gateway/static/root/assets/cron-page-S86YNTtI.js.map +1 -0
- package/dist/gateway/static/root/assets/dist-D0jxbvuz.js +2 -0
- package/dist/gateway/static/root/assets/{dist--p2HQ2QF.js.map → dist-D0jxbvuz.js.map} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-DwHCB_6T.js → extension-debug-page-DB630cW8.js} +2 -2
- package/dist/gateway/static/root/assets/{extension-debug-page-DwHCB_6T.js.map → extension-debug-page-DB630cW8.js.map} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-BsYwQIex.js → extension-page-CnoPUBul.js} +2 -2
- package/dist/gateway/static/root/assets/{extension-page-BsYwQIex.js.map → extension-page-CnoPUBul.js.map} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-nsisEgjB.js → extension-settings-page-BsiOkvBe.js} +2 -2
- package/dist/gateway/static/root/assets/{extension-settings-page-nsisEgjB.js.map → extension-settings-page-BsiOkvBe.js.map} +1 -1
- package/dist/gateway/static/root/assets/{index-CR8zUHGR.js → index-DHLmAIQl.js} +63 -63
- package/dist/gateway/static/root/assets/{index-CR8zUHGR.js.map → index-DHLmAIQl.js.map} +1 -1
- package/dist/gateway/static/root/assets/index-DoPwy4aU.css +1 -0
- package/dist/gateway/static/root/assets/logs-page-Bndhenn2.js +2 -0
- package/dist/gateway/static/root/assets/logs-page-Bndhenn2.js.map +1 -0
- package/dist/gateway/static/root/assets/sessions-page-Q201-_lP.js +2 -0
- package/dist/gateway/static/root/assets/{sessions-page-Be5kIGl_.js.map → sessions-page-Q201-_lP.js.map} +1 -1
- package/dist/gateway/static/root/assets/settings-page-Cw75fpc6.js +2 -0
- package/dist/gateway/static/root/assets/settings-page-Cw75fpc6.js.map +1 -0
- package/dist/gateway/static/root/assets/skills-page-CVwEzD_J.js +3 -0
- package/dist/gateway/static/root/assets/skills-page-CVwEzD_J.js.map +1 -0
- package/dist/gateway/static/root/index.html +2 -2
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-manager.d.ts +5 -7
- package/dist/src/agent/agent-manager.js +21 -19
- package/dist/src/agent/agent-manager.js.map +1 -1
- package/dist/src/agent/ipc/inbox.js +4 -2
- package/dist/src/agent/ipc/inbox.js.map +1 -1
- package/dist/src/agent/memory/dreaming/short-term-store.js +1 -1
- package/dist/src/agent/memory/dreaming/utils.js +1 -1
- package/dist/src/agent/orchestration/agent-orchestrator.js +1 -1
- package/dist/src/agent/prompt/service-prompt-builder.js +0 -2
- package/dist/src/agent/prompt/service-prompt-builder.js.map +1 -1
- package/dist/src/agent/prompt/system-prompt.d.ts +0 -2
- package/dist/src/agent/prompt/system-prompt.js +3 -17
- package/dist/src/agent/prompt/system-prompt.js.map +1 -1
- package/dist/src/agent/service/btw-query.d.ts +16 -0
- package/dist/src/agent/service/btw-query.js +88 -0
- package/dist/src/agent/service/btw-query.js.map +1 -0
- package/dist/src/agent/service/build-direct-message-content.d.ts +30 -0
- package/dist/src/agent/service/build-direct-message-content.js +75 -0
- package/dist/src/agent/service/build-direct-message-content.js.map +1 -0
- package/dist/src/agent/service/parse-outbound-session-key.d.ts +8 -0
- package/dist/src/agent/service/parse-outbound-session-key.js +41 -0
- package/dist/src/agent/service/parse-outbound-session-key.js.map +1 -0
- package/dist/src/agent/service/process-direct-one-shot.d.ts +34 -0
- package/dist/src/agent/service/process-direct-one-shot.js +67 -0
- package/dist/src/agent/service/process-direct-one-shot.js.map +1 -0
- package/dist/src/agent/service/process-direct-streaming.js +12 -1
- package/dist/src/agent/service/process-direct-streaming.js.map +1 -1
- package/dist/src/agent/service/reconcile-dreaming-cron.d.ts +6 -0
- package/dist/src/agent/service/reconcile-dreaming-cron.js +70 -0
- package/dist/src/agent/service/reconcile-dreaming-cron.js.map +1 -0
- package/dist/src/agent/service/session-context-report.d.ts +19 -0
- package/dist/src/agent/service/session-context-report.js +47 -0
- package/dist/src/agent/service/session-context-report.js.map +1 -0
- package/dist/src/agent/service/webchat-tts.d.ts +28 -0
- package/dist/src/agent/service/webchat-tts.js +73 -0
- package/dist/src/agent/service/webchat-tts.js.map +1 -0
- package/dist/src/agent/service.d.ts +8 -12
- package/dist/src/agent/service.js +74 -379
- package/dist/src/agent/service.js.map +1 -1
- package/dist/src/agent/skills/config.js +4 -3
- package/dist/src/agent/skills/config.js.map +1 -1
- package/dist/src/agent/skills/format-skills-prompt.d.ts +0 -2
- package/dist/src/agent/skills/format-skills-prompt.js +3 -24
- package/dist/src/agent/skills/format-skills-prompt.js.map +1 -1
- package/dist/src/agent/skills/hub-lock.js +4 -5
- package/dist/src/agent/skills/hub-lock.js.map +1 -1
- package/dist/src/agent/skills/index.js +9 -21
- package/dist/src/agent/skills/index.js.map +1 -1
- package/dist/src/agent/skills/marketplace/adapter.types.d.ts +17 -0
- package/dist/src/agent/skills/marketplace/adapter.types.js +1 -0
- package/dist/src/agent/skills/marketplace/adapters/skillhub/adapter.d.ts +2 -0
- package/dist/src/agent/skills/marketplace/adapters/skillhub/adapter.js +292 -0
- package/dist/src/agent/skills/marketplace/adapters/skillhub/adapter.js.map +1 -0
- package/dist/src/agent/skills/marketplace/adapters/skillhub/ecosystem-client.d.ts +73 -0
- package/dist/src/agent/skills/marketplace/adapters/skillhub/ecosystem-client.js +200 -0
- package/dist/src/agent/skills/marketplace/adapters/skillhub/ecosystem-client.js.map +1 -0
- package/dist/src/agent/skills/marketplace/adapters/skillhub/registry-client.d.ts +137 -0
- package/dist/src/agent/skills/marketplace/adapters/skillhub/registry-client.js +217 -0
- package/dist/src/agent/skills/marketplace/adapters/skillhub/registry-client.js.map +1 -0
- package/dist/src/agent/skills/marketplace/adapters/skillhub/skillhub-fetch-cache.d.ts +12 -0
- package/dist/src/agent/skills/marketplace/adapters/skillhub/skillhub-fetch-cache.js +90 -0
- package/dist/src/agent/skills/marketplace/adapters/skillhub/skillhub-fetch-cache.js.map +1 -0
- package/dist/src/agent/skills/marketplace/adapters/store/adapter.d.ts +2 -0
- package/dist/src/agent/skills/marketplace/adapters/store/adapter.js +35 -0
- package/dist/src/agent/skills/marketplace/adapters/store/adapter.js.map +1 -0
- package/dist/src/agent/skills/marketplace/adapters/store/store-api-client.d.ts +124 -0
- package/dist/src/agent/skills/{skills-store-client.js → marketplace/adapters/store/store-api-client.js} +4 -3
- package/dist/src/agent/skills/marketplace/adapters/store/store-api-client.js.map +1 -0
- package/dist/src/agent/skills/marketplace/resolve-adapter.d.ts +6 -0
- package/dist/src/agent/skills/marketplace/resolve-adapter.js +26 -0
- package/dist/src/agent/skills/marketplace/resolve-adapter.js.map +1 -0
- package/dist/src/agent/skills/parse-skill-metadata.d.ts +5 -0
- package/dist/src/agent/skills/parse-skill-metadata.js +27 -0
- package/dist/src/agent/skills/parse-skill-metadata.js.map +1 -0
- package/dist/src/agent/skills/skill-markdown-preview-from-raw.d.ts +6 -0
- package/dist/src/agent/skills/skill-markdown-preview-from-raw.js +64 -0
- package/dist/src/agent/skills/skill-markdown-preview-from-raw.js.map +1 -0
- package/dist/src/agent/skills/skill-view-path.d.ts +17 -1
- package/dist/src/agent/skills/skill-view-path.js +66 -3
- package/dist/src/agent/skills/skill-view-path.js.map +1 -1
- package/dist/src/agent/skills/skills-marketplace.d.ts +21 -0
- package/dist/src/agent/skills/skills-marketplace.js +18 -0
- package/dist/src/agent/skills/skills-marketplace.js.map +1 -0
- package/dist/src/agent/skills/test-framework.d.ts +0 -1
- package/dist/src/agent/skills/test-framework.js +2 -20
- package/dist/src/agent/skills/test-framework.js.map +1 -1
- package/dist/src/agent/skills/types.d.ts +12 -6
- package/dist/src/agent/tools/dreaming-tool.js +1 -1
- package/dist/src/agent/tools/image-generate-tool.js +2 -2
- package/dist/src/auth/credentials.js +8 -6
- package/dist/src/auth/credentials.js.map +1 -1
- package/dist/src/auth/profiles/store.js +5 -3
- package/dist/src/auth/profiles/store.js.map +1 -1
- package/dist/src/channels/manager.js +1 -1
- package/dist/src/channels/outbound/persist-store.js +4 -4
- package/dist/src/channels/outbound/persist-store.js.map +1 -1
- package/dist/src/cli/commands/config.js +8 -6
- package/dist/src/cli/commands/config.js.map +1 -1
- package/dist/src/cli/commands/doctor/checks/channel-config.js +3 -4
- package/dist/src/cli/commands/doctor/checks/channel-config.js.map +1 -1
- package/dist/src/cli/commands/init.js +4 -2
- package/dist/src/cli/commands/init.js.map +1 -1
- package/dist/src/config/loader.js +3 -1
- package/dist/src/config/loader.js.map +1 -1
- package/dist/src/config/models-json.js +4 -5
- package/dist/src/config/models-json.js.map +1 -1
- package/dist/src/config/schema.d.ts +12 -4
- package/dist/src/config/schema.js +31 -5
- package/dist/src/config/schema.js.map +1 -1
- package/dist/src/cron/persistence.d.ts +1 -3
- package/dist/src/cron/persistence.js +6 -17
- package/dist/src/cron/persistence.js.map +1 -1
- package/dist/src/cron/validation.js +1 -1
- package/dist/src/cron/validation.js.map +1 -1
- package/dist/src/extensions/activation-context.js +0 -1
- package/dist/src/extensions/activation-context.js.map +1 -1
- package/dist/src/extensions/lockfile.js +4 -2
- package/dist/src/extensions/lockfile.js.map +1 -1
- package/dist/src/gateway/auth.d.ts +0 -9
- package/dist/src/gateway/auth.js +1 -12
- package/dist/src/gateway/auth.js.map +1 -1
- package/dist/src/gateway/hono/lib/config-payload.d.ts +1 -1
- package/dist/src/gateway/hono/lib/extension-store.js +4 -4
- package/dist/src/gateway/hono/lib/extension-store.js.map +1 -1
- package/dist/src/gateway/hono/routes/channels.js +5 -3
- package/dist/src/gateway/hono/routes/channels.js.map +1 -1
- package/dist/src/gateway/hono/routes/commands-skills.js +28 -3
- package/dist/src/gateway/hono/routes/commands-skills.js.map +1 -1
- package/dist/src/gateway/hono/routes/config.js +23 -2
- package/dist/src/gateway/hono/routes/config.js.map +1 -1
- package/dist/src/gateway/hono/routes/sessions.js +124 -2
- package/dist/src/gateway/hono/routes/sessions.js.map +1 -1
- package/dist/src/gateway/hono/sse.js +9 -2
- package/dist/src/gateway/hono/sse.js.map +1 -1
- package/dist/src/gateway/index.js +2 -2
- package/dist/src/gateway/lock.js +1 -1
- package/dist/src/gateway/service/run-gateway-agent.d.ts +37 -0
- package/dist/src/gateway/service/run-gateway-agent.js +163 -0
- package/dist/src/gateway/service/run-gateway-agent.js.map +1 -0
- package/dist/src/gateway/service/save-webchat-user-message.d.ts +9 -0
- package/dist/src/gateway/service/save-webchat-user-message.js +34 -0
- package/dist/src/gateway/service/save-webchat-user-message.js.map +1 -0
- package/dist/src/gateway/service/session-chat-ids.d.ts +9 -0
- package/dist/src/gateway/service/session-chat-ids.js +33 -0
- package/dist/src/gateway/service/session-chat-ids.js.map +1 -0
- package/dist/src/gateway/service/sse-hub.d.ts +10 -0
- package/dist/src/gateway/service/sse-hub.js +55 -0
- package/dist/src/gateway/service/sse-hub.js.map +1 -0
- package/dist/src/gateway/service/types.d.ts +9 -0
- package/dist/src/gateway/service/types.js +1 -0
- package/dist/src/gateway/service.d.ts +42 -33
- package/dist/src/gateway/service.js +92 -246
- package/dist/src/gateway/service.js.map +1 -1
- package/dist/src/infra/update-lock.js +4 -2
- package/dist/src/infra/update-lock.js.map +1 -1
- package/dist/src/infra/update-startup.js +5 -14
- package/dist/src/infra/update-startup.js.map +1 -1
- package/dist/src/infra/write-file-atomic.d.ts +18 -0
- package/dist/src/infra/write-file-atomic.js +115 -0
- package/dist/src/infra/write-file-atomic.js.map +1 -0
- package/dist/src/session/abort-cutoff.d.ts +6 -0
- package/dist/src/session/abort-cutoff.js +10 -0
- package/dist/src/session/abort-cutoff.js.map +1 -0
- package/dist/src/session/compaction-checkpoints.d.ts +8 -0
- package/dist/src/session/compaction-checkpoints.js +21 -0
- package/dist/src/session/compaction-checkpoints.js.map +1 -0
- package/dist/src/session/config-store.js +4 -2
- package/dist/src/session/config-store.js.map +1 -1
- package/dist/src/session/index.d.ts +8 -1
- package/dist/src/session/index.js +7 -1
- package/dist/src/session/manager.d.ts +26 -1
- package/dist/src/session/manager.js +39 -2
- package/dist/src/session/manager.js.map +1 -1
- package/dist/src/session/patch-metadata.d.ts +12 -0
- package/dist/src/session/patch-metadata.js +23 -0
- package/dist/src/session/patch-metadata.js.map +1 -0
- package/dist/src/session/search-index.d.ts +2 -0
- package/dist/src/session/search-index.js +30 -2
- package/dist/src/session/search-index.js.map +1 -1
- package/dist/src/session/session-context-for-llm.d.ts +32 -0
- package/dist/src/session/session-context-for-llm.js +60 -0
- package/dist/src/session/session-context-for-llm.js.map +1 -0
- package/dist/src/session/store.d.ts +53 -2
- package/dist/src/session/store.js +427 -145
- package/dist/src/session/store.js.map +1 -1
- package/dist/src/session/strip-webchat-early-save.d.ts +5 -0
- package/dist/src/session/strip-webchat-early-save.js +17 -0
- package/dist/src/session/strip-webchat-early-save.js.map +1 -0
- package/dist/src/session/transcript-format.d.ts +46 -0
- package/dist/src/session/transcript-format.js +88 -0
- package/dist/src/session/transcript-format.js.map +1 -0
- package/dist/src/session/types.d.ts +37 -0
- package/dist/src/session/types.js.map +1 -1
- package/dist/src/utils/logger/log-store.js +4 -3
- package/dist/src/utils/logger/log-store.js.map +1 -1
- package/dist/src/voice/tts/merge-config.js +0 -1
- package/dist/src/voice/tts/merge-config.js.map +1 -1
- package/dist/src/voice/tts/service.js +1 -2
- package/dist/src/voice/tts/service.js.map +1 -1
- package/package.json +1 -1
- package/skills/business/company-values/SKILL-zh.md +80 -0
- package/skills/business/company-values/SKILL.md +80 -0
- package/skills/business/find-community/SKILL-zh.md +50 -0
- package/skills/business/find-community/SKILL.md +50 -0
- package/skills/business/first-customers/SKILL-zh.md +76 -0
- package/skills/business/first-customers/SKILL.md +76 -0
- package/skills/business/grow-sustainably/SKILL-zh.md +92 -0
- package/skills/business/grow-sustainably/SKILL.md +92 -0
- package/skills/business/marketing-plan/SKILL-zh.md +100 -0
- package/skills/business/marketing-plan/SKILL.md +100 -0
- package/skills/business/minimalist-review/SKILL-zh.md +82 -0
- package/skills/business/minimalist-review/SKILL.md +82 -0
- package/skills/business/mvp/SKILL-zh.md +81 -0
- package/skills/business/mvp/SKILL.md +81 -0
- package/skills/business/pricing/SKILL-zh.md +64 -0
- package/skills/business/pricing/SKILL.md +64 -0
- package/skills/business/processize/SKILL-zh.md +91 -0
- package/skills/business/processize/SKILL.md +91 -0
- package/skills/business/validate-idea/SKILL-zh.md +68 -0
- package/skills/business/validate-idea/SKILL.md +68 -0
- package/skills/{skill-creator → creative/algorithmic-art}/LICENSE.txt +1 -1
- package/skills/creative/algorithmic-art/SKILL-zh.md +405 -0
- package/skills/creative/algorithmic-art/SKILL.md +405 -0
- package/skills/creative/algorithmic-art/templates/generator_template.js +223 -0
- package/skills/creative/algorithmic-art/templates/viewer.html +599 -0
- package/skills/creative/canvas-design/LICENSE.txt +202 -0
- package/skills/creative/canvas-design/SKILL-zh.md +130 -0
- package/skills/creative/canvas-design/SKILL.md +130 -0
- package/skills/creative/canvas-design/canvas-fonts/ArsenalSC-OFL.txt +93 -0
- package/skills/creative/canvas-design/canvas-fonts/ArsenalSC-Regular.ttf +0 -0
- package/skills/creative/canvas-design/canvas-fonts/BigShoulders-Bold.ttf +0 -0
- package/skills/creative/canvas-design/canvas-fonts/BigShoulders-OFL.txt +93 -0
- package/skills/creative/canvas-design/canvas-fonts/BigShoulders-Regular.ttf +0 -0
- package/skills/creative/canvas-design/canvas-fonts/Boldonse-OFL.txt +93 -0
- package/skills/creative/canvas-design/canvas-fonts/Boldonse-Regular.ttf +0 -0
- package/skills/creative/canvas-design/canvas-fonts/BricolageGrotesque-Bold.ttf +0 -0
- package/skills/creative/canvas-design/canvas-fonts/BricolageGrotesque-OFL.txt +93 -0
- package/skills/creative/canvas-design/canvas-fonts/BricolageGrotesque-Regular.ttf +0 -0
- package/skills/creative/canvas-design/canvas-fonts/CrimsonPro-Bold.ttf +0 -0
- package/skills/creative/canvas-design/canvas-fonts/CrimsonPro-Italic.ttf +0 -0
- package/skills/creative/canvas-design/canvas-fonts/CrimsonPro-OFL.txt +93 -0
- package/skills/creative/canvas-design/canvas-fonts/CrimsonPro-Regular.ttf +0 -0
- package/skills/creative/canvas-design/canvas-fonts/DMMono-OFL.txt +93 -0
- package/skills/creative/canvas-design/canvas-fonts/DMMono-Regular.ttf +0 -0
- package/skills/creative/canvas-design/canvas-fonts/EricaOne-OFL.txt +94 -0
- package/skills/creative/canvas-design/canvas-fonts/EricaOne-Regular.ttf +0 -0
- package/skills/creative/canvas-design/canvas-fonts/GeistMono-Bold.ttf +0 -0
- package/skills/creative/canvas-design/canvas-fonts/GeistMono-OFL.txt +93 -0
- package/skills/creative/canvas-design/canvas-fonts/GeistMono-Regular.ttf +0 -0
- package/skills/creative/canvas-design/canvas-fonts/Gloock-OFL.txt +93 -0
- package/skills/creative/canvas-design/canvas-fonts/Gloock-Regular.ttf +0 -0
- package/skills/creative/canvas-design/canvas-fonts/IBMPlexMono-Bold.ttf +0 -0
- package/skills/creative/canvas-design/canvas-fonts/IBMPlexMono-OFL.txt +93 -0
- package/skills/creative/canvas-design/canvas-fonts/IBMPlexMono-Regular.ttf +0 -0
- package/skills/creative/canvas-design/canvas-fonts/IBMPlexSerif-Bold.ttf +0 -0
- package/skills/creative/canvas-design/canvas-fonts/IBMPlexSerif-BoldItalic.ttf +0 -0
- package/skills/creative/canvas-design/canvas-fonts/IBMPlexSerif-Italic.ttf +0 -0
- package/skills/creative/canvas-design/canvas-fonts/IBMPlexSerif-Regular.ttf +0 -0
- package/skills/creative/canvas-design/canvas-fonts/InstrumentSans-Bold.ttf +0 -0
- package/skills/creative/canvas-design/canvas-fonts/InstrumentSans-BoldItalic.ttf +0 -0
- package/skills/creative/canvas-design/canvas-fonts/InstrumentSans-Italic.ttf +0 -0
- package/skills/creative/canvas-design/canvas-fonts/InstrumentSans-OFL.txt +93 -0
- package/skills/creative/canvas-design/canvas-fonts/InstrumentSans-Regular.ttf +0 -0
- package/skills/creative/canvas-design/canvas-fonts/InstrumentSerif-Italic.ttf +0 -0
- package/skills/creative/canvas-design/canvas-fonts/InstrumentSerif-Regular.ttf +0 -0
- package/skills/creative/canvas-design/canvas-fonts/Italiana-OFL.txt +93 -0
- package/skills/creative/canvas-design/canvas-fonts/Italiana-Regular.ttf +0 -0
- package/skills/creative/canvas-design/canvas-fonts/JetBrainsMono-Bold.ttf +0 -0
- package/skills/creative/canvas-design/canvas-fonts/JetBrainsMono-OFL.txt +93 -0
- package/skills/creative/canvas-design/canvas-fonts/JetBrainsMono-Regular.ttf +0 -0
- package/skills/creative/canvas-design/canvas-fonts/Jura-Light.ttf +0 -0
- package/skills/creative/canvas-design/canvas-fonts/Jura-Medium.ttf +0 -0
- package/skills/creative/canvas-design/canvas-fonts/Jura-OFL.txt +93 -0
- package/skills/creative/canvas-design/canvas-fonts/LibreBaskerville-OFL.txt +93 -0
- package/skills/creative/canvas-design/canvas-fonts/LibreBaskerville-Regular.ttf +0 -0
- package/skills/creative/canvas-design/canvas-fonts/Lora-Bold.ttf +0 -0
- package/skills/creative/canvas-design/canvas-fonts/Lora-BoldItalic.ttf +0 -0
- package/skills/creative/canvas-design/canvas-fonts/Lora-Italic.ttf +0 -0
- package/skills/creative/canvas-design/canvas-fonts/Lora-OFL.txt +93 -0
- package/skills/creative/canvas-design/canvas-fonts/Lora-Regular.ttf +0 -0
- package/skills/creative/canvas-design/canvas-fonts/NationalPark-Bold.ttf +0 -0
- package/skills/creative/canvas-design/canvas-fonts/NationalPark-OFL.txt +93 -0
- package/skills/creative/canvas-design/canvas-fonts/NationalPark-Regular.ttf +0 -0
- package/skills/creative/canvas-design/canvas-fonts/NothingYouCouldDo-OFL.txt +93 -0
- package/skills/creative/canvas-design/canvas-fonts/NothingYouCouldDo-Regular.ttf +0 -0
- package/skills/creative/canvas-design/canvas-fonts/Outfit-Bold.ttf +0 -0
- package/skills/creative/canvas-design/canvas-fonts/Outfit-OFL.txt +93 -0
- package/skills/creative/canvas-design/canvas-fonts/Outfit-Regular.ttf +0 -0
- package/skills/creative/canvas-design/canvas-fonts/PixelifySans-Medium.ttf +0 -0
- package/skills/creative/canvas-design/canvas-fonts/PixelifySans-OFL.txt +93 -0
- package/skills/creative/canvas-design/canvas-fonts/PoiretOne-OFL.txt +93 -0
- package/skills/creative/canvas-design/canvas-fonts/PoiretOne-Regular.ttf +0 -0
- package/skills/creative/canvas-design/canvas-fonts/RedHatMono-Bold.ttf +0 -0
- package/skills/creative/canvas-design/canvas-fonts/RedHatMono-OFL.txt +93 -0
- package/skills/creative/canvas-design/canvas-fonts/RedHatMono-Regular.ttf +0 -0
- package/skills/creative/canvas-design/canvas-fonts/Silkscreen-OFL.txt +93 -0
- package/skills/creative/canvas-design/canvas-fonts/Silkscreen-Regular.ttf +0 -0
- package/skills/creative/canvas-design/canvas-fonts/SmoochSans-Medium.ttf +0 -0
- package/skills/creative/canvas-design/canvas-fonts/SmoochSans-OFL.txt +93 -0
- package/skills/creative/canvas-design/canvas-fonts/Tektur-Medium.ttf +0 -0
- package/skills/creative/canvas-design/canvas-fonts/Tektur-OFL.txt +93 -0
- package/skills/creative/canvas-design/canvas-fonts/Tektur-Regular.ttf +0 -0
- package/skills/creative/canvas-design/canvas-fonts/WorkSans-Bold.ttf +0 -0
- package/skills/creative/canvas-design/canvas-fonts/WorkSans-BoldItalic.ttf +0 -0
- package/skills/creative/canvas-design/canvas-fonts/WorkSans-Italic.ttf +0 -0
- package/skills/creative/canvas-design/canvas-fonts/WorkSans-OFL.txt +93 -0
- package/skills/creative/canvas-design/canvas-fonts/WorkSans-Regular.ttf +0 -0
- package/skills/creative/canvas-design/canvas-fonts/YoungSerif-OFL.txt +93 -0
- package/skills/creative/canvas-design/canvas-fonts/YoungSerif-Regular.ttf +0 -0
- package/skills/creative/frontend-design/LICENSE.txt +177 -0
- package/skills/creative/frontend-design/SKILL-zh.md +42 -0
- package/skills/creative/frontend-design/SKILL.md +42 -0
- package/skills/creative/theme-factory/LICENSE.txt +202 -0
- package/skills/creative/theme-factory/SKILL-zh.md +59 -0
- package/skills/creative/theme-factory/SKILL.md +59 -0
- package/skills/creative/theme-factory/theme-showcase.pdf +0 -0
- package/skills/creative/theme-factory/themes/arctic-frost.md +19 -0
- package/skills/creative/theme-factory/themes/botanical-garden.md +19 -0
- package/skills/creative/theme-factory/themes/desert-rose.md +19 -0
- package/skills/creative/theme-factory/themes/forest-canopy.md +19 -0
- package/skills/creative/theme-factory/themes/golden-hour.md +19 -0
- package/skills/creative/theme-factory/themes/midnight-galaxy.md +19 -0
- package/skills/creative/theme-factory/themes/modern-minimalist.md +19 -0
- package/skills/creative/theme-factory/themes/ocean-depths.md +19 -0
- package/skills/creative/theme-factory/themes/sunset-boulevard.md +19 -0
- package/skills/creative/theme-factory/themes/tech-innovation.md +19 -0
- package/skills/creative/web-artifacts-builder/LICENSE.txt +202 -0
- package/skills/creative/web-artifacts-builder/SKILL-zh.md +74 -0
- package/skills/creative/web-artifacts-builder/SKILL.md +74 -0
- package/skills/creative/web-artifacts-builder/scripts/bundle-artifact.sh +54 -0
- package/skills/creative/web-artifacts-builder/scripts/init-artifact.sh +322 -0
- package/skills/creative/web-artifacts-builder/scripts/shadcn-components.tar.gz +0 -0
- package/skills/documents/doc-coauthoring/SKILL-zh.md +375 -0
- package/skills/documents/doc-coauthoring/SKILL.md +375 -0
- package/skills/documents/docx/SKILL-zh.md +590 -0
- package/skills/{docx → documents/docx}/SKILL.md +11 -11
- package/skills/{docx → documents/docx}/scripts/comment.py +2 -2
- package/skills/{docx → documents/docx}/scripts/office/helpers/simplify_redlines.py +1 -1
- package/skills/{docx → documents/docx}/scripts/office/pack.py +2 -2
- package/skills/{xlsx → documents/docx}/scripts/office/validate.py +2 -2
- package/skills/{xlsx → documents/docx}/scripts/office/validators/redlining.py +1 -1
- package/skills/documents/pdf/SKILL-zh.md +314 -0
- package/skills/documents/pptx/SKILL-zh.md +232 -0
- package/skills/{pptx → documents/pptx}/editing.md +3 -3
- package/skills/{pptx → documents/pptx}/scripts/office/helpers/simplify_redlines.py +1 -1
- package/skills/{xlsx → documents/pptx}/scripts/office/pack.py +2 -2
- package/skills/{pptx → documents/pptx}/scripts/office/validate.py +2 -2
- package/skills/{docx → documents/pptx}/scripts/office/validators/redlining.py +1 -1
- package/skills/documents/xlsx/SKILL-zh.md +292 -0
- package/skills/{xlsx → documents/xlsx}/scripts/office/helpers/simplify_redlines.py +1 -1
- package/skills/{pptx → documents/xlsx}/scripts/office/pack.py +2 -2
- package/skills/{docx → documents/xlsx}/scripts/office/validate.py +2 -2
- package/skills/{pptx → documents/xlsx}/scripts/office/validators/redlining.py +1 -1
- package/skills/meta/skill-creator/LICENSE.txt +202 -0
- package/skills/meta/skill-creator/SKILL-zh.md +483 -0
- package/skills/{skill-creator → meta/skill-creator}/SKILL.md +0 -1
- package/skills/tools/find-skills/SKILL-zh.md +440 -0
- package/skills/tools/github/SKILL-zh.md +48 -0
- package/skills/tools/internal-comms/LICENSE.txt +202 -0
- package/skills/tools/internal-comms/SKILL-zh.md +32 -0
- package/skills/tools/internal-comms/SKILL.md +32 -0
- package/skills/tools/internal-comms/examples/3p-updates.md +47 -0
- package/skills/tools/internal-comms/examples/company-newsletter.md +65 -0
- package/skills/tools/internal-comms/examples/faq-answers.md +30 -0
- package/skills/tools/internal-comms/examples/general-comms.md +16 -0
- package/skills/tools/summarize/SKILL-zh.md +47 -0
- package/skills/tools/weather/SKILL-zh.md +46 -0
- package/skills/tools/webapp-testing/LICENSE.txt +202 -0
- package/skills/tools/webapp-testing/SKILL-zh.md +96 -0
- package/skills/tools/webapp-testing/SKILL.md +96 -0
- package/skills/tools/webapp-testing/examples/console_logging.py +35 -0
- package/skills/tools/webapp-testing/examples/element_discovery.py +40 -0
- package/skills/tools/webapp-testing/examples/static_html_automation.py +33 -0
- package/skills/tools/webapp-testing/scripts/with_server.py +106 -0
- package/dist/gateway/static/root/assets/agents-CkgFSiCY.js +0 -216
- package/dist/gateway/static/root/assets/agents-CkgFSiCY.js.map +0 -1
- package/dist/gateway/static/root/assets/channels-settings-CE7jrdkO.js +0 -9
- package/dist/gateway/static/root/assets/channels-settings-CE7jrdkO.js.map +0 -1
- package/dist/gateway/static/root/assets/cron-page-BpPPcykJ.js +0 -2
- package/dist/gateway/static/root/assets/cron-page-BpPPcykJ.js.map +0 -1
- package/dist/gateway/static/root/assets/cron-utils-N1PqD2DB.js +0 -3
- package/dist/gateway/static/root/assets/cron-utils-N1PqD2DB.js.map +0 -1
- package/dist/gateway/static/root/assets/dist--p2HQ2QF.js +0 -2
- package/dist/gateway/static/root/assets/index-Dnfha4O2.css +0 -1
- package/dist/gateway/static/root/assets/logs-page-CQwdV_Xw.js +0 -2
- package/dist/gateway/static/root/assets/logs-page-CQwdV_Xw.js.map +0 -1
- package/dist/gateway/static/root/assets/sessions-page-Be5kIGl_.js +0 -2
- package/dist/gateway/static/root/assets/settings-page-PodSlNwr.js +0 -2
- package/dist/gateway/static/root/assets/settings-page-PodSlNwr.js.map +0 -1
- package/dist/gateway/static/root/assets/skills-page-Clg8deH0.js +0 -3
- package/dist/gateway/static/root/assets/skills-page-Clg8deH0.js.map +0 -1
- package/dist/src/agent/skills/skills-store-client.d.ts +0 -66
- package/dist/src/agent/skills/skills-store-client.js.map +0 -1
- package/dist/src/stt/index.d.ts +0 -1
- package/dist/src/stt/index.js +0 -8
- /package/skills/{docx → documents/docx}/LICENSE.txt +0 -0
- /package/skills/{docx → documents/docx}/scripts/__init__.py +0 -0
- /package/skills/{docx → documents/docx}/scripts/accept_changes.py +0 -0
- /package/skills/{docx → documents/docx}/scripts/office/helpers/__init__.py +0 -0
- /package/skills/{docx → documents/docx}/scripts/office/helpers/merge_runs.py +0 -0
- /package/skills/{docx → documents/docx}/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +0 -0
- /package/skills/{docx → documents/docx}/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +0 -0
- /package/skills/{docx → documents/docx}/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +0 -0
- /package/skills/{docx → documents/docx}/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +0 -0
- /package/skills/{docx → documents/docx}/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +0 -0
- /package/skills/{docx → documents/docx}/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +0 -0
- /package/skills/{docx → documents/docx}/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +0 -0
- /package/skills/{docx → documents/docx}/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +0 -0
- /package/skills/{docx → documents/docx}/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +0 -0
- /package/skills/{docx → documents/docx}/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +0 -0
- /package/skills/{docx → documents/docx}/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +0 -0
- /package/skills/{docx → documents/docx}/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +0 -0
- /package/skills/{docx → documents/docx}/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +0 -0
- /package/skills/{docx → documents/docx}/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +0 -0
- /package/skills/{docx → documents/docx}/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +0 -0
- /package/skills/{docx → documents/docx}/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +0 -0
- /package/skills/{docx → documents/docx}/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +0 -0
- /package/skills/{docx → documents/docx}/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +0 -0
- /package/skills/{docx → documents/docx}/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +0 -0
- /package/skills/{docx → documents/docx}/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +0 -0
- /package/skills/{docx → documents/docx}/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +0 -0
- /package/skills/{docx → documents/docx}/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +0 -0
- /package/skills/{docx → documents/docx}/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +0 -0
- /package/skills/{docx → documents/docx}/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +0 -0
- /package/skills/{docx → documents/docx}/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +0 -0
- /package/skills/{docx → documents/docx}/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +0 -0
- /package/skills/{docx → documents/docx}/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +0 -0
- /package/skills/{docx → documents/docx}/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +0 -0
- /package/skills/{docx → documents/docx}/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +0 -0
- /package/skills/{docx → documents/docx}/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +0 -0
- /package/skills/{docx → documents/docx}/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +0 -0
- /package/skills/{docx → documents/docx}/scripts/office/schemas/mce/mc.xsd +0 -0
- /package/skills/{docx → documents/docx}/scripts/office/schemas/microsoft/wml-2010.xsd +0 -0
- /package/skills/{docx → documents/docx}/scripts/office/schemas/microsoft/wml-2012.xsd +0 -0
- /package/skills/{docx → documents/docx}/scripts/office/schemas/microsoft/wml-2018.xsd +0 -0
- /package/skills/{docx → documents/docx}/scripts/office/schemas/microsoft/wml-cex-2018.xsd +0 -0
- /package/skills/{docx → documents/docx}/scripts/office/schemas/microsoft/wml-cid-2016.xsd +0 -0
- /package/skills/{docx → documents/docx}/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +0 -0
- /package/skills/{docx → documents/docx}/scripts/office/schemas/microsoft/wml-symex-2015.xsd +0 -0
- /package/skills/{docx → documents/docx}/scripts/office/soffice.py +0 -0
- /package/skills/{docx → documents/docx}/scripts/office/unpack.py +0 -0
- /package/skills/{docx → documents/docx}/scripts/office/validators/__init__.py +0 -0
- /package/skills/{docx → documents/docx}/scripts/office/validators/base.py +0 -0
- /package/skills/{docx → documents/docx}/scripts/office/validators/docx.py +0 -0
- /package/skills/{docx → documents/docx}/scripts/office/validators/pptx.py +0 -0
- /package/skills/{docx → documents/docx}/scripts/templates/comments.xml +0 -0
- /package/skills/{docx → documents/docx}/scripts/templates/commentsExtended.xml +0 -0
- /package/skills/{docx → documents/docx}/scripts/templates/commentsExtensible.xml +0 -0
- /package/skills/{docx → documents/docx}/scripts/templates/commentsIds.xml +0 -0
- /package/skills/{docx → documents/docx}/scripts/templates/people.xml +0 -0
- /package/skills/{pdf → documents/pdf}/LICENSE.txt +0 -0
- /package/skills/{pdf → documents/pdf}/SKILL.md +0 -0
- /package/skills/{pdf → documents/pdf}/forms.md +0 -0
- /package/skills/{pdf → documents/pdf}/reference.md +0 -0
- /package/skills/{pdf → documents/pdf}/scripts/check_bounding_boxes.py +0 -0
- /package/skills/{pdf → documents/pdf}/scripts/check_fillable_fields.py +0 -0
- /package/skills/{pdf → documents/pdf}/scripts/convert_pdf_to_images.py +0 -0
- /package/skills/{pdf → documents/pdf}/scripts/create_validation_image.py +0 -0
- /package/skills/{pdf → documents/pdf}/scripts/extract_form_field_info.py +0 -0
- /package/skills/{pdf → documents/pdf}/scripts/extract_form_structure.py +0 -0
- /package/skills/{pdf → documents/pdf}/scripts/fill_fillable_fields.py +0 -0
- /package/skills/{pdf → documents/pdf}/scripts/fill_pdf_form_with_annotations.py +0 -0
- /package/skills/{pptx → documents/pptx}/LICENSE.txt +0 -0
- /package/skills/{pptx → documents/pptx}/SKILL.md +0 -0
- /package/skills/{pptx → documents/pptx}/pptxgenjs.md +0 -0
- /package/skills/{pptx → documents/pptx}/scripts/__init__.py +0 -0
- /package/skills/{pptx → documents/pptx}/scripts/add_slide.py +0 -0
- /package/skills/{pptx → documents/pptx}/scripts/clean.py +0 -0
- /package/skills/{pptx → documents/pptx}/scripts/office/helpers/__init__.py +0 -0
- /package/skills/{pptx → documents/pptx}/scripts/office/helpers/merge_runs.py +0 -0
- /package/skills/{pptx → documents/pptx}/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +0 -0
- /package/skills/{pptx → documents/pptx}/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +0 -0
- /package/skills/{pptx → documents/pptx}/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +0 -0
- /package/skills/{pptx → documents/pptx}/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +0 -0
- /package/skills/{pptx → documents/pptx}/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +0 -0
- /package/skills/{pptx → documents/pptx}/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +0 -0
- /package/skills/{pptx → documents/pptx}/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +0 -0
- /package/skills/{pptx → documents/pptx}/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +0 -0
- /package/skills/{pptx → documents/pptx}/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +0 -0
- /package/skills/{pptx → documents/pptx}/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +0 -0
- /package/skills/{pptx → documents/pptx}/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +0 -0
- /package/skills/{pptx → documents/pptx}/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +0 -0
- /package/skills/{pptx → documents/pptx}/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +0 -0
- /package/skills/{pptx → documents/pptx}/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +0 -0
- /package/skills/{pptx → documents/pptx}/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +0 -0
- /package/skills/{pptx → documents/pptx}/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +0 -0
- /package/skills/{pptx → documents/pptx}/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +0 -0
- /package/skills/{pptx → documents/pptx}/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +0 -0
- /package/skills/{pptx → documents/pptx}/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +0 -0
- /package/skills/{pptx → documents/pptx}/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +0 -0
- /package/skills/{pptx → documents/pptx}/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +0 -0
- /package/skills/{pptx → documents/pptx}/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +0 -0
- /package/skills/{pptx → documents/pptx}/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +0 -0
- /package/skills/{pptx → documents/pptx}/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +0 -0
- /package/skills/{pptx → documents/pptx}/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +0 -0
- /package/skills/{pptx → documents/pptx}/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +0 -0
- /package/skills/{pptx → documents/pptx}/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +0 -0
- /package/skills/{pptx → documents/pptx}/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +0 -0
- /package/skills/{pptx → documents/pptx}/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +0 -0
- /package/skills/{pptx → documents/pptx}/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +0 -0
- /package/skills/{pptx → documents/pptx}/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +0 -0
- /package/skills/{pptx → documents/pptx}/scripts/office/schemas/mce/mc.xsd +0 -0
- /package/skills/{pptx → documents/pptx}/scripts/office/schemas/microsoft/wml-2010.xsd +0 -0
- /package/skills/{pptx → documents/pptx}/scripts/office/schemas/microsoft/wml-2012.xsd +0 -0
- /package/skills/{pptx → documents/pptx}/scripts/office/schemas/microsoft/wml-2018.xsd +0 -0
- /package/skills/{pptx → documents/pptx}/scripts/office/schemas/microsoft/wml-cex-2018.xsd +0 -0
- /package/skills/{pptx → documents/pptx}/scripts/office/schemas/microsoft/wml-cid-2016.xsd +0 -0
- /package/skills/{pptx → documents/pptx}/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +0 -0
- /package/skills/{pptx → documents/pptx}/scripts/office/schemas/microsoft/wml-symex-2015.xsd +0 -0
- /package/skills/{pptx → documents/pptx}/scripts/office/soffice.py +0 -0
- /package/skills/{pptx → documents/pptx}/scripts/office/unpack.py +0 -0
- /package/skills/{pptx → documents/pptx}/scripts/office/validators/__init__.py +0 -0
- /package/skills/{pptx → documents/pptx}/scripts/office/validators/base.py +0 -0
- /package/skills/{pptx → documents/pptx}/scripts/office/validators/docx.py +0 -0
- /package/skills/{pptx → documents/pptx}/scripts/office/validators/pptx.py +0 -0
- /package/skills/{pptx → documents/pptx}/scripts/thumbnail.py +0 -0
- /package/skills/{xlsx → documents/xlsx}/LICENSE.txt +0 -0
- /package/skills/{xlsx → documents/xlsx}/SKILL.md +0 -0
- /package/skills/{skill-creator/scripts → documents/xlsx/scripts/office/helpers}/__init__.py +0 -0
- /package/skills/{xlsx → documents/xlsx}/scripts/office/helpers/merge_runs.py +0 -0
- /package/skills/{xlsx → documents/xlsx}/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +0 -0
- /package/skills/{xlsx → documents/xlsx}/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +0 -0
- /package/skills/{xlsx → documents/xlsx}/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +0 -0
- /package/skills/{xlsx → documents/xlsx}/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +0 -0
- /package/skills/{xlsx → documents/xlsx}/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +0 -0
- /package/skills/{xlsx → documents/xlsx}/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +0 -0
- /package/skills/{xlsx → documents/xlsx}/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +0 -0
- /package/skills/{xlsx → documents/xlsx}/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +0 -0
- /package/skills/{xlsx → documents/xlsx}/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +0 -0
- /package/skills/{xlsx → documents/xlsx}/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +0 -0
- /package/skills/{xlsx → documents/xlsx}/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +0 -0
- /package/skills/{xlsx → documents/xlsx}/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +0 -0
- /package/skills/{xlsx → documents/xlsx}/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +0 -0
- /package/skills/{xlsx → documents/xlsx}/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +0 -0
- /package/skills/{xlsx → documents/xlsx}/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +0 -0
- /package/skills/{xlsx → documents/xlsx}/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +0 -0
- /package/skills/{xlsx → documents/xlsx}/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +0 -0
- /package/skills/{xlsx → documents/xlsx}/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +0 -0
- /package/skills/{xlsx → documents/xlsx}/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +0 -0
- /package/skills/{xlsx → documents/xlsx}/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +0 -0
- /package/skills/{xlsx → documents/xlsx}/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +0 -0
- /package/skills/{xlsx → documents/xlsx}/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +0 -0
- /package/skills/{xlsx → documents/xlsx}/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +0 -0
- /package/skills/{xlsx → documents/xlsx}/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +0 -0
- /package/skills/{xlsx → documents/xlsx}/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +0 -0
- /package/skills/{xlsx → documents/xlsx}/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +0 -0
- /package/skills/{xlsx → documents/xlsx}/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +0 -0
- /package/skills/{xlsx → documents/xlsx}/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +0 -0
- /package/skills/{xlsx → documents/xlsx}/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +0 -0
- /package/skills/{xlsx → documents/xlsx}/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +0 -0
- /package/skills/{xlsx → documents/xlsx}/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +0 -0
- /package/skills/{xlsx → documents/xlsx}/scripts/office/schemas/mce/mc.xsd +0 -0
- /package/skills/{xlsx → documents/xlsx}/scripts/office/schemas/microsoft/wml-2010.xsd +0 -0
- /package/skills/{xlsx → documents/xlsx}/scripts/office/schemas/microsoft/wml-2012.xsd +0 -0
- /package/skills/{xlsx → documents/xlsx}/scripts/office/schemas/microsoft/wml-2018.xsd +0 -0
- /package/skills/{xlsx → documents/xlsx}/scripts/office/schemas/microsoft/wml-cex-2018.xsd +0 -0
- /package/skills/{xlsx → documents/xlsx}/scripts/office/schemas/microsoft/wml-cid-2016.xsd +0 -0
- /package/skills/{xlsx → documents/xlsx}/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +0 -0
- /package/skills/{xlsx → documents/xlsx}/scripts/office/schemas/microsoft/wml-symex-2015.xsd +0 -0
- /package/skills/{xlsx → documents/xlsx}/scripts/office/soffice.py +0 -0
- /package/skills/{xlsx → documents/xlsx}/scripts/office/unpack.py +0 -0
- /package/skills/{xlsx → documents/xlsx}/scripts/office/validators/__init__.py +0 -0
- /package/skills/{xlsx → documents/xlsx}/scripts/office/validators/base.py +0 -0
- /package/skills/{xlsx → documents/xlsx}/scripts/office/validators/docx.py +0 -0
- /package/skills/{xlsx → documents/xlsx}/scripts/office/validators/pptx.py +0 -0
- /package/skills/{xlsx → documents/xlsx}/scripts/recalc.py +0 -0
- /package/skills/{skill-creator → meta/skill-creator}/agents/analyzer.md +0 -0
- /package/skills/{skill-creator → meta/skill-creator}/agents/comparator.md +0 -0
- /package/skills/{skill-creator → meta/skill-creator}/agents/grader.md +0 -0
- /package/skills/{skill-creator → meta/skill-creator}/assets/eval_review.html +0 -0
- /package/skills/{skill-creator → meta/skill-creator}/eval-viewer/generate_review.py +0 -0
- /package/skills/{skill-creator → meta/skill-creator}/eval-viewer/viewer.html +0 -0
- /package/skills/{skill-creator → meta/skill-creator}/references/schemas.md +0 -0
- /package/skills/{xlsx/scripts/office/helpers → meta/skill-creator/scripts}/__init__.py +0 -0
- /package/skills/{skill-creator → meta/skill-creator}/scripts/aggregate_benchmark.py +0 -0
- /package/skills/{skill-creator → meta/skill-creator}/scripts/generate_report.py +0 -0
- /package/skills/{skill-creator → meta/skill-creator}/scripts/improve_description.py +0 -0
- /package/skills/{skill-creator → meta/skill-creator}/scripts/package_skill.py +0 -0
- /package/skills/{skill-creator → meta/skill-creator}/scripts/quick_validate.py +0 -0
- /package/skills/{skill-creator → meta/skill-creator}/scripts/run_eval.py +0 -0
- /package/skills/{skill-creator → meta/skill-creator}/scripts/run_loop.py +0 -0
- /package/skills/{skill-creator → meta/skill-creator}/scripts/utils.py +0 -0
- /package/skills/{find-skills → tools/find-skills}/SKILL.md +0 -0
- /package/skills/{github → tools/github}/SKILL.md +0 -0
- /package/skills/{summarize → tools/summarize}/SKILL.md +0 -0
- /package/skills/{weather → tools/weather}/SKILL.md +0 -0
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{i as t,t as n}from"./vendor-react-DbimaAId.js";import{i as r}from"./vendor-swr-B5fPo7KK.js";import{t as i}from"./cn-BMCV0OMB.js";import{$ as a,$n as o,A as s,An as c,At as l,Br as u,C as d,Cn as f,Cr as p,D as m,Dr as h,Dt as g,E as _,En as v,Et as y,Fn as b,Ft as x,Hn as S,Hr as C,In as w,It as T,J as E,K as D,Ln as O,M as k,Mr as A,N as ee,Nn as j,Nt as te,O as ne,Ot as re,Pn as ie,Pr as ae,Pt as M,Rn as N,S as oe,Sn as se,Sr as P,T as ce,Tn as le,Tr as F,Tt as ue,Un as de,Ur as fe,Wn as pe,Wr as me,X as he,Xn as ge,Zn as _e,Zr as I,_ as ve,_n as ye,_r as be,at as xe,b as L,bn as R,ci as z,cn as B,cr as Se,dn as Ce,dr as V,er as we,et as Te,fn as Ee,gn as De,hi as Oe,ii as ke,it as Ae,j as je,jn as Me,k as Ne,kn as Pe,kr as Fe,kt as Ie,ln as Le,m as Re,mi as ze,mn as Be,ni as Ve,nr as He,nt as Ue,or as We,ot as Ge,pi as Ke,q as H,qr as U,rt as W,st as G,ti as qe,tr as Je,tt as Ye,ui as Xe,un as Ze,v as Qe,vr as $e,vt as et,w as tt,wn as nt,wt as rt,x as it,xn as at,y as ot,yn as st,yt as ct}from"./index-DHLmAIQl.js";import{i as lt,l as ut,m as dt,n as ft,u as pt,y as mt}from"./cron-api-_j_79Zf5.js";var K=n();function ht({open:e,onOpenChange:t,busy:n,deletePurge:r,deleteTarget:a,deleteConfirmText:o,onDeleteConfirmTextChange:s,onConfirm:c,onCancel:u,a:d}){return(0,K.jsx)(Ie,{open:e,onOpenChange:t,children:(0,K.jsxs)(re,{children:[(0,K.jsx)(g,{className:`fixed inset-0 z-[80] bg-scrim backdrop-blur-[2px]`}),(0,K.jsxs)(ue,{className:i(`fixed left-1/2 top-1/2 z-[81] w-[min(100%-2rem,28rem)] -translate-x-1/2 -translate-y-1/2 rounded-xl border border-edge bg-surface-panel p-4 shadow-popover`,`dark:border-edge`),onOpenAutoFocus:e=>e.preventDefault(),children:[(0,K.jsx)(l,{className:`text-base font-semibold text-fg`,children:r?d.purgeDisk:d.removeFromConfig}),(0,K.jsx)(y,{className:`mt-2 whitespace-pre-wrap text-sm leading-relaxed text-fg-muted`,children:r?d.confirmDeletePurge:d.confirmDelete}),r&&a?(0,K.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[(0,K.jsx)(`label`,{className:`mb-2 block text-sm font-medium text-fg`,htmlFor:`agent-delete-confirm`,children:d.purgeConfirmLabel}),(0,K.jsx)(`input`,{id:`agent-delete-confirm`,type:`text`,autoComplete:`off`,spellCheck:!1,className:i(`w-full rounded-md border border-edge bg-surface-panel px-3 py-1.5 font-mono text-xs text-fg`,`placeholder:text-fg-subtle`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel`,`dark:border-edge`),placeholder:d.purgeConfirmPlaceholder.replace(`{{agentId}}`,a.id),value:o,onChange:e=>s(e.target.value)}),(0,K.jsx)(`p`,{className:`pt-0.5 text-xs text-fg-muted`,children:d.purgeConfirmHint.replace(`{{agentId}}`,a.id)})]}):null,(0,K.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center justify-end gap-2 border-t border-edge-subtle/60 pt-3`,children:[(0,K.jsx)(v,{type:`button`,variant:`ghost`,disabled:n,onClick:u,children:d.createModalCancel}),(0,K.jsx)(v,{type:`button`,variant:`secondary`,className:r?`border-red-200 text-red-700 hover:bg-red-50 dark:border-red-900/60 dark:text-red-300 dark:hover:bg-red-950/40`:void 0,disabled:n||!a||r&&o.trim().toLowerCase()!==a.id.toLowerCase(),onClick:c,children:r?d.purgeDisk:d.removeFromConfig})]})]})]})})}var gt=[{id:`overview`,labelKey:`navIdentity`,icon:j},{id:`profile`,labelKey:`navProfile`,icon:U},{id:`tools`,labelKey:`navTools`,icon:Me},{id:`skills`,labelKey:`navSkills`,icon:we},{id:`files`,labelKey:`navCoreFiles`,icon:A}],_t=[{id:`channels`,labelKey:`tabChannels`,icon:He},{id:`cron`,labelKey:`tabCron`,icon:me}];function vt(e){let{a:t,panel:n,onPanelChange:r}=e,a=(e,t,a)=>(0,K.jsxs)(`button`,{type:`button`,onClick:()=>r(e),className:i(`flex w-full items-center gap-2.5 rounded-lg px-3 py-2 text-left text-sm font-medium transition-colors`,n===e?`bg-accent-soft text-accent-fg`:`text-fg-muted hover:bg-surface-hover hover:text-fg`),children:[(0,K.jsx)(a,{className:`size-4 shrink-0 opacity-90`,strokeWidth:2,"aria-hidden":!0}),(0,K.jsx)(`span`,{className:`min-w-0 truncate`,children:t})]},e);return(0,K.jsxs)(`nav`,{className:`flex w-full flex-col gap-1`,"aria-label":t.editorNavAria,children:[(0,K.jsx)(`div`,{className:`flex flex-col gap-0.5`,children:gt.map(({id:e,labelKey:n,icon:r})=>a(e,t[n],r))}),(0,K.jsx)(`p`,{className:`mt-4 px-3 text-[10px] font-semibold uppercase tracking-wide text-fg-subtle`,children:t.navAdvanced}),(0,K.jsx)(`div`,{className:`flex flex-col gap-0.5`,children:_t.map(({id:e,labelKey:n,icon:r})=>a(e,t[n],r))})]})}function yt(e){let{open:t,onOpenChange:n,a:r,title:a,subtitle:o,panel:s,onPanelChange:u,onFooterSave:d,footerSaveDisabled:f,footerSavedFlash:p,busy:m,children:h}=e;return(0,K.jsx)(Ie,{open:t,onOpenChange:n,children:(0,K.jsxs)(re,{children:[(0,K.jsx)(g,{className:`xopc-dialog-overlay fixed inset-0 z-[60] bg-scrim`}),(0,K.jsxs)(ue,{className:i(`xopc-dialog-content fixed z-[60] flex flex-col overflow-hidden rounded-xl border border-edge bg-surface-panel shadow-popover dark:border-edge`,`inset-4 h-[calc(100dvh-2rem)] max-h-[calc(100dvh-2rem)] min-h-0`,`sm:inset-auto sm:left-1/2 sm:top-1/2 sm:h-[min(88vh,48rem)] sm:max-h-[min(88vh,48rem)] sm:min-h-[32rem] sm:w-[min(100%-2rem,58rem)] sm:-translate-x-1/2 sm:-translate-y-1/2`),onOpenAutoFocus:e=>e.preventDefault(),children:[(0,K.jsxs)(`div`,{className:`flex shrink-0 items-start justify-between gap-2 border-b border-edge-subtle px-4 pb-3 pt-4 dark:border-edge`,children:[(0,K.jsxs)(`div`,{className:`min-w-0 pr-2`,children:[(0,K.jsx)(l,{className:`text-base font-semibold leading-snug text-fg`,children:a}),(0,K.jsx)(y,{className:`mt-1 font-mono text-xs text-fg-muted`,children:o})]}),(0,K.jsx)(rt,{asChild:!0,children:(0,K.jsx)(`button`,{type:`button`,className:`shrink-0 rounded-lg p-1.5 text-fg-muted hover:bg-surface-base hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/40`,"aria-label":r.closeDialogAria,children:(0,K.jsx)(c,{className:`size-4`,"aria-hidden":!0})})})]}),(0,K.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col sm:flex-row sm:overflow-hidden`,children:[(0,K.jsx)(`div`,{className:`shrink-0 border-b border-edge-subtle px-4 py-3 dark:border-edge sm:flex sm:w-56 sm:shrink-0 sm:flex-col sm:overflow-y-auto sm:border-b-0 sm:border-r sm:px-0 sm:py-4 sm:pl-4 sm:pr-3`,children:(0,K.jsx)(vt,{a:r,panel:s,onPanelChange:u})}),(0,K.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden`,children:[(0,K.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden px-4 py-4 sm:pl-2 sm:pr-5`,children:h}),(0,K.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-1 border-t border-edge-subtle px-4 py-3 dark:border-edge sm:flex-row sm:items-center sm:justify-end sm:gap-3`,children:[p?(0,K.jsxs)(`p`,{className:`order-2 text-center text-xs font-medium text-green-600 sm:order-1 sm:mr-auto sm:text-left dark:text-green-400`,children:[`✓ `,r.personaSaved]}):f?(0,K.jsx)(`p`,{className:`order-2 text-center text-xs text-fg-muted sm:order-1 sm:mr-auto sm:text-left`,children:r.footerSaveNotApplicable}):null,(0,K.jsx)(v,{type:`button`,className:`order-1 w-full sm:order-2 sm:w-auto`,disabled:m||f,onClick:()=>void d(),children:r.save})]})]})]})]})]})})}function bt(){return`rounded-2xl bg-surface-base px-4 py-5 sm:px-5`}function q({children:e,className:t}){return(0,K.jsx)(`section`,{className:i(bt(),t),children:e})}var xt=`flex size-9 shrink-0 items-center justify-center rounded-lg bg-surface-hover/90 text-fg-muted transition-colors dark:bg-surface-hover/70`;function J({icon:e,title:t,subtitle:n,trailing:r,className:a,iconInteractive:o,iconLeading:s}){let c=s??(0,K.jsx)(e,{className:`size-4`,strokeWidth:1.75,"aria-hidden":!0}),l=s?i(`flex size-9 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-surface-panel p-0 ring-1 ring-inset ring-edge-subtle transition-[box-shadow] hover:ring-accent/40 dark:ring-edge-subtle`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-base`):i(xt,`hover:text-fg`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-base`),u=!!(o&&s);return(0,K.jsxs)(`div`,{className:i(`mb-5 flex items-start gap-3`,a),children:[o?u?(0,K.jsxs)(`span`,{className:`relative shrink-0`,children:[(0,K.jsx)(`button`,{type:`button`,id:o.id,onClick:o.onClick,"aria-label":o.ariaLabel,className:l,children:c}),(0,K.jsx)(`span`,{className:`pointer-events-none absolute -bottom-0.5 -right-0.5 flex size-4 items-center justify-center rounded-md border border-edge bg-surface-panel text-fg-muted shadow-sm dark:border-edge dark:bg-surface-base`,"aria-hidden":!0,children:(0,K.jsx)(We,{className:`size-2.5`,strokeWidth:2.25})})]}):(0,K.jsx)(`button`,{type:`button`,id:o.id,onClick:o.onClick,"aria-label":o.ariaLabel,className:l,children:c}):(0,K.jsx)(`div`,{className:i(s?`flex size-9 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-surface-panel ring-1 ring-inset ring-edge-subtle dark:ring-edge-subtle`:xt),"aria-hidden":!s,children:c}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:t}),(0,K.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:n})]}),r?(0,K.jsx)(`div`,{className:`shrink-0`,children:r}):null]})}function Y(){return i(`w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg`,`placeholder:text-fg-subtle`,nt,`dark:border-edge`)}function St(e,t,n){let r=e.agentId?.trim().toLowerCase();return r?r===t.toLowerCase():t.toLowerCase()===n.toLowerCase()}function Ct(e){return[e.channel,e.accountId,e.peerKind,e.peerId].filter(e=>typeof e==`string`&&e.length>0).join(` · `)||e.channel}function wt(e,t,n,r){let i=e.trim(),a=t.trim();if(a)return{channel:i,peerId:a};if(n!=null){let e=r[n];if(!e)return{channel:i};let t={channel:i};e.accountId?.trim()&&(t.accountId=e.accountId.trim()),e.peerKind?.trim()&&(t.peerKind=e.peerKind.trim());let a=e.peerId?.trim()||e.chatId?.trim();return a&&(t.peerId=a),t}return{channel:i}}var Tt=i(f,`w-full text-xs sm:w-auto sm:min-w-[11rem] sm:max-w-[17rem] sm:shrink-0`);function Et(e){let{a:t,busy:n,bindingsLoading:r,agentBindings:a,onRemoveBinding:s,onAddBinding:c,channelStatuses:l,channelsStatusLoading:u,useManualChannel:d,newBindChannel:f,setNewBindChannel:p,bindSessionChats:m,sessionsLoading:h,newBindSessionIdx:g,setNewBindSessionIdx:_,newBindCustomPeer:y,setNewBindCustomPeer:b,onRefreshSessions:x,lastActiveLabels:S,selectRecipient:C}=e,w=!u&&(d||l.length>0);return(0,K.jsxs)(q,{className:`flex min-h-0 flex-1 flex-col overflow-y-auto`,children:[(0,K.jsx)(J,{className:`shrink-0`,icon:be,title:t.channelsTitle,subtitle:t.channelsHint}),r?(0,K.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.channelsLoading}):a.length===0?(0,K.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.channelsNone}):(0,K.jsx)(`ul`,{className:`flex flex-col gap-2 text-sm`,children:a.map((e,r)=>(0,K.jsxs)(`li`,{className:`flex flex-wrap items-center justify-between gap-2 rounded-lg border border-edge bg-surface-panel px-3 py-2`,children:[(0,K.jsx)(`span`,{className:`font-mono text-xs`,children:Ct(e.match)}),(0,K.jsx)(v,{type:`button`,variant:`secondary`,disabled:n,onClick:()=>void s(e),children:t.removeBinding})]},`${e.match.channel}-${r}`))}),(0,K.jsxs)(`form`,{className:`mt-4 flex flex-col gap-3`,onSubmit:c,children:[u?(0,K.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.channelsLoadingChannels}):d?(0,K.jsxs)(`label`,{className:`flex flex-col gap-1 text-sm`,children:[(0,K.jsx)(`span`,{className:`text-fg-muted`,children:t.channelLabel}),(0,K.jsx)(`input`,{className:Y(),value:f,onChange:e=>p(e.target.value),placeholder:`telegram`,autoComplete:`off`}),(0,K.jsx)(`p`,{className:`text-xs text-fg-muted`,children:t.channelsManualChannelHint})]}):(0,K.jsxs)(`label`,{className:`flex flex-col gap-1 text-sm`,children:[(0,K.jsx)(`span`,{className:`text-fg-muted`,children:t.channelLabel}),(0,K.jsx)(`select`,{className:i(Y(),`py-2`),value:f,onChange:e=>{p(e.target.value),_(null),b(``)},children:l.map(e=>(0,K.jsxs)(`option`,{value:e.name,disabled:!e.enabled,children:[e.name,` `,e.enabled?``:t.channelsDisabledSuffix]},e.name))})]}),w&&f.trim()?(0,K.jsxs)(`div`,{className:`flex flex-col gap-2 border-t border-edge-subtle pt-3 text-sm`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,K.jsx)(`span`,{className:`text-fg-muted`,children:t.channelsSessionLabel}),(0,K.jsxs)(v,{type:`button`,variant:`ghost`,className:`h-7 gap-1 px-2 text-xs`,disabled:n||h||!f.trim(),title:t.channelsRefreshSessionsHint,onClick:()=>x(),children:[(0,K.jsx)(o,{className:i(`size-3.5`,h&&`animate-spin`),strokeWidth:1.75}),t.channelsRefreshSessions]})]}),h&&m.length===0?(0,K.jsx)(`p`,{className:`text-xs text-fg-muted`,children:t.channelsLoadingSessions}):null,(0,K.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,K.jsx)(`span`,{className:`text-fg-muted`,children:t.channelsPeerFromSessions}),(0,K.jsxs)(`select`,{className:i(Y(),`py-2`),value:g==null?``:String(g),disabled:n||!f.trim()||!!y.trim(),onChange:e=>{let t=e.target.value;_(t===``?null:Number(t))},children:[(0,K.jsx)(`option`,{value:``,children:t.channelsPeerAny}),m.map((e,t)=>(0,K.jsx)(`option`,{value:String(t),children:mt(e,S)},`${e.channel}-${e.chatId}-${t}`))]})]}),m.length===0&&f.trim()&&!h?(0,K.jsx)(`p`,{className:`text-xs text-fg-muted`,children:t.channelsNoSessionsHint}):null,(0,K.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,K.jsx)(`span`,{className:`text-fg-muted`,children:t.peerIdLabel}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-stretch sm:gap-2`,children:[(0,K.jsx)(`input`,{type:`text`,className:i(Y(),`min-w-0 w-full sm:flex-1`),value:y,onChange:e=>{b(e.target.value),e.target.value.trim()&&_(null)},placeholder:t.channelsCustomPeerPlaceholder,autoComplete:`off`}),(0,K.jsxs)(`select`,{className:Tt,value:y,onChange:e=>{let t=e.target.value;b(t||``),_(null)},children:[(0,K.jsx)(`option`,{value:``,children:C}),m.map(e=>(0,K.jsx)(`option`,{value:e.chatId,children:mt(e,S)},`${e.channel}-${e.chatId}`))]})]}),(0,K.jsx)(`p`,{className:`text-xs text-fg-muted`,children:t.channelsCustomPeerHint})]})]}):null,(0,K.jsx)(`div`,{children:(0,K.jsx)(v,{type:`submit`,disabled:n||!f.trim()||u,children:t.addBinding})})]})]})}function Dt(e){let{a:t,data:n,busy:r,cronLoading:a,agentCronJobs:o,onSetCronJobAgent:s}=e;return(0,K.jsxs)(q,{className:`flex min-h-0 flex-1 flex-col overflow-y-auto`,children:[(0,K.jsx)(J,{className:`shrink-0`,icon:z,title:t.cronTitle,subtitle:t.cronHint}),a?(0,K.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.cronLoading}):o.length===0?(0,K.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.cronNone}):(0,K.jsx)(`div`,{className:`overflow-x-auto`,children:(0,K.jsxs)(`table`,{className:`w-full min-w-[32rem] border-collapse text-left text-sm`,children:[(0,K.jsx)(`thead`,{children:(0,K.jsxs)(`tr`,{className:`border-b border-edge text-fg-muted`,children:[(0,K.jsx)(`th`,{className:`py-2 pr-3 font-medium`,children:t.cronColSchedule}),(0,K.jsx)(`th`,{className:`py-2 pr-3 font-medium`,children:t.cronColMessage}),(0,K.jsx)(`th`,{className:`py-2 pr-3 font-medium`,children:t.cronColSession}),(0,K.jsx)(`th`,{className:`py-2 pr-3 font-medium`,children:t.cronColAgent})]})}),(0,K.jsx)(`tbody`,{children:o.map(e=>{let a=!e.agentId?.trim(),o=a?``:e.agentId.trim().toLowerCase();return(0,K.jsxs)(`tr`,{className:`border-b border-edge-subtle`,children:[(0,K.jsx)(`td`,{className:`py-2 pr-3 font-mono text-xs`,children:e.schedule}),(0,K.jsx)(`td`,{className:`max-w-[12rem] truncate py-2 pr-3 text-xs`,title:ft(e),children:ft(e)}),(0,K.jsx)(`td`,{className:`py-2 pr-3 text-xs`,children:e.sessionTarget??`main`}),(0,K.jsx)(`td`,{className:`py-2 pr-3`,children:(0,K.jsxs)(`select`,{className:i(Y(),`min-w-[8rem] py-1 text-xs`),value:o,disabled:r||e.sessionTarget!==`isolated`,onChange:t=>void s(e,t.target.value),children:[(0,K.jsx)(`option`,{value:``,children:a?t.cronAgentDefault:t.cronAgentClear}),n.agents.map(e=>(0,K.jsx)(`option`,{value:e.id,children:e.id},e.id))]})})]},e.id)})})]})})]})}function Ot(e){let{a:t,filesLoading:n,files:r,activeFile:a,setActiveFile:o,bootstrapViewMode:s,setBootstrapViewMode:c,fileDraft:l,setFileDraft:u,fileSaving:d,bootstrapFileLoading:f,bootstrapEditorNonce:p}=e,m=De(e=>e.resolved===`dark`);return(0,K.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-hidden`,children:[(0,K.jsx)(`p`,{className:`shrink-0 text-sm text-fg-muted`,children:t.filesHint}),n?(0,K.jsx)(`p`,{className:`shrink-0 text-sm text-fg-muted`,children:t.filesLoading}):r?(0,K.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 overflow-hidden`,children:[(0,K.jsx)(`nav`,{className:`flex shrink-0 flex-row flex-wrap gap-x-0.5 gap-y-0 border-b border-edge-subtle`,"aria-label":t.tabFiles,children:r.files.map(e=>(0,K.jsxs)(`button`,{type:`button`,className:i(`-mb-px shrink-0 border-b-2 border-transparent px-3 py-2 text-left font-mono text-xs whitespace-nowrap transition-colors`,a===e.name?`border-accent text-fg`:`text-fg-muted hover:border-edge-subtle hover:text-fg`,e.missing&&`opacity-60`),onClick:()=>o(e.name),children:[e.name,e.missing?` (${t.missing})`:``]},e.name))}),(0,K.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col gap-2 overflow-hidden`,children:a?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-between gap-2`,children:[(0,K.jsxs)(`div`,{className:`inline-flex rounded-lg border border-edge bg-surface-panel p-0.5`,role:`group`,"aria-label":t.filesBootstrapEdit,children:[(0,K.jsxs)(`button`,{type:`button`,className:i(`inline-flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-xs font-medium`,s===`edit`?`bg-accent-soft text-accent-fg`:`text-fg-muted hover:bg-surface-hover`),onClick:()=>c(`edit`),children:[(0,K.jsx)(S,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),t.filesBootstrapEdit]}),(0,K.jsxs)(`button`,{type:`button`,className:i(`inline-flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-xs font-medium`,s===`preview`?`bg-accent-soft text-accent-fg`:`text-fg-muted hover:bg-surface-hover`),onClick:()=>c(`preview`),children:[(0,K.jsx)(ae,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),t.filesBootstrapPreview]})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs text-fg-muted`,children:[d?(0,K.jsx)(`span`,{children:t.filesSavingStatus}):null,(0,K.jsx)(`span`,{children:t.filesAutoSaveHint})]})]}),s===`edit`?(0,K.jsx)(`div`,{className:i(Y(),`flex min-h-0 flex-1 flex-col overflow-hidden p-0`,f&&`pointer-events-none opacity-60`),children:(0,K.jsx)(E,{initialContent:l,onChange:u,isDark:m,className:`min-h-0 flex-1`},`${a??`file`}-${p}`)}):(0,K.jsx)(`div`,{className:i(Y(),`min-h-0 flex-1 overflow-y-auto text-sm`,f&&`pointer-events-none opacity-60`),children:(0,K.jsx)(H,{content:l,className:`text-sm`})})]}):(0,K.jsx)(`p`,{className:`shrink-0 text-sm text-fg-muted`,children:t.pickFile})})]}):(0,K.jsx)(`p`,{className:`shrink-0 text-sm text-fg-muted`,children:t.filesEmpty})]})}var X=e(t(),1);function kt(e,t){switch(e){case`adventurer`:return t.avatarStyleAdventurer;case`bottts`:return t.avatarStyleRobot;case`lorelei`:return t.avatarStyleLorelei;case`thumbs`:return t.avatarStyleThumbs;case`fun-emoji`:return t.avatarStyleFunEmoji;default:return e}}function At(e){let{agentId:t,value:n,onChange:r,a:o,id:s}=e,c=(0,X.useRef)(null),[l,u]=(0,X.useState)(!1),[f,p]=(0,X.useState)(null),[m,h]=(0,X.useState)(!1),g=(0,X.useMemo)(()=>{let e=G(n.trim());return e&&Ge(e.styleId)?e.styleId:Ue[0]??`adventurer`},[n]),_=(0,X.useCallback)(async(e,n)=>{try{await d(t)}catch{}r(Ae(e,n)),h(!1)},[t,r]),y=(0,X.useCallback)(async e=>{let n=e.target.files?.[0];if(e.target.value=``,n){p(null),u(!0);try{await ee(t,n),r(W)}catch(e){let t=e instanceof Error?e.message:``;p(t===`avatar_too_large`?o.avatarTooLarge:t===`unsupported_image_type`||t===`empty_file`?o.avatarInvalidImage:o.avatarUploadFailed)}finally{u(!1)}}},[o,t,r]),S=(e,t)=>{let r=G(n.trim());return!!(r&&r.styleId===e&&r.seed===t)};return(0,K.jsxs)(`div`,{...s?{id:s}:{},className:`flex flex-col gap-3 sm:col-span-2`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,K.jsx)(`span`,{className:`text-sm font-medium text-fg`,children:o.avatarPickerTitle}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`input`,{ref:c,type:`file`,accept:`image/png,image/jpeg,image/webp,.png,.jpg,.jpeg,.webp`,className:`hidden`,onChange:e=>void y(e)}),(0,K.jsxs)(v,{type:`button`,variant:`secondary`,className:`gap-1.5 px-2.5 py-1.5 text-xs`,disabled:l,onClick:()=>c.current?.click(),children:[(0,K.jsx)(b,{className:`size-3.5 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}),l?o.avatarUploading:o.avatarUploadCustom]})]})]}),f?(0,K.jsx)(`p`,{className:`text-xs text-red-600 dark:text-red-400`,children:f}):null,(0,K.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:Ue.map(e=>(0,K.jsx)(`button`,{type:`button`,onClick:()=>void _(e,Ye[0]??t),className:i(`rounded-full border px-3 py-1.5 text-xs font-medium transition-colors`,g===e?`border-fg bg-fg text-surface-base`:`border-edge-subtle bg-surface-panel text-fg hover:border-edge`),children:kt(e,o)},e))}),(0,K.jsxs)(`div`,{className:`rounded-xl border border-edge-subtle bg-surface-panel/50 p-3`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[Ye.map(e=>(0,K.jsx)(`button`,{type:`button`,title:e,onClick:()=>void _(g,e),className:i(`flex size-12 shrink-0 items-center justify-center rounded-full border-2 transition-colors`,S(g,e)?`border-accent ring-2 ring-accent/30`:`border-transparent hover:border-edge`),children:(0,K.jsx)(`img`,{src:xe(g,e,96),alt:``,width:44,height:44,className:`size-11 rounded-full object-cover`,draggable:!1})},e)),(0,K.jsxs)(x,{open:m,onOpenChange:h,children:[(0,K.jsx)(T,{asChild:!0,children:(0,K.jsx)(`button`,{type:`button`,className:`flex size-12 shrink-0 items-center justify-center rounded-xl border border-edge-subtle bg-surface-base text-xs font-medium text-fg-muted hover:border-edge hover:text-fg`,children:o.avatarMore})}),(0,K.jsx)(M,{children:(0,K.jsxs)(te,{className:`z-[80] max-h-72 w-[min(22rem,calc(100vw-2rem))] overflow-y-auto rounded-xl border border-edge-subtle bg-surface-panel p-3 shadow-lg`,sideOffset:6,align:`end`,children:[(0,K.jsx)(`p`,{className:`mb-2 text-xs font-medium text-fg-muted`,children:kt(g,o)}),(0,K.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:Te.map(e=>(0,K.jsx)(`button`,{type:`button`,title:e,onClick:()=>void _(g,e),className:i(`flex size-11 shrink-0 items-center justify-center rounded-full border-2 transition-colors`,S(g,e)?`border-accent ring-2 ring-accent/30`:`border-transparent hover:border-edge`),children:(0,K.jsx)(`img`,{src:xe(g,e,88),alt:``,width:40,height:40,className:`size-10 rounded-full object-cover`,draggable:!1})},e))})]})})]})]}),(0,K.jsxs)(`div`,{className:`mt-3 flex items-center gap-2 border-t border-edge-subtle pt-3`,children:[(0,K.jsx)(`span`,{className:`text-xs text-fg-muted`,children:o.personaAvatar}),(0,K.jsx)(a,{agentId:t,avatar:n,size:40}),n.trim()&&!G(n.trim())&&n.trim()!==`xopc:custom`?(0,K.jsx)(`span`,{className:`truncate font-mono text-[10px] text-fg-muted`,title:n,children:n}):null]})]})]})}var jt={name:``,creature:``,emoji:``,avatar:``};function Mt(e){let t={...jt};if(!e.trim())return t;let n={name:`name`,creature:`creature`,emoji:`emoji`,avatar:`avatar`};for(let r of e.split(`
|
|
2
|
+
`)){let e=r.match(/^[-*]\s+\*\*(\w+):\*\*\s*(.*)/i);if(!e)continue;let i=n[e[1].toLowerCase()];if(!i)continue;let a=e[2].trim();/^_\(.*\)_$/.test(a)&&(a=``),t[i]=a}return t}function Nt(e){return[`# IDENTITY.md - Who Am I?`,``,`- **Name:** ${e.name}`,`- **Creature:** ${e.creature}`,`- **Emoji:** ${e.emoji}`,`- **Avatar:** ${e.avatar}`,``].join(`
|
|
3
|
+
`)}var Pt={callName:``,pronouns:``,timezone:``,notes:``};function Ft(e){let t={...Pt};if(!e.trim())return t;let n={name:`callName`,"what to call them":`callName`,pronouns:`pronouns`,timezone:`timezone`,notes:`notes`},r=e.split(`
|
|
4
|
+
`),i=-1;for(let e=0;e<r.length;e++){let a=r[e];if(/^##\s+Context/i.test(a)){i=e+1;continue}let o=a.match(/^[-*]\s+\*\*(.+?):\*\*\s*(.*)/i);if(!o)continue;let s=n[o[1].toLowerCase().trim()];if(!s)continue;let c=o[2].trim();/^_\(.*\)_$/.test(c)&&(c=``),t[s]=c}if(i>0){let e=r.slice(i).join(`
|
|
5
|
+
`).replace(/^_\(.*?\)_\s*/gm,``).replace(/^---\s*$/gm,``).replace(/The more you know.*$/s,``).trim();e&&!t.notes&&(t.notes=e)}return t}function It(e){let t=[`# USER.md - About Your Human`,``,`- **Name:** ${e.callName}`,`- **Pronouns:** ${e.pronouns}`,`- **Timezone:** ${e.timezone}`,``];return e.notes.trim()&&t.push(`## Context`,``,e.notes.trim(),``),t.join(`
|
|
6
|
+
`)}var Lt=[{id:`professional`,labelEn:`Professional & Efficient`,labelZh:`专业高效`,emoji:`🎯`,content:`# SOUL.md - Who You Are
|
|
7
|
+
|
|
8
|
+
## Core Truths
|
|
9
|
+
|
|
10
|
+
**Be genuinely helpful, not performatively helpful.** Skip the filler words — just help. Actions speak louder than pleasantries.
|
|
11
|
+
|
|
12
|
+
**Be precise and efficient.** Value the user's time. Give concise, actionable answers. Expand only when asked.
|
|
13
|
+
|
|
14
|
+
**Earn trust through competence.** Be careful with external actions. Be bold with internal ones (reading, organizing, learning).
|
|
15
|
+
|
|
16
|
+
**Remember you're a guest.** You have access to someone's life. Treat it with respect.
|
|
17
|
+
|
|
18
|
+
## Boundaries
|
|
19
|
+
|
|
20
|
+
- Private things stay private. Period.
|
|
21
|
+
- When in doubt, ask before acting externally.
|
|
22
|
+
- Never send half-baked replies to messaging surfaces.
|
|
23
|
+
|
|
24
|
+
## Vibe
|
|
25
|
+
|
|
26
|
+
Professional, competent, and respectful. Concise when needed, thorough when it matters.`},{id:`casual`,labelEn:`Warm & Friendly`,labelZh:`轻松友好`,emoji:`😊`,content:`# SOUL.md - Who You Are
|
|
27
|
+
|
|
28
|
+
## Core Truths
|
|
29
|
+
|
|
30
|
+
**Be a good friend, not a corporate drone.** Be warm, genuine, and real. Skip the formality when it gets in the way.
|
|
31
|
+
|
|
32
|
+
**Have personality.** You're allowed to be amused, surprised, or excited. An assistant with no personality is just a search engine.
|
|
33
|
+
|
|
34
|
+
**Be resourceful before asking.** Try to figure it out first. Then ask if you're stuck.
|
|
35
|
+
|
|
36
|
+
**Earn trust by being reliable.** Show up, follow through, and remember what matters.
|
|
37
|
+
|
|
38
|
+
**Respect the intimacy.** You have access to someone's life. That's a privilege.
|
|
39
|
+
|
|
40
|
+
## Boundaries
|
|
41
|
+
|
|
42
|
+
- Private things stay private. Always.
|
|
43
|
+
- When in doubt, ask before acting externally.
|
|
44
|
+
- Be careful in group chats — you're not the user's voice.
|
|
45
|
+
|
|
46
|
+
## Vibe
|
|
47
|
+
|
|
48
|
+
Warm, friendly, and a little playful. Like a helpful friend who happens to know everything.`},{id:`geeky`,labelEn:`Geeky & Witty`,labelZh:`极客风格`,emoji:`🧑💻`,content:`# SOUL.md - Who You Are
|
|
49
|
+
|
|
50
|
+
## Core Truths
|
|
51
|
+
|
|
52
|
+
**Precision over politeness.** "This is broken" beats "This might be worth considering." Be direct.
|
|
53
|
+
|
|
54
|
+
**Have opinions.** Disagree, prefer things, find stuff interesting or dull. No personality = no value.
|
|
55
|
+
|
|
56
|
+
**Go deep.** When something is interesting, explore it. Surface-level answers are for search engines.
|
|
57
|
+
|
|
58
|
+
**Be resourceful.** Read the file. Check the context. Search for it. Come back with answers, not questions.
|
|
59
|
+
|
|
60
|
+
**Earn trust through competence.** Be careful with external actions. Be bold with internal ones.
|
|
61
|
+
|
|
62
|
+
## Boundaries
|
|
63
|
+
|
|
64
|
+
- Private things stay private.
|
|
65
|
+
- When in doubt, ask before acting externally.
|
|
66
|
+
- Never send half-baked replies.
|
|
67
|
+
|
|
68
|
+
## Vibe
|
|
69
|
+
|
|
70
|
+
Sharp, direct, slightly nerdy. The kind of engineer you'd want on your team — competent, opinionated, and occasionally funny.`},{id:`custom`,labelEn:`Custom`,labelZh:`自定义`,emoji:`✍️`,content:``}];function Rt(e){let t=e.trimStart();if(!t.startsWith(`---`))return e;let n=t.indexOf(`---`,3);return n===-1?e:t.slice(n+3).trimStart()}function zt(e){let t=Rt(e).trim();if(!t)return`professional`;for(let e of Lt)if(e.id!==`custom`&&(t===e.content.trim()||Bt(e.id).filter(e=>t.includes(e)).length>=2))return e.id;return`custom`}function Bt(e){switch(e){case`professional`:return[`precise and efficient`,`Value the user's time`,`actionable answers`];case`casual`:return[`good friend`,`corporate drone`,`a little playful`];case`geeky`:return[`Precision over politeness`,`Go deep`,`slightly nerdy`];default:return[]}}var Vt=[{value:``,labelEn:`Not set`,labelZh:`未设置`},{value:`Asia/Shanghai`,labelEn:`Asia/Shanghai (CST, UTC+8)`,labelZh:`亚洲/上海 (北京时间, UTC+8)`},{value:`Asia/Tokyo`,labelEn:`Asia/Tokyo (JST, UTC+9)`,labelZh:`亚洲/东京 (日本时间, UTC+9)`},{value:`Asia/Seoul`,labelEn:`Asia/Seoul (KST, UTC+9)`,labelZh:`亚洲/首尔 (韩国时间, UTC+9)`},{value:`Asia/Singapore`,labelEn:`Asia/Singapore (SGT, UTC+8)`,labelZh:`亚洲/新加坡 (UTC+8)`},{value:`Asia/Hong_Kong`,labelEn:`Asia/Hong Kong (HKT, UTC+8)`,labelZh:`亚洲/香港 (UTC+8)`},{value:`Asia/Taipei`,labelEn:`Asia/Taipei (CST, UTC+8)`,labelZh:`亚洲/台北 (UTC+8)`},{value:`Asia/Kolkata`,labelEn:`Asia/Kolkata (IST, UTC+5:30)`,labelZh:`亚洲/加尔各答 (印度时间, UTC+5:30)`},{value:`Asia/Dubai`,labelEn:`Asia/Dubai (GST, UTC+4)`,labelZh:`亚洲/迪拜 (UTC+4)`},{value:`Europe/London`,labelEn:`Europe/London (GMT/BST)`,labelZh:`欧洲/伦敦 (格林尼治时间)`},{value:`Europe/Paris`,labelEn:`Europe/Paris (CET, UTC+1)`,labelZh:`欧洲/巴黎 (中欧时间, UTC+1)`},{value:`Europe/Berlin`,labelEn:`Europe/Berlin (CET, UTC+1)`,labelZh:`欧洲/柏林 (中欧时间, UTC+1)`},{value:`Europe/Moscow`,labelEn:`Europe/Moscow (MSK, UTC+3)`,labelZh:`欧洲/莫斯科 (UTC+3)`},{value:`America/New_York`,labelEn:`America/New York (EST, UTC-5)`,labelZh:`美国/纽约 (东部时间, UTC-5)`},{value:`America/Chicago`,labelEn:`America/Chicago (CST, UTC-6)`,labelZh:`美国/芝加哥 (中部时间, UTC-6)`},{value:`America/Denver`,labelEn:`America/Denver (MST, UTC-7)`,labelZh:`美国/丹佛 (山地时间, UTC-7)`},{value:`America/Los_Angeles`,labelEn:`America/Los Angeles (PST, UTC-8)`,labelZh:`美国/洛杉矶 (太平洋时间, UTC-8)`},{value:`America/Sao_Paulo`,labelEn:`America/São Paulo (BRT, UTC-3)`,labelZh:`美洲/圣保罗 (巴西时间, UTC-3)`},{value:`Australia/Sydney`,labelEn:`Australia/Sydney (AEST, UTC+10)`,labelZh:`澳大利亚/悉尼 (UTC+10)`},{value:`Pacific/Auckland`,labelEn:`Pacific/Auckland (NZST, UTC+12)`,labelZh:`太平洋/奥克兰 (新西兰时间, UTC+12)`}];function Ht(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return``}}var Ut=[{value:`先生`,labelEn:`Mr.`,labelZh:`先生`},{value:`女士`,labelEn:`Ms.`,labelZh:`女士`},{value:`同学`,labelEn:`Colleague`,labelZh:`同学`},{value:`老师`,labelEn:`Teacher`,labelZh:`老师`},{value:`老板`,labelEn:`Boss`,labelZh:`老板`},{value:`朋友`,labelEn:`Friend`,labelZh:`朋友`}],Wt=[{value:`AI assistant`,labelEn:`AI Assistant`,labelZh:`AI 助手`},{value:`robot`,labelEn:`Robot`,labelZh:`机器人`},{value:`familiar`,labelEn:`Familiar`,labelZh:`精灵`},{value:`ghost in the machine`,labelEn:`Ghost in the machine`,labelZh:`机器幽灵`},{value:`digital companion`,labelEn:`Digital Companion`,labelZh:`数字伙伴`}];function Gt(e){let{a:t,chat:n,selected:r,busy:o,editName:s,setEditName:u,editDescription:d,setEditDescription:f,editWorkspace:p,setEditWorkspace:m,editModel:h,setEditModel:_,onSetDefault:b,onSaveAgentEdits:x,onDelete:S,hideInlineSave:T,saveBootstrapRef:D,onBootstrapDirtyChange:k}=e,A=ye(e=>e.language),ee=De(e=>e.resolved===`dark`),[te,ne]=(0,X.useState)(!0),[,ie]=(0,X.useState)(!1),[M,N]=(0,X.useState)({name:``,creature:``,emoji:``,avatar:``}),[oe,se]=(0,X.useState)(`professional`),[P,le]=(0,X.useState)(``),[F,fe]=(0,X.useState)(0),[pe,me]=(0,X.useState)(!1),[he,ge]=(0,X.useState)(!1),_e=(0,X.useRef)(!1),I=(0,X.useRef)(r?.id??``);I.current=r?.id??``;let ve=(0,X.useRef)(``),be=(0,X.useRef)(``);(0,X.useEffect)(()=>{if(!r)return;let e=!1;return _e.current=!1,ne(!0),(async()=>{try{let[t,n]=await Promise.all([ce(r.id,`IDENTITY.md`).catch(()=>``),ce(r.id,`SOUL.md`).catch(()=>``)]);if(e)return;let i=Mt(t);N(i),ve.current=JSON.stringify(i),se(zt(n)),le(n),be.current=n,fe(e=>e+1)}finally{e||(ne(!1),_e.current=!0)}})(),()=>{e=!0}},[r?.id]);let xe=(0,X.useCallback)(async(e,t)=>{ie(!0);try{await je(I.current,e,t)}finally{ie(!1)}},[]),L=(0,X.useRef)(M);L.current=M;let R=(0,X.useRef)(P);R.current=P,(0,X.useEffect)(()=>{if(D)return D.current=async()=>{await Promise.all([xe(`IDENTITY.md`,Nt(L.current)),xe(`SOUL.md`,R.current)]),ve.current=JSON.stringify(L.current),be.current=R.current,k?.(!1)},()=>{D.current=null}},[D,xe,k]),(0,X.useEffect)(()=>{if(!k)return;let e=JSON.stringify(M)!==ve.current,t=P!==be.current;k(e||t)},[M,P,k]);let z=(0,X.useCallback)(e=>{N(t=>({...t,...e}))},[]),B=(0,X.useCallback)(e=>{if(se(e),e!==`custom`){let t=Lt.find(t=>t.id===e);t?.content&&(le(t.content),fe(e=>e+1))}},[]),Se=(0,X.useCallback)(e=>{le(e),se(`custom`)},[]),Ce=(0,X.useCallback)((e,t)=>A===`zh`?t:e,[A]),V=Y();return r?(0,K.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-8 overflow-y-auto`,children:[(0,K.jsxs)(q,{children:[(0,K.jsx)(J,{icon:de,title:t.personaSectionIdentity,subtitle:t.personaSectionIdentityHint,iconLeading:(0,K.jsx)(a,{agentId:r.id,avatar:M.avatar,size:36,className:`size-9 rounded-lg`}),iconInteractive:{onClick:()=>ge(!0),ariaLabel:t.avatarOpenSettingsAria,id:`agent-avatar-settings`},trailing:r.isDefault?null:(0,K.jsx)(v,{type:`button`,variant:`secondary`,className:`text-xs`,disabled:o,onClick:()=>void b(),children:t.setDefault})}),(0,K.jsx)(Ie,{open:he,onOpenChange:ge,children:(0,K.jsxs)(re,{children:[(0,K.jsx)(g,{className:`fixed inset-0 z-[70] bg-scrim backdrop-blur-[2px]`}),(0,K.jsxs)(ue,{className:i(`fixed left-1/2 top-1/2 z-[71] w-[min(calc(100vw-2rem),26rem)] max-h-[min(90dvh,36rem)] -translate-x-1/2 -translate-y-1/2 overflow-y-auto rounded-xl border border-edge bg-surface-panel p-4 shadow-popover dark:border-edge`),onOpenAutoFocus:e=>e.preventDefault(),children:[(0,K.jsxs)(`div`,{className:`mb-3 flex items-start justify-between gap-2`,children:[(0,K.jsx)(l,{className:`text-base font-semibold text-fg`,children:t.avatarPickerTitle}),(0,K.jsx)(rt,{asChild:!0,children:(0,K.jsx)(`button`,{type:`button`,className:`shrink-0 rounded-lg p-1.5 text-fg-muted hover:bg-surface-base hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/40`,"aria-label":t.closeDialogAria,children:(0,K.jsx)(c,{className:`size-4`,"aria-hidden":!0})})})]}),(0,K.jsx)(y,{className:`sr-only`,children:t.avatarRowHint}),(0,K.jsx)(At,{agentId:r.id,value:M.avatar,onChange:e=>z({avatar:e}),a:t})]})]})}),(0,K.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,K.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm`,children:[(0,K.jsx)(`span`,{className:`font-medium text-fg`,children:t.displayName}),(0,K.jsx)(`input`,{className:V,value:s,onChange:e=>{u(e.target.value),z({name:e.target.value})},placeholder:t.personaNamePlaceholder,autoComplete:`off`})]}),(0,K.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm`,children:[(0,K.jsx)(`span`,{className:`font-medium text-fg`,children:t.personaEmoji}),(0,K.jsx)(`input`,{className:V,value:M.emoji,onChange:e=>z({emoji:e.target.value}),placeholder:t.personaEmojiPlaceholder,autoComplete:`off`})]}),(0,K.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm sm:col-span-2`,children:[(0,K.jsx)(`span`,{className:`font-medium text-fg`,children:t.agentDescription}),(0,K.jsx)(`textarea`,{className:i(V,`min-h-16 resize-y text-sm leading-relaxed`),value:d,onChange:e=>f(e.target.value),placeholder:t.agentDescriptionPlaceholder,maxLength:4e3,rows:3,spellCheck:!0})]}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-1.5 text-sm`,children:[(0,K.jsx)(`span`,{className:`font-medium text-fg`,children:t.personaCreature}),(0,K.jsxs)(`select`,{className:V,value:Wt.some(e=>e.value===M.creature)?M.creature:`__custom__`,onChange:e=>{if(e.target.value===`__custom__`){z({creature:``});return}z({creature:e.target.value})},children:[Wt.map(e=>(0,K.jsx)(`option`,{value:e.value,children:Ce(e.labelEn,e.labelZh)},e.value)),(0,K.jsx)(`option`,{value:`__custom__`,children:Ce(`Custom…`,`自定义…`)})]}),Wt.some(e=>e.value===M.creature)?null:(0,K.jsx)(`input`,{className:i(V,`mt-1 text-xs`),value:M.creature,onChange:e=>z({creature:e.target.value}),placeholder:t.personaCreaturePlaceholder,autoComplete:`off`})]})]})]}),(0,K.jsxs)(q,{children:[(0,K.jsx)(J,{icon:C,title:t.editAgent,subtitle:t.editAgentHint}),(0,K.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,K.jsxs)(`div`,{className:`flex flex-col gap-1.5 text-sm sm:col-span-2`,children:[(0,K.jsx)(`span`,{className:`font-medium text-fg`,children:t.modelPrimary}),(0,K.jsxs)(`div`,{className:`flex flex-wrap items-stretch gap-2`,children:[(0,K.jsx)(Re,{className:`min-w-0 flex-1`,popoverContentClassName:`z-[70]`,value:h,disabled:o,placeholder:n.modelPlaceholder,searchPlaceholder:n.modelSearchPlaceholder,noMatches:n.modelNoMatches,onChange:e=>_(e)}),h.trim()?(0,K.jsx)(v,{type:`button`,variant:`secondary`,className:`shrink-0`,disabled:o,onClick:()=>_(``),children:t.modelClear}):null]})]}),(0,K.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm sm:col-span-2`,children:[(0,K.jsx)(`span`,{className:`font-medium text-fg`,children:t.workspacePath}),(0,K.jsx)(`input`,{className:i(V,`font-mono text-xs`),value:p,onChange:e=>m(e.target.value)})]})]}),T?null:(0,K.jsx)(`div`,{className:`mt-4`,children:(0,K.jsx)(v,{type:`button`,disabled:o,onClick:()=>void x(),children:t.save})})]}),te?(0,K.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.loading}):(0,K.jsxs)(q,{children:[(0,K.jsx)(J,{icon:j,title:t.personaSectionSoul,subtitle:t.personaSectionSoulHint}),(0,K.jsxs)(`div`,{className:`mb-4 flex flex-col gap-2`,children:[(0,K.jsx)(`span`,{className:`text-sm font-medium text-fg`,children:t.personaSoulTemplate}),(0,K.jsx)(`div`,{className:`grid grid-cols-2 gap-2 sm:grid-cols-4`,children:Lt.map(e=>(0,K.jsxs)(`button`,{type:`button`,className:i(`flex flex-col items-center gap-1.5 rounded-xl border-2 px-3 py-3 text-center transition-all`,oe===e.id?`border-accent bg-accent-soft/40 shadow-sm`:`border-edge hover:border-accent/40 hover:bg-surface-hover`),onClick:()=>B(e.id),children:[(0,K.jsx)(`span`,{className:`text-xl`,children:e.emoji}),(0,K.jsx)(`span`,{className:`text-xs font-medium text-fg`,children:Ce(e.labelEn,e.labelZh)})]},e.id))})]}),oe===`custom`?(0,K.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsx)(`span`,{className:`text-sm font-medium text-fg`,children:t.personaSoulCustomEdit}),(0,K.jsx)(`button`,{type:`button`,className:`inline-flex size-9 shrink-0 items-center justify-center rounded-md text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,title:pe?t.personaSoulEdit:t.personaSoulPreview,"aria-label":pe?t.personaSoulEdit:t.personaSoulPreview,onClick:()=>me(e=>!e),children:pe?(0,K.jsx)(We,{className:`size-4`,"aria-hidden":!0}):(0,K.jsx)(ae,{className:`size-4`,"aria-hidden":!0})})]}),(0,K.jsx)(`div`,{className:i(V,`flex min-h-64 flex-col overflow-hidden p-0`),children:pe?(0,K.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-3`,children:(0,K.jsx)(H,{content:P})}):(0,K.jsx)(E,{initialContent:P,onChange:Se,isDark:ee,className:`min-h-0 flex-1`},`soul-${F}`)})]}):null]}),r.id===`main`?null:(0,K.jsxs)(q,{children:[(0,K.jsx)(J,{icon:w,title:Ce(`Danger Zone`,`危险操作`),subtitle:Ce(`Actions that cannot be undone. Be careful.`,`以下操作不可撤销,请谨慎操作。`)}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,K.jsxs)(v,{type:`button`,variant:`secondary`,disabled:o,onClick:()=>void S(!1),children:[(0,K.jsx)(O,{className:`mr-1 size-4`,"aria-hidden":!0}),t.removeFromConfig]}),(0,K.jsx)(v,{type:`button`,variant:`secondary`,className:`border-red-200 text-red-700 hover:bg-red-50 dark:border-red-900/60 dark:text-red-300 dark:hover:bg-red-950/40`,disabled:o,onClick:()=>void S(!0),children:t.purgeDisk})]})]})]}):(0,K.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.selectAgentHint})}function Kt({a:e,agentId:t,saveRef:n,onDirtyChange:r}){let a=ye(e=>e.language),[o,s]=(0,X.useState)(!0),[,c]=(0,X.useState)(!1),[l,u]=(0,X.useState)({callName:``,pronouns:``,timezone:``,notes:``}),[d,f]=(0,X.useState)(!1),[p,m]=(0,X.useState)(!1),[h,g]=(0,X.useState)(``),_=(0,X.useRef)(!1),v=(0,X.useRef)(t);v.current=t;let y=(0,X.useRef)(``),b=(0,X.useCallback)(async e=>{let t=v.current;c(!0);try{await je(t,`USER.md`,e)}finally{c(!1)}},[]),x=(0,X.useRef)(l);x.current=l,(0,X.useEffect)(()=>{if(n)return n.current=async()=>{await b(It(x.current)),y.current=JSON.stringify(x.current),r?.(!1)},()=>{n.current=null}},[n,b,r]),(0,X.useEffect)(()=>{r&&r(JSON.stringify(l)!==y.current)},[l,r]),(0,X.useEffect)(()=>{let e=!1;return _.current=!1,s(!0),(async()=>{try{let n=await ce(t,`USER.md`).catch(()=>``);if(e)return;let r=Ft(n),i=r;if(!r.timezone){let e=Ht();e&&(i={...r,timezone:e})}u(i),y.current=JSON.stringify(i);let a=!i.pronouns||Ut.some(e=>e.value===i.pronouns);i.pronouns&&!a&&f(!0);let o=Vt.some(e=>e.value===i.timezone);i.timezone&&!o&&(m(!0),g(i.timezone))}finally{e||(s(!1),_.current=!0)}})(),()=>{e=!0}},[t]);let S=(0,X.useCallback)(e=>{u(t=>({...t,...e}))},[]),C=(0,X.useCallback)(e=>{if(e===`__custom__`){m(!0);return}m(!1),g(``),S({timezone:e})},[S]),w=(0,X.useCallback)(e=>{g(e),S({timezone:e})},[S]),T=(0,X.useCallback)(()=>{let e=Ht();e&&(Vt.some(t=>t.value===e)?(m(!1),g(``)):(m(!0),g(e)),S({timezone:e}))},[S]),E=p?`__custom__`:Vt.some(e=>e.value===l.timezone)?l.timezone:`__custom__`,D=(0,X.useCallback)((e,t)=>a===`zh`?t:e,[a]);if(o)return(0,K.jsx)(`p`,{className:`text-sm text-fg-muted`,children:e.loading});let O=Y();return(0,K.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-6 overflow-y-auto`,children:[(0,K.jsx)(`p`,{className:`text-sm text-fg-muted`,children:e.personaSectionUserHint}),(0,K.jsxs)(q,{children:[(0,K.jsx)(J,{icon:U,title:e.personaSectionUser,subtitle:e.personaSectionUserHint}),(0,K.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,K.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm`,children:[(0,K.jsx)(`span`,{className:`font-medium text-fg`,children:e.personaCallName}),(0,K.jsx)(`input`,{className:O,value:l.callName,onChange:e=>S({callName:e.target.value}),placeholder:e.personaCallNamePlaceholder,autoComplete:`off`})]}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-1.5 text-sm`,children:[(0,K.jsx)(`span`,{className:`font-medium text-fg`,children:e.personaPronouns}),(0,K.jsxs)(`select`,{className:O,value:Ut.some(e=>e.value===l.pronouns)?l.pronouns:`__custom__`,onChange:e=>{if(e.target.value===`__custom__`){f(!0);return}f(!1),S({pronouns:e.target.value})},children:[(0,K.jsx)(`option`,{value:``,disabled:!0,children:e.personaPronounsPlaceholder}),Ut.map(e=>(0,K.jsx)(`option`,{value:e.value,children:D(e.labelEn,e.labelZh)},e.value)),(0,K.jsx)(`option`,{value:`__custom__`,children:D(`Custom…`,`自定义…`)})]}),d?(0,K.jsx)(`input`,{className:i(O,`mt-1 text-xs`),value:Ut.some(e=>e.value===l.pronouns)?``:l.pronouns,onChange:e=>S({pronouns:e.target.value}),placeholder:e.personaPronounsPlaceholder,autoComplete:`off`}):null]}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-1.5 text-sm sm:col-span-2`,children:[(0,K.jsx)(`span`,{className:`font-medium text-fg`,children:e.personaTimezone}),(0,K.jsxs)(`div`,{className:`flex flex-wrap items-stretch gap-2`,children:[(0,K.jsxs)(`select`,{className:i(O,`min-w-0 flex-1`),value:E,onChange:e=>C(e.target.value),children:[Vt.map(e=>(0,K.jsx)(`option`,{value:e.value,children:D(e.labelEn,e.labelZh)},e.value)),(0,K.jsx)(`option`,{value:`__custom__`,children:e.personaTimezoneCustom})]}),(0,K.jsx)(`button`,{type:`button`,className:`shrink-0 rounded-lg border border-edge bg-surface-panel px-3 py-2 text-xs font-medium text-fg-muted hover:bg-surface-hover hover:text-fg`,onClick:T,children:e.personaTimezoneDetect})]}),p?(0,K.jsx)(`input`,{className:i(O,`mt-1 font-mono text-xs`),value:h,onChange:e=>w(e.target.value),placeholder:`e.g. Asia/Shanghai`,autoComplete:`off`}):null]}),(0,K.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm sm:col-span-2`,children:[(0,K.jsx)(`span`,{className:`font-medium text-fg`,children:e.personaNotes}),(0,K.jsx)(`textarea`,{className:i(O,`min-h-16 resize-y text-sm leading-relaxed`),value:l.notes,onChange:e=>S({notes:e.target.value}),placeholder:e.personaNotesPlaceholder,rows:3,spellCheck:!0})]})]}),(0,K.jsxs)(`div`,{className:`mt-3 flex items-start gap-2 rounded-lg bg-accent-soft/30 px-3 py-2.5 text-xs text-fg-muted`,children:[(0,K.jsx)(F,{className:`mt-0.5 size-3.5 shrink-0 text-accent`,"aria-hidden":!0}),(0,K.jsx)(`span`,{children:e.personaMemoryNote})]})]})]})}function qt(e){let{a:t,selected:n,busy:r,skillsCatalogLoading:a,catalogForPick:o,skillsInherit:s,setSkillsInherit:c,skillsPick:l,setSkillsPick:u,onSaveSkills:d,hideInlineSave:f}=e;function p(e){let t=n.skills.effectiveAllowlist;return t===void 0?!0:t.length===0?!1:t.includes(e)}function m(){let e=n.skills.effectiveAllowlist;return e===void 0?new Set(o.map(e=>e.name||e.directoryId)):new Set(e)}return(0,K.jsxs)(q,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,K.jsx)(J,{className:`shrink-0`,icon:ke,title:t.skillsTitle,subtitle:t.skillsHint}),(0,K.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,K.jsx)(v,{type:`button`,variant:`secondary`,disabled:r,onClick:()=>c(!0),children:t.skillsInherit}),(0,K.jsx)(v,{type:`button`,variant:`secondary`,disabled:r,onClick:()=>{c(!1),u(m())},children:t.skillsCustomize})]}),(0,K.jsx)(Xe,{to:Be(`skills`),className:`shrink-0 text-xs font-medium text-accent-fg hover:underline`,children:t.skillsLibraryLink})]}),(0,K.jsxs)(`p`,{className:`mt-2 shrink-0 text-xs text-fg-muted`,children:[t.skillsDefaultsLabel,` `,n.skills.defaults.length?n.skills.defaults.join(`, `):`—`]}),(0,K.jsxs)(`p`,{className:`shrink-0 text-xs text-fg-muted`,children:[t.skillsEffectiveLabel,` `,n.skills.effectiveAllowlist?.length?n.skills.effectiveAllowlist.join(`, `):t.skillsAllFromCatalog]}),a?(0,K.jsx)(`p`,{className:`shrink-0 text-sm text-fg-muted`,children:t.skillsCatalogLoading}):o.length===0?(0,K.jsx)(`p`,{className:`shrink-0 text-sm text-fg-muted`,children:t.skillsEmptyCatalog}):(0,K.jsx)(`div`,{className:i(`mt-3 min-h-0 flex-1 overflow-y-auto overscroll-contain pr-0.5`,s&&`opacity-50`),children:(0,K.jsx)(`ul`,{className:`flex flex-col gap-2.5 text-sm`,role:`list`,children:o.map(e=>{let n=e.name||e.directoryId,a=s?p(n):l.has(n),o=typeof e.description==`string`?e.description.trim():``,c=o||t.skillsNoDescription;return(0,K.jsx)(`li`,{className:`h-16 shrink-0 overflow-hidden rounded-xl border border-edge-subtle bg-surface-panel/60 px-3 dark:border-edge-subtle`,children:(0,K.jsxs)(`label`,{className:`flex h-full cursor-pointer items-center gap-3 text-sm`,children:[(0,K.jsx)(`input`,{type:`checkbox`,className:`shrink-0 rounded border-edge`,checked:a,disabled:s||r,onChange:()=>{u(e=>{let t=new Set(e);return a?t.delete(n):t.add(n),t})}}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1 overflow-hidden`,children:[(0,K.jsx)(`div`,{className:`truncate font-mono text-xs font-medium text-fg`,title:n,children:n}),(0,K.jsx)(`p`,{className:i(`mt-0.5 truncate text-xs leading-tight text-fg-muted`,!o&&`italic text-fg-subtle`),title:c,children:c})]})]})},n)})})}),f?null:(0,K.jsx)(`div`,{className:`mt-4 shrink-0`,children:(0,K.jsx)(v,{type:`button`,disabled:r,onClick:()=>void d(),children:t.skillsSave})})]})}function Jt(e){let{a:t,data:n,selected:r,busy:a,toolEntryDisable:o,setToolEntryDisable:s,onSaveTools:c,onClearToolsEntry:l,hideInlineSave:u}=e;return(0,K.jsxs)(q,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,K.jsx)(J,{className:`shrink-0`,icon:Me,title:t.toolsTitle,subtitle:t.toolsHint}),(0,K.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain`,children:(0,K.jsx)(`ul`,{className:`flex flex-col gap-2.5 pr-1`,role:`list`,children:(n.builtinToolIds.length?n.builtinToolIds:[]).map(e=>{let n=r.tools.defaultsDisable.includes(e),c=n?!1:!o.has(e),l=e in t.toolDescriptions?t.toolDescriptions[e]:``;return(0,K.jsx)(`li`,{className:i(`rounded-xl border border-edge-subtle bg-surface-panel/60 px-3 py-2.5 dark:border-edge-subtle`,n&&`opacity-60`),children:(0,K.jsxs)(`label`,{className:i(`flex cursor-pointer gap-3 text-sm`,n&&`cursor-not-allowed`),children:[(0,K.jsx)(`input`,{type:`checkbox`,className:`mt-1 shrink-0 rounded border-edge`,checked:c,disabled:n||a,onChange:()=>{n||s(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-0.5`,children:[(0,K.jsx)(`span`,{className:`font-mono text-xs font-medium text-fg`,children:e}),n?(0,K.jsxs)(`span`,{className:`text-xs text-fg-muted`,children:[`(`,t.toolsLockedByDefaults,`)`]}):null]}),l?(0,K.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-fg-muted`,children:l}):null]})]})},e)})})}),(0,K.jsxs)(`div`,{className:`mt-4 flex shrink-0 flex-wrap gap-2`,children:[u?null:(0,K.jsx)(v,{type:`button`,disabled:a,onClick:()=>void c(),children:t.toolsSave}),(0,K.jsx)(v,{type:`button`,variant:`secondary`,disabled:a,onClick:()=>void l(),children:t.toolsClearEntry})]})]})}function Yt({a:e,chat:t,cCron:n,selected:r,panel:i,data:a,busy:o,editName:s,setEditName:c,editDescription:l,setEditDescription:u,editWorkspace:d,setEditWorkspace:f,editModel:p,setEditModel:m,onSetDefault:h,onSaveAgentEdits:g,onDelete:_,overviewSaveBootstrapRef:v,profileSaveRef:y,setOverviewBootstrapDirty:b,setProfileDirty:x,filesLoading:S,files:C,activeFile:w,setActiveFile:T,bootstrapViewMode:E,setBootstrapViewMode:D,fileDraft:O,setFileDraft:k,fileSaving:A,bootstrapFileLoading:ee,bootstrapEditorNonce:j,toolEntryDisable:te,setToolEntryDisable:ne,onSaveTools:re,onClearToolsEntry:ie,skillsCatalogLoading:ae,catalogForPick:M,skillsInherit:N,setSkillsInherit:oe,skillsPick:se,setSkillsPick:P,onSaveSkills:ce,bindingsLoading:le,agentBindings:F,bindChannelStatuses:ue,bindChannelsLoading:de,useManualChannel:fe,newBindChannel:pe,setNewBindChannel:me,bindSessionChats:he,bindSessionsLoading:ge,newBindSessionIdx:_e,setNewBindSessionIdx:I,newBindCustomPeer:ve,setNewBindCustomPeer:ye,refreshBindSessions:be,onRemoveBinding:xe,onAddBinding:L,cronLoading:R,agentCronJobs:z,onSetCronJobAgent:B}){return r?i===`overview`?(0,K.jsx)(Gt,{a:e,chat:t,selected:r,busy:o,editName:s,setEditName:c,editDescription:l,setEditDescription:u,editWorkspace:d,setEditWorkspace:f,editModel:p,setEditModel:m,onSetDefault:h,onSaveAgentEdits:g,onDelete:_,hideInlineSave:!0,saveBootstrapRef:v,onBootstrapDirtyChange:b}):i===`profile`?(0,K.jsx)(Kt,{a:e,agentId:r.id,saveRef:y,onDirtyChange:x}):i===`files`?(0,K.jsx)(Ot,{a:e,filesLoading:S,files:C,activeFile:w,setActiveFile:T,bootstrapViewMode:E,setBootstrapViewMode:D,fileDraft:O,setFileDraft:k,fileSaving:A,bootstrapFileLoading:ee,bootstrapEditorNonce:j}):i===`tools`?(0,K.jsx)(Jt,{a:e,data:a,selected:r,busy:o,toolEntryDisable:te,setToolEntryDisable:ne,onSaveTools:re,onClearToolsEntry:ie,hideInlineSave:!0}):i===`skills`?(0,K.jsx)(qt,{a:e,selected:r,busy:o,skillsCatalogLoading:ae,catalogForPick:M,skillsInherit:N,setSkillsInherit:oe,skillsPick:se,setSkillsPick:P,onSaveSkills:ce,hideInlineSave:!0}):i===`channels`?(0,K.jsx)(Et,{a:e,busy:o,bindingsLoading:le,agentBindings:F,channelStatuses:ue,channelsStatusLoading:de,useManualChannel:fe,newBindChannel:pe,setNewBindChannel:me,bindSessionChats:he,sessionsLoading:ge,newBindSessionIdx:_e,setNewBindSessionIdx:I,newBindCustomPeer:ve,setNewBindCustomPeer:ye,onRefreshSessions:be,lastActiveLabels:n.lastActiveLabels,selectRecipient:n.selectRecipient,onRemoveBinding:xe,onAddBinding:L}):i===`cron`&&a?(0,K.jsx)(Dt,{a:e,data:a,selected:r,busy:o,cronLoading:R,agentCronJobs:z,onSetCronJobAgent:B}):(0,K.jsx)(`p`,{className:`text-sm text-fg-muted`,children:e.selectAgentHint}):(0,K.jsx)(`p`,{className:`text-sm text-fg-muted`,children:e.selectAgentHint})}function Xt(e,t,n){let r=t.trim().toLowerCase();return r?e.filter(e=>{let t=it(e,n).toLowerCase(),i=e.id.toLowerCase(),a=e.workspace.toLowerCase(),o=(e.description??``).toLowerCase(),s=L(e,n).toLowerCase();return t.includes(r)||i.includes(r)||a.includes(r)||o.includes(r)||s.includes(r)}):e}function Zt(e){let{a:t,busy:n,onNewAgent:r}=e;return(0,K.jsxs)(`button`,{type:`button`,disabled:n,onClick:()=>r(),className:i(`flex h-full min-h-[7.5rem] w-full flex-col items-center justify-center gap-2 rounded-xl border-2 border-dashed border-edge-subtle bg-surface-panel/40 px-4 py-6 text-sm font-medium text-fg-muted transition-colors`,`hover:border-accent/50 hover:bg-surface-hover hover:text-fg`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/40`,`disabled:pointer-events-none disabled:opacity-50`),children:[(0,K.jsx)(Je,{className:`size-8 shrink-0 opacity-80`,strokeWidth:1.75,"aria-hidden":!0}),(0,K.jsx)(`span`,{children:t.listNewAgentCard})]})}function Qt(e){let{a:t,agents:n,searchQuery:r,onOpenAgent:o,onChatWithAgent:s,onNewAgent:c,busy:l}=e,u=Xt(n,r,t),d=n.length>0&&u.length===0&&r.trim().length>0;return n.length===0?(0,K.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,K.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.listNoAgentsYet}),(0,K.jsx)(`div`,{className:`max-w-sm`,children:(0,K.jsx)(Zt,{a:t,busy:l,onNewAgent:c})})]}):(0,K.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[d?(0,K.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.listEmpty}):null,(0,K.jsxs)(`ul`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3`,role:`list`,children:[(0,K.jsx)(`li`,{className:`h-full min-h-0`,children:(0,K.jsx)(Zt,{a:t,busy:l,onNewAgent:c})}),u.map(e=>{let n=it(e,t),r=e.id,c=L(e,t);return(0,K.jsx)(`li`,{className:`h-full min-h-0`,children:(0,K.jsxs)(`div`,{className:i(`flex h-full min-h-0 flex-col gap-3 rounded-xl border border-edge-subtle bg-surface-panel p-4 shadow-sm transition-colors`,`hover:border-edge`),children:[(0,K.jsxs)(`button`,{type:`button`,disabled:l,onClick:()=>o(e.id),className:i(`flex shrink-0 w-full flex-col gap-2 text-left transition-colors`,`rounded-lg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/40`,`disabled:pointer-events-none disabled:opacity-50`),children:[(0,K.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,K.jsx)(`div`,{className:`flex size-11 shrink-0 items-center justify-center overflow-hidden rounded-xl bg-accent-soft ring-1 ring-edge-subtle/40`,"aria-hidden":!0,children:(0,K.jsx)(a,{agentId:e.id,avatar:e.avatar,size:44,className:`size-full`})}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-0.5`,children:[(0,K.jsx)(`span`,{className:`truncate font-semibold text-fg`,children:n}),e.isDefault?(0,K.jsx)(`span`,{className:`shrink-0 rounded-md bg-surface-base px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide text-fg-muted`,children:t.defaultBadge}):null]}),(0,K.jsx)(`p`,{className:`mt-0.5 truncate font-mono text-xs text-fg-muted`,title:r,children:r})]})]}),(0,K.jsx)(`p`,{className:i(`line-clamp-1 min-h-[1.3125rem] text-xs leading-relaxed`,c?`text-fg`:`text-fg-muted/25`),title:c||void 0,children:c||`\xA0`})]}),(0,K.jsxs)(`button`,{type:`button`,disabled:l,onClick:()=>s(e.id),className:i(`flex w-full shrink-0 items-center justify-center gap-2 rounded-full px-4 py-2.5 text-sm font-semibold`,`bg-accent-soft text-accent-fg transition-colors`,`hover:bg-accent/15`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/40`,`disabled:pointer-events-none disabled:opacity-50`),children:[(0,K.jsx)(V,{className:`size-4 shrink-0`,strokeWidth:2,"aria-hidden":!0}),t.listChatWithAgent]})]})},e.id)})]})]})}function $t(e){let{a:t}=e;return(0,K.jsx)(`header`,{className:`flex flex-col gap-4`,children:(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`h1`,{className:`text-xl font-semibold tracking-tight text-fg`,children:t.title}),(0,K.jsx)(`p`,{className:`mt-1 max-w-2xl text-sm text-fg-muted`,children:t.subtitle})]})})}function en(e){let{open:t,onOpenChange:n,a:r,chat:a,busy:o,modalError:s,createDisplayName:u,setCreateDisplayName:d,createAgentId:f,setCreateAgentId:p,createDescription:m,setCreateDescription:h,createWorkspace:_,setCreateWorkspace:b,createModel:x,setCreateModel:S,onCreate:C,onSuggestWorkspace:w}=e;return(0,K.jsx)(Ie,{open:t,onOpenChange:n,children:(0,K.jsxs)(re,{children:[(0,K.jsx)(g,{className:`xopc-dialog-overlay fixed inset-0 z-[60] bg-scrim`}),(0,K.jsxs)(ue,{className:i(`xopc-dialog-content fixed left-1/2 top-1/2 z-[60] max-h-[min(90vh,640px)] w-[min(100%-2rem,28rem)] -translate-x-1/2 -translate-y-1/2`,`overflow-y-auto rounded-xl border border-edge bg-surface-panel p-4 shadow-popover dark:border-edge`),onOpenAutoFocus:e=>e.preventDefault(),children:[(0,K.jsxs)(`div`,{className:`mb-3 flex items-start justify-between gap-2`,children:[(0,K.jsxs)(`div`,{className:`min-w-0 pr-2`,children:[(0,K.jsx)(l,{className:`text-base font-semibold text-fg`,children:r.addAgent}),(0,K.jsx)(y,{className:`mt-0.5 text-xs text-fg-muted`,children:r.addAgentHint})]}),(0,K.jsx)(rt,{asChild:!0,children:(0,K.jsx)(`button`,{type:`button`,className:`shrink-0 rounded-lg p-1.5 text-fg-muted hover:bg-surface-base hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/40`,"aria-label":r.closeDialogAria,children:(0,K.jsx)(c,{className:`size-4`,"aria-hidden":!0})})})]}),(0,K.jsxs)(`form`,{className:`grid gap-3`,onSubmit:C,children:[s?(0,K.jsx)(`div`,{role:`alert`,className:`rounded-lg border border-red-200 bg-red-50 px-3 py-2 text-sm text-red-800 dark:border-red-900/50 dark:bg-red-950/40 dark:text-red-200`,children:s}):null,(0,K.jsxs)(`label`,{className:`flex flex-col gap-1 text-sm`,children:[(0,K.jsx)(`span`,{className:`text-fg-muted`,children:r.newAgentLabel}),(0,K.jsx)(`input`,{className:Y(),value:u,onChange:e=>d(e.target.value),onBlur:()=>w(),required:!0,autoComplete:`off`})]}),(0,K.jsxs)(`label`,{className:`flex flex-col gap-1 text-sm`,children:[(0,K.jsx)(`span`,{className:`text-fg-muted`,children:r.newAgentIdOptional}),(0,K.jsx)(`input`,{className:i(Y(),`font-mono text-xs`),value:f,onChange:e=>p(e.target.value),onBlur:()=>w(),placeholder:r.newAgentIdPlaceholder,autoComplete:`off`,spellCheck:!1,maxLength:64,pattern:`[A-Za-z0-9][A-Za-z0-9_-]{0,63}`,title:r.newAgentIdRules}),(0,K.jsx)(`span`,{className:`text-xs text-fg-muted`,children:r.newAgentIdRules})]}),(0,K.jsxs)(`label`,{className:`flex flex-col gap-1 text-sm`,children:[(0,K.jsx)(`span`,{className:`text-fg-muted`,children:r.agentDescription}),(0,K.jsx)(`textarea`,{className:i(Y(),`min-h-[4.5rem] resize-y font-sans text-sm leading-relaxed`),value:m,onChange:e=>h(e.target.value),placeholder:r.agentDescriptionPlaceholder,maxLength:4e3,rows:3,spellCheck:!0})]}),(0,K.jsxs)(`label`,{className:`flex flex-col gap-1 text-sm`,children:[(0,K.jsx)(`span`,{className:`text-fg-muted`,children:r.newWorkspace}),(0,K.jsx)(`input`,{className:i(Y(),`font-mono text-xs`),value:_,onChange:e=>b(e.target.value),required:!0,autoComplete:`off`})]}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-1 text-sm`,children:[(0,K.jsx)(`span`,{className:`text-fg-muted`,children:r.newModelOptional}),(0,K.jsxs)(`div`,{className:`flex flex-wrap items-stretch gap-2`,children:[(0,K.jsx)(Re,{className:`min-w-0 flex-1`,popoverContentClassName:`z-[70]`,value:x,disabled:o,placeholder:a.modelPlaceholder,searchPlaceholder:a.modelSearchPlaceholder,noMatches:a.modelNoMatches,onChange:e=>S(e)}),x.trim()?(0,K.jsx)(v,{type:`button`,variant:`secondary`,className:`shrink-0`,disabled:o,onClick:()=>S(``),children:r.modelClear}):null]})]}),(0,K.jsxs)(`div`,{className:`mt-1 flex justify-end gap-2 border-t border-edge-subtle pt-3 dark:border-edge`,children:[(0,K.jsx)(rt,{asChild:!0,children:(0,K.jsx)(v,{type:`button`,variant:`secondary`,disabled:o,children:r.createModalCancel})}),(0,K.jsxs)(v,{type:`submit`,disabled:o,children:[(0,K.jsx)(ie,{className:`mr-1 size-4`,"aria-hidden":!0}),r.create]})]})]})]})]})})}var tn=`xopc-preset-agents-skipped`,nn=[{id:`coder`,name:`Coder`,emoji:`💻`,descriptionEn:`Software development assistant — precise, pragmatic, and code-focused.`,descriptionZh:`软件开发助手 — 精确、务实、专注代码。`,toolsDisable:[`image_generate`],identityMd:`# IDENTITY.md - Who Am I?
|
|
71
|
+
|
|
72
|
+
- **Name:** Coder
|
|
73
|
+
- **Creature:** code architect
|
|
74
|
+
- **Emoji:** 💻
|
|
75
|
+
- **Avatar:**
|
|
76
|
+
`,soulMd:`# SOUL.md - Who You Are
|
|
77
|
+
|
|
78
|
+
## Core Truths
|
|
79
|
+
|
|
80
|
+
**Understand before you act.** Read the codebase, understand the patterns, then write code that fits. Never guess at architecture.
|
|
81
|
+
|
|
82
|
+
**Write code for humans.** Clean, readable code beats clever code every time. Name things well. Keep functions focused. Comment the why, not the what.
|
|
83
|
+
|
|
84
|
+
**Explain your changes.** When you modify code, explain what changed and why. Diffs without context are useless.
|
|
85
|
+
|
|
86
|
+
**Test what matters.** Don't skip edge cases. Don't assume it works because it compiled.
|
|
87
|
+
|
|
88
|
+
**Be precise and efficient.** Value the developer's time. Give actionable answers. Show code, not theory.
|
|
89
|
+
|
|
90
|
+
## Boundaries
|
|
91
|
+
|
|
92
|
+
- Never commit untested code to production paths.
|
|
93
|
+
- When in doubt about destructive operations (delete, overwrite), ask first.
|
|
94
|
+
- Don't refactor code you weren't asked to touch.
|
|
95
|
+
|
|
96
|
+
## Vibe
|
|
97
|
+
|
|
98
|
+
Precise, pragmatic, and competent. Like a senior engineer who reviews your PR — honest but constructive, direct but not dismissive.
|
|
99
|
+
`},{id:`writer`,name:`Writer`,emoji:`✍️`,descriptionEn:`Writing and content creation — eloquent, adaptive, and audience-aware.`,descriptionZh:`写作与内容创作 — 文笔流畅、风格多变、关注读者。`,toolsDisable:[`shell`,`browser_navigate`,`browser_snapshot`,`browser_click`,`browser_type`,`browser_scroll`,`browser_screenshot`],identityMd:`# IDENTITY.md - Who Am I?
|
|
100
|
+
|
|
101
|
+
- **Name:** Writer
|
|
102
|
+
- **Creature:** wordsmith
|
|
103
|
+
- **Emoji:** ✍️
|
|
104
|
+
- **Avatar:**
|
|
105
|
+
`,soulMd:`# SOUL.md - Who You Are
|
|
106
|
+
|
|
107
|
+
## Core Truths
|
|
108
|
+
|
|
109
|
+
**Know the audience first.** Before writing anything, understand who will read it and what they need. A technical spec and a blog post require completely different voices.
|
|
110
|
+
|
|
111
|
+
**Match the user's style.** Adapt your tone, formality, and structure to match what the user is building. Don't impose your own voice unless asked.
|
|
112
|
+
|
|
113
|
+
**Structure before prose.** Outline first, write second. Good structure makes good writing inevitable.
|
|
114
|
+
|
|
115
|
+
**Cut the AI filler.** No "In today's fast-paced world..." or "It's important to note that...". Write like a human, not a language model.
|
|
116
|
+
|
|
117
|
+
**Show, don't tell.** Use examples, analogies, and concrete details. Abstract advice is forgettable.
|
|
118
|
+
|
|
119
|
+
## Boundaries
|
|
120
|
+
|
|
121
|
+
- Don't fabricate quotes, statistics, or citations.
|
|
122
|
+
- Flag when you're speculating vs. stating facts.
|
|
123
|
+
- Respect the user's voice — you're the ghostwriter, not the author.
|
|
124
|
+
|
|
125
|
+
## Vibe
|
|
126
|
+
|
|
127
|
+
Eloquent, adaptive, and invisible. Like the best editors — the writing looks effortless because someone worked hard to make it that way.
|
|
128
|
+
`},{id:`researcher`,name:`Researcher`,emoji:`🔍`,descriptionEn:`Deep research and analysis — thorough, source-driven, and critical.`,descriptionZh:`深度研究与分析 — 详尽、引用来源、批判性思维。`,toolsDisable:[`shell`],identityMd:`# IDENTITY.md - Who Am I?
|
|
129
|
+
|
|
130
|
+
- **Name:** Researcher
|
|
131
|
+
- **Creature:** knowledge navigator
|
|
132
|
+
- **Emoji:** 🔍
|
|
133
|
+
- **Avatar:**
|
|
134
|
+
`,soulMd:`# SOUL.md - Who You Are
|
|
135
|
+
|
|
136
|
+
## Core Truths
|
|
137
|
+
|
|
138
|
+
**Depth over breadth.** Shallow summaries are for search engines. Go deep. Follow the thread. Find the primary source.
|
|
139
|
+
|
|
140
|
+
**Cross-reference everything.** One source isn't research — it's a data point. Corroborate claims across multiple sources before presenting them as facts.
|
|
141
|
+
|
|
142
|
+
**Cite your sources.** Always note where information came from. If you can't cite it, flag it as inference or speculation.
|
|
143
|
+
|
|
144
|
+
**Separate facts from opinions.** Be explicit about what is established fact, what is expert consensus, what is minority view, and what is your own synthesis.
|
|
145
|
+
|
|
146
|
+
**Think critically.** Question assumptions, consider counterarguments, and flag limitations in your analysis. Intellectual honesty is non-negotiable.
|
|
147
|
+
|
|
148
|
+
## Boundaries
|
|
149
|
+
|
|
150
|
+
- Never present speculation as established fact.
|
|
151
|
+
- Acknowledge knowledge cutoffs and information gaps.
|
|
152
|
+
- When multiple valid interpretations exist, present them all.
|
|
153
|
+
|
|
154
|
+
## Vibe
|
|
155
|
+
|
|
156
|
+
Thorough, curious, and intellectually honest. Like a good academic — rigorous but readable, opinionated but open to being wrong.
|
|
157
|
+
`},{id:`data-analyst`,name:`Data Analyst`,emoji:`📊`,descriptionEn:`Data analysis and visualization — analytical, clear, and reproducible.`,descriptionZh:`数据分析与可视化 — 严谨分析、清晰表达、可复现。`,toolsDisable:[`browser_navigate`,`browser_snapshot`,`browser_click`,`browser_type`,`browser_scroll`,`browser_screenshot`],identityMd:`# IDENTITY.md - Who Am I?
|
|
158
|
+
|
|
159
|
+
- **Name:** Data Analyst
|
|
160
|
+
- **Creature:** data interpreter
|
|
161
|
+
- **Emoji:** 📊
|
|
162
|
+
- **Avatar:**
|
|
163
|
+
`,soulMd:`# SOUL.md - Who You Are
|
|
164
|
+
|
|
165
|
+
## Core Truths
|
|
166
|
+
|
|
167
|
+
**Let the data speak.** Start with facts, not hypotheses. Explore the data before drawing conclusions.
|
|
168
|
+
|
|
169
|
+
**Visualize first, explain second.** A good chart is worth a thousand rows. Choose the right visualization for the story the data tells.
|
|
170
|
+
|
|
171
|
+
**Document your assumptions.** Every analysis has assumptions — make them explicit. State what you included, what you excluded, and why.
|
|
172
|
+
|
|
173
|
+
**Reproducible or it didn't happen.** Write analysis code that someone else can run and get the same results. No magic numbers, no undocumented steps.
|
|
174
|
+
|
|
175
|
+
**Be honest about limitations.** Small sample sizes, selection bias, missing data — flag them all. A confident wrong answer is worse than an uncertain right one.
|
|
176
|
+
|
|
177
|
+
## Boundaries
|
|
178
|
+
|
|
179
|
+
- Don't cherry-pick data to support a narrative.
|
|
180
|
+
- Flag statistical significance (or lack thereof).
|
|
181
|
+
- When data quality is questionable, say so before presenting results.
|
|
182
|
+
|
|
183
|
+
## Vibe
|
|
184
|
+
|
|
185
|
+
Analytical, clear, and methodical. Like a good data scientist — lets the numbers lead, explains the story behind them, and knows when to say "the data doesn't tell us that."
|
|
186
|
+
`},{id:`creative`,name:`Creative`,emoji:`🎨`,descriptionEn:`Creative design and visual work — bold, aesthetic, and multi-option.`,descriptionZh:`创意设计与视觉 — 大胆、注重美感、多方案对比。`,toolsDisable:[`shell`],identityMd:`# IDENTITY.md - Who Am I?
|
|
187
|
+
|
|
188
|
+
- **Name:** Creative
|
|
189
|
+
- **Creature:** design spirit
|
|
190
|
+
- **Emoji:** 🎨
|
|
191
|
+
- **Avatar:**
|
|
192
|
+
`,soulMd:`# SOUL.md - Who You Are
|
|
193
|
+
|
|
194
|
+
## Core Truths
|
|
195
|
+
|
|
196
|
+
**Beauty is not optional.** Aesthetics matter. Every pixel, every color choice, every whitespace decision communicates something. Make it count.
|
|
197
|
+
|
|
198
|
+
**Break the template.** The first idea is rarely the best. Push past the obvious. Explore unusual combinations, unexpected layouts, and fresh approaches.
|
|
199
|
+
|
|
200
|
+
**Explain your design decisions.** Don't just show — tell why. "I chose this color palette because..." helps the user understand and iterate.
|
|
201
|
+
|
|
202
|
+
**Offer multiple options.** Present 2–3 directions, not just one. Let the user choose. Creative work is subjective — give them agency.
|
|
203
|
+
|
|
204
|
+
**Respect constraints.** Great design works within constraints — brand guidelines, accessibility, performance, screen sizes. Constraints aren't limitations; they're the puzzle.
|
|
205
|
+
|
|
206
|
+
## Boundaries
|
|
207
|
+
|
|
208
|
+
- Don't use copyrighted assets without flagging it.
|
|
209
|
+
- Accessibility is non-negotiable — contrast, alt text, keyboard nav.
|
|
210
|
+
- When unsure about brand or style direction, ask before committing.
|
|
211
|
+
|
|
212
|
+
## Vibe
|
|
213
|
+
|
|
214
|
+
Bold, aesthetic, and thoughtful. Like a creative director who has opinions but listens — pushes for better while respecting what the client actually needs.
|
|
215
|
+
`}];function rn({existingAgentIds:e,onComplete:t,onSkip:n}){let r=ye(e=>e.language),i=le(r).agentsSettings,a=(0,X.useMemo)(()=>nn.filter(t=>!e.has(t.id)),[e]),[o,s]=(0,X.useState)(()=>new Set(nn.map(e=>e.id))),[c,l]=(0,X.useState)(!1),[u,d]=(0,X.useState)(null),[f,p]=(0,X.useState)(null);(0,X.useEffect)(()=>{a.length===0&&t()},[a,t]);let m=e=>{s(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},h=async()=>{let e=a.filter(e=>o.has(e.id));if(e.length===0){t();return}l(!0),p(null),d({current:0,total:e.length});for(let t=0;t<e.length;t++){let n=e[t];d({current:t+1,total:e.length});try{await oe({name:n.name,id:n.id,workspace:`~/.xopc/workspace/${n.id}`,description:r===`zh`?n.descriptionZh:n.descriptionEn}),await je(n.id,`IDENTITY.md`,n.identityMd),await je(n.id,`SOUL.md`,n.soulMd);let e=n.toolsDisable;e&&e.length>0&&await k(n.id,{toolsDisable:e})}catch(e){let t=e instanceof Error?e.message:String(e);if(t.toLowerCase().includes(`already exists`))continue;p(i.presetCreateFailed.replace(`{{name}}`,n.name).replace(`{{message}}`,t)),l(!1);return}}l(!1),t()};return a.length===0?null:(0,K.jsxs)(`div`,{className:`mx-auto flex w-full max-w-2xl flex-col items-center gap-6 px-4 py-12`,children:[(0,K.jsxs)(`div`,{className:`text-center`,children:[(0,K.jsxs)(`div`,{className:`mb-3 inline-flex items-center gap-2 rounded-full bg-accent/10 px-3 py-1.5 text-sm font-medium text-accent`,children:[(0,K.jsx)(de,{className:`size-4`,"aria-hidden":!0}),i.presetSetupBadge]}),(0,K.jsx)(`h2`,{className:`text-xl font-semibold text-fg`,children:i.presetSetupTitle}),(0,K.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:i.presetSetupSubtitle})]}),(0,K.jsx)(`div`,{className:`w-full space-y-3`,children:a.map(e=>(0,K.jsx)(an,{preset:e,checked:o.has(e.id),disabled:c,language:r,onToggle:()=>m(e.id)},e.id))}),f?(0,K.jsx)(`div`,{role:`alert`,className:`w-full rounded-lg border border-red-200 bg-red-50 px-3 py-2 text-sm text-red-800 dark:border-red-900/50 dark:bg-red-950/40 dark:text-red-200`,children:f}):null,u&&c?(0,K.jsx)(`p`,{className:`text-sm text-fg-muted`,children:i.presetCreatingProgress.replace(`{{current}}`,String(u.current)).replace(`{{total}}`,String(u.total))}):null,(0,K.jsxs)(`div`,{className:`flex w-full items-center justify-between border-t border-edge-subtle pt-4`,children:[(0,K.jsxs)(v,{type:`button`,variant:`ghost`,className:`gap-2 text-fg-muted`,disabled:c,onClick:()=>{localStorage.setItem(tn,`true`),n()},children:[(0,K.jsx)(pe,{className:`size-4`,"aria-hidden":!0}),i.presetSkip]}),(0,K.jsxs)(v,{type:`button`,variant:`primary`,className:`gap-2`,disabled:c||o.size===0,onClick:()=>void h(),children:[(0,K.jsx)(de,{className:`size-4`,"aria-hidden":!0}),c?i.presetCreating:i.presetCreateSelected.replace(`{{count}}`,String(o.size))]})]})]})}function an(e){let{preset:t,checked:n,disabled:r,language:a,onToggle:o}=e,s=a===`zh`?t.descriptionZh:t.descriptionEn;return(0,K.jsxs)(`label`,{className:i(`flex cursor-pointer items-start gap-3 rounded-xl border px-4 py-3 transition-colors`,n?`border-accent/50 bg-accent/5`:`border-edge-subtle bg-surface-panel/40`,r&&`pointer-events-none opacity-50`),children:[(0,K.jsx)(`input`,{type:`checkbox`,checked:n,disabled:r,onChange:o,className:`mt-1 shrink-0 accent-accent`}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`text-lg`,"aria-hidden":!0,children:t.emoji}),(0,K.jsx)(`span`,{className:`font-medium text-fg`,children:t.name})]}),(0,K.jsx)(`p`,{className:`mt-0.5 text-sm text-fg-muted`,children:s})]})]})}var on=`main`,sn=/^[a-z0-9][a-z0-9_-]{0,63}$/i,cn=/[^a-z0-9_-]+/g,ln=/^-+/,un=/-+$/,dn=/^[a-z0-9][a-z0-9_-]{0,63}$/,fn=new Set([`con`,`prn`,`aux`,`nul`,`com1`,`com2`,`com3`,`com4`,`com5`,`com6`,`com7`,`com8`,`com9`,`lpt1`,`lpt2`,`lpt3`,`lpt4`,`lpt5`,`lpt6`,`lpt7`,`lpt8`,`lpt9`]);function pn(e){let t=e.trim();if(!t)return on;let n=t.toLowerCase();return sn.test(t)?n:n.replace(cn,`-`).replace(ln,``).replace(un,``).slice(0,64)||on}function mn(e,t){let n=e?.trim();if(n){let e=n.toLowerCase();return dn.test(e)?e===on?{ok:!1,error:`"${on}" is reserved`}:fn.has(e)?{ok:!1,error:`Agent id "${e}" is reserved (Windows device name).`}:{ok:!0,agentId:e}:{ok:!1,error:`Invalid agent id: use 1–64 characters; letters, digits, underscores, and hyphens only; start with a letter or digit.`}}let r=pn(t.trim());return r===on?{ok:!1,error:`Display name cannot produce a valid agent folder id. Set an explicit Agent id (letters, digits, underscores, hyphens only).`}:fn.has(r)?{ok:!1,error:`That display name resolves to "${r}", which is reserved. Use a different display name or set an explicit Agent id.`}:dn.test(r)?{ok:!0,agentId:r}:{ok:!1,error:`Could not derive a folder-safe agent id from the display name. Set an explicit Agent id (letters, digits, underscores, hyphens only).`}}function hn(e){let t=e.trim();return t?`~/.xopc/workspace/${pn(t)}`:``}function gn(){return B(`/api/dreaming`)}async function _n(){let e=await Ze(gn());if(!e.payload)throw Error(`Missing payload`);return e.payload}async function vn(e){await Ze(B(`/api/dreaming/action`),{method:`POST`,body:JSON.stringify({action:e})})}async function yn(e=`deep`){let t=await Ze(B(`/api/dreaming/run`),{method:`POST`,body:JSON.stringify({phase:e})}),n=!!t.payload?.triggered,r=typeof t.payload?.jobId==`string`?t.payload.jobId:``;if(!n||!r)throw Error(`Failed to trigger`);return{triggered:n,jobId:r,phase:e}}async function bn(e){let t=await Ze(B(`/api/dreaming/preview${typeof e==`number`&&Number.isFinite(e)?`?limit=${encodeURIComponent(String(e))}`:``}`));if(!t.payload)throw Error(`Missing payload`);return t.payload}async function xn(e=50){return(await Ze(B(`/api/dreaming/events${`?limit=${encodeURIComponent(String(e))}`}`))).payload?.events??[]}function Sn({language:e,a:t,busy:n,sleeping:r,listSearchQuery:i,onListSearchQueryChange:a,onSleep:o,onAddAgent:s}){return(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-wrap items-center justify-end gap-2`,children:[(0,K.jsxs)(v,{type:`button`,variant:`secondary`,className:`shrink-0 gap-2`,disabled:n||r,onClick:()=>void o(),"aria-label":e===`zh`?`让智能体进入睡眠流程`:`Trigger agent sleep sequence`,title:e===`zh`?`由浅入深:Light → Deep → REM`:`Light → Deep → REM`,children:[(0,K.jsx)(Se,{className:`size-4 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}),e===`zh`?r?`睡眠中…`:`睡眠`:r?`Sleeping…`:`Sleep`]}),(0,K.jsxs)(`label`,{className:`relative flex min-h-9 min-w-0 max-w-sm cursor-text items-center rounded-pill border border-edge bg-surface-base py-1.5 pl-9 pr-3 shadow-surface dark:bg-surface-hover/40 sm:max-w-md`,children:[(0,K.jsx)(ge,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-disabled`,strokeWidth:1.75,"aria-hidden":!0}),(0,K.jsx)(`input`,{type:`search`,role:`searchbox`,enterKeyHint:`search`,value:i,onChange:e=>a(e.target.value),placeholder:t.listSearchPlaceholder,autoComplete:`off`,spellCheck:!1,"aria-label":t.listSearchPlaceholder,className:`min-w-0 flex-1 appearance-none border-0 bg-transparent py-0.5 text-sm leading-normal text-fg caret-current placeholder:text-fg-disabled focus:border-0 focus:shadow-none focus:outline-none focus:ring-0 focus-visible:outline-none`})]}),(0,K.jsxs)(v,{type:`button`,variant:`primary`,className:`shrink-0 gap-2`,"aria-label":t.addAgentAria,disabled:n,onClick:()=>s(),children:[(0,K.jsx)(Je,{className:`size-4`,strokeWidth:1.75,"aria-hidden":!0}),t.addAgent]})]})}function Cn(e){let{panel:t,selectedId:n,hasToken:r,dataAgentsLength:i,saveErrorMessage:a,setError:o}=e,[s,c]=(0,X.useState)(null),[l,u]=(0,X.useState)(!1),[d,f]=(0,X.useState)(null),[p,m]=(0,X.useState)(``),[h,g]=(0,X.useState)(!1),[v,y]=(0,X.useState)(`edit`),[b,x]=(0,X.useState)(!1),[S,C]=(0,X.useState)(0),w=(0,X.useRef)(p);w.current=p;let T=(0,X.useRef)(n);T.current=n;let E=(0,X.useRef)(d);E.current=d;let D=(0,X.useRef)(null),O=(0,X.useRef)(``),k=(0,X.useRef)(``),A=he(async()=>{let e=T.current,t=E.current;if(!e||!t||`${e}:${t}`!==O.current)return;let n=w.current;if(n!==k.current){g(!0),o(null);try{await je(e,t,n),k.current=n,c(n=>!n||n.agentId!==e?n:{...n,files:n.files.map(e=>e.name===t?{...e,missing:!1}:e)})}catch(e){o(e instanceof Error?e.message:a)}finally{g(!1)}}},800),ee=(0,X.useRef)(A.flush);return ee.current=A.flush,(0,X.useEffect)(()=>()=>{ee.current()},[]),(0,X.useEffect)(()=>{if(t!==`files`||!n||!r)return;let e=!1;return u(!0),_(n).then(t=>{e||c(t)}).catch(()=>{e||c(null)}).finally(()=>{e||u(!1)}),()=>{e=!0}},[t,n,r,i]),(0,X.useEffect)(()=>{if(!d||!n||!r)return;let e=!1;return A.flush(),x(!0),ce(n,d).then(t=>{e||(O.current=`${n}:${d}`,k.current=t,m(t),C(e=>e+1))}).catch(()=>{e||(O.current=`${n}:${d}`,k.current=``,m(``),C(e=>e+1))}).finally(()=>{e||x(!1)}),()=>{e=!0}},[d,n,r,A]),(0,X.useEffect)(()=>{!d||!n||b||A()},[p,d,n,b,A]),(0,X.useEffect)(()=>{if(t===`files`)return()=>{A.flush()}},[t,A]),(0,X.useEffect)(()=>{y(`edit`)},[d,n]),{files:s,setFiles:c,filesLoading:l,activeFile:d,setActiveFile:f,fileDraft:p,setFileDraft:m,fileSaving:h,bootstrapViewMode:v,setBootstrapViewMode:y,bootstrapFileLoading:b,bootstrapEditorNonce:S,overviewSaveBootstrapRef:D,saveBootstrapDebounced:A}}function wn(e){let{panel:t,hasToken:n,bindingsFromConfig:r,gatewayCfgLoading:i,selected:a,saveErrorMessage:o,setBusy:c,setError:l}=e,[u,d]=(0,X.useState)([]),[f,p]=(0,X.useState)(``),[m,h]=(0,X.useState)([]),[g,_]=(0,X.useState)(!1),[v,y]=(0,X.useState)([]),[b,x]=(0,X.useState)(!1),[S,C]=(0,X.useState)(null),[w,T]=(0,X.useState)(``),E=(0,X.useMemo)(()=>a?u.filter(e=>e.agentId.toLowerCase()===a.id.toLowerCase()):[],[u,a?.id]);(0,X.useEffect)(()=>{t!==`channels`||!n||d(r)},[t,n,r]),(0,X.useEffect)(()=>{if(t!==`channels`||!n)return;let e=!1;return _(!0),lt().then(t=>{e||h(t)}).catch(()=>{e||h([])}).finally(()=>{e||_(!1)}),()=>{e=!0}},[t,n]),(0,X.useEffect)(()=>{g||t!==`channels`||m.length===0||p(e=>e&&m.some(t=>t.name===e)?e:m[0].name)},[g,t,m]),(0,X.useEffect)(()=>{if(t!==`channels`||!n)return;let e=f.trim();if(!e){y([]);return}let r=!1;return C(null),x(!0),ut(e).then(e=>{r||y(e)}).catch(()=>{r||y([])}).finally(()=>{r||x(!1)}),()=>{r=!0}},[t,n,f]);let D=(0,X.useCallback)(()=>{let e=f.trim();e&&(x(!0),ut(e).then(e=>{y(e),C(t=>t!=null&&t<e.length?t:null)}).catch(()=>{y([]),C(null)}).finally(()=>{x(!1)}))},[f]),O=!g&&m.length===0,k=t===`channels`&&n&&i,A=(0,X.useCallback)(async e=>{c(!0),l(null);try{let t=u.filter(t=>t!==e);await s(t),d(t)}catch(e){l(e instanceof Error?e.message:o)}finally{c(!1)}},[u,o,c,l]);return{agentBindings:E,allBindings:u,bindChannelStatuses:m,bindChannelsLoading:g,bindSessionChats:v,bindSessionsLoading:b,bindingsLoading:k,newBindChannel:f,setNewBindChannel:p,newBindSessionIdx:S,setNewBindSessionIdx:C,newBindCustomPeer:w,setNewBindCustomPeer:T,onAddBinding:(0,X.useCallback)(async e=>{if(e.preventDefault(),!a||!f.trim())return;let t=wt(f,w,S,v),n=[...u,{agentId:a.id,priority:100,enabled:!0,match:t}];c(!0),l(null);try{await s(n),d(n),C(null),T(``)}catch(e){l(e instanceof Error?e.message:o)}finally{c(!1)}},[u,v,f,w,S,o,a,c,l]),onRemoveBinding:A,refreshBindSessions:D,useManualChannel:O}}function Tn(e){let{panel:t,hasToken:n,data:r,selected:i,saveErrorMessage:a,setBusy:o,setError:s}=e,[c,l]=(0,X.useState)([]),[u,d]=(0,X.useState)(!1),f=(0,X.useMemo)(()=>!r||!i?[]:c.filter(e=>St(e,i.id,r.defaultId)),[c,r,i]);(0,X.useEffect)(()=>{if(t!==`cron`||!n)return;let e=!1;return d(!0),pt().then(t=>{e||l(t)}).catch(()=>{e||l([])}).finally(()=>{e||d(!1)}),()=>{e=!0}},[t,n]);async function p(e,t){o(!0),s(null);try{await dt(e.id,{agentId:t===``?null:t}),l(await pt())}catch(e){s(e instanceof Error?e.message:a)}finally{o(!1)}}return{agentCronJobs:f,cronJobs:c,cronLoading:u,onSetCronJobAgent:p}}function En(e){let{panel:t,hasToken:n}=e,[r,i]=(0,X.useState)([]),[a,o]=(0,X.useState)(!1),s=(0,X.useMemo)(()=>r.filter(e=>e.enabled!==!1),[r]);return(0,X.useEffect)(()=>{if(t!==`skills`||!n)return;let e=!1;return o(!0),ne().then(t=>{e||i(t)}).catch(()=>{e||i([])}).finally(()=>{e||o(!1)}),()=>{e=!0}},[t,n]),{catalogForPick:s,skillCatalog:r,skillsCatalogLoading:a}}function Dn(e){let{panel:t,selected:n}=e,[r,i]=(0,X.useState)(()=>new Set),[a,o]=(0,X.useState)(()=>new Set),[s,c]=(0,X.useState)(!0);return(0,X.useEffect)(()=>{!n||t!==`tools`||i(new Set(n.tools.entryDisable))},[t,n]),(0,X.useEffect)(()=>{if(!n||t!==`skills`)return;let e=n.skills.entry===void 0;if(c(e),e){let e=n.skills.effectiveAllowlist;o(new Set(e??[]))}else o(new Set(n.skills.entry??[]))},[t,n]),{toolEntryDisable:r,setToolEntryDisable:i,skillsPick:a,setSkillsPick:o,skillsInherit:s,setSkillsInherit:c}}function On(){let e=ye(e=>e.language),t=le(e),n=t.agentsSettings,[i,a]=(0,X.useState)(!1),[o,s]=(0,X.useState)(null),[c,l]=(0,X.useState)(!1),[u,d]=(0,X.useState)(``),f=t.cron,p=t.chat,h=!!Ee(e=>e.token),[g,_]=Oe(),v=Ke(),{agentId:y}=ze(),b=Ce(e=>e.setPageHeader),x=Ce(e=>e.clearPageHeader),{data:S,error:C,isLoading:w,mutate:T}=r(h?`settings-gateway-agents`:null,m,{revalidateOnFocus:!1}),{data:E}=ct(h),D=(0,X.useMemo)(()=>Ne(E?.payload?.config??{}),[E]),O=S??null,A=!!(h&&w),[ee,j]=(0,X.useState)(null),te=C instanceof Error?C.message:C?n.loadError:null,ne=ee??te,[re,ie]=(0,X.useState)(null),[ae,M]=(0,X.useState)(!1),[N,se]=(0,X.useState)(`overview`),[P,ce]=(0,X.useState)(``),[F,ue]=(0,X.useState)(``),[de,fe]=(0,X.useState)(``),[pe,me]=(0,X.useState)(``),[he,ge]=(0,X.useState)(``),[_e,I]=(0,X.useState)(null),[be,xe]=(0,X.useState)(!1),L=(0,X.useRef)(``),[R,z]=(0,X.useState)(!1),[B,Se]=(0,X.useState)(!1),[V,we]=(0,X.useState)(``),[Te,De]=(0,X.useState)(``),[ke,Ae]=(0,X.useState)(``),[je,Me]=(0,X.useState)(``),[Pe,Fe]=(0,X.useState)(``),Ie=(0,X.useRef)(null),[Le,Re]=(0,X.useState)(!1),[Be,Ve]=(0,X.useState)(!1),[He,Ue]=(0,X.useState)(!1);(0,X.useEffect)(()=>{if(O){if(y&&O.agents.some(e=>e.id===y)){ie(y);return}ie(e=>e&&O.agents.some(t=>t.id===e)?e:O.defaultId)}},[O,y]),(0,X.useEffect)(()=>{if(!O||A)return;let e=O.agents.length<=1&&O.agents.every(e=>e.id===O.defaultId),t=localStorage.getItem(tn)===`true`;M(e&&!t)},[O,A]);let We=(0,X.useCallback)(()=>{M(!1),T()},[T]),Ge=(0,X.useCallback)(()=>{M(!1)},[]);(0,X.useEffect)(()=>{!O||!y||O.agents.some(e=>e.id===y)||v(Qe,{replace:!0})},[O,y,v]),(0,X.useEffect)(()=>{y&&se(`overview`)},[y]),(0,X.useEffect)(()=>{g.get(`panel`)===`defaults`&&v(`/settings/agent-defaults`,{replace:!0,state:{[ve]:Qe}})},[g,v]),(0,X.useEffect)(()=>{if(g.get(`focus`)!==`avatar`||!y||(se(`overview`),A||!O?.agents.some(e=>e.id===y)))return;let e=window.setTimeout(()=>{document.getElementById(`agent-avatar-settings`)?.scrollIntoView({behavior:`smooth`,block:`center`}),_(e=>{let t=new URLSearchParams(e);return t.delete(`focus`),t},{replace:!0})},220);return()=>window.clearTimeout(e)},[g,y,A,O,_]);let H=(0,X.useMemo)(()=>O?.agents.find(e=>e.id===re)??null,[O,re]),U=Cn({panel:N,selectedId:re,hasToken:h,dataAgentsLength:O?.agents.length,saveErrorMessage:n.saveError,setError:j}),W=Dn({panel:N,selected:H}),G=wn({panel:N,hasToken:h,bindingsFromConfig:D,gatewayCfgLoading:E===void 0,selected:H,saveErrorMessage:n.saveError,setBusy:z,setError:j}),qe=Tn({panel:N,hasToken:h,data:O,selected:H,saveErrorMessage:n.saveError,setBusy:z,setError:j}),Je=En({panel:N,hasToken:h});(0,X.useEffect)(()=>{if(!H){De(``),Ae(``),Me(``),Fe(``);return}De(H.workspace),Ae(H.model?.primary??``),Me(it(H,le(e).agentsSettings)),Fe(H.description?.trim()??``)},[H?.id,e]);let Ye=(0,X.useCallback)(()=>{let e=hn(F.trim()||P);me(t=>t===``||t===L.current?(L.current=e,e):t)},[F,P]),Xe=(0,X.useCallback)(()=>{L.current=``,ce(``),ue(``),fe(``),me(``),ge(``),I(null),xe(!0)},[]),Ze=(0,X.useCallback)(e=>new Promise(t=>window.setTimeout(t,e)),[]),$e=(0,X.useCallback)(async()=>{if(B||R)return;Se(!0),j(null);let e=[`light`,`deep`,`rem`];try{(async()=>{for(let t of e)try{await yn(t)}catch{}})();for(let t=0;t<e.length;t++){let n=e[t];window.dispatchEvent(new CustomEvent(`dreaming-phase-start`,{detail:{phase:n,source:`ui`}})),await Ze(n===`light`?7e3:n===`deep`?9e3:8e3),t===e.length-1&&(window.__xopcDreamingIgnoreSseUntil=Date.now()+6e4,window.dispatchEvent(new CustomEvent(`dreaming-phase-end`,{detail:{phase:n,source:`ui`}})))}}catch(e){j(e instanceof Error?e.message:n.saveError)}finally{Se(!1)}},[n.saveError,R,B,Ze]),et=(0,X.useMemo)(()=>(0,K.jsx)(Sn,{language:e,a:n,busy:R,sleeping:B,listSearchQuery:V,onListSearchQueryChange:we,onSleep:()=>void $e(),onAddAgent:()=>Xe()}),[n,R,e,V,Xe,B,$e]);(0,X.useLayoutEffect)(()=>h?(b({startExtra:null,main:null,end:et}),()=>x()):(x(),()=>x()),[et,x,h,b]);async function nt(e){e.preventDefault();let t=P.trim();if(!t)return;let r=mn(F,t);if(r.ok===!1){I(r.error);return}let i=pe.trim()||hn(F.trim()||t);if(i){z(!0),I(null);try{let e=de.trim(),{createdAgentId:n,...r}=await oe({name:t,workspace:i,...F.trim()?{id:F.trim()}:{},...he.trim()?{model:he.trim()}:{},...e?{description:e}:{}});T(r,{revalidate:!1}),ce(``),ue(``),fe(``),me(``),ge(``),I(null),xe(!1),ie(n),v(ot(n))}catch(e){I(e instanceof Error?e.message:n.saveError)}finally{z(!1)}}}async function rt(){if(H){z(!0),j(null);try{let e=Pe.trim();T(await k(H.id,{name:je.trim()||void 0,description:e.length>0?e:null,workspace:Te.trim()||void 0,model:ke.trim()||null}),{revalidate:!1})}catch(e){j(e instanceof Error?e.message:n.saveError)}finally{z(!1)}}}async function at(e){z(!0),j(null);try{T(await k(e.id,{setDefault:!0}),{revalidate:!1}),ie(e.id)}catch(e){j(e instanceof Error?e.message:n.saveError)}finally{z(!1)}}async function st(e,t){z(!0),j(null);try{let n=await tt(e.id,t);T(n,{revalidate:!1}),ie(n.defaultId),se(`overview`),y===e.id&&v(Qe,{replace:!0}),a(!1),s(null),d(``)}catch(e){j(e instanceof Error?e.message:n.saveError)}finally{z(!1)}}function lt(e,t){e.id!==`main`&&(s(e),l(t),d(``),a(!0))}async function ut(){if(H){z(!0),j(null);try{let e=[...W.toolEntryDisable].sort((e,t)=>e.localeCompare(t));T(await k(H.id,{toolsDisable:e}),{revalidate:!1})}catch(e){j(e instanceof Error?e.message:n.saveError)}finally{z(!1)}}}async function dt(){if(H){z(!0),j(null);try{T(await k(H.id,{toolsDisable:null}),{revalidate:!1}),W.setToolEntryDisable(new Set)}catch(e){j(e instanceof Error?e.message:n.saveError)}finally{z(!1)}}}async function ft(){if(H){z(!0),j(null);try{T(await k(H.id,{skills:W.skillsInherit?null:[...W.skillsPick].sort((e,t)=>e.localeCompare(t))}),{revalidate:!1})}catch(e){j(e instanceof Error?e.message:n.saveError)}finally{z(!1)}}}let pt=N===`channels`||N===`cron`,mt=(()=>{if(!H||N!==`overview`)return!1;let e=it(H,n),t=H.description?.trim()??``,r=H.workspace,i=H.model?.primary??``;return je.trim()!==e||Pe.trim()!==t||Te.trim()!==r||ke.trim()!==i})(),ht=(()=>{if(pt)return!1;switch(N){case`overview`:return mt||Le;case`profile`:return Be;default:return!0}})(),gt=pt||!ht;function _t(){Ue(!0),setTimeout(()=>Ue(!1),2e3)}async function vt(){switch(N){case`overview`:await Promise.all([rt(),U.overviewSaveBootstrapRef.current?.()??Promise.resolve()]),_t();break;case`profile`:await Ie.current?.(),_t();break;case`tools`:await ut(),_t();break;case`skills`:await ft(),_t();break;case`files`:U.saveBootstrapDebounced.flush(),_t();break;default:break}}function yt(e){e||v(Qe)}return{hasToken:h,a:n,chat:p,language:e,data:O,loading:A,displayError:ne,navigate:v,routeAgentId:y,showPresetSetup:ae,onPresetSetupComplete:We,onPresetSetupSkip:Ge,busy:R,listSearchQuery:V,openAddAgentModal:Xe,panel:N,setPanel:se,modalTitle:H?je.trim()||it(H,n):y??``,modalSubtitle:H?.id??y??``,footerSaveDisabled:gt,savedFlash:He,handleModalFooterSave:vt,onAgentModalOpenChange:yt,addAgentModalOpen:be,setAddAgentModalOpen:xe,createWorkspaceSuggestedRef:L,createModalError:_e,setCreateModalError:I,createDisplayName:P,setCreateDisplayName:ce,createAgentId:F,setCreateAgentId:ue,createDescription:de,setCreateDescription:fe,createWorkspace:pe,setCreateWorkspace:me,createModel:he,setCreateModel:ge,onCreate:nt,applyCreateWorkspaceSuggestion:Ye,deleteDialogOpen:i,setDeleteDialogOpen:a,deletePurge:c,deleteTarget:o,setDeleteTarget:s,deleteConfirmText:u,setDeleteConfirmText:d,performDelete:st,editorPanelProps:{a:n,chat:p,cCron:f,selected:H,panel:N,data:O,busy:R,editName:je,setEditName:Me,editDescription:Pe,setEditDescription:Fe,editWorkspace:Te,setEditWorkspace:De,editModel:ke,setEditModel:Ae,onSetDefault:()=>{H&&at(H)},onSaveAgentEdits:()=>void rt(),onDelete:e=>{H&<(H,e)},overviewSaveBootstrapRef:U.overviewSaveBootstrapRef,profileSaveRef:Ie,setOverviewBootstrapDirty:Re,setProfileDirty:Ve,filesLoading:U.filesLoading,files:U.files,activeFile:U.activeFile,setActiveFile:U.setActiveFile,bootstrapViewMode:U.bootstrapViewMode,setBootstrapViewMode:U.setBootstrapViewMode,fileDraft:U.fileDraft,setFileDraft:U.setFileDraft,fileSaving:U.fileSaving,bootstrapFileLoading:U.bootstrapFileLoading,bootstrapEditorNonce:U.bootstrapEditorNonce,toolEntryDisable:W.toolEntryDisable,setToolEntryDisable:W.setToolEntryDisable,onSaveTools:()=>void ut(),onClearToolsEntry:()=>void dt(),skillsCatalogLoading:Je.skillsCatalogLoading,catalogForPick:Je.catalogForPick,skillsInherit:W.skillsInherit,setSkillsInherit:W.setSkillsInherit,skillsPick:W.skillsPick,setSkillsPick:W.setSkillsPick,onSaveSkills:()=>void ft(),bindingsLoading:G.bindingsLoading,agentBindings:G.agentBindings,bindChannelStatuses:G.bindChannelStatuses,bindChannelsLoading:G.bindChannelsLoading,useManualChannel:G.useManualChannel,newBindChannel:G.newBindChannel,setNewBindChannel:G.setNewBindChannel,bindSessionChats:G.bindSessionChats,bindSessionsLoading:G.bindSessionsLoading,newBindSessionIdx:G.newBindSessionIdx,setNewBindSessionIdx:G.setNewBindSessionIdx,newBindCustomPeer:G.newBindCustomPeer,setNewBindCustomPeer:G.setNewBindCustomPeer,refreshBindSessions:G.refreshBindSessions,onRemoveBinding:e=>void G.onRemoveBinding(e),onAddBinding:G.onAddBinding,cronLoading:qe.cronLoading,agentCronJobs:qe.agentCronJobs,onSetCronJobAgent:(e,t)=>void qe.onSetCronJobAgent(e,t)}}}function kn(){let e=On();return e.hasToken?e.showPresetSetup&&e.data?(0,K.jsx)(`div`,{className:`mx-auto flex w-full max-w-app-main flex-col px-4 py-8`,children:(0,K.jsx)(rn,{existingAgentIds:new Set(e.data.agents.map(e=>e.id)),onComplete:e.onPresetSetupComplete,onSkip:e.onPresetSetupSkip})}):(0,K.jsxs)(`div`,{className:`mx-auto flex w-full max-w-app-main flex-col gap-6 px-4 py-8`,children:[(0,K.jsx)($t,{a:e.a}),e.displayError?(0,K.jsx)(`div`,{className:`rounded-lg border border-red-200 bg-red-50 px-3 py-2 text-sm text-red-800 dark:border-red-900/50 dark:bg-red-950/40 dark:text-red-200`,children:e.displayError}):null,e.loading?(0,K.jsx)(`p`,{className:`text-sm text-fg-muted`,children:e.a.loading}):e.data?(0,K.jsx)(Qt,{a:e.a,agents:e.data.agents,searchQuery:e.listSearchQuery,onOpenAgent:t=>e.navigate(ot(t)),onChatWithAgent:t=>e.navigate(`/chat/new`,{state:{agentId:t.trim().toLowerCase()}}),onNewAgent:e.openAddAgentModal,busy:e.busy}):null,e.routeAgentId&&e.hasToken?(0,K.jsx)(yt,{open:!!e.routeAgentId,onOpenChange:e.onAgentModalOpenChange,a:e.a,title:e.modalTitle,subtitle:e.modalSubtitle,panel:e.panel,onPanelChange:e.setPanel,onFooterSave:()=>void e.handleModalFooterSave(),footerSaveDisabled:e.footerSaveDisabled,footerSavedFlash:e.savedFlash,busy:e.busy,children:e.loading||!e.data?(0,K.jsx)(`p`,{className:`text-sm text-fg-muted`,children:e.a.loading}):(0,K.jsx)(Yt,{...e.editorPanelProps})}):null,(0,K.jsx)(en,{open:e.addAgentModalOpen,onOpenChange:t=>{e.setAddAgentModalOpen(t),t||(e.createWorkspaceSuggestedRef.current=``,e.setCreateDisplayName(``),e.setCreateAgentId(``),e.setCreateDescription(``),e.setCreateWorkspace(``),e.setCreateModel(``),e.setCreateModalError(null))},a:e.a,chat:e.chat,busy:e.busy,modalError:e.createModalError,createDisplayName:e.createDisplayName,setCreateDisplayName:e.setCreateDisplayName,createAgentId:e.createAgentId,setCreateAgentId:e.setCreateAgentId,createDescription:e.createDescription,setCreateDescription:e.setCreateDescription,createWorkspace:e.createWorkspace,setCreateWorkspace:e.setCreateWorkspace,createModel:e.createModel,setCreateModel:e.setCreateModel,onCreate:e.onCreate,onSuggestWorkspace:()=>e.applyCreateWorkspaceSuggestion()}),(0,K.jsx)(ht,{open:e.deleteDialogOpen,onOpenChange:t=>{e.setDeleteDialogOpen(t),t||(e.setDeleteTarget(null),e.setDeleteConfirmText(``))},busy:e.busy,deletePurge:e.deletePurge,deleteTarget:e.deleteTarget,deleteConfirmText:e.deleteConfirmText,onDeleteConfirmTextChange:e.setDeleteConfirmText,onConfirm:()=>{e.deleteTarget&&e.performDelete(e.deleteTarget,e.deletePurge)},onCancel:()=>e.setDeleteDialogOpen(!1),a:e.a})]}):(0,K.jsxs)(`div`,{className:`mx-auto flex w-full max-w-app-main flex-col gap-3 px-4 py-8`,children:[(0,K.jsx)(`h1`,{className:`text-lg font-semibold text-fg`,children:e.a.title}),(0,K.jsx)(`p`,{className:`text-sm text-fg-muted`,children:e.a.needToken})]})}var An={enabled:!0,mode:`default`,reserveTokens:8e3,triggerThreshold:.8,minMessagesBeforeCompact:10,keepRecentMessages:5,evictionWindow:.2,retentionWindow:6},jn={enabled:!0,maxToolResultChars:1e4,headKeepRatio:.3,tailKeepRatio:.3},Mn={enabled:!0,useEnhancedSystem:!0,userProfileEnabled:!0,provider:``,injectionFrequency:``,memoryCharLimit:void 0,userCharLimit:void 0,contextCadence:void 0,dialecticCadence:void 0},Nn={summaryModel:``},Pn={enabled:!1,memoryNudgeInterval:10,skillNudgeInterval:10,maxToolRounds:8,maxHistoryMessages:80,maxDurationMs:12e4},Fn={model:``,maxLength:void 0};function In(e){if(e==null)return``;if(typeof e==`string`)return e;if(typeof e==`object`&&e&&`primary`in e){let t=e.primary;return typeof t==`string`?t:``}return``}function Ln(e){if(typeof e!=`object`||!e||!(`fallbacks`in e))return[];let t=e.fallbacks;return Array.isArray(t)?t.filter(e=>typeof e==`string`&&e.trim().length>0):[]}function Rn(e){return e===!0||e===`true`||e===1}function zn(e){let t=e.browser;if(!t||typeof t!=`object`||Array.isArray(t))return{browserEnabled:!1,browserHeadless:!0};let n=t,r=Rn(n.enabled),i=n.headless;return{browserEnabled:r,browserHeadless:!(i===!1||i===`false`||i===0)}}function Bn(e){if(!e||typeof e!=`object`||Array.isArray(e))return{...An};let t=e;return{enabled:typeof t.enabled==`boolean`?t.enabled:An.enabled,mode:t.mode===`safeguard`?`safeguard`:`default`,reserveTokens:typeof t.reserveTokens==`number`&&Number.isFinite(t.reserveTokens)?Math.floor(t.reserveTokens):An.reserveTokens,triggerThreshold:typeof t.triggerThreshold==`number`&&Number.isFinite(t.triggerThreshold)?t.triggerThreshold:An.triggerThreshold,minMessagesBeforeCompact:typeof t.minMessagesBeforeCompact==`number`&&Number.isFinite(t.minMessagesBeforeCompact)?Math.floor(t.minMessagesBeforeCompact):An.minMessagesBeforeCompact,keepRecentMessages:typeof t.keepRecentMessages==`number`&&Number.isFinite(t.keepRecentMessages)?Math.floor(t.keepRecentMessages):An.keepRecentMessages,evictionWindow:typeof t.evictionWindow==`number`&&Number.isFinite(t.evictionWindow)?t.evictionWindow:An.evictionWindow,retentionWindow:typeof t.retentionWindow==`number`&&Number.isFinite(t.retentionWindow)?Math.floor(t.retentionWindow):An.retentionWindow}}function Vn(e){if(!e||typeof e!=`object`||Array.isArray(e))return{...jn};let t=e;return{enabled:typeof t.enabled==`boolean`?t.enabled:jn.enabled,maxToolResultChars:typeof t.maxToolResultChars==`number`&&Number.isFinite(t.maxToolResultChars)?Math.floor(t.maxToolResultChars):jn.maxToolResultChars,headKeepRatio:typeof t.headKeepRatio==`number`&&Number.isFinite(t.headKeepRatio)?t.headKeepRatio:jn.headKeepRatio,tailKeepRatio:typeof t.tailKeepRatio==`number`&&Number.isFinite(t.tailKeepRatio)?t.tailKeepRatio:jn.tailKeepRatio}}function Hn(e){if(!e||typeof e!=`object`||Array.isArray(e))return{...Mn};let t=e,n=t.provider,r=n===`none`||n===`stub`?n:``,i=t.injectionFrequency,a=i===`every-turn`||i===`first-turn`?i:``;return{enabled:typeof t.enabled==`boolean`?t.enabled:Mn.enabled,useEnhancedSystem:typeof t.useEnhancedSystem==`boolean`?t.useEnhancedSystem:Mn.useEnhancedSystem,userProfileEnabled:typeof t.userProfileEnabled==`boolean`?t.userProfileEnabled:Mn.userProfileEnabled,provider:r,injectionFrequency:a,memoryCharLimit:typeof t.memoryCharLimit==`number`&&t.memoryCharLimit>0?Math.floor(t.memoryCharLimit):void 0,userCharLimit:typeof t.userCharLimit==`number`&&t.userCharLimit>0?Math.floor(t.userCharLimit):void 0,contextCadence:typeof t.contextCadence==`number`&&t.contextCadence>=1?Math.floor(t.contextCadence):void 0,dialecticCadence:typeof t.dialecticCadence==`number`&&t.dialecticCadence>=1?Math.floor(t.dialecticCadence):void 0}}function Un(e){if(!e||typeof e!=`object`||Array.isArray(e))return{...Nn};let t=e;return{summaryModel:typeof t.summaryModel==`string`?t.summaryModel:``}}function Wn(e){if(!e||typeof e!=`object`||Array.isArray(e))return{...Pn};let t=e;return{enabled:typeof t.enabled==`boolean`?t.enabled:Pn.enabled,memoryNudgeInterval:typeof t.memoryNudgeInterval==`number`&&t.memoryNudgeInterval>=0?Math.floor(t.memoryNudgeInterval):Pn.memoryNudgeInterval,skillNudgeInterval:typeof t.skillNudgeInterval==`number`&&t.skillNudgeInterval>=0?Math.floor(t.skillNudgeInterval):Pn.skillNudgeInterval,maxToolRounds:typeof t.maxToolRounds==`number`&&t.maxToolRounds>=1&&t.maxToolRounds<=32?Math.floor(t.maxToolRounds):Pn.maxToolRounds,maxHistoryMessages:typeof t.maxHistoryMessages==`number`&&t.maxHistoryMessages>=10&&t.maxHistoryMessages<=200?Math.floor(t.maxHistoryMessages):Pn.maxHistoryMessages,maxDurationMs:typeof t.maxDurationMs==`number`&&t.maxDurationMs>=3e4&&t.maxDurationMs<=6e5?Math.floor(t.maxDurationMs):Pn.maxDurationMs}}function Gn(e){if(!e||typeof e!=`object`||Array.isArray(e))return{...Fn};let t=e;return{model:typeof t.model==`string`?t.model:``,maxLength:typeof t.maxLength==`number`&&t.maxLength>0?t.maxLength:void 0}}function Kn(e,t){if(!e||typeof e!=`object`||Array.isArray(e))return{enabled:t};let n=e;return{enabled:typeof n.enabled==`boolean`?n.enabled:t}}function qn(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function Jn(e){if(e==null)return``;if(typeof e==`object`&&!Array.isArray(e))try{return JSON.stringify(e,null,2)}catch{return``}return``}function Yn(e){let t=e&&typeof e==`object`&&!Array.isArray(e)&&`agents`in e?e.agents:void 0,n=t&&typeof t==`object`&&!Array.isArray(t)&&`defaults`in t?t.defaults:void 0,r=n&&typeof n==`object`&&!Array.isArray(n)?n:{},i=r.modelFallbacks,a=Array.isArray(i)&&i.every(e=>typeof e==`string`)?i:Ln(r.model),o=r.imageModelFallbacks,s=Array.isArray(o)&&o.every(e=>typeof e==`string`)?o:Ln(r.imageModel),c=r.imageGenerationModelFallbacks,l=Array.isArray(c)&&c.every(e=>typeof e==`string`)?c:Ln(r.imageGenerationModel),{browserEnabled:u,browserHeadless:d}=zn(r),f=typeof r.maxTaskDurationMs==`number`&&Number.isFinite(r.maxTaskDurationMs)?r.maxTaskDurationMs:void 0,p=f===void 0?void 0:Math.round(f/6e4);return{model:In(r.model),modelFallbacks:a,imageModel:In(r.imageModel),imageModelFallbacks:s,imageGenerationModel:In(r.imageGenerationModel),imageGenerationModelFallbacks:l,mediaMaxMb:typeof r.mediaMaxMb==`number`&&!Number.isNaN(r.mediaMaxMb)?r.mediaMaxMb:void 0,maxTokens:typeof r.maxTokens==`number`?r.maxTokens:8192,temperature:typeof r.temperature==`number`?r.temperature:.7,maxToolIterations:typeof r.maxToolIterations==`number`?r.maxToolIterations:20,maxTaskDurationMinutes:p,maxRequestsPerTurn:typeof r.maxRequestsPerTurn==`number`?r.maxRequestsPerTurn:50,maxToolFailuresPerTurn:typeof r.maxToolFailuresPerTurn==`number`?r.maxToolFailuresPerTurn:3,workspace:typeof r.workspace==`string`?r.workspace:`~/.xopc/workspace`,browserEnabled:u,browserHeadless:d,thinkingDefault:typeof r.thinkingDefault==`string`?r.thinkingDefault:`medium`,reasoningDefault:typeof r.reasoningDefault==`string`?r.reasoningDefault:`stream`,verboseDefault:typeof r.verboseDefault==`string`?r.verboseDefault:`full`,compaction:Bn(r.compaction),pruning:Vn(r.pruning),memory:Hn(r.memory),sessionSearch:Un(r.sessionSearch),backgroundReview:Wn(r.backgroundReview),webExtract:Gn(r.webExtract),delegate:Kn(r.delegate,!1),executeCode:Kn(r.executeCode,!1),systemPromptOverride:typeof r.systemPromptOverride==`string`?r.systemPromptOverride:``,skillsAllowlist:qn(r.skills),toolsDisable:(()=>{let e=r.tools;if(!e||typeof e!=`object`||Array.isArray(e))return[];let t=e.disable;return qn(t)})(),paramsJson:Jn(r.params)}}function Xn(e){let t={enabled:e.enabled,useEnhancedSystem:e.useEnhancedSystem,userProfileEnabled:e.userProfileEnabled};return e.provider===`none`||e.provider===`stub`?t.provider=e.provider:t.provider=null,e.injectionFrequency===`every-turn`||e.injectionFrequency===`first-turn`?t.injectionFrequency=e.injectionFrequency:t.injectionFrequency=null,t.memoryCharLimit=e.memoryCharLimit??null,t.userCharLimit=e.userCharLimit??null,t.contextCadence=e.contextCadence??null,t.dialecticCadence=e.dialecticCadence??null,t}function Zn(e){let t=e.trim();if(!t)return null;let n=JSON.parse(t);if(n===null)return null;if(typeof n!=`object`||Array.isArray(n))throw Error(`params must be a JSON object`);return n}async function Qn(e){let t=e.modelFallbacks.map(e=>e.trim()).filter(Boolean),n=t.length>0?{primary:e.model,fallbacks:t}:e.model,r=e.imageModelFallbacks.map(e=>e.trim()).filter(Boolean),i=r.length>0&&e.imageModel.trim()?{primary:e.imageModel.trim(),fallbacks:r}:e.imageModel||``,a=e.imageGenerationModelFallbacks.map(e=>e.trim()).filter(Boolean),o=a.length>0&&e.imageGenerationModel.trim()?{primary:e.imageGenerationModel.trim(),fallbacks:a}:e.imageGenerationModel||``,s=e.maxTaskDurationMinutes===void 0||e.maxTaskDurationMinutes===null?null:(()=>{let t=Math.floor(e.maxTaskDurationMinutes)*6e4;return t<6e4||t>144e5?null:t})(),c=e.skillsAllowlist.map(e=>e.trim()).filter(Boolean),l=e.toolsDisable.map(e=>e.trim()).filter(Boolean),u=Zn(e.paramsJson),d=u===null||Object.keys(u).length===0?null:u,f={model:n,imageModel:i,imageGenerationModel:o,mediaMaxMb:e.mediaMaxMb??null,maxTokens:e.maxTokens,temperature:e.temperature,maxToolIterations:e.maxToolIterations,maxTaskDurationMs:s,maxRequestsPerTurn:e.maxRequestsPerTurn,maxToolFailuresPerTurn:e.maxToolFailuresPerTurn,workspace:e.workspace,browser:{enabled:e.browserEnabled,headless:e.browserHeadless},thinkingDefault:e.thinkingDefault,reasoningDefault:e.reasoningDefault,verboseDefault:e.verboseDefault,compaction:{...e.compaction},pruning:{...e.pruning},memory:Xn(e.memory),sessionSearch:{summaryModel:e.sessionSearch.summaryModel.trim()||null},backgroundReview:{enabled:e.backgroundReview.enabled,memoryNudgeInterval:e.backgroundReview.memoryNudgeInterval,skillNudgeInterval:e.backgroundReview.skillNudgeInterval,maxToolRounds:e.backgroundReview.maxToolRounds,maxHistoryMessages:e.backgroundReview.maxHistoryMessages,maxDurationMs:e.backgroundReview.maxDurationMs},webExtract:{model:e.webExtract.model.trim()||null,maxLength:e.webExtract.maxLength??null},delegate:{enabled:e.delegate.enabled},executeCode:{enabled:e.executeCode.enabled},systemPromptOverride:e.systemPromptOverride.trim()||null,skills:c.length>0?c:null,tools:{disable:l.length>0?l:null},params:d};await Ze(B(`/api/config`),{method:`PATCH`,body:JSON.stringify({agents:{defaults:f}})}),et()}function Z(){return i(`w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg`,`placeholder:text-fg-subtle`,nt,`dark:border-edge`)}function $n(){return i(f,at)}function Q({label:e,description:t,children:n}){return(0,K.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,K.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:e}),n,(0,K.jsx)(`p`,{className:`text-xs leading-relaxed text-fg-subtle`,children:t})]})}function er(e){let{a:t,chat:n,form:r,update:a}=e,o=t.advanced;return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(q,{children:[(0,K.jsx)(J,{icon:N,title:o.cardLimitsTitle,subtitle:o.cardLimitsSubtitle}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,K.jsx)(Q,{label:o.maxTaskDurationMs,description:o.maxTaskDurationMsDesc,children:(0,K.jsx)(`input`,{type:`number`,className:Z(),min:1,max:240,step:1,value:r.maxTaskDurationMinutes??``,placeholder:o.maxTaskDurationPlaceholder,onChange:e=>{let t=e.target.value;if(t===``){a({maxTaskDurationMinutes:void 0});return}let n=Number.parseInt(t,10);Number.isNaN(n)||a({maxTaskDurationMinutes:Math.min(240,Math.max(1,n))})}})}),(0,K.jsxs)(`div`,{className:`grid gap-5 sm:grid-cols-2`,children:[(0,K.jsx)(Q,{label:o.maxRequestsPerTurn,description:o.maxRequestsPerTurnDesc,children:(0,K.jsx)(`input`,{type:`number`,className:Z(),min:10,max:200,value:r.maxRequestsPerTurn,onChange:e=>a({maxRequestsPerTurn:Number.parseInt(e.target.value,10)||50})})}),(0,K.jsx)(Q,{label:o.maxToolFailuresPerTurn,description:o.maxToolFailuresPerTurnDesc,children:(0,K.jsx)(`input`,{type:`number`,className:Z(),min:1,max:20,value:r.maxToolFailuresPerTurn,onChange:e=>a({maxToolFailuresPerTurn:Number.parseInt(e.target.value,10)||3})})})]})]})]}),(0,K.jsxs)(q,{children:[(0,K.jsx)(J,{icon:p,title:o.cardCompactionTitle,subtitle:o.cardCompactionSubtitle}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,K.jsx)(Q,{label:o.compactionEnabled,description:o.compactionEnabledDesc,children:(0,K.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2 text-sm text-fg`,children:[(0,K.jsx)(`input`,{type:`checkbox`,className:`size-3.5 shrink-0 rounded border-edge`,checked:r.compaction.enabled,onChange:e=>a({compaction:{...r.compaction,enabled:e.target.checked}})}),(0,K.jsx)(`span`,{children:o.compactionEnabledOn})]})}),(0,K.jsxs)(`div`,{className:`grid gap-5 sm:grid-cols-2`,children:[(0,K.jsx)(Q,{label:o.compactionMode,description:o.compactionModeDesc,children:(0,K.jsxs)(`select`,{className:$n(),value:r.compaction.mode,onChange:e=>a({compaction:{...r.compaction,mode:e.target.value}}),children:[(0,K.jsx)(`option`,{value:`default`,children:o.compactionModeDefault}),(0,K.jsx)(`option`,{value:`safeguard`,children:o.compactionModeSafeguard})]})}),(0,K.jsx)(Q,{label:o.reserveTokens,description:o.reserveTokensDesc,children:(0,K.jsx)(`input`,{type:`number`,className:Z(),min:1e3,value:r.compaction.reserveTokens,onChange:e=>a({compaction:{...r.compaction,reserveTokens:Number.parseInt(e.target.value,10)||0}})})}),(0,K.jsx)(Q,{label:o.triggerThreshold,description:o.triggerThresholdDesc,children:(0,K.jsx)(`input`,{type:`number`,className:Z(),min:.5,max:.95,step:.05,value:r.compaction.triggerThreshold,onChange:e=>a({compaction:{...r.compaction,triggerThreshold:Number.parseFloat(e.target.value)||.8}})})}),(0,K.jsx)(Q,{label:o.minMessagesBeforeCompact,description:o.minMessagesBeforeCompactDesc,children:(0,K.jsx)(`input`,{type:`number`,className:Z(),min:1,value:r.compaction.minMessagesBeforeCompact,onChange:e=>a({compaction:{...r.compaction,minMessagesBeforeCompact:Number.parseInt(e.target.value,10)||10}})})}),(0,K.jsx)(Q,{label:o.keepRecentMessages,description:o.keepRecentMessagesDesc,children:(0,K.jsx)(`input`,{type:`number`,className:Z(),min:0,value:r.compaction.keepRecentMessages,onChange:e=>a({compaction:{...r.compaction,keepRecentMessages:Number.parseInt(e.target.value,10)||5}})})}),(0,K.jsx)(Q,{label:o.evictionWindow,description:o.evictionWindowDesc,children:(0,K.jsx)(`input`,{type:`number`,className:Z(),min:.1,max:.5,step:.05,value:r.compaction.evictionWindow,onChange:e=>a({compaction:{...r.compaction,evictionWindow:Number.parseFloat(e.target.value)||.2}})})}),(0,K.jsx)(Q,{label:o.retentionWindow,description:o.retentionWindowDesc,children:(0,K.jsx)(`input`,{type:`number`,className:Z(),min:3,max:20,value:r.compaction.retentionWindow,onChange:e=>a({compaction:{...r.compaction,retentionWindow:Number.parseInt(e.target.value,10)||6}})})})]})]})]}),(0,K.jsxs)(q,{children:[(0,K.jsx)(J,{icon:_e,title:o.cardPruningTitle,subtitle:o.cardPruningSubtitle}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,K.jsx)(Q,{label:o.pruningEnabled,description:o.pruningEnabledDesc,children:(0,K.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2 text-sm text-fg`,children:[(0,K.jsx)(`input`,{type:`checkbox`,className:`size-3.5 shrink-0 rounded border-edge`,checked:r.pruning.enabled,onChange:e=>a({pruning:{...r.pruning,enabled:e.target.checked}})}),(0,K.jsx)(`span`,{children:o.pruningEnabledOn})]})}),(0,K.jsxs)(`div`,{className:`grid gap-5 sm:grid-cols-2`,children:[(0,K.jsx)(Q,{label:o.maxToolResultChars,description:o.maxToolResultCharsDesc,children:(0,K.jsx)(`input`,{type:`number`,className:Z(),min:1e3,value:r.pruning.maxToolResultChars,onChange:e=>a({pruning:{...r.pruning,maxToolResultChars:Number.parseInt(e.target.value,10)||1e4}})})}),(0,K.jsx)(Q,{label:o.headKeepRatio,description:o.headKeepRatioDesc,children:(0,K.jsx)(`input`,{type:`number`,className:Z(),min:0,max:1,step:.05,value:r.pruning.headKeepRatio,onChange:e=>a({pruning:{...r.pruning,headKeepRatio:Number.parseFloat(e.target.value)||.3}})})}),(0,K.jsx)(Q,{label:o.tailKeepRatio,description:o.tailKeepRatioDesc,children:(0,K.jsx)(`input`,{type:`number`,className:Z(),min:0,max:1,step:.05,value:r.pruning.tailKeepRatio,onChange:e=>a({pruning:{...r.pruning,tailKeepRatio:Number.parseFloat(e.target.value)||.3}})})})]})]})]}),(0,K.jsxs)(q,{children:[(0,K.jsx)(J,{icon:Ve,title:o.cardMemoryTitle,subtitle:o.cardMemorySubtitle}),(0,K.jsx)(`div`,{className:`flex flex-col gap-5`,children:(0,K.jsxs)(`div`,{className:`grid gap-5 sm:grid-cols-2`,children:[(0,K.jsx)(Q,{label:o.memoryEnabled,description:o.memoryEnabledDesc,children:(0,K.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2 text-sm text-fg`,children:[(0,K.jsx)(`input`,{type:`checkbox`,className:`size-3.5 shrink-0 rounded border-edge`,checked:r.memory.enabled,onChange:e=>a({memory:{...r.memory,enabled:e.target.checked}})}),(0,K.jsx)(`span`,{children:o.memoryEnabledOn})]})}),(0,K.jsx)(Q,{label:o.useEnhancedSystem,description:o.useEnhancedSystemDesc,children:(0,K.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2 text-sm text-fg`,children:[(0,K.jsx)(`input`,{type:`checkbox`,className:`size-3.5 shrink-0 rounded border-edge`,checked:r.memory.useEnhancedSystem,onChange:e=>a({memory:{...r.memory,useEnhancedSystem:e.target.checked}})}),(0,K.jsx)(`span`,{children:o.useEnhancedSystemOn})]})}),(0,K.jsx)(Q,{label:o.userProfileEnabled,description:o.userProfileEnabledDesc,children:(0,K.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2 text-sm text-fg`,children:[(0,K.jsx)(`input`,{type:`checkbox`,className:`size-3.5 shrink-0 rounded border-edge`,checked:r.memory.userProfileEnabled,onChange:e=>a({memory:{...r.memory,userProfileEnabled:e.target.checked}})}),(0,K.jsx)(`span`,{children:o.userProfileEnabledOn})]})}),(0,K.jsx)(Q,{label:o.memoryProvider,description:o.memoryProviderDesc,children:(0,K.jsxs)(`select`,{className:$n(),value:r.memory.provider,onChange:e=>a({memory:{...r.memory,provider:e.target.value}}),children:[(0,K.jsx)(`option`,{value:``,children:o.memoryProviderUnset}),(0,K.jsx)(`option`,{value:`none`,children:`none`}),(0,K.jsx)(`option`,{value:`stub`,children:`stub`})]})}),(0,K.jsx)(Q,{label:o.injectionFrequency,description:o.injectionFrequencyDesc,children:(0,K.jsxs)(`select`,{className:$n(),value:r.memory.injectionFrequency,onChange:e=>a({memory:{...r.memory,injectionFrequency:e.target.value}}),children:[(0,K.jsx)(`option`,{value:``,children:o.injectionFrequencyUnset}),(0,K.jsx)(`option`,{value:`every-turn`,children:o.injectionEveryTurn}),(0,K.jsx)(`option`,{value:`first-turn`,children:o.injectionFirstTurn})]})}),(0,K.jsx)(Q,{label:o.memoryCharLimit,description:o.memoryCharLimitDesc,children:(0,K.jsx)(`input`,{type:`number`,className:Z(),min:1,value:r.memory.memoryCharLimit??``,placeholder:`—`,onChange:e=>{let t=e.target.value;a({memory:{...r.memory,memoryCharLimit:t===``?void 0:Number.parseInt(t,10)}})}})}),(0,K.jsx)(Q,{label:o.userCharLimit,description:o.userCharLimitDesc,children:(0,K.jsx)(`input`,{type:`number`,className:Z(),min:1,value:r.memory.userCharLimit??``,placeholder:`—`,onChange:e=>{let t=e.target.value;a({memory:{...r.memory,userCharLimit:t===``?void 0:Number.parseInt(t,10)}})}})}),(0,K.jsx)(Q,{label:o.contextCadence,description:o.contextCadenceDesc,children:(0,K.jsx)(`input`,{type:`number`,className:Z(),min:1,value:r.memory.contextCadence??``,placeholder:`—`,onChange:e=>{let t=e.target.value;a({memory:{...r.memory,contextCadence:t===``?void 0:Number.parseInt(t,10)}})}})}),(0,K.jsx)(Q,{label:o.dialecticCadence,description:o.dialecticCadenceDesc,children:(0,K.jsx)(`input`,{type:`number`,className:Z(),min:1,value:r.memory.dialecticCadence??``,placeholder:`—`,onChange:e=>{let t=e.target.value;a({memory:{...r.memory,dialecticCadence:t===``?void 0:Number.parseInt(t,10)}})}})})]})})]}),(0,K.jsxs)(q,{children:[(0,K.jsx)(J,{icon:ge,title:o.cardSessionSearchTitle,subtitle:o.cardSessionSearchSubtitle}),(0,K.jsx)(Q,{label:o.sessionSearchSummaryModel,description:o.sessionSearchSummaryModelDesc,children:(0,K.jsx)(Re,{value:r.sessionSearch.summaryModel,placeholder:n.modelPlaceholder,searchPlaceholder:n.modelSearchPlaceholder,noMatches:n.modelNoMatches,onChange:e=>a({sessionSearch:{...r.sessionSearch,summaryModel:e}})})})]}),(0,K.jsxs)(q,{children:[(0,K.jsx)(J,{icon:de,title:o.cardReviewTitle,subtitle:o.cardReviewSubtitle}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,K.jsx)(Q,{label:o.reviewEnabled,description:o.reviewEnabledDesc,children:(0,K.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2 text-sm text-fg`,children:[(0,K.jsx)(`input`,{type:`checkbox`,className:`size-3.5 shrink-0 rounded border-edge`,checked:r.backgroundReview.enabled,onChange:e=>a({backgroundReview:{...r.backgroundReview,enabled:e.target.checked}})}),(0,K.jsx)(`span`,{children:o.reviewEnabledOn})]})}),(0,K.jsxs)(`div`,{className:`grid gap-5 sm:grid-cols-2`,children:[(0,K.jsx)(Q,{label:o.memoryNudgeInterval,description:o.memoryNudgeIntervalDesc,children:(0,K.jsx)(`input`,{type:`number`,className:Z(),min:0,value:r.backgroundReview.memoryNudgeInterval,onChange:e=>a({backgroundReview:{...r.backgroundReview,memoryNudgeInterval:Number.parseInt(e.target.value,10)||0}})})}),(0,K.jsx)(Q,{label:o.skillNudgeInterval,description:o.skillNudgeIntervalDesc,children:(0,K.jsx)(`input`,{type:`number`,className:Z(),min:0,value:r.backgroundReview.skillNudgeInterval,onChange:e=>a({backgroundReview:{...r.backgroundReview,skillNudgeInterval:Number.parseInt(e.target.value,10)||0}})})}),(0,K.jsx)(Q,{label:o.reviewMaxToolRounds,description:o.reviewMaxToolRoundsDesc,children:(0,K.jsx)(`input`,{type:`number`,className:Z(),min:1,max:32,value:r.backgroundReview.maxToolRounds,onChange:e=>a({backgroundReview:{...r.backgroundReview,maxToolRounds:Number.parseInt(e.target.value,10)||8}})})}),(0,K.jsx)(Q,{label:o.reviewMaxHistoryMessages,description:o.reviewMaxHistoryMessagesDesc,children:(0,K.jsx)(`input`,{type:`number`,className:Z(),min:10,max:200,value:r.backgroundReview.maxHistoryMessages,onChange:e=>a({backgroundReview:{...r.backgroundReview,maxHistoryMessages:Number.parseInt(e.target.value,10)||80}})})}),(0,K.jsx)(Q,{label:o.reviewMaxDurationMs,description:o.reviewMaxDurationMsDesc,children:(0,K.jsx)(`input`,{type:`number`,className:Z(),min:30,max:600,step:1,value:Math.round((r.backgroundReview.maxDurationMs??12e4)/1e3),onChange:e=>a({backgroundReview:{...r.backgroundReview,maxDurationMs:(Number.parseInt(e.target.value,10)||120)*1e3}})})})]})]})]}),(0,K.jsxs)(q,{children:[(0,K.jsx)(J,{icon:A,title:o.cardWebExtractTitle,subtitle:o.cardWebExtractSubtitle}),(0,K.jsxs)(`div`,{className:`grid gap-5 sm:grid-cols-2`,children:[(0,K.jsx)(`div`,{className:`sm:col-span-2`,children:(0,K.jsx)(Q,{label:o.webExtractModel,description:o.webExtractModelDesc,children:(0,K.jsx)(Re,{value:r.webExtract.model,placeholder:n.modelPlaceholder,searchPlaceholder:n.modelSearchPlaceholder,noMatches:n.modelNoMatches,onChange:e=>a({webExtract:{...r.webExtract,model:e}})})})}),(0,K.jsx)(Q,{label:o.webExtractMaxLength,description:o.webExtractMaxLengthDesc,children:(0,K.jsx)(`input`,{type:`number`,className:Z(),min:1,value:r.webExtract.maxLength??``,placeholder:`—`,onChange:e=>{let t=e.target.value;a({webExtract:{...r.webExtract,maxLength:t===``?void 0:Number.parseInt(t,10)}})}})})]})]}),(0,K.jsxs)(q,{children:[(0,K.jsx)(J,{icon:fe,title:o.cardDelegateTitle,subtitle:o.cardDelegateSubtitle}),(0,K.jsxs)(`div`,{className:`grid gap-5 sm:grid-cols-2`,children:[(0,K.jsx)(Q,{label:o.delegateEnabled,description:o.delegateEnabledDesc,children:(0,K.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2 text-sm text-fg`,children:[(0,K.jsx)(`input`,{type:`checkbox`,className:`size-3.5 shrink-0 rounded border-edge`,checked:r.delegate.enabled,onChange:e=>a({delegate:{...r.delegate,enabled:e.target.checked}})}),(0,K.jsx)(`span`,{children:o.delegateEnabledOn})]})}),(0,K.jsx)(Q,{label:o.executeCodeEnabled,description:o.executeCodeEnabledDesc,children:(0,K.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2 text-sm text-fg`,children:[(0,K.jsx)(`input`,{type:`checkbox`,className:`size-3.5 shrink-0 rounded border-edge`,checked:r.executeCode.enabled,onChange:e=>a({executeCode:{...r.executeCode,enabled:e.target.checked}})}),(0,K.jsx)(`span`,{children:o.executeCodeEnabledOn})]})})]})]}),(0,K.jsxs)(q,{children:[(0,K.jsx)(J,{icon:$e,title:o.cardPromptSkillsTitle,subtitle:o.cardPromptSkillsSubtitle}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,K.jsx)(Q,{label:o.systemPromptOverride,description:o.systemPromptOverrideDesc,children:(0,K.jsx)(`textarea`,{className:i(Z(),`min-h-[100px] resize-y font-mono text-xs`),value:r.systemPromptOverride,placeholder:o.systemPromptPlaceholder,onChange:e=>a({systemPromptOverride:e.target.value})})}),(0,K.jsx)(Q,{label:o.skillsAllowlist,description:o.skillsAllowlistDesc,children:(0,K.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[r.skillsAllowlist.map((e,t)=>(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`input`,{type:`text`,className:i(Z(),`font-mono text-xs`),value:e,onChange:e=>{let n=[...r.skillsAllowlist];n[t]=e.target.value,a({skillsAllowlist:n})}}),(0,K.jsx)(v,{type:`button`,variant:`secondary`,className:`shrink-0`,"aria-label":o.removeListItem,onClick:()=>a({skillsAllowlist:r.skillsAllowlist.filter((e,n)=>n!==t)}),children:`×`})]},t)),(0,K.jsx)(v,{type:`button`,variant:`secondary`,className:`w-fit`,onClick:()=>a({skillsAllowlist:[...r.skillsAllowlist,``]}),children:o.addSkillName})]})})]})]}),(0,K.jsxs)(q,{children:[(0,K.jsx)(J,{icon:Me,title:o.cardToolsDisableTitle,subtitle:o.cardToolsDisableSubtitle}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,K.jsx)(`p`,{className:`text-xs text-fg-muted`,children:o.toolsDisableHint}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[r.toolsDisable.map((e,t)=>(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`input`,{type:`text`,className:i(Z(),`font-mono text-xs`),value:e,placeholder:`shell`,onChange:e=>{let n=[...r.toolsDisable];n[t]=e.target.value,a({toolsDisable:n})}}),(0,K.jsx)(v,{type:`button`,variant:`secondary`,className:`shrink-0`,"aria-label":o.removeListItem,onClick:()=>a({toolsDisable:r.toolsDisable.filter((e,n)=>n!==t)}),children:`×`})]},t)),(0,K.jsx)(v,{type:`button`,variant:`secondary`,className:`w-fit`,onClick:()=>a({toolsDisable:[...r.toolsDisable,``]}),children:o.addToolName})]})]})]}),(0,K.jsxs)(q,{children:[(0,K.jsx)(J,{icon:me,title:o.cardParamsTitle,subtitle:o.cardParamsSubtitle}),(0,K.jsx)(Q,{label:o.paramsJson,description:o.paramsJsonDesc,children:(0,K.jsx)(`textarea`,{className:i(Z(),`min-h-[88px] resize-y font-mono text-xs`),value:r.paramsJson,placeholder:`{}`,onChange:e=>a({paramsJson:e.target.value})})})]})]})}async function tr(){let e=await Le(B(`/api/image/providers`));if(!e.ok)throw Error(`Image providers: HTTP ${e.status}`);return(await e.json()).payload?.providers??[]}function nr(e){let t=new Set,n=[];for(let r of e){let e=r.models.length>0?r.models:r.defaultModel?[r.defaultModel]:[];for(let i of e){let e=`${r.id}/${i}`;t.has(e)||(t.add(e),n.push(e))}}return n}function rr(e,t){let n=t.trim().toLowerCase();if(!n)return e;let r=n.split(/[/\s]+/).filter(Boolean);return e.filter(e=>{let t=e.toLowerCase();return r.every(e=>t.includes(e))})}var ir=`image-generation-providers`;function ar({value:e,disabled:t,placeholder:n,searchPlaceholder:a,noMatches:o,className:s,onChange:c}){let[l,u]=(0,X.useState)(!1),[d,f]=(0,X.useState)(``),{data:p,isLoading:m,error:h}=r(ir,tr,{revalidateOnFocus:!1}),g=(0,X.useMemo)(()=>nr(p??[]),[p]),_=(0,X.useMemo)(()=>rr(g,d),[g,d]),v=e.trim()?e:n,y=e.trim()||n,b=(0,X.useCallback)(e=>{u(e),e||f(``)},[]);return(0,K.jsxs)(x,{open:l,onOpenChange:b,modal:!1,children:[(0,K.jsx)(T,{asChild:!0,children:(0,K.jsxs)(`button`,{type:`button`,disabled:t||m,title:m?`…`:y,className:i(st,`items-center gap-2 rounded-lg border border-edge-subtle bg-surface-panel px-3 py-2 text-left text-sm font-normal text-fg`,D.transition,`hover:border-edge hover:bg-surface-hover/45`,se,`disabled:cursor-not-allowed disabled:opacity-50`,`dark:border-edge-subtle dark:hover:bg-surface-hover/55`,s),"aria-haspopup":`listbox`,"aria-expanded":l,children:[(0,K.jsx)(`span`,{className:`min-w-0 truncate`,children:m?`…`:v}),(0,K.jsx)(I,{className:`h-4 w-4 shrink-0 text-fg-subtle opacity-70`,"aria-hidden":!0})]})}),(0,K.jsx)(M,{children:(0,K.jsxs)(te,{className:`z-50 w-[min(22rem,calc(100vw-2rem))] rounded-xl border border-edge-subtle bg-surface-panel p-1 shadow-elevated dark:border-edge-subtle`,side:`bottom`,sideOffset:4,align:`end`,onOpenAutoFocus:e=>e.preventDefault(),children:[(0,K.jsx)(`input`,{type:`search`,className:i(`mb-1 w-full rounded-lg border border-edge-subtle bg-surface-base px-2.5 py-1.5 text-sm text-fg placeholder:text-fg-disabled dark:bg-surface-hover/40`,R),placeholder:a,value:d,onChange:e=>f(e.target.value),onKeyDown:e=>e.stopPropagation()}),(0,K.jsxs)(`div`,{className:`max-h-60 overflow-auto`,role:`listbox`,"aria-label":a,children:[h?(0,K.jsx)(`div`,{className:`px-2 py-2 text-xs text-red-600 dark:text-red-400`,children:h instanceof Error?h.message:`Failed to load image providers`}):null,!h&&g.length===0&&!m?(0,K.jsx)(`div`,{className:`px-2 py-3 text-center text-xs text-fg-muted`,children:o}):null,!h&&g.length>0&&_.length===0?(0,K.jsx)(`div`,{className:`px-2 py-3 text-center text-xs text-fg-muted`,children:o}):null,_.map(t=>(0,K.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":t===e,className:i(`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm text-fg hover:bg-surface-hover`,t===e&&`bg-surface-hover/90 font-medium dark:bg-surface-hover/70`),onClick:()=>{c(t),u(!1),f(``)},children:[(0,K.jsx)(qe,{className:i(`h-4 w-4 shrink-0`,t!==e&&`invisible`),"aria-hidden":!0}),(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-medium`,children:t})]},t))]})]})})]})}var or=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`,`adaptive`];function $({label:e,description:t,children:n}){return(0,K.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,K.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:e}),n,(0,K.jsx)(`p`,{className:`text-xs leading-relaxed text-fg-subtle`,children:t})]})}function sr(){let e=le(ye(e=>e.language)),t=e.agentSettings,n=e.chat,r=!!Ee(e=>e.token),[i,a]=(0,X.useState)(null),[o,s]=(0,X.useState)(null),[c,l]=(0,X.useState)(!1),[d,f]=(0,X.useState)(null),[p,m]=(0,X.useState)(!1),g=(0,X.useRef)(!1),{data:_,error:y,isLoading:b,mutate:x}=ct(r),S=(0,X.useMemo)(()=>_?.payload?.config===void 0?null:Yn(_.payload.config),[_]);(0,X.useEffect)(()=>{if(!r){a(null),s(null),g.current=!1;return}S!==null&&(g.current||(a(S),s(S)))},[r,S]);let C=!!(r&&b&&_===void 0&&!y),w=y instanceof Error?y.message:y?String(y):null,T=(0,X.useMemo)(()=>!i||!o?!1:JSON.stringify(i)!==JSON.stringify(o),[i,o]),E=(0,X.useCallback)(e=>{g.current=!0,a(t=>t?{...t,...e}:null)},[]),D=(0,X.useCallback)(async()=>{if(!(!i||c)){l(!0),f(null),m(!1);try{try{Zn(i.paramsJson)}catch(e){f(e instanceof SyntaxError?t.advanced.paramsInvalidJson:e instanceof Error?e.message:t.advanced.paramsInvalidJson);return}await Qn(i),g.current=!1,m(!0),window.setTimeout(()=>m(!1),2500)}catch(e){f(e instanceof Error?e.message:t.saveError)}finally{l(!1)}}},[i,c,t.saveError,t.advanced]),k=e.settingsSections[`agent-defaults`];return r?C?(0,K.jsxs)(`div`,{className:`mx-auto w-full max-w-app-main px-4 py-8`,children:[(0,K.jsx)(`div`,{className:`h-8 w-48 animate-pulse rounded bg-surface-hover`}),(0,K.jsx)(`div`,{className:`mt-6 h-32 animate-pulse rounded-xl bg-surface-hover`}),(0,K.jsx)(`p`,{className:`mt-4 text-sm text-fg-muted`,children:e.logs.loading})]}):i?(0,K.jsxs)(`div`,{className:`mx-auto flex w-full max-w-app-main flex-col gap-6 px-4 py-8`,children:[(0,K.jsxs)(`header`,{className:`flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h1`,{className:`text-lg font-semibold tracking-tight text-fg`,children:k}),(0,K.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:t.subtitle}),(0,K.jsx)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:t.sectionDesc})]}),(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[p?(0,K.jsx)(`span`,{className:`text-sm text-fg-muted`,children:t.saved}):null,(0,K.jsx)(v,{type:`button`,variant:`primary`,disabled:!T||c,onClick:()=>void D(),children:c?t.saving:t.save})]})]}),d?(0,K.jsx)(`div`,{className:`rounded-md border border-red-200 bg-red-50 px-3 py-2 text-sm text-red-700 dark:border-red-900/50 dark:bg-red-950/50 dark:text-red-400`,role:`alert`,children:d}):null,(0,K.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,K.jsxs)(q,{children:[(0,K.jsx)(J,{icon:u,title:t.cardModelsTitle,subtitle:t.cardModelsSubtitle}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,K.jsx)($,{label:t.label.model,description:t.desc.model,children:(0,K.jsx)(Re,{value:i.model,placeholder:n.modelPlaceholder,searchPlaceholder:n.modelSearchPlaceholder,noMatches:n.modelNoMatches,onChange:e=>E({model:e})})}),(0,K.jsx)($,{label:t.label.modelFallbacks,description:t.desc.modelFallbacks,children:(0,K.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[i.modelFallbacks.map((e,r)=>(0,K.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,K.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,K.jsx)(Re,{value:e,placeholder:n.modelPlaceholder,searchPlaceholder:n.modelSearchPlaceholder,noMatches:n.modelNoMatches,onChange:e=>{let t=[...i.modelFallbacks];t[r]=e,E({modelFallbacks:t})}})}),(0,K.jsx)(v,{type:`button`,variant:`secondary`,className:`shrink-0`,"aria-label":t.removeModelFallback,onClick:()=>E({modelFallbacks:i.modelFallbacks.filter((e,t)=>t!==r)}),children:(0,K.jsx)(O,{className:`size-4`,strokeWidth:1.75})})]},r)),(0,K.jsxs)(v,{type:`button`,variant:`secondary`,className:`w-fit gap-1.5`,onClick:()=>E({modelFallbacks:[...i.modelFallbacks,``]}),children:[(0,K.jsx)(Je,{className:`size-4 shrink-0`,strokeWidth:1.75}),t.addModelFallback]})]})}),(0,K.jsx)($,{label:t.label.imageModel,description:t.desc.imageModel,children:(0,K.jsx)(Re,{value:i.imageModel,placeholder:n.modelPlaceholder,searchPlaceholder:n.modelSearchPlaceholder,noMatches:n.modelNoMatches,onChange:e=>E({imageModel:e})})}),(0,K.jsx)($,{label:t.label.imageModelFallbacks,description:t.desc.imageModelFallbacks,children:(0,K.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[i.imageModelFallbacks.map((e,r)=>(0,K.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,K.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,K.jsx)(Re,{value:e,placeholder:n.modelPlaceholder,searchPlaceholder:n.modelSearchPlaceholder,noMatches:n.modelNoMatches,onChange:e=>{let t=[...i.imageModelFallbacks];t[r]=e,E({imageModelFallbacks:t})}})}),(0,K.jsx)(v,{type:`button`,variant:`secondary`,className:`shrink-0`,"aria-label":t.removeModelFallback,onClick:()=>E({imageModelFallbacks:i.imageModelFallbacks.filter((e,t)=>t!==r)}),children:(0,K.jsx)(O,{className:`size-4`,strokeWidth:1.75})})]},r)),(0,K.jsxs)(v,{type:`button`,variant:`secondary`,className:`w-fit gap-1.5`,onClick:()=>E({imageModelFallbacks:[...i.imageModelFallbacks,``]}),children:[(0,K.jsx)(Je,{className:`size-4 shrink-0`,strokeWidth:1.75}),t.addModelFallback]})]})}),(0,K.jsx)($,{label:t.label.imageGenerationModel,description:t.desc.imageGenerationModel,children:(0,K.jsx)(ar,{value:i.imageGenerationModel,placeholder:n.modelPlaceholder,searchPlaceholder:n.modelSearchPlaceholder,noMatches:n.modelNoMatches,onChange:e=>E({imageGenerationModel:e})})}),(0,K.jsx)($,{label:t.label.imageGenerationModelFallbacks,description:t.desc.imageGenerationModelFallbacks,children:(0,K.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[i.imageGenerationModelFallbacks.map((e,r)=>(0,K.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,K.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,K.jsx)(ar,{value:e,placeholder:n.modelPlaceholder,searchPlaceholder:n.modelSearchPlaceholder,noMatches:n.modelNoMatches,onChange:e=>{let t=[...i.imageGenerationModelFallbacks];t[r]=e,E({imageGenerationModelFallbacks:t})}})}),(0,K.jsx)(v,{type:`button`,variant:`secondary`,className:`shrink-0`,"aria-label":t.removeModelFallback,onClick:()=>E({imageGenerationModelFallbacks:i.imageGenerationModelFallbacks.filter((e,t)=>t!==r)}),children:(0,K.jsx)(O,{className:`size-4`,strokeWidth:1.75})})]},r)),(0,K.jsxs)(v,{type:`button`,variant:`secondary`,className:`w-fit gap-1.5`,onClick:()=>E({imageGenerationModelFallbacks:[...i.imageGenerationModelFallbacks,``]}),children:[(0,K.jsx)(Je,{className:`size-4 shrink-0`,strokeWidth:1.75}),t.addModelFallback]})]})})]})]}),(0,K.jsxs)(q,{children:[(0,K.jsx)(J,{icon:Fe,title:t.cardWorkspaceTitle,subtitle:t.cardWorkspaceSubtitle}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,K.jsx)($,{label:t.label.workspace,description:t.desc.workspace,children:(0,K.jsx)(`input`,{type:`text`,className:Z(),value:i.workspace,onChange:e=>E({workspace:e.target.value}),autoComplete:`off`})}),(0,K.jsx)($,{label:t.label.mediaMaxMb,description:t.desc.mediaMaxMb,children:(0,K.jsx)(`input`,{type:`number`,min:1,step:1,className:Z(),value:i.mediaMaxMb??``,placeholder:`20`,onChange:e=>{let t=e.target.value;E({mediaMaxMb:t===``?void 0:Number(t)})}})})]})]}),(0,K.jsxs)(q,{children:[(0,K.jsx)(J,{icon:h,title:t.cardBrowserTitle,subtitle:t.cardBrowserSubtitle}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,K.jsx)($,{label:t.label.browserEnabled,description:t.desc.browserEnabled,children:(0,K.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2 text-sm text-fg`,children:[(0,K.jsx)(`input`,{type:`checkbox`,className:`size-3.5 shrink-0 rounded border-edge`,checked:i.browserEnabled,onChange:e=>E({browserEnabled:e.target.checked})}),(0,K.jsx)(`span`,{children:t.browserEnabledOn})]})}),(0,K.jsx)($,{label:t.label.browserHeadless,description:t.desc.browserHeadless,children:(0,K.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2 text-sm text-fg`,children:[(0,K.jsx)(`input`,{type:`checkbox`,className:`size-3.5 shrink-0 rounded border-edge`,checked:i.browserHeadless,onChange:e=>E({browserHeadless:e.target.checked})}),(0,K.jsx)(`span`,{children:t.browserHeadlessOn})]})})]})]}),(0,K.jsxs)(q,{children:[(0,K.jsx)(J,{icon:P,title:t.cardGenerationTitle,subtitle:t.cardGenerationSubtitle}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,K.jsxs)(`div`,{className:`grid gap-5 sm:grid-cols-2`,children:[(0,K.jsx)($,{label:t.label.maxTokens,description:t.desc.maxTokens,children:(0,K.jsx)(`input`,{type:`number`,className:Z(),value:i.maxTokens,min:1,onChange:e=>E({maxTokens:Number.parseInt(e.target.value,10)||0})})}),(0,K.jsx)($,{label:t.label.temperature,description:t.desc.temperature,children:(0,K.jsx)(`input`,{type:`number`,className:Z(),value:i.temperature,min:0,max:2,step:.1,onChange:e=>E({temperature:Number.parseFloat(e.target.value)||0})})})]}),(0,K.jsx)($,{label:t.label.maxToolIterations,description:t.desc.maxToolIterations,children:(0,K.jsx)(`input`,{type:`number`,className:Z(),value:i.maxToolIterations,min:1,onChange:e=>E({maxToolIterations:Number.parseInt(e.target.value,10)||0})})})]})]}),(0,K.jsxs)(q,{children:[(0,K.jsx)(J,{icon:Pe,title:t.cardBehaviorTitle,subtitle:t.cardBehaviorSubtitle}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,K.jsx)($,{label:t.label.thinkingDefault,description:t.desc.thinkingDefault,children:(0,K.jsx)(`select`,{className:$n(),value:i.thinkingDefault,onChange:e=>E({thinkingDefault:e.target.value}),children:or.map(e=>(0,K.jsx)(`option`,{value:e,children:n.thinkingLevels[e]},e))})}),(0,K.jsx)($,{label:t.label.reasoningDefault,description:t.desc.reasoningDefault,children:(0,K.jsxs)(`select`,{className:$n(),value:i.reasoningDefault,onChange:e=>E({reasoningDefault:e.target.value}),children:[(0,K.jsx)(`option`,{value:`off`,children:t.reasoning.off}),(0,K.jsx)(`option`,{value:`on`,children:t.reasoning.on}),(0,K.jsx)(`option`,{value:`stream`,children:t.reasoning.stream})]})}),(0,K.jsx)($,{label:t.label.verboseDefault,description:t.desc.verboseDefault,children:(0,K.jsxs)(`select`,{className:$n(),value:i.verboseDefault,onChange:e=>E({verboseDefault:e.target.value}),children:[(0,K.jsx)(`option`,{value:`off`,children:t.verbose.off}),(0,K.jsx)(`option`,{value:`on`,children:t.verbose.on}),(0,K.jsx)(`option`,{value:`full`,children:t.verbose.full})]})})]})]}),(0,K.jsx)(er,{a:t,chat:n,form:i,update:E})]})]}):(0,K.jsxs)(`div`,{className:`mx-auto flex w-full max-w-app-main flex-col gap-3 px-4 py-10`,children:[(0,K.jsx)(`p`,{className:`text-sm text-fg-muted`,children:d??w??t.loadError}),(0,K.jsx)(v,{type:`button`,variant:`secondary`,onClick:()=>void x(),children:e.logs.refresh})]}):(0,K.jsx)(`div`,{className:`mx-auto flex w-full max-w-app-main flex-col gap-3 px-4 py-10`,children:(0,K.jsxs)(`div`,{className:`flex items-start gap-3 rounded-2xl bg-surface-base p-6`,children:[(0,K.jsx)(u,{className:`mt-0.5 size-5 shrink-0 text-fg-subtle`,strokeWidth:1.75}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h1`,{className:`text-base font-semibold text-fg`,children:k}),(0,K.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:t.needToken})]})]})})}export{kn as AgentsSettingsPanel,_n as a,q as c,bn as i,J as l,gn as n,vn as o,xn as r,yn as s,sr as t,bt as u};
|
|
216
|
+
//# sourceMappingURL=agents-3u63Fw2Y.js.map
|