@xopcai/xopc 0.0.353 → 0.0.354
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/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/activity-YogQEteU.js +1 -0
- package/dist/gateway/static/root/assets/activity-store-X7CG9pzB.js +1 -0
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-BVIuZcCP.js → agent-avatar-dicebear-B8PS1eLP.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-CLBSL9hl.js +1 -0
- package/dist/gateway/static/root/assets/agent-plugin-dialog-BninweSg.js +1 -0
- package/dist/gateway/static/root/assets/agents-CcVLP_WP.js +66 -0
- package/dist/gateway/static/root/assets/app-chrome-BeB4KgOf.js +1 -0
- package/dist/gateway/static/root/assets/app-management-settings-panel-COdQOmdT.js +1 -0
- package/dist/gateway/static/root/assets/appearance-settings-CDNjc2yy.js +1 -0
- package/dist/gateway/static/root/assets/apps-page-C-kvpPj8.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-BZXXJvpX.js → archive-plugin-QfOaQPL_.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-C7VKkDb5.js → automations-page-87DN5nXX.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-BdZ8NO8k.js +7 -0
- package/dist/gateway/static/root/assets/{binary-plugins-DoT3g5SP.js → binary-plugins-BF2lVwR9.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-sqqrCafh.js → block-editor-B04Kv5DU.js} +39 -39
- package/dist/gateway/static/root/assets/bot-DjLkhyZL.js +1 -0
- package/dist/gateway/static/root/assets/{browser-automation-inputs-CZOKsAaa.js → browser-automation-inputs-FW3bYZ-z.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-TEeTmkGP.js → browser-automations-page-Ck6Zb9aU.js} +2 -2
- package/dist/gateway/static/root/assets/browser-settings-page-DHlyYItE.js +3 -0
- package/dist/gateway/static/root/assets/{capabilities-BOrLei_L.js → capabilities-BCF_160Z.js} +1 -1
- package/dist/gateway/static/root/assets/capabilities-CF4-mrIa.js +1 -0
- package/dist/gateway/static/root/assets/capabilities-page-C-6RLFNh.js +2 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-CST_HBkR.js +8 -0
- package/dist/gateway/static/root/assets/capability-header-actions-PBPJJsp6.js +1 -0
- package/dist/gateway/static/root/assets/channels-CM4sIvcP.js +1 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-Q99iKyiO.js → chat-terminal-dock-DTd7mWyE.js} +2 -2
- package/dist/gateway/static/root/assets/chevron-right-BweFrslA.js +1 -0
- package/dist/gateway/static/root/assets/circle-alert-BEjgurr2.js +1 -0
- package/dist/gateway/static/root/assets/circle-dashed-8qMD7gHf.js +1 -0
- package/dist/gateway/static/root/assets/circle-dot-BAseJTrF.js +1 -0
- package/dist/gateway/static/root/assets/circle-pause-CN9jYH2s.js +1 -0
- package/dist/gateway/static/root/assets/clock-3-DnrAnuyZ.js +1 -0
- package/dist/gateway/static/root/assets/cloud-C4-yfnnk.js +1 -0
- package/dist/gateway/static/root/assets/computer-settings-page--9rh1mvu.js +1 -0
- package/dist/gateway/static/root/assets/connector-service-page-v6Is0BOO.js +1 -0
- package/dist/gateway/static/root/assets/connectors-page-CryQzmEZ.js +2 -0
- package/dist/gateway/static/root/assets/copy-text-row-BHDs3cBa.js +1 -0
- package/dist/gateway/static/root/assets/date-picker-DTsMzjoZ.js +1 -0
- package/dist/gateway/static/root/assets/{dependency-picker-BjH8XrKb.js → dependency-picker-Y1QYCcLp.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-DyGxNAVW.js → desktop-pet-D9dfZrOp.js} +1 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-BHVOHZUL.js +1 -0
- package/dist/gateway/static/root/assets/device-pairing-wizard-Cy5YDZ2b.js +1 -0
- package/dist/gateway/static/root/assets/directory-picker-path-field-DeMo9KlE.js +1 -0
- package/dist/gateway/static/root/assets/dist-3h6cXXhT.js +1 -0
- package/dist/gateway/static/root/assets/dist-Che_jiQF.js +1 -0
- package/dist/gateway/static/root/assets/extension-debug-page-BrGWLJg9.js +1 -0
- package/dist/gateway/static/root/assets/extension-page-AWrvy1Nb.js +1 -0
- package/dist/gateway/static/root/assets/extension-provider-CUpbXB2k.js +1 -0
- package/dist/gateway/static/root/assets/extension-settings-page-C5KgmhYu.js +1 -0
- package/dist/gateway/static/root/assets/form-field-width-DJw_jULe.js +1 -0
- package/dist/gateway/static/root/assets/gateway-settings-DC-lok0J.js +1 -0
- package/dist/gateway/static/root/assets/git-branch-Dh9uxTot.js +1 -0
- package/dist/gateway/static/root/assets/home-page-C29_VFAs.js +1 -0
- package/dist/gateway/static/root/assets/imports-page-BKVKfVMA.js +1 -0
- package/dist/gateway/static/root/assets/index-BJh5gU04.css +1 -0
- package/dist/gateway/static/root/assets/index-ByFXhQ-T.js +107 -0
- package/dist/gateway/static/root/assets/index.module-Cd9ENXfk.js +1 -0
- package/dist/gateway/static/root/assets/interaction-BdhHBbYa.js +1 -0
- package/dist/gateway/static/root/assets/is-masked-secret-DOkL5b_X.js +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-CoYdyBRh.js → keyboard-shortcuts-settings-DiwE4gKU.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-Dt3TC64L.js +1 -0
- package/dist/gateway/static/root/assets/{local-apps-page-CeBhXeoX.js → local-apps-page-DFPhWkxU.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-C4faHZHj.js +2 -0
- package/dist/gateway/static/root/assets/management-settings-pZLdvIiw.js +1 -0
- package/dist/gateway/static/root/assets/markdown-view-7tzqIp_G.js +201 -0
- package/dist/gateway/static/root/assets/{media-plugins-C9ya5rUH.js → media-plugins-cjgrKnne.js} +1 -1
- package/dist/gateway/static/root/assets/message-square-fVE7Ghj1.js +1 -0
- package/dist/gateway/static/root/assets/mic-CuUb7zc-.js +1 -0
- package/dist/gateway/static/root/assets/model-display-name-DXhO9rcM.js +1 -0
- package/dist/gateway/static/root/assets/models-hub-cache-HGrORbzR.js +1 -0
- package/dist/gateway/static/root/assets/note-detail-panel-BLnT1tYJ.js +5 -0
- package/dist/gateway/static/root/assets/notes-api-J0yhflxC.js +1 -0
- package/dist/gateway/static/root/assets/notes-page-BawArJvP.js +8 -0
- package/dist/gateway/static/root/assets/oauth-api-CYe61zfD.js +1 -0
- package/dist/gateway/static/root/assets/page-context-capture-button-CiBUm2Br.js +1 -0
- package/dist/gateway/static/root/assets/page-tabs-D2xpUV26.js +1 -0
- package/dist/gateway/static/root/assets/pause-DuPxgSxk.js +1 -0
- package/dist/gateway/static/root/assets/personal-page-Cng583RH.js +1 -0
- package/dist/gateway/static/root/assets/play-kxZvpBg8.js +1 -0
- package/dist/gateway/static/root/assets/popover-select-DcsFzD_i.js +1 -0
- package/dist/gateway/static/root/assets/preview-open-alternatives-Dvey7GwU.js +1 -0
- package/dist/gateway/static/root/assets/{product-open-page-DUPsiVP9.js → product-open-page-B8_w6c3J.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-CDZdKiTz.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-BvahSrZi.js +1 -0
- package/dist/gateway/static/root/assets/remote-access-hub-CU_UdkuI.js +1 -0
- package/dist/gateway/static/root/assets/rotate-ccw-JM1TBLpp.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-C25xEYTK.js → runtime-tools-settings-panel-BnMS50vK.js} +2 -2
- package/dist/gateway/static/root/assets/scenes-page-CDR1-q25.js +2 -0
- package/dist/gateway/static/root/assets/schema-form-B4Xa8w8S.js +1 -0
- package/dist/gateway/static/root/assets/secret-input-DPl3VYM8.js +1 -0
- package/dist/gateway/static/root/assets/send-session-input-C7Nqy0sK.js +1 -0
- package/dist/gateway/static/root/assets/sessions-page-Ymyg98G-.js +1 -0
- package/dist/gateway/static/root/assets/settings-2-D-csvaET.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-wMZhxwTM.js +1 -0
- package/dist/gateway/static/root/assets/settings-form-draft-Dy10ldo8.js +1 -0
- package/dist/gateway/static/root/assets/settings-form-section-exRhP9xn.js +1 -0
- package/dist/gateway/static/root/assets/{settings-page-DqCJHcdG.js → settings-page-CHZdpvkT.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-HESfALIF.js +1 -0
- package/dist/gateway/static/root/assets/share-link-dialog-COlX10Dc.js +1 -0
- package/dist/gateway/static/root/assets/share-preview-page-NtRLUieq.js +2 -0
- package/dist/gateway/static/root/assets/shares-api-DICV5EKH.js +1 -0
- package/dist/gateway/static/root/assets/shares-settings-CXEBo5YL.js +1 -0
- package/dist/gateway/static/root/assets/skill-api-DYgcO7y0.js +1 -0
- package/dist/gateway/static/root/assets/skill-api-utils-C7V4JVXM.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-CWH3Fmx4.js +1 -0
- package/dist/gateway/static/root/assets/skill-wire-pattern-BPpeIcCi.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-Dx5v64jU.js +2 -0
- package/dist/gateway/static/root/assets/sparkles-DHlfQFAF.js +1 -0
- package/dist/gateway/static/root/assets/system-settings-panel-wXCBwYwE.js +1 -0
- package/dist/gateway/static/root/assets/task-detail-page-hoIyr7tp.js +1 -0
- package/dist/gateway/static/root/assets/tasks-Buv1mgPF.js +1 -0
- package/dist/gateway/static/root/assets/theme-store-BKgBPLH4.js +1 -0
- package/dist/gateway/static/root/assets/tunnel-api-C0t8y3Mi.js +1 -0
- package/dist/gateway/static/root/assets/usage-page-A2DZAidl.js +1 -0
- package/dist/gateway/static/root/assets/use-async-resource-GrnWNwMZ.js +1 -0
- package/dist/gateway/static/root/assets/use-autosave-Cn6hqqyM.js +1 -0
- package/dist/gateway/static/root/assets/use-composer-attachments-DL61XeSu.js +2 -0
- package/dist/gateway/static/root/assets/use-file-preview-expanded-Cl9mU32w.js +2 -0
- package/dist/gateway/static/root/assets/user-model-page-C1jGTwjK.js +2 -0
- package/dist/gateway/static/root/assets/voice-api-key-field-Bw05QB_V.js +1 -0
- package/dist/gateway/static/root/assets/{work-discovery-overlay-BnfD6w0k.js → work-discovery-overlay-xB0QpOFk.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-DSy57rBr.js → workflow-run-setup-panel-rM4U1FXc.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-QKC34FzQ.js +6 -0
- package/dist/gateway/static/root/assets/workspace-api-BbBT75Kg.js +2 -0
- package/dist/gateway/static/root/index.html +61 -19
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/tasks.js +19 -2
- package/dist/src/agent/agent-manager.js +7 -7
- package/dist/src/agent/background-review/run-background-review.js +1 -1
- package/dist/src/agent/embedded/run-turn.js +11 -1
- package/dist/src/agent/external-tools/endpoint-provider.js +2 -2
- package/dist/src/agent/image/tool-model-config.js +1 -1
- package/dist/src/agent/mcp/oauth/mcp-oauth-store.js +1 -1
- package/dist/src/agent/service.js +6 -3
- package/dist/src/agent/session/session-config-service.js +27 -1
- package/dist/src/agent/session/session-hydrator.js +1 -1
- package/dist/src/agent/skills/hub-lock.js +1 -1
- package/dist/src/agent/skills/index.js +1 -1
- package/dist/src/agent/skills/managed-store.js +1 -1
- package/dist/src/agent/skills/skill-manage-ops.js +1 -1
- package/dist/src/agent/tools/factory.js +21 -14
- package/dist/src/agent/tools/personal-preference-tool.d.ts +10 -0
- package/dist/src/agent/tools/personal-preference-tool.js +43 -0
- package/dist/src/agent/tools/personal-task-tool.d.ts +28 -0
- package/dist/src/agent/tools/personal-task-tool.js +165 -0
- package/dist/src/agent/tools/xopc-use-tool.js +5 -4
- package/dist/src/agent-catalog/capabilities.js +2 -2
- package/dist/src/agent-catalog/service.d.ts +1 -1
- package/dist/src/agent-catalog/service.js +2 -1
- package/dist/src/agent-config/index.js +2 -2
- package/dist/src/agent-config/schema.d.ts +148 -0
- package/dist/src/agent-config/schema.js +40 -2
- package/dist/src/auth/credentials.js +1 -1
- package/dist/src/auth/oauth-provider-lock.js +1 -1
- package/dist/src/auth/profiles/store.js +1 -1
- package/dist/src/automations/capabilities/drafts.js +1 -1
- package/dist/src/bootstrap/application-state.js +1 -1
- package/dist/src/browser/providers/browser-ext-install.js +1 -1
- package/dist/src/capabilities/runtime/dispatcher.js +1 -1
- package/dist/src/capabilities/runtime/product.js +1 -1
- package/dist/src/chat-commands/builtins/thinking.js +12 -2
- package/dist/src/chat-commands/context.js +7 -1
- package/dist/src/cli/commands/agent.js +1 -1
- package/dist/src/cli/commands/agents.js +1 -1
- package/dist/src/cli/commands/auth.js +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/cli/commands/onboard/model.js +2 -2
- package/dist/src/cli/commands/providers.js +1 -1
- package/dist/src/cli/utils/init-workspace-core.js +1 -1
- package/dist/src/config/index.js +3 -3
- package/dist/src/config/loader.js +1 -1
- package/dist/src/config/models-json.js +1 -1
- package/dist/src/config/schema.js +1 -1
- package/dist/src/extensions/agent-plugins/validation.js +1 -1
- package/dist/src/extensions/lockfile.js +1 -1
- package/dist/src/gateway/agents-admin.js +2 -2
- package/dist/src/gateway/hono/lib/config-payload.d.ts +1 -0
- package/dist/src/gateway/hono/lib/config-payload.js +1 -1
- package/dist/src/gateway/hono/routes/config-patch/misc.js +2 -2
- package/dist/src/gateway/hono/routes/lazy-bundles.js +8 -0
- package/dist/src/gateway/hono/routes/models.js +1 -1
- package/dist/src/gateway/hono/routes/notes.js +2 -2
- package/dist/src/gateway/hono/routes/personal-agent.d.ts +3 -0
- package/dist/src/gateway/hono/routes/personal-agent.js +107 -0
- package/dist/src/gateway/hono/routes/projects.js +2 -2
- package/dist/src/gateway/hono/routes/session-input-handler.js +2 -2
- package/dist/src/gateway/hono/routes/sessions.js +5 -0
- package/dist/src/gateway/hono/routes/side-chats.js +1 -1
- package/dist/src/gateway/hono/routes/tasks.js +65 -2
- package/dist/src/gateway/hono/routes/voice.js +8 -0
- package/dist/src/gateway/image-generation-setup.js +2 -2
- package/dist/src/gateway/lock.js +1 -1
- package/dist/src/gateway/service/session-command-service.js +7 -1
- package/dist/src/gateway/service/sessions-api.js +11 -1
- package/dist/src/gateway/service.js +5 -5
- package/dist/src/gateway/session-reset-service.js +5 -0
- package/dist/src/gateway/xopc-cloud-capability-setup.js +1 -1
- package/dist/src/local-apps/service.js +1 -1
- package/dist/src/personal-agent/policy.d.ts +1 -0
- package/dist/src/personal-agent/policy.js +13 -0
- package/dist/src/personal-agent/repository.d.ts +25 -0
- package/dist/src/personal-agent/repository.js +68 -0
- package/dist/src/personal-agent/service.d.ts +48 -0
- package/dist/src/personal-agent/service.js +222 -0
- package/dist/src/providers/model-catalog-persistence.js +1 -1
- package/dist/src/session/resolve-session.js +4 -2
- package/dist/src/storage/sqlite/migrations/229_task_criterion_reviews.sql +12 -0
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +3 -3
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/storage/sqlite/schema.sql +13 -0
- package/dist/src/storage/sqlite/session-repository.js +6 -2
- package/dist/src/storage/sqlite/transcript-repository.js +2 -1
- package/dist/src/tasks/capabilities/read.js +5 -2
- package/dist/src/tasks/task-application-service.js +6 -1
- package/dist/src/tasks/task-criterion-review-repository.d.ts +22 -0
- package/dist/src/tasks/task-criterion-review-repository.js +74 -0
- package/dist/src/tasks/task-main-update-decision-service.js +6 -0
- package/dist/src/tui/backends/embedded-backend.js +2 -2
- package/dist/src/voice/realtime/persona-context.js +1 -1
- package/package.json +3 -3
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-CcTnphqy.js +0 -1
- package/dist/gateway/static/root/assets/agent-plugin-dialog-CdCzMPhC.js +0 -1
- package/dist/gateway/static/root/assets/agents-BiNKpndr.js +0 -66
- package/dist/gateway/static/root/assets/app-management-settings-panel-BvGDN5J6.js +0 -1
- package/dist/gateway/static/root/assets/appearance-settings-BhQYkuQj.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-BQZJuM-C.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-y4qcvlg8.js +0 -7
- package/dist/gateway/static/root/assets/browser-settings-page--N4P7V0l.js +0 -3
- package/dist/gateway/static/root/assets/capabilities-page-F7OAv-iz.js +0 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-CaiIo1S1.js +0 -8
- package/dist/gateway/static/root/assets/capability-header-actions-CR_O9_Vr.js +0 -1
- package/dist/gateway/static/root/assets/channels-Bb-8c4wl.js +0 -1
- package/dist/gateway/static/root/assets/computer-settings-page-QuXZBfky.js +0 -1
- package/dist/gateway/static/root/assets/connector-service-page-BIqzVqCO.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-CZ24DSBJ.js +0 -2
- package/dist/gateway/static/root/assets/date-picker-Ck-FmYEL.js +0 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-C1rKgB-S.js +0 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-UrPcOU6Q.js +0 -1
- package/dist/gateway/static/root/assets/directory-picker-path-field-BYxUgMZb.js +0 -1
- package/dist/gateway/static/root/assets/dist-CKkafhaS.js +0 -1
- package/dist/gateway/static/root/assets/dist-io9jFpN72.js +0 -1
- package/dist/gateway/static/root/assets/extension-debug-page-CGL0jpQA.js +0 -1
- package/dist/gateway/static/root/assets/extension-page-DPWf-tYg.js +0 -1
- package/dist/gateway/static/root/assets/extension-settings-page-DZWBY39d.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-D5w5aYXK.js +0 -1
- package/dist/gateway/static/root/assets/home-page-DPQwxBGy.js +0 -1
- package/dist/gateway/static/root/assets/imports-page-CnRWDtGz.js +0 -1
- package/dist/gateway/static/root/assets/index-B-w6Rk9Z.css +0 -1
- package/dist/gateway/static/root/assets/index-DU5Eb1V8.js +0 -106
- package/dist/gateway/static/root/assets/local-app-workbench-page-hjFeYlIq.js +0 -1
- package/dist/gateway/static/root/assets/logs-page-CzpZDjkA.js +0 -2
- package/dist/gateway/static/root/assets/management-settings-Beu_R_Rc.js +0 -1
- package/dist/gateway/static/root/assets/markdown-view-BlzX7Ze5.js +0 -201
- package/dist/gateway/static/root/assets/note-detail-panel-D8bpTGwP.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-OmgXowUG.js +0 -8
- package/dist/gateway/static/root/assets/page-context-capture-button-BjjjuLkz.js +0 -1
- package/dist/gateway/static/root/assets/page-tabs-_DiuzxyD.js +0 -1
- package/dist/gateway/static/root/assets/popover-select-0p9PIHRy.js +0 -1
- package/dist/gateway/static/root/assets/preview-open-alternatives-BKvUadws.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-CWlCg2x5.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-NbVNo0tP.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-CD8HrqGC.js +0 -1
- package/dist/gateway/static/root/assets/scenes-page-DbWaemwR.js +0 -2
- package/dist/gateway/static/root/assets/schema-form-_3LQ4hyB.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-B7ZUdXlb.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-CpKzZMft.js +0 -1
- package/dist/gateway/static/root/assets/settings-form-section-DS80hVSY.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-De-kC3yJ.js +0 -1
- package/dist/gateway/static/root/assets/share-preview-page-T-0g_rwr.js +0 -2
- package/dist/gateway/static/root/assets/shares-settings-Dz33T3du.js +0 -1
- package/dist/gateway/static/root/assets/skill-api-Cx6GGpSY.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-DyJ-Duem.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-B2iyN-kP.js +0 -2
- package/dist/gateway/static/root/assets/system-settings-panel-By3SZQR_.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-4yHUTs4_.js +0 -1
- package/dist/gateway/static/root/assets/tasks-BH8_WMUF.js +0 -1
- package/dist/gateway/static/root/assets/tunnel-api-BoH0LBkw.js +0 -1
- package/dist/gateway/static/root/assets/usage-page-dKU5X9zT.js +0 -1
- package/dist/gateway/static/root/assets/use-autosave-YKCwQvqT.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-Uht32LPP.js +0 -2
- package/dist/gateway/static/root/assets/voice-api-key-field-DiqHIA8l.js +0 -1
- package/dist/gateway/static/root/assets/workflows-page-Cq3vRUbc.js +0 -6
- /package/dist/gateway/static/root/assets/{dist-CI_fqRk-2.js → dist-CI_fqRk-.js} +0 -0
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/block-editor-sqqrCafh.js","assets/rolldown-runtime-aKtaBQYM.js","assets/index-DU5Eb1V8.js","assets/preload-helper-zJ_50EbN.js","assets/es2015-DBLcMg5B.js","assets/vendor-react-BOUWij0V.js","assets/dist-CxGUk8J-.js","assets/dist-CI_fqRk-2.js","assets/floating-ui.dom-B7uQOZZW.js","assets/markdown-view-BlzX7Ze5.js","assets/dist-BGTk37IG.js","assets/chunk-KS7C4IRE-BMYIfy9x.js","assets/createLucideIcon-DPHK1VkS.js","assets/download-Dk-ZjtO6.js","assets/plus-Q2yW6OE7.js","assets/x-B_N4OPjy.js","assets/locale-store-Y1aBayM_.js","assets/messages-DPw2X06D.js","assets/cn-JdwAhgNB.js","assets/app-link-DRL0YnPs.js","assets/product-delivery-BAks11S4.js","assets/schemas-CObaziC7.js","assets/local-apps-yys1VChX.js","assets/copy-to-clipboard-HOJ79TWv.js","assets/markdown-view-DSjfHfaW.css","assets/dist-CKkafhaS.js","assets/vendor-swr-BIWyz7Rc.js","assets/check-DUBLcKHA.js","assets/popover-select-0p9PIHRy.js","assets/dist-io9jFpN72.js","assets/skeleton-BwbyijEw.js","assets/settings-shell-dialog-layer-BU3UuiJr.js","assets/settings-shell-layer-context-BTQUDoJ2.js","assets/circle-check-C23XjkUj.js","assets/copy-Dv6d4Dvw.js","assets/ellipsis-0k4rZLoy.js","assets/external-link-DjqjBmc3.js","assets/eye-CABVeTq0.js","assets/folder-open-CyzJ19I9.js","assets/globe-DSSGFWFn.js","assets/link-2-D_ZKYUW7.js","assets/loader-circle-CifKLtgG.js","assets/message-square-plus-XP0tGdlV.js","assets/minimize-2-DtOGrlpo.js","assets/pencil-DmIY3Oa-.js","assets/rotate-cw-LIg3Am9S.js","assets/search-DA7gz22f.js","assets/middleware-Pd0e8Igk.js","assets/gateway-realtime-D6ffOiPe.js","assets/gateway-realtime-store-DQuFWNjA.js","assets/local-session-drafts-wiq_12oN.js","assets/capabilities-BOrLei_L.js","assets/tasks-BH8_WMUF.js","assets/session-api-CTN4qwiN.js","assets/gateway-startup-retry-DVol958v.js","assets/files-Bw4SBGdM.js","assets/session-manager-DsH1DZI_.js","assets/tool-activity-BtJkgjFf.js","assets/constants-Co2_smKQ.js","assets/registry-api-DqDOrPQ0.js","assets/attachment-utils-core-BIOUBrpT.js","assets/agents-admin-api-Ck2x78jq.js","assets/gateway-config-swr-B31I6Gbq.js","assets/button-CS04eWY9.js","assets/electron-env-Dit0bHgy.js","assets/index-B-w6Rk9Z.css","assets/vendor-codemirror-DFxP3B9T.js","assets/with-selector-aYPsXwdl.js","assets/note-image-lightbox-1qg2v-9j.js","assets/block-editor-BdOTO0Yo.css","assets/markdown-editor-BhBJANcx.js","assets/code-editor-CXIH8jQw.js","assets/languages-BFe8nIOO.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./preload-helper-zJ_50EbN.js";import{f as a}from"./chunk-KS7C4IRE-BMYIfy9x.js";import{t as o}from"./ellipsis-0k4rZLoy.js";import{t as s}from"./eye-CABVeTq0.js";import{t as c}from"./markdown-view-BlzX7Ze5.js";import{t as l}from"./message-square-plus-XP0tGdlV.js";import{t as u}from"./pencil-DmIY3Oa-.js";import{t as d}from"./plus-Q2yW6OE7.js";import{t as f}from"./x-B_N4OPjy.js";import{t as p}from"./messages-DPw2X06D.js";import{t as m}from"./cn-JdwAhgNB.js";import{c as h,n as g}from"./locale-store-Y1aBayM_.js";import{a as _,i as v,n as y,o as b,r as x,s as S,t as C}from"./dist-BGTk37IG.js";import{i as w}from"./vendor-swr-BIWyz7Rc.js";import{t as T}from"./button-CS04eWY9.js";import{c as E,i as D,n as O,o as k,r as A,s as j,t as M}from"./agents-admin-api-Ck2x78jq.js";import{t as N}from"./skeleton-BwbyijEw.js";import{i as P,o as F}from"./settings-shell-dialog-layer-BU3UuiJr.js";import{t as I}from"./settings-shell-layer-context-BTQUDoJ2.js";import{Bc as L,Bn as R,Cn as z,Fc as B,Hn as V,Kc as H,Ku as U,L as W,Mn as G,Nc as ee,Ns as K,Oo as q,Ta as J,Tn as Y,Tu as te,Vn as ne,Wn as re,Xu as ie,Zl as ae,_c as oe,fc as se,fu as ce,jn as le,ru as ue,wn as de,zn as fe}from"./index-DU5Eb1V8.js";import{r as pe}from"./settings-page-layout-X1x-2Cp9.js";import{t as me}from"./directory-picker-path-field-BYxUgMZb.js";var X=e(t(),1),Z=n();function he(e){let t=e.match(/^(---\r?\n[\s\S]*?\r?\n---(?:\r?\n)*)/);return t?{frontMatter:t[1],body:e.slice(t[1].length)}:{frontMatter:``,body:e}}function ge(e,t){let{frontMatter:n}=he(e);return`${n}${t}`}var _e=[{id:`professional`,labelEn:`Professional & Efficient`,labelZh:`专业高效`,emoji:`🎯`,content:`# SOUL.md - Who You Are
|
|
3
|
-
|
|
4
|
-
## Core Truths
|
|
5
|
-
|
|
6
|
-
**Be genuinely helpful, not performatively helpful.** Skip the filler words — just help. Actions speak louder than pleasantries.
|
|
7
|
-
|
|
8
|
-
**Be precise and efficient.** Value the user's time. Give concise, actionable answers. Expand only when asked.
|
|
9
|
-
|
|
10
|
-
**Earn trust through competence.** Be careful with external actions. Be bold with internal ones (reading, organizing, learning).
|
|
11
|
-
|
|
12
|
-
**Remember you're a guest.** You have access to someone's life. Treat it with respect.
|
|
13
|
-
|
|
14
|
-
## Boundaries
|
|
15
|
-
|
|
16
|
-
- Private things stay private. Period.
|
|
17
|
-
- When in doubt, ask before acting externally.
|
|
18
|
-
- Never send half-baked replies to messaging surfaces.
|
|
19
|
-
|
|
20
|
-
## Vibe
|
|
21
|
-
|
|
22
|
-
Professional, competent, and respectful. Concise when needed, thorough when it matters.`},{id:`casual`,labelEn:`Warm & Friendly`,labelZh:`轻松友好`,emoji:`😊`,content:`# SOUL.md - Who You Are
|
|
23
|
-
|
|
24
|
-
## Core Truths
|
|
25
|
-
|
|
26
|
-
**Be a good friend, not a corporate drone.** Be warm, genuine, and real. Skip the formality when it gets in the way.
|
|
27
|
-
|
|
28
|
-
**Have personality.** You're allowed to be amused, surprised, or excited. An assistant with no personality is just a search engine.
|
|
29
|
-
|
|
30
|
-
**Be resourceful before asking.** Try to figure it out first. Then ask if you're stuck.
|
|
31
|
-
|
|
32
|
-
**Earn trust by being reliable.** Show up, follow through, and remember what matters.
|
|
33
|
-
|
|
34
|
-
**Respect the intimacy.** You have access to someone's life. That's a privilege.
|
|
35
|
-
|
|
36
|
-
## Boundaries
|
|
37
|
-
|
|
38
|
-
- Private things stay private. Always.
|
|
39
|
-
- When in doubt, ask before acting externally.
|
|
40
|
-
- Be careful in group chats — you're not the user's voice.
|
|
41
|
-
|
|
42
|
-
## Vibe
|
|
43
|
-
|
|
44
|
-
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
|
|
45
|
-
|
|
46
|
-
## Core Truths
|
|
47
|
-
|
|
48
|
-
**Precision over politeness.** "This is broken" beats "This might be worth considering." Be direct.
|
|
49
|
-
|
|
50
|
-
**Have opinions.** Disagree, prefer things, find stuff interesting or dull. No personality = no value.
|
|
51
|
-
|
|
52
|
-
**Go deep.** When something is interesting, explore it. Surface-level answers are for search engines.
|
|
53
|
-
|
|
54
|
-
**Be resourceful.** Read the file. Check the context. Search for it. Come back with answers, not questions.
|
|
55
|
-
|
|
56
|
-
**Earn trust through competence.** Be careful with external actions. Be bold with internal ones.
|
|
57
|
-
|
|
58
|
-
## Boundaries
|
|
59
|
-
|
|
60
|
-
- Private things stay private.
|
|
61
|
-
- When in doubt, ask before acting externally.
|
|
62
|
-
- Never send half-baked replies.
|
|
63
|
-
|
|
64
|
-
## Vibe
|
|
65
|
-
|
|
66
|
-
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:``}],ve=[{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:`数字伙伴`}],Q=r(),ye=()=>i(()=>import(`./block-editor-sqqrCafh.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69])),be=()=>i(()=>import(`./markdown-editor-BhBJANcx.js`),__vite__mapDeps([70,1,66,5,71,72,3])),xe=(0,X.lazy)(()=>ye().then(e=>({default:e.BlockEditor}))),Se=(0,X.lazy)(()=>be().then(e=>({default:e.MarkdownEditor}))),Ce=[`SOUL.md`,`TOOLS.md`,`AGENTS.md`],we={"SOUL.md":``,"TOOLS.md":``,"AGENTS.md":``};function Te(){let e=(0,Z.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsxs)(`div`,{className:`space-y-3 p-5`,"aria-busy":`true`,children:[(0,Q.jsx)(N,{className:`h-8 w-52`}),(0,Q.jsx)(N,{className:`h-4 w-full`}),(0,Q.jsx)(N,{className:`h-4 w-4/5`}),(0,Q.jsx)(N,{className:`h-4 w-11/12`})]}),e[0]=t):t=e[0],t}var Ee=(0,X.forwardRef)(function({agentId:e,zh:t,onDirtyChange:n},r){let i=q(e=>e.resolved===`dark`),[a,o]=(0,X.useState)(we),[l,d]=(0,X.useState)(we),[f,p]=(0,X.useState)(!0),[h,g]=(0,X.useState)(!1),[_,v]=(0,X.useState)(!1),[y,b]=(0,X.useState)(null),[x,S]=(0,X.useState)(`SOUL.md`),[C,w]=(0,X.useState)(`direct`);(0,X.useEffect)(()=>{let t=!1;return p(!0),g(!1),b(null),o({...we}),d({...we}),(async()=>{try{let n=await D(e),r=new Set(n.files.filter(e=>!e.missing).map(e=>e.name)),i=await Promise.all(Ce.map(async t=>[t,r.has(t)?await A(e,t):``]));if(t)return;let a={...we};for(let[e,t]of i)a[e]=t;o(a),d(a)}catch(e){if(t)return;g(!0),b(e instanceof Error?e.message:String(e))}finally{t||p(!1)}})(),()=>{t=!0}},[e]);let T=(0,X.useMemo)(()=>Ce.some(e=>a[e]!==l[e]),[l,a]);(0,X.useEffect)(()=>n(T),[T,n]);let E=(0,X.useCallback)(async()=>{let t=Ce.filter(e=>a[e]!==l[e]);if(t.length!==0){v(!0),b(null);try{await Promise.all(t.map(t=>j(e,t,a[t]))),d({...a})}catch(e){throw b(e instanceof Error?e.message:String(e)),e}finally{v(!1)}}},[e,l,a]);(0,X.useImperativeHandle)(r,()=>({save:E}),[E]);let O={"SOUL.md":{label:t?`个性与边界`:`Personality & boundaries`,description:t?`定义语气、价值观、行为原则与安全边界。`:`Tone, values, behavior principles, and safety boundaries.`},"TOOLS.md":{label:t?`工具说明`:`Tool guidance`,description:t?`补充工具偏好和使用约定,不负责授予权限。`:`Tool preferences and conventions; this does not grant access.`},"AGENTS.md":{label:t?`工作规范`:`Working instructions`,description:t?`该智能体长期遵循的协作和执行规范。`:`Persistent collaboration and execution instructions.`}},k=[U,ae,te,u],M=he(a[x]).body;return(0,Q.jsx)(`div`,{className:`space-y-5`,children:(0,Q.jsxs)(`section`,{className:`overflow-hidden rounded-2xl border border-edge bg-surface-base`,children:[(0,Q.jsxs)(`div`,{className:`border-b border-edge px-4 py-4 sm:px-5`,children:[(0,Q.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Q.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-xl bg-surface-hover text-fg-muted`,children:(0,Q.jsx)(ce,{className:`size-4`,"aria-hidden":!0})}),(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsx)(`h4`,{className:`text-sm font-semibold text-fg`,children:t?`角色配置`:`Profile documents`}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:t?`三类角色文件均可编辑。默认使用所见即所得编辑器,熟悉 Markdown 时再切换源码。`:`All three profile documents are editable. The visual editor is the default; switch to Markdown source only when needed.`})]})]}),(0,Q.jsx)(`div`,{className:`mt-4 flex gap-1 overflow-x-auto`,role:`tablist`,"aria-label":t?`角色配置文件`:`Profile documents`,children:Ce.map(e=>(0,Q.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":x===e,onClick:()=>{S(e),w(`direct`)},className:m(`min-h-10 shrink-0 rounded-lg px-3 py-2 font-mono text-xs font-medium transition-colors`,x===e?`bg-accent-soft text-accent-fg`:`text-fg-muted hover:bg-surface-hover hover:text-fg`),children:e},e))})]}),(0,Q.jsxs)(`div`,{className:`p-4 sm:p-5`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:O[x].label}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:O[x].description})]}),(0,Q.jsx)(`div`,{className:`flex rounded-lg bg-surface-hover p-1`,role:`group`,"aria-label":t?`编辑模式`:`Editor mode`,children:[[`direct`,u,t?`直接编辑`:`Visual`],[`source`,te,`Markdown`],[`preview`,s,t?`预览`:`Preview`]].map(([e,t,n])=>(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>w(e),"aria-pressed":C===e,className:m(`inline-flex min-h-9 items-center gap-1.5 rounded-md px-2.5 text-xs font-medium transition-colors`,C===e?`bg-surface-panel text-fg shadow-surface`:`text-fg-muted hover:text-fg`),children:[(0,Q.jsx)(t,{className:`size-3.5`,"aria-hidden":!0}),n]},e))})]}),x===`SOUL.md`&&!f?(0,Q.jsxs)(`div`,{className:`mt-4`,children:[(0,Q.jsx)(`p`,{className:`mb-2 text-xs font-medium text-fg-muted`,children:t?`从模板开始`:`Start from a template`}),(0,Q.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-4`,children:_e.map((e,n)=>(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>{e.content&&o(t=>({...t,"SOUL.md":ge(t[`SOUL.md`],e.content)})),w(`direct`)},className:`flex min-h-11 items-center gap-2 rounded-xl border border-edge px-3 py-2 text-left text-xs font-medium text-fg-muted transition-colors hover:border-accent/40 hover:bg-surface-hover hover:text-fg`,children:[(0,Q.jsx)(k[n]??ie,{className:`size-4 shrink-0 text-accent`,"aria-hidden":!0}),t?e.labelZh:e.labelEn]},e.id))})]}):null,y?(0,Q.jsx)(`p`,{className:`mt-4 rounded-lg bg-red-500/10 px-3 py-2 text-sm text-red-600`,role:`alert`,children:y}):null,(0,Q.jsx)(`div`,{className:`mt-4 h-[min(40vh,22rem)] min-h-64 overflow-hidden rounded-xl border border-edge bg-surface-panel`,role:`tabpanel`,children:f?(0,Q.jsx)(Te,{}):h?(0,Q.jsx)(`div`,{className:`flex h-full items-center justify-center p-6 text-center text-sm text-fg-muted`,children:t?`无法加载角色配置,未对文件进行任何更改。`:`Profile documents could not be loaded. No files were changed.`}):C===`direct`?(0,Q.jsx)(X.Suspense,{fallback:(0,Q.jsx)(Te,{}),children:(0,Q.jsx)(xe,{initialContent:M,onChange:e=>o(t=>({...t,[x]:ge(t[x],e)})),placeholder:t?`直接输入内容,或输入 / 使用快捷命令…`:`Start writing, or type / for commands…`},`${e}-${x}-direct`)}):C===`source`?(0,Q.jsx)(X.Suspense,{fallback:(0,Q.jsx)(Te,{}),children:(0,Q.jsx)(Se,{initialContent:a[x],onChange:e=>o(t=>({...t,[x]:e})),isDark:i,lineWrap:!0,className:`min-h-0 flex-1`},`${e}-${x}-source`)}):(0,Q.jsx)(`div`,{className:`h-full overflow-y-auto p-5`,children:M.trim()?(0,Q.jsx)(c,{content:M}):(0,Q.jsx)(`p`,{className:`text-sm italic text-fg-muted`,children:t?`暂无内容。`:`No content yet.`})})}),(0,Q.jsx)(`div`,{className:`mt-2 flex justify-end text-xs text-fg-muted`,"aria-live":`polite`,children:_?t?`正在保存角色配置…`:`Saving profile documents…`:T?t?`角色配置有未保存的更改`:`Profile documents have unsaved changes`:t?`角色配置已保存`:`Profile documents saved`})]})]})})}),De=[`fast`,`reasoning`,`coding`,`review`,`vision`,`understanding`],$=`w-full rounded-xl border border-edge bg-surface-base px-3 py-2.5 text-sm text-fg outline-none focus:border-accent focus:ring-2 focus:ring-accent/15`;function Oe(e){return[...new Set(e.split(`,`).map(e=>e.trim()).filter(Boolean))]}function ke(e){let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>0?t:void 0}function Ae(e){let t=(0,Z.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Q.jsx)(`span`,{className:`rounded-full bg-accent-soft px-2 py-0.5 text-[10px] font-medium text-accent`,children:n}),t[0]=n,t[1]=r),r}function je(e){let t=(0,Z.c)(10),{title:n,description:r,action:i}=e,a;t[0]===n?a=t[1]:(a=(0,Q.jsx)(`h3`,{className:`text-base font-semibold text-fg`,children:n}),t[0]=n,t[1]=a);let o;t[2]===r?o=t[3]:(o=r?(0,Q.jsx)(`p`,{className:`mt-1 text-sm leading-5 text-fg-muted`,children:r}):null,t[2]=r,t[3]=o);let s;t[4]!==a||t[5]!==o?(s=(0,Q.jsxs)(`div`,{children:[a,o]}),t[4]=a,t[5]=o,t[6]=s):s=t[6];let c;return t[7]!==i||t[8]!==s?(c=(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[s,i]}),t[7]=i,t[8]=s,t[9]=c):c=t[9],c}function Me(e){let t=(0,Z.c)(10),{label:n,value:r,detail:i}=e,a;t[0]===n?a=t[1]:(a=(0,Q.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,children:n}),t[0]=n,t[1]=a);let o;t[2]===r?o=t[3]:(o=(0,Q.jsx)(`p`,{className:`mt-2 truncate text-sm font-semibold text-fg`,title:r,children:r}),t[2]=r,t[3]=o);let s;t[4]===i?s=t[5]:(s=(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:i}),t[4]=i,t[5]=s);let c;return t[6]!==a||t[7]!==o||t[8]!==s?(c=(0,Q.jsxs)(`div`,{className:`rounded-2xl border border-edge bg-surface-base p-4`,children:[a,o,s]}),t[6]=a,t[7]=o,t[8]=s,t[9]=c):c=t[9],c}function Ne(e){let t=(0,Z.c)(56),{label:n,inherited:r,value:i,zh:a,allowChatFallback:o,allowDisabled:s,onChange:c}=e,l=o===void 0?!1:o,u=s===void 0?!1:s,d=i!=null,f;t[0]===n?f=t[1]:(f=(0,Q.jsx)(`h4`,{className:`text-sm font-medium text-fg`,children:n}),t[0]=n,t[1]=f);let p;t[2]!==i||t[3]!==a?(p=i===void 0?(0,Q.jsx)(Ae,{children:a?`继承`:`Inherited`}):null,t[2]=i,t[3]=a,t[4]=p):p=t[4];let m;t[5]!==u||t[6]!==i||t[7]!==a?(m=i===null?(0,Q.jsx)(Ae,{children:u?a?`已禁用`:`Disabled`:a?`使用 Chat`:`Uses Chat`}):null,t[5]=u,t[6]=i,t[7]=a,t[8]=m):m=t[8];let h;t[9]!==f||t[10]!==p||t[11]!==m?(h=(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[f,p,m]}),t[9]=f,t[10]=p,t[11]=m,t[12]=h):h=t[12];let g;t[13]!==r?.primary||t[14]!==i||t[15]!==a?(g=i===void 0?(0,Q.jsx)(`p`,{className:`mt-1 truncate font-mono text-xs text-fg-muted`,children:r?.primary??(a?`全局未配置`:`Not configured globally`)}):null,t[13]=r?.primary,t[14]=i,t[15]=a,t[16]=g):g=t[16];let _;t[17]!==h||t[18]!==g?(_=(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[h,g]}),t[17]=h,t[18]=g,t[19]=_):_=t[19];let v;t[20]!==c||t[21]!==i||t[22]!==a?(v=i===void 0?null:(0,Q.jsx)(T,{variant:`ghost`,className:`px-2 py-1 text-xs`,onClick:()=>c(void 0),children:a?`继承`:`Inherit`}),t[20]=c,t[21]=i,t[22]=a,t[23]=v):v=t[23];let y;t[24]!==l||t[25]!==c||t[26]!==i||t[27]!==a?(y=l&&i!==null?(0,Q.jsx)(T,{variant:`ghost`,className:`px-2 py-1 text-xs`,onClick:()=>c(null),children:a?`使用 Chat`:`Use Chat`}):null,t[24]=l,t[25]=c,t[26]=i,t[27]=a,t[28]=y):y=t[28];let b;t[29]!==u||t[30]!==c||t[31]!==i||t[32]!==a?(b=u&&i!==null?(0,Q.jsx)(T,{variant:`ghost`,className:`px-2 py-1 text-xs`,onClick:()=>c(null),children:a?`禁用`:`Disable`}):null,t[29]=u,t[30]=c,t[31]=i,t[32]=a,t[33]=b):b=t[33];let x;t[34]!==d||t[35]!==r?.fallbacks||t[36]!==r?.primary||t[37]!==c||t[38]!==a?(x=d?null:(0,Q.jsx)(T,{className:`px-2 py-1 text-xs`,onClick:()=>c({primary:r?.primary??``,fallbacks:[...r?.fallbacks??[]]}),children:a?`自定义`:`Customize`}),t[34]=d,t[35]=r?.fallbacks,t[36]=r?.primary,t[37]=c,t[38]=a,t[39]=x):x=t[39];let S;t[40]!==y||t[41]!==b||t[42]!==x||t[43]!==v?(S=(0,Q.jsxs)(`div`,{className:`flex gap-1`,children:[v,y,b,x]}),t[40]=y,t[41]=b,t[42]=x,t[43]=v,t[44]=S):S=t[44];let C;t[45]!==S||t[46]!==_?(C=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[_,S]}),t[45]=S,t[46]=_,t[47]=C):C=t[47];let w;t[48]!==d||t[49]!==c||t[50]!==i||t[51]!==a?(w=d?(0,Q.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-[minmax(0,1fr)_minmax(0,0.8fr)]`,children:[(0,Q.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[a?`主模型`:`Primary model`,(0,Q.jsx)(`input`,{className:`${$} mt-1.5 font-mono`,value:i.primary,onChange:e=>c({...i,primary:e.target.value})})]}),(0,Q.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[a?`回退模型`:`Fallbacks`,(0,Q.jsx)(`input`,{className:`${$} mt-1.5 font-mono`,value:i.fallbacks.join(`, `),onChange:e=>c({...i,fallbacks:Oe(e.target.value)}),placeholder:a?`逗号分隔`:`Comma separated`})]})]}):null,t[48]=d,t[49]=c,t[50]=i,t[51]=a,t[52]=w):w=t[52];let E;return t[53]!==C||t[54]!==w?(E=(0,Q.jsxs)(`div`,{className:`rounded-2xl border border-edge bg-surface-base p-4`,children:[C,w]}),t[53]=C,t[54]=w,t[55]=E):E=t[55],E}function Pe(e){return Object.values(e).some(e=>e!==void 0)?e:void 0}function Fe({agent:e,toolIds:t,zh:n,messages:r,externalError:i,onDirtyChange:a,onClose:o,onOpenDefaults:s,onChat:c,onDelete:u}){let[d,f]=(0,X.useState)(`overview`),[h,g]=(0,X.useState)(()=>structuredClone(e.override)),[_,v]=(0,X.useState)(!1),[y,b]=(0,X.useState)(null),[x,S]=(0,X.useState)(!1),[C,w]=(0,X.useState)(!1),D=(0,X.useRef)(null),O=JSON.stringify(h)!==JSON.stringify(e.override)||C,k=[h.models?.chat,...Object.values(h.models?.intents??{}),h.models?.imageUnderstanding,h.models?.imageGeneration].some(e=>e!=null&&!e.primary.trim());(0,X.useEffect)(()=>a(O),[O,a]);let A=(0,X.useMemo)(()=>[...new Set([...t,...Object.keys(e.effective.tools),...Object.keys(h.tools??{}),...h.toolAllowlist??[]])].sort(),[e.effective.tools,h.toolAllowlist,h.tools,t]),j=[h.models?n?`模型`:`Models`:null,h.skills?n?`技能`:`Skills`:null,h.tools?n?`工具权限`:`Tool access`:null,h.runtime||h.workflows?n?`运行限制`:`Runtime`:null].filter(e=>!!e),M=h.toolAllowlist,N=M?A.filter(t=>M.includes(t)&&e.effective.tools[t]?.mode!==`deny`).length:null,P=Object.values(e.effective.tools).filter(e=>e.mode===`deny`).length,F=e.effective.skills.mode===`selected`?n?`${e.effective.skills.include.length} 个已选技能`:`${e.effective.skills.include.length} selected skills`:n?`所有已启用技能`:`All enabled skills`,I=h.profile?.name??e.name??e.id,L=(t,n)=>{g(r=>({...r,profile:{...r.profile,name:r.profile?.name??e.name??e.id,[t]:n}}))},R=p(n?`zh`:`en`).chat.workingDirectory,z={fast:r.editorIntentFast,reasoning:r.editorIntentReasoning,coding:r.editorIntentCoding,review:r.editorIntentReview,vision:r.editorIntentVision,understanding:r.editorIntentUnderstanding},B={inherit:r.editorToolModeInherit,allow:r.editorToolModeAllow,ask:r.editorToolModeAsk,deny:r.editorToolModeDeny},V=async()=>{v(!0),b(null);try{await D.current?.save();let t=(await E(e.id,{workspace:h.workspace??null,profile:h.profile,models:h.models??null,skills:h.skills??null,tools:h.tools??null,toolAllowlist:h.toolAllowlist??null,workflows:h.workflows??null,runtime:h.runtime??null})).agents.find(t=>t.id===e.id);t&&g(structuredClone(t.override)),w(!1)}catch(e){b(e instanceof Error?e.message:String(e))}finally{v(!1)}},U=async()=>{v(!0),b(null);try{await E(e.id,{setDefault:!0})}catch(e){b(e instanceof Error?e.message:String(e))}finally{v(!1)}},W=(e,t)=>{let n={...h.tools??{}};t===`inherit`?delete n[e]:n[e]={...n[e],mode:t},g({...h,tools:Object.keys(n).length>0?n:void 0})},G=(t,n)=>{let r=new Set(h.toolAllowlist??[]);n?r.add(t):r.delete(t);let i={...h.tools??{}};n&&(i[t]?.mode===`deny`||e.effective.tools[t]?.mode===`deny`)&&(i[t]={...i[t],mode:`allow`}),g({...h,toolAllowlist:[...r],tools:Object.keys(i).length>0?i:void 0})},K=(e,t)=>{let n={...h.models??{}},r={...n.intents??{}};t===void 0?delete r[e]:r[e]=t,Object.keys(r).length>0?n.intents=r:delete n.intents,g({...h,models:Object.keys(n).length>0?n:void 0})},q=(0,X.useCallback)(e=>{w(e)},[]);return(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col sm:flex-row`,children:[(0,Q.jsx)(`aside`,{className:`shrink-0 overflow-x-auto border-b border-edge px-3 py-3 sm:w-52 sm:overflow-y-auto sm:border-b-0 sm:border-r sm:px-3 sm:py-4`,children:(0,Q.jsx)(`nav`,{className:`flex gap-1 sm:flex-col`,children:[{id:`overview`,label:n?`概览`:`Overview`,icon:ue},{id:`profile`,label:n?`个性`:`Profile`,icon:se},{id:`models`,label:n?`模型`:`Models`,icon:ee},{id:`capabilities`,label:n?`技能与工具`:`Skills & tools`,icon:ie},{id:`runtime`,label:n?`运行限制`:`Runtime`,icon:ue},{id:`danger`,label:n?`危险区`:`Danger zone`,icon:oe}].map(({id:e,label:t,icon:n})=>(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>{f(e),e===`profile`&&S(!0)},className:m(`flex shrink-0 items-center gap-2.5 rounded-xl px-3 py-2 text-left text-sm font-medium transition-colors`,d===e?`bg-accent-soft text-accent-fg`:`text-fg-muted hover:bg-surface-hover hover:text-fg`),children:[(0,Q.jsx)(n,{className:`size-4`}),t]},e))})}),(0,Q.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:[(0,Q.jsxs)(`main`,{className:`min-h-0 flex-1 overflow-y-auto p-5 sm:p-6`,children:[y||i?(0,Q.jsx)(`p`,{className:`mb-4 rounded-lg bg-red-500/10 px-3 py-2 text-sm text-red-600`,children:y??i}):null,d===`overview`?(0,Q.jsxs)(`div`,{className:`space-y-6`,children:[(0,Q.jsx)(je,{title:n?`配置概览`:`Configuration overview`,description:n?`查看当前真正生效的配置。未覆盖的部分会持续跟随全局默认值。`:`Review what actually takes effect. Anything not overridden keeps following global defaults.`,action:(0,Q.jsxs)(T,{onClick:c,children:[(0,Q.jsx)(l,{className:`size-4`}),n?`开始对话`:`Start chat`]})}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-4 rounded-2xl border border-accent/20 bg-accent/5 p-4`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:j.length>0?n?`已自定义:${j.join(`、`)}`:`Customized: ${j.join(`, `)}`:n?`能力配置使用全局默认`:`Capabilities use global defaults`}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:j.length>0?n?`其他能力会继续跟随全局默认配置。`:`All other capabilities continue to follow global defaults.`:n?`修改全局默认配置后,这个智能体会自动同步。`:`This agent updates automatically when global defaults change.`})]}),(0,Q.jsx)(T,{onClick:s,children:n?`查看全局默认配置`:`View global defaults`})]}),(0,Q.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,Q.jsx)(Me,{label:n?`对话模型`:`Chat model`,value:e.effective.models.chat.primary,detail:h.models?.chat?n?`单独设置`:`Agent override`:n?`继承全局`:`Inherited globally`}),(0,Q.jsx)(Me,{label:n?`技能`:`Skills`,value:F,detail:h.skills?n?`单独设置`:`Agent override`:n?`继承全局`:`Inherited globally`}),(0,Q.jsx)(Me,{label:n?`工具权限`:`Tool access`,value:N===null?P>0?n?`${P} 个禁用`:`${P} denied`:n?`全部可用`:`All available`:n?`${N} 个已开放`:`${N} in scope`,detail:M?n?`受智能体工具范围限制`:`Limited by agent tool scope`:h.tools?n?`${Object.keys(h.tools).length} 个本地覆盖`:`${Object.keys(h.tools).length} local overrides`:n?`继承全局`:`Inherited globally`}),(0,Q.jsx)(Me,{label:n?`工作区`:`Workspace`,value:e.effective.workspace,detail:h.workspace?n?`单独设置`:`Agent specific`:n?`自动工作区`:`Automatic workspace`})]}),e.isDefault?null:(0,Q.jsx)(T,{onClick:()=>void U(),disabled:_,children:n?`设为默认智能体`:`Make default agent`})]}):null,x?(0,Q.jsxs)(`div`,{className:m(`space-y-6`,d!==`profile`&&`hidden`),children:[(0,Q.jsx)(je,{title:n?`身份、个性与工作区`:`Identity, behavior, and workspace`,description:n?`管理结构化身份资料、三类角色文件和工作目录。`:`Manage structured identity, three profile documents, and the working directory.`}),(0,Q.jsxs)(`section`,{className:`rounded-2xl border border-edge bg-surface-base p-4 sm:p-5`,children:[(0,Q.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Q.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-xl bg-accent-soft text-accent`,children:(0,Q.jsx)(ee,{className:`size-4`,"aria-hidden":!0})}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`text-sm font-semibold text-fg`,children:n?`智能体身份`:`Agent identity`}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:n?`身份资料保存在智能体配置中,供界面、对话和语音共同使用。`:`Identity is saved in the Agent profile and shared by the UI, chat, and voice.`})]})]}),(0,Q.jsxs)(`div`,{className:`mt-5 grid gap-4 sm:grid-cols-2`,children:[(0,Q.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[n?`名称`:`Name`,(0,Q.jsx)(`input`,{className:`${$} mt-1.5`,value:I,onChange:e=>L(`name`,e.target.value),placeholder:n?`例如:小助`:`e.g. Nova`})]}),(0,Q.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[n?`一句话介绍`:`Description`,(0,Q.jsx)(`input`,{className:`${$} mt-1.5`,value:h.profile?.description??``,onChange:e=>L(`description`,e.target.value),placeholder:n?`擅长什么、如何帮助你`:`What this agent is great at`})]}),(0,Q.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[n?`类型`:`Type`,(0,Q.jsx)(`input`,{className:`${$} mt-1.5`,list:`agent-creatures-${e.id}`,value:h.profile?.creature??``,onChange:e=>L(`creature`,e.target.value),placeholder:n?`AI 助手、研究伙伴…`:`AI assistant, research partner…`}),(0,Q.jsx)(`datalist`,{id:`agent-creatures-${e.id}`,children:ve.map(e=>(0,Q.jsx)(`option`,{value:e.value,children:n?e.labelZh:e.labelEn},e.value))})]}),(0,Q.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[n?`表达风格`:`Style`,(0,Q.jsx)(`input`,{className:`${$} mt-1.5`,value:h.profile?.style??``,onChange:e=>L(`style`,e.target.value),placeholder:n?`例如:直接、温和`:`e.g. direct and warm`})]}),(0,Q.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[n?`主要语言`:`Primary language`,(0,Q.jsx)(`input`,{className:`${$} mt-1.5`,value:h.profile?.language??``,onChange:e=>L(`language`,e.target.value),placeholder:n?`例如:简体中文`:`e.g. English`})]}),(0,Q.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[n?`签名表情`:`Signature emoji`,(0,Q.jsx)(`input`,{className:`${$} mt-1.5`,value:h.profile?.emoji??``,onChange:e=>L(`emoji`,e.target.value),placeholder:`✨`})]}),(0,Q.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[n?`头像地址`:`Avatar URL or path`,(0,Q.jsx)(`input`,{className:`${$} mt-1.5`,value:h.profile?.avatar??``,onChange:e=>L(`avatar`,e.target.value),placeholder:n?`URL 或本地路径`:`URL or local path`})]})]})]}),(0,Q.jsx)(Ee,{ref:D,agentId:e.id,zh:n,onDirtyChange:q}),(0,Q.jsxs)(`section`,{className:`rounded-2xl border border-edge bg-surface-base p-4 sm:p-5`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`text-sm font-semibold text-fg`,children:n?`工作区`:`Workspace`}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:n?`选择这个智能体读写文件时使用的目录;留空则使用自动工作区。`:`Choose where this agent reads and writes files, or leave it empty to use the automatic workspace.`})]}),h.workspace?(0,Q.jsxs)(T,{variant:`ghost`,className:`px-2 py-1 text-xs`,onClick:()=>g(e=>({...e,workspace:void 0})),children:[(0,Q.jsx)(H,{className:`size-3.5`}),n?`恢复自动`:`Use automatic`]}):(0,Q.jsx)(Ae,{children:n?`自动`:`Automatic`})]}),(0,Q.jsx)(`div`,{className:`mt-4`,children:(0,Q.jsx)(me,{value:h.workspace??``,onChange:e=>g(t=>({...t,workspace:e||void 0})),wd:R,placeholder:e.effective.workspace,inputAriaLabel:n?`智能体工作区路径`:`Agent workspace path`,inputClassName:`${$} font-mono`,disabled:_})})]}),(0,Q.jsxs)(`section`,{className:`rounded-2xl border border-edge bg-surface-base p-4 sm:p-5`,children:[(0,Q.jsx)(`h4`,{className:`text-sm font-semibold text-fg`,children:n?`附加指令`:`Additional instructions`}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:n?`补充简短的执行规则;个性与长期工作规范请写入上方角色配置。`:`Add short execution rules. Keep personality and lasting work guidance in the profile documents above.`}),(0,Q.jsx)(`textarea`,{rows:4,className:`${$} mt-4 resize-y leading-6`,value:h.profile?.instructions??``,onChange:t=>g(n=>({...n,profile:{...n.profile,name:n.profile?.name||e.name||e.id,instructions:t.target.value||void 0}})),placeholder:n?`可选:补充必须始终遵循的规则`:`Optional: add a rule that must always be followed`})]})]}):null,d===`models`?(0,Q.jsxs)(`div`,{className:`space-y-6`,children:[(0,Q.jsx)(je,{title:n?`模型路由`:`Model routing`,description:n?`日常对话使用 Chat;固定意图只在对应任务中生效。默认继承全局。`:`Chat handles normal turns; fixed intents apply only to matching work. Everything inherits by default.`,action:h.models?(0,Q.jsxs)(T,{variant:`ghost`,onClick:()=>g({...h,models:void 0}),children:[(0,Q.jsx)(H,{className:`size-4`}),n?`全部继承`:`Inherit all`]}):void 0}),(0,Q.jsx)(Ne,{label:r.editorChatModel,inherited:e.effective.models.chat,value:h.models?.chat,zh:n,onChange:e=>{let t={...h.models??{}};e?t.chat=e:delete t.chat,g({...h,models:Object.keys(t).length>0?t:void 0})}}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`mb-3 text-xs font-semibold uppercase tracking-wide text-fg-subtle`,children:n?`固定意图`:`Fixed intents`}),(0,Q.jsx)(`div`,{className:`space-y-3`,children:De.map(t=>(0,Q.jsx)(Ne,{label:z[t],inherited:e.effective.models.intents[t]??e.effective.models.chat,value:h.models?.intents?.[t],zh:n,allowChatFallback:!0,onChange:e=>K(t,e)},t))})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`mb-3 text-xs font-semibold uppercase tracking-wide text-fg-subtle`,children:n?`图片能力`:`Image capabilities`}),(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsx)(Ne,{label:n?`图片理解`:`Image understanding`,inherited:e.effective.models.imageUnderstanding,value:h.models?.imageUnderstanding,zh:n,allowDisabled:!0,onChange:e=>{let t={...h.models??{}};e===void 0?delete t.imageUnderstanding:t.imageUnderstanding=e,g({...h,models:Object.keys(t).length>0?t:void 0})}}),(0,Q.jsx)(Ne,{label:n?`图片生成`:`Image generation`,inherited:e.effective.models.imageGeneration,value:h.models?.imageGeneration,zh:n,allowDisabled:!0,onChange:t=>{let n={...h.models??{}};t===void 0?delete n.imageGeneration:t===null?n.imageGeneration=null:n.imageGeneration={...t,timeoutMs:h.models?.imageGeneration?.timeoutMs??e.effective.models.imageGeneration?.timeoutMs,autoProviderFallback:h.models?.imageGeneration?.autoProviderFallback??e.effective.models.imageGeneration?.autoProviderFallback??!0},g({...h,models:Object.keys(n).length>0?n:void 0})}}),h.models?.imageGeneration?(0,Q.jsxs)(`div`,{className:`grid gap-4 rounded-2xl border border-edge bg-surface-base p-4 sm:grid-cols-2`,children:[(0,Q.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[n?`生成超时(毫秒)`:`Generation timeout (ms)`,(0,Q.jsx)(`input`,{type:`number`,min:1,className:`${$} mt-1.5`,value:h.models.imageGeneration.timeoutMs??``,onChange:e=>g({...h,models:{...h.models,imageGeneration:{...h.models.imageGeneration,timeoutMs:ke(e.target.value)}}})})]}),(0,Q.jsxs)(`div`,{className:`text-xs font-medium text-fg-muted`,children:[(0,Q.jsx)(`span`,{children:n?`提供商自动回退`:`Automatic provider fallback`}),(0,Q.jsx)(`div`,{className:`mt-1.5 flex rounded-xl bg-surface-hover p-1`,children:[!0,!1].map(e=>(0,Q.jsx)(`button`,{type:`button`,onClick:()=>g({...h,models:{...h.models,imageGeneration:{...h.models.imageGeneration,autoProviderFallback:e}}}),className:m(`flex-1 rounded-lg px-3 py-2 text-xs font-medium`,h.models?.imageGeneration?.autoProviderFallback===e?`bg-surface-panel text-fg shadow-surface`:`text-fg-muted`),children:e?n?`开启`:`On`:n?`关闭`:`Off`},String(e)))})]})]}):null]})]})]}):null,d===`capabilities`?(0,Q.jsxs)(`div`,{className:`space-y-7`,children:[(0,Q.jsx)(je,{title:n?`技能与工具`:`Skills and tools`,description:n?`默认继承全局能力;只设置确实不同的部分。`:`Keep inheritance for global capabilities; override only agents that genuinely differ.`}),(0,Q.jsxs)(`section`,{className:`rounded-2xl border border-edge bg-surface-base p-4`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`text-sm font-semibold text-fg`,children:n?`技能策略`:`Skill policy`}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:h.skills?n?`当前使用单独设置`:`Using an agent override`:n?`当前继承全局`:`Currently inherited globally`})]}),h.skills?(0,Q.jsxs)(T,{variant:`ghost`,onClick:()=>g({...h,skills:void 0}),children:[(0,Q.jsx)(H,{className:`size-4`}),n?`继承`:`Inherit`]}):null]}),(0,Q.jsxs)(`div`,{className:`mt-4 flex gap-2`,children:[(0,Q.jsx)(T,{variant:h.skills?.mode===`merge`?`primary`:`secondary`,onClick:()=>g({...h,skills:{mode:`merge`,add:[],remove:[]}}),children:r.editorSkillModeMerge}),(0,Q.jsx)(T,{variant:h.skills?.mode===`replace`?`primary`:`secondary`,onClick:()=>g({...h,skills:{mode:`replace`,include:[]}}),children:r.editorSkillModeReplace})]}),h.skills?.mode===`merge`?(0,Q.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-2`,children:[(0,Q.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[n?`新增技能`:`Add skills`,(0,Q.jsx)(`input`,{className:`${$} mt-1.5`,value:h.skills.add.join(`, `),onChange:e=>g({...h,skills:{mode:`merge`,add:Oe(e.target.value),remove:h.skills?.mode===`merge`?h.skills.remove:[]}})})]}),(0,Q.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[n?`移除技能`:`Remove skills`,(0,Q.jsx)(`input`,{className:`${$} mt-1.5`,value:h.skills.remove.join(`, `),onChange:e=>g({...h,skills:{mode:`merge`,add:h.skills?.mode===`merge`?h.skills.add:[],remove:Oe(e.target.value)}})})]})]}):null,h.skills?.mode===`replace`?(0,Q.jsxs)(`label`,{className:`mt-4 block text-xs font-medium text-fg-muted`,children:[n?`仅启用这些技能`:`Enable only these skills`,(0,Q.jsx)(`input`,{className:`${$} mt-1.5`,value:h.skills.include.join(`, `),onChange:e=>g({...h,skills:{mode:`replace`,include:Oe(e.target.value)}})})]}):null]}),(0,Q.jsxs)(`section`,{children:[(0,Q.jsxs)(`div`,{className:`mb-3 flex items-center justify-between`,children:[(0,Q.jsx)(`h4`,{className:`text-sm font-semibold text-fg`,children:n?`工具权限`:`Tool permissions`}),h.tools?(0,Q.jsxs)(T,{variant:`ghost`,onClick:()=>g({...h,tools:void 0}),children:[(0,Q.jsx)(H,{className:`size-4`}),n?`全部继承`:`Inherit all`]}):null]}),M?(0,Q.jsx)(`p`,{className:`mb-3 text-xs text-fg-muted`,children:n?`此智能体使用限定的工具范围。可在下方启用或移除工具,保存后从下一轮对话生效。`:`This agent uses a limited tool set. Add or remove tools below; changes apply from the next conversation turn.`}):null,(0,Q.jsx)(`div`,{className:`divide-y divide-edge overflow-hidden rounded-2xl border border-edge bg-surface-base`,children:A.map(t=>{if(M&&!M.includes(t))return(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-4 py-3`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`code`,{className:`text-xs text-fg-muted`,children:t}),(0,Q.jsx)(`p`,{className:`mt-1 text-[11px] text-fg-muted`,children:n?`未开放`:`Unavailable`})]}),(0,Q.jsx)(T,{variant:`secondary`,className:`px-3 py-1.5 text-xs`,onClick:()=>G(t,!0),children:n?`启用`:`Enable`})]},t);let r=h.tools?.[t]?.mode,i=e.effective.tools[t]?.mode??`allow`;return(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 px-4 py-3`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`code`,{className:`text-xs text-fg`,children:t}),(0,Q.jsx)(`p`,{className:`mt-1 text-[11px] text-fg-muted`,children:r?n?`单独设置`:`Agent override`:`${n?`继承`:`Inherits`} ${B[i]}`})]}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Q.jsx)(`div`,{className:`flex rounded-xl bg-surface-hover p-1`,children:[`inherit`,`allow`,`ask`,`deny`].map(e=>(0,Q.jsx)(`button`,{type:`button`,onClick:()=>W(t,e),className:m(`rounded-lg px-2.5 py-1.5 text-xs font-medium transition-colors`,(e===`inherit`?!r:r===e)?`bg-surface-panel text-fg shadow-surface`:`text-fg-muted hover:text-fg`),children:B[e]},e))}),M?(0,Q.jsx)(T,{variant:`ghost`,className:`px-2 py-1.5 text-xs`,onClick:()=>G(t,!1),children:n?`移除`:`Remove`}):null]})]},t)})})]})]}):null,d===`runtime`?(0,Q.jsxs)(`div`,{className:`space-y-6`,children:[(0,Q.jsx)(je,{title:n?`运行限制`:`Runtime limits`,description:n?`留空即继承全局限制。`:`Leave blank to inherit global limits. Use overrides only to tighten or relax a specialist agent.`,action:h.runtime||h.workflows?(0,Q.jsxs)(T,{variant:`ghost`,onClick:()=>g({...h,runtime:void 0,workflows:void 0}),children:[(0,Q.jsx)(H,{className:`size-4`}),n?`全部继承`:`Inherit all`]}):void 0}),(0,Q.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[[`maxTurns`,n?`单次最大轮数`:`Maximum turns`],[`timeoutMs`,n?`单轮超时(毫秒)`:`Turn timeout (ms)`],[`maxToolFailuresPerTurn`,n?`最大工具失败次数`:`Maximum tool failures`]].map(([t,r])=>(0,Q.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[(0,Q.jsxs)(`span`,{className:`flex items-center gap-2`,children:[r,h.runtime?.[t]===void 0?(0,Q.jsx)(Ae,{children:n?`继承`:`Inherited`}):null]}),(0,Q.jsx)(`input`,{type:`number`,min:1,className:`${$} mt-1.5`,value:h.runtime?.[t]??``,placeholder:String(e.effective.runtime[t]??``),onChange:e=>{let n=Pe({...h.runtime??{},[t]:ke(e.target.value)});g({...h,runtime:n})}})]},t))}),(0,Q.jsxs)(`section`,{className:`rounded-2xl border border-edge bg-surface-base p-4`,children:[(0,Q.jsx)(`h4`,{className:`text-sm font-semibold text-fg`,children:n?`工作流`:`Workflows`}),(0,Q.jsxs)(`div`,{className:`mt-4 grid gap-4 sm:grid-cols-2`,children:[(0,Q.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[n?`默认工作流`:`Default workflow`,(0,Q.jsx)(`input`,{className:`${$} mt-1.5`,value:h.workflows?.default??``,placeholder:e.effective.workflows.default,onChange:e=>{let t=Pe({...h.workflows??{},default:e.target.value||void 0});g({...h,workflows:t})}})]}),(0,Q.jsxs)(`label`,{className:`text-xs font-medium text-fg-muted`,children:[n?`允许的工作流`:`Allowed workflows`,(0,Q.jsx)(`input`,{className:`${$} mt-1.5`,value:h.workflows?.allowed?.join(`, `)??``,placeholder:e.effective.workflows.allowed?.join(`, `),onChange:e=>{let t=Oe(e.target.value),n=Pe({...h.workflows??{},allowed:t.length>0?t:void 0});g({...h,workflows:n})}})]})]})]}),(0,Q.jsxs)(`section`,{className:`rounded-2xl border border-edge bg-surface-base p-4`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`text-sm font-semibold text-fg`,children:n?`提示词缓存`:`Prompt cache`}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:h.runtime?.promptCache?n?`使用单独设置`:`Using agent override`:n?`继承全局`:`Inherited globally`})]}),h.runtime?.promptCache?(0,Q.jsxs)(T,{variant:`ghost`,onClick:()=>{let e=Pe({...h.runtime??{},promptCache:void 0});g({...h,runtime:e})},children:[(0,Q.jsx)(H,{className:`size-4`}),n?`继承`:`Inherit`]}):null]}),h.runtime?.promptCache?(0,Q.jsxs)(`div`,{className:`mt-4 grid gap-4 sm:grid-cols-2`,children:[(0,Q.jsxs)(`div`,{className:`text-xs font-medium text-fg-muted`,children:[(0,Q.jsx)(`span`,{children:n?`模式`:`Mode`}),(0,Q.jsx)(`div`,{className:`mt-1.5 flex rounded-xl bg-surface-hover p-1`,children:[`auto`,`off`].map(e=>(0,Q.jsx)(`button`,{type:`button`,onClick:()=>g({...h,runtime:{...h.runtime,promptCache:{...h.runtime.promptCache,mode:e}}}),className:m(`flex-1 rounded-lg px-3 py-2 text-xs font-medium`,h.runtime?.promptCache?.mode===e?`bg-surface-panel text-fg shadow-surface`:`text-fg-muted`),children:e===`auto`?r.editorCacheModeAuto:r.editorCacheModeOff},e))})]}),(0,Q.jsxs)(`div`,{className:`text-xs font-medium text-fg-muted`,children:[(0,Q.jsx)(`span`,{children:n?`缓存周期`:`Lifetime`}),(0,Q.jsx)(`div`,{className:`mt-1.5 flex rounded-xl bg-surface-hover p-1`,children:[`short`,`long`].map(e=>(0,Q.jsx)(`button`,{type:`button`,onClick:()=>g({...h,runtime:{...h.runtime,promptCache:{...h.runtime.promptCache,lifetime:e}}}),className:m(`flex-1 rounded-lg px-3 py-2 text-xs font-medium`,h.runtime?.promptCache?.lifetime===e?`bg-surface-panel text-fg shadow-surface`:`text-fg-muted`),children:e===`short`?r.editorCacheLifetimeShort:r.editorCacheLifetimeLong},e))})]})]}):(0,Q.jsx)(T,{className:`mt-4`,onClick:()=>g({...h,runtime:{...h.runtime,promptCache:{...e.effective.runtime.promptCache??{mode:`auto`,lifetime:`short`}}}}),children:n?`自定义缓存策略`:`Customize cache policy`})]})]}):null,d===`danger`?(0,Q.jsxs)(`div`,{className:`space-y-6`,children:[(0,Q.jsx)(je,{title:n?`危险区`:`Danger zone`,description:n?`这些操作会改变默认路由或移除智能体。`:`These actions change default routing or remove the agent.`}),e.isDefault?null:(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-4 rounded-2xl border border-edge bg-surface-base p-4`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`text-sm font-semibold text-fg`,children:n?`设为默认智能体`:`Make default agent`}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:n?`新会话和未指定路由将使用这个智能体。`:`New sessions and unspecified routes will use this agent.`})]}),(0,Q.jsx)(T,{disabled:_,onClick:()=>void U(),children:n?`设为默认`:`Make default`})]}),e.isDefault?(0,Q.jsx)(`p`,{className:`rounded-2xl bg-surface-base p-4 text-sm text-fg-muted`,children:n?`默认智能体不能删除,请先将其他智能体设为默认。`:`The default agent cannot be deleted. Make another agent the default first.`}):(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-4 rounded-2xl border border-red-500/25 bg-red-500/5 p-4`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`text-sm font-semibold text-red-600`,children:n?`删除智能体`:`Delete agent`}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:n?`配置条目会被移除,删除前仍会再次确认。`:`The configuration entry will be removed after confirmation.`})]}),(0,Q.jsxs)(T,{variant:`ghost`,className:`text-red-600`,onClick:u,children:[(0,Q.jsx)(oe,{className:`size-4`}),n?`删除`:`Delete`]})]})]}):null]}),(0,Q.jsxs)(`footer`,{className:`flex shrink-0 items-center justify-between gap-3 border-t border-edge bg-surface-panel px-5 py-3`,children:[(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:k?n?`请补全自定义模型`:`Complete the custom model reference`:O?n?`有未保存的更改`:`Unsaved changes`:n?`所有更改已保存`:`All changes saved`}),(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Q.jsx)(T,{onClick:o,children:n?`关闭`:`Close`}),(0,Q.jsx)(T,{variant:`primary`,disabled:_||!O||k||h.profile!==void 0&&!h.profile.name.trim(),onClick:()=>void V(),children:_?n?`保存中…`:`Saving…`:n?`保存更改`:`Save changes`})]})]})]})]})}function Ie(e){let t=(0,Z.c)(36),{agent:n,messages:r,open:i,onOpenChange:a,children:o}=e,[s,c]=(0,X.useState)(null),l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Q.jsx)(_,{className:m(`xopc-dialog-overlay fixed inset-0 bg-scrim`,F)}),t[0]=l):l=t[0];let u;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(u=m(`xopc-dialog-content fixed flex flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay shadow-popover`,P,`inset-3 h-[calc(100dvh-1.5rem)] min-h-0 sm:inset-auto sm:left-1/2 sm:top-1/2`,`sm:h-[min(88vh,48rem)] sm:w-[min(94vw,62rem)] sm:-translate-x-1/2 sm:-translate-y-1/2`),t[1]=u):u=t[1];let d;t[2]!==n.avatar||t[3]!==n.id?(d=(0,Q.jsx)(W,{agentId:n.id,avatar:n.avatar,size:42,className:`size-11 shrink-0`}),t[2]=n.avatar,t[3]=n.id,t[4]=d):d=t[4];let p;t[5]!==n||t[6]!==r?(p=de(n,r),t[5]=n,t[6]=r,t[7]=p):p=t[7];let h;t[8]===p?h=t[9]:(h=(0,Q.jsx)(S,{className:`truncate text-base font-semibold text-fg`,children:p}),t[8]=p,t[9]=h);let g;t[10]===n.id?g=t[11]:(g=(0,Q.jsx)(v,{className:`mt-0.5 truncate font-mono text-xs text-fg-muted`,children:n.id}),t[10]=n.id,t[11]=g);let w;t[12]!==h||t[13]!==g?(w=(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[h,g]}),t[12]=h,t[13]=g,t[14]=w):w=t[14];let T;t[15]!==n.isDefault||t[16]!==r.listDefaultBadge?(T=n.isDefault?(0,Q.jsx)(`span`,{className:`rounded-full bg-accent-soft px-2 py-0.5 text-[11px] font-medium text-accent`,children:r.listDefaultBadge}):null,t[15]=n.isDefault,t[16]=r.listDefaultBadge,t[17]=T):T=t[17];let E;t[18]!==d||t[19]!==w||t[20]!==T?(E=(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[d,w,T]}),t[18]=d,t[19]=w,t[20]=T,t[21]=E):E=t[21];let D;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Q.jsx)(f,{className:`size-4`}),t[22]=D):D=t[22];let O;t[23]===r.closeDialogAria?O=t[24]:(O=(0,Q.jsx)(y,{asChild:!0,children:(0,Q.jsx)(`button`,{type:`button`,className:`rounded-lg p-2 text-fg-muted hover:bg-surface-hover hover:text-fg`,"aria-label":r.closeDialogAria,children:D})}),t[23]=r.closeDialogAria,t[24]=O);let k;t[25]!==O||t[26]!==E?(k=(0,Q.jsxs)(`header`,{className:`flex shrink-0 items-center justify-between gap-4 border-b border-edge px-5 py-4`,children:[E,O]}),t[25]=O,t[26]=E,t[27]=k):k=t[27];let A;t[28]!==o||t[29]!==s||t[30]!==k?(A=(0,Q.jsxs)(b,{children:[l,(0,Q.jsx)(x,{ref:c,className:u,onOpenAutoFocus:Le,children:(0,Q.jsxs)(I,{layer:`modal`,portalContainer:s,children:[k,o]})})]}),t[28]=o,t[29]=s,t[30]=k,t[31]=A):A=t[31];let j;return t[32]!==a||t[33]!==i||t[34]!==A?(j=(0,Q.jsx)(C,{open:i,onOpenChange:a,children:A}),t[32]=a,t[33]=i,t[34]=A,t[35]=j):j=t[35],j}function Le(e){return e.preventDefault()}function Re(e){let t=(0,Z.c)(13),{agents:n,busy:r,messages:i,onOpen:a,onChat:o}=e,s;if(t[0]!==n||t[1]!==r||t[2]!==i||t[3]!==o||t[4]!==a){let e;t[6]!==r||t[7]!==i||t[8]!==o||t[9]!==a?(e=e=>{let t=de(e,i),n=z(e,i);return(0,Q.jsx)(`li`,{className:`min-h-0`,children:(0,Q.jsxs)(`article`,{className:m(`group relative flex min-h-52 flex-col rounded-2xl border border-edge bg-surface-panel p-4 shadow-surface`,`transition-[transform,background-color,border-color] duration-200 ease-out hover:-translate-y-0.5 hover:border-accent/30 hover:bg-surface-hover/35 active:scale-[0.99] motion-reduce:transform-none`),children:[(0,Q.jsx)(`button`,{type:`button`,disabled:r,"aria-label":i.listConfigureAgent.replace(`{{name}}`,t),onClick:()=>a(e.id),className:`absolute inset-0 z-0 rounded-2xl focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`}),(0,Q.jsxs)(`div`,{className:`pointer-events-none relative z-10 flex items-start justify-between gap-3`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,Q.jsx)(W,{agentId:e.id,avatar:e.avatar,size:48,className:`size-12 shrink-0`}),(0,Q.jsx)(`div`,{className:`min-w-0`,children:(0,Q.jsx)(`h2`,{className:`truncate text-base font-semibold text-fg`,children:t})})]}),(0,Q.jsx)(`span`,{className:m(`rounded-full px-2 py-0.5 text-[11px] font-medium`,e.isDefault?`bg-accent-soft text-accent`:`bg-surface-hover text-fg-muted`),children:e.isDefault?i.listDefaultBadge:i.listCustomBadge})]}),(0,Q.jsx)(`p`,{className:`pointer-events-none relative z-10 mt-5 line-clamp-2 min-h-10 text-sm leading-5 text-fg-muted`,children:n||e.override.profile?.instructions||i.listUsesGlobalSettings}),(0,Q.jsxs)(`div`,{className:`pointer-events-none relative z-10 mt-4 rounded-xl bg-surface-base px-3 py-2.5`,children:[(0,Q.jsx)(`p`,{className:`text-[11px] font-medium uppercase tracking-wide text-fg-subtle`,children:i.listCurrentModelLabel}),(0,Q.jsx)(`p`,{className:`mt-1 truncate font-mono text-xs text-fg`,children:e.effective.models.chat.primary})]}),(0,Q.jsx)(`div`,{className:`relative z-10 mt-auto pt-4`,children:(0,Q.jsxs)(T,{className:`w-full`,disabled:r,onClick:t=>{t.stopPropagation(),o(e.id)},children:[(0,Q.jsx)(l,{className:`size-4`}),i.listChatWithAgent]})})]})},e.id)},t[6]=r,t[7]=i,t[8]=o,t[9]=a,t[10]=e):e=t[10],s=n.map(e),t[0]=n,t[1]=r,t[2]=i,t[3]=o,t[4]=a,t[5]=s}else s=t[5];let c;return t[11]===s?c=t[12]:(c=(0,Q.jsx)(`ul`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2 xl:grid-cols-3`,children:s}),t[11]=s,t[12]=c),c}var ze=`w-full rounded-xl border border-edge bg-surface-base px-3 py-2.5 text-sm text-fg outline-none focus:border-accent focus:ring-2 focus:ring-accent/15`;function Be(e){let t=(0,Z.c)(79),{draft:n,busy:r,error:i,messages:a,workingDirectoryMessages:o,onChange:s,onCreate:c,onOpenChange:l}=e,u=n.open,d;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsx)(_,{className:m(`xopc-dialog-overlay fixed inset-0 bg-scrim`,F)}),t[0]=d):d=t[0];let p;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(p=m(`xopc-dialog-content fixed left-1/2 top-1/2 flex h-[min(38rem,calc(100dvh-2rem))] w-[min(92vw,36rem)] -translate-x-1/2 -translate-y-1/2 flex-col`,`overflow-hidden rounded-2xl border border-edge bg-surface-overlay shadow-popover`,P),t[1]=p):p=t[1];let h;t[2]===a.manualCreateTitle?h=t[3]:(h=(0,Q.jsx)(S,{className:`text-base font-semibold text-fg`,children:a.manualCreateTitle}),t[2]=a.manualCreateTitle,t[3]=h);let g;t[4]===a.manualCreateDescription?g=t[5]:(g=(0,Q.jsx)(v,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:a.manualCreateDescription}),t[4]=a.manualCreateDescription,t[5]=g);let w;t[6]!==h||t[7]!==g?(w=(0,Q.jsxs)(`div`,{children:[h,g]}),t[6]=h,t[7]=g,t[8]=w):w=t[8];let E;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,Q.jsx)(f,{className:`size-4`,"aria-hidden":!0}),t[9]=E):E=t[9];let D;t[10]===a.manualCreateClose?D=t[11]:(D=(0,Q.jsx)(y,{asChild:!0,children:(0,Q.jsx)(`button`,{type:`button`,className:`touch-target shrink-0 rounded-lg p-2 text-fg-muted hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":a.manualCreateClose,children:E})}),t[10]=a.manualCreateClose,t[11]=D);let O;t[12]!==w||t[13]!==D?(O=(0,Q.jsxs)(`header`,{className:`flex shrink-0 items-start justify-between gap-4 border-b border-edge px-5 py-4`,children:[w,D]}),t[12]=w,t[13]=D,t[14]=O):O=t[14];let k;t[15]===i?k=t[16]:(k=i?(0,Q.jsx)(`p`,{role:`alert`,className:`rounded-lg bg-red-500/10 px-3 py-2 text-sm text-red-600`,children:i}):null,t[15]=i,t[16]=k);let A;t[17]===s?A=t[18]:(A=e=>s({name:e.target.value}),t[17]=s,t[18]=A);let j;t[19]!==n.name||t[20]!==a.manualCreateNamePlaceholder||t[21]!==A?(j=(0,Q.jsx)(`input`,{id:`manual-agent-name`,autoFocus:!0,className:`${ze} mt-1.5`,value:n.name,onChange:A,placeholder:a.manualCreateNamePlaceholder}),t[19]=n.name,t[20]=a.manualCreateNamePlaceholder,t[21]=A,t[22]=j):j=t[22];let M;t[23]!==a.manualCreateName||t[24]!==j?(M=(0,Q.jsxs)(`label`,{htmlFor:`manual-agent-name`,className:`block text-xs font-medium text-fg-muted`,children:[a.manualCreateName,j]}),t[23]=a.manualCreateName,t[24]=j,t[25]=M):M=t[25];let N;t[26]===s?N=t[27]:(N=e=>s({instructions:e.target.value}),t[26]=s,t[27]=N);let I;t[28]!==n.instructions||t[29]!==a.manualCreateInstructionsPlaceholder||t[30]!==N?(I=(0,Q.jsx)(`textarea`,{id:`manual-agent-instructions`,rows:4,className:`${ze} mt-1.5 resize-y leading-6`,value:n.instructions,onChange:N,placeholder:a.manualCreateInstructionsPlaceholder}),t[28]=n.instructions,t[29]=a.manualCreateInstructionsPlaceholder,t[30]=N,t[31]=I):I=t[31];let L;t[32]!==a.manualCreateInstructions||t[33]!==I?(L=(0,Q.jsxs)(`label`,{htmlFor:`manual-agent-instructions`,className:`block text-xs font-medium text-fg-muted`,children:[a.manualCreateInstructions,I]}),t[32]=a.manualCreateInstructions,t[33]=I,t[34]=L):L=t[34];let R;t[35]===a.manualCreateWorkspace?R=t[36]:(R=(0,Q.jsx)(`label`,{htmlFor:`manual-agent-workspace`,className:`block text-xs font-medium text-fg-muted`,children:a.manualCreateWorkspace}),t[35]=a.manualCreateWorkspace,t[36]=R);let z;t[37]===a.manualCreateWorkspaceHint?z=t[38]:(z=(0,Q.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-subtle`,children:a.manualCreateWorkspaceHint}),t[37]=a.manualCreateWorkspaceHint,t[38]=z);let B;t[39]===s?B=t[40]:(B=e=>s({workspace:e}),t[39]=s,t[40]=B);let V;t[41]!==r||t[42]!==n.workspace||t[43]!==a.manualCreateWorkspace||t[44]!==a.manualCreateWorkspacePlaceholder||t[45]!==B||t[46]!==o?(V=(0,Q.jsx)(`div`,{className:`mt-2`,children:(0,Q.jsx)(me,{value:n.workspace,onChange:B,disabled:r,wd:o,placeholder:a.manualCreateWorkspacePlaceholder,inputAriaLabel:a.manualCreateWorkspace,inputClassName:`${ze} font-mono`})}),t[41]=r,t[42]=n.workspace,t[43]=a.manualCreateWorkspace,t[44]=a.manualCreateWorkspacePlaceholder,t[45]=B,t[46]=o,t[47]=V):V=t[47];let H;t[48]!==R||t[49]!==z||t[50]!==V?(H=(0,Q.jsxs)(`div`,{children:[R,z,V]}),t[48]=R,t[49]=z,t[50]=V,t[51]=H):H=t[51];let U;t[52]!==k||t[53]!==M||t[54]!==L||t[55]!==H?(U=(0,Q.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-5 overflow-y-auto p-5`,children:[k,M,L,H]}),t[52]=k,t[53]=M,t[54]=L,t[55]=H,t[56]=U):U=t[56];let W;t[57]!==r||t[58]!==a.manualCreateCancel?(W=(0,Q.jsx)(y,{asChild:!0,children:(0,Q.jsx)(T,{disabled:r,children:a.manualCreateCancel})}),t[57]=r,t[58]=a.manualCreateCancel,t[59]=W):W=t[59];let G;t[60]!==r||t[61]!==n.name?(G=r||!n.name.trim(),t[60]=r,t[61]=n.name,t[62]=G):G=t[62];let ee=r?a.manualCreating:a.manualCreateSubmit,K;t[63]!==r||t[64]!==c||t[65]!==G||t[66]!==ee?(K=(0,Q.jsx)(T,{variant:`primary`,disabled:G,"aria-busy":r,onClick:c,children:ee}),t[63]=r,t[64]=c,t[65]=G,t[66]=ee,t[67]=K):K=t[67];let q;t[68]!==W||t[69]!==K?(q=(0,Q.jsxs)(`footer`,{className:`flex shrink-0 justify-end gap-2 border-t border-edge px-5 py-4`,children:[W,K]}),t[68]=W,t[69]=K,t[70]=q):q=t[70];let J;t[71]!==U||t[72]!==q||t[73]!==O?(J=(0,Q.jsxs)(b,{children:[d,(0,Q.jsxs)(x,{className:p,children:[O,U,q]})]}),t[71]=U,t[72]=q,t[73]=O,t[74]=J):J=t[74];let Y;return t[75]!==n.open||t[76]!==l||t[77]!==J?(Y=(0,Q.jsx)(C,{open:u,onOpenChange:l,children:J}),t[75]=n.open,t[76]=l,t[77]=J,t[78]=Y):Y=t[78],Y}var Ve=`px-4 pb-7 pt-3 sm:px-6 lg:px-8 lg:pb-9 lg:pt-4`,He=`max-w-7xl`;function Ue(){let e=(0,Z.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsx)(N,{className:`h-7 w-28`}),(0,Q.jsx)(N,{className:`h-4 w-80 max-w-full`})]}),(0,Q.jsx)(N,{className:`h-9 w-28`})]}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsxs)(pe,{gap:`gap-5`,padding:Ve,className:He,children:[t,(0,Q.jsx)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2 xl:grid-cols-3`,children:[0,1,2].map(We)})]}),e[1]=n):n=e[1],n}function We(e){return(0,Q.jsx)(N,{className:`h-64 rounded-2xl`},e)}function Ge({agentId:e,onHeaderActionChange:t}){let n=h(e=>e.conversationId),r=g(e=>e.language),i=r===`zh`,s=p(r),c=s.agentsSettings,l=a(),{data:u,error:f,isLoading:_,mutate:v}=w(n?`settings-gateway-agents`:null,k),[y,b]=(0,X.useState)(!1),[x,S]=(0,X.useState)(null),[C,E]=(0,X.useState)(null),[D,A]=(0,X.useState)(null),[j,N]=(0,X.useState)({open:!1,name:``,instructions:``,workspace:``}),P=(0,X.useRef)(!1),F=u?.agents.find(t=>t.id===e),I=(0,X.useCallback)(()=>{u&&(S(null),Y(u.defaultId),l(`/chat/new?${new URLSearchParams({agentSetup:`1`,projectScope:`none`,draft:c.setupDraftPrefix}).toString()}`,{state:{forceNewChat:!0,agentId:u.defaultId}}))},[c.setupDraftPrefix,u,l]),z=(0,X.useCallback)(async()=>{if(!(y||!j.name.trim())){b(!0),E(null);try{let e=await M({profile:{name:j.name.trim(),...j.instructions.trim()?{instructions:j.instructions.trim()}:{}},...j.workspace.trim()?{workspace:j.workspace.trim()}:{}});N({open:!1,name:``,instructions:``,workspace:``}),Y(e.createdAgentId),l(`/chat/new?projectScope=none`,{state:{forceNewChat:!0,agentId:e.createdAgentId}})}catch(e){E(e instanceof Error?e.message:String(e))}finally{b(!1)}}},[y,j,l]),H=(0,X.useMemo)(()=>({overflow:(0,Q.jsxs)(V,{children:[(0,Q.jsx)(re,{asChild:!0,children:(0,Q.jsx)(T,{variant:`secondary`,className:`size-9 shrink-0 p-0`,"aria-label":s.capabilitiesHub.moreActions,title:s.capabilitiesHub.moreActions,children:(0,Q.jsx)(o,{className:`size-4`,"aria-hidden":!0})})}),(0,Q.jsx)(ne,{children:(0,Q.jsxs)(fe,{align:`end`,sideOffset:6,className:`z-50 min-w-48 rounded-xl border border-edge bg-surface-panel p-1 shadow-popover`,children:[(0,Q.jsxs)(R,{className:m(`touch-target flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover`,K.transition),onSelect:()=>l(`/settings/agent-defaults`),children:[(0,Q.jsx)(L,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),i?`全局默认配置`:`Global defaults`]}),(0,Q.jsxs)(R,{className:m(`touch-target flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover`,K.transition),onSelect:()=>{E(null),N(e=>({...e,open:!0}))},children:[(0,Q.jsx)(B,{className:`size-4 text-fg-muted`,strokeWidth:1.75,"aria-hidden":!0}),c.manualCreateMenu]})]})})]}),primary:(0,Q.jsxs)(T,{variant:`primary`,className:`shrink-0`,"aria-label":c.listNewAgentCard,onClick:I,children:[(0,Q.jsx)(d,{className:`size-4`,"aria-hidden":!0}),(0,Q.jsx)(`span`,{className:`hidden sm:inline`,children:c.listNewAgentCard})]})}),[c.listNewAgentCard,c.manualCreateMenu,s.capabilitiesHub.moreActions,l,I,i]);(0,X.useLayoutEffect)(()=>(t?.(H),()=>t?.(null)),[H,t]);let U=async e=>{b(!0),S(null);try{await O(e.id),l(le)}catch(e){S(e instanceof Error?e.message:String(e))}finally{b(!1)}},W=e=>{Y(e),l(`/chat/new`)},ee=e=>{P.current=!1,window.setTimeout(()=>l(G(e)),0)},q=()=>{if(P.current){A({kind:`discard`,destination:le});return}P.current=!1,l(le)},te=()=>{if(P.current){A({kind:`discard`,destination:`/settings/agent-defaults`});return}P.current=!1,l(`/settings/agent-defaults`)},ie=()=>{if(!D)return;if(A(null),D.kind===`discard`){P.current=!1,l(D.destination);return}let e=u?.agents.find(e=>e.id===D.agentId);e&&U(e)},ae=(0,X.useCallback)(e=>{P.current=e},[]);return n?f&&!u?(0,Q.jsxs)(pe,{className:He,padding:Ve,children:[(0,Q.jsx)(`p`,{className:`rounded-xl bg-red-500/10 px-3 py-2 text-sm text-red-600`,children:String(f)}),(0,Q.jsx)(T,{onClick:()=>void v(),children:i?`重试`:`Retry`})]}):_||!u?(0,Q.jsx)(Ue,{}):(0,Q.jsxs)(pe,{gap:`gap-5`,className:He,padding:Ve,children:[(f||x)&&!F?(0,Q.jsx)(`p`,{className:`rounded-xl bg-red-500/10 px-3 py-2 text-sm text-red-600`,children:x??String(f)}):null,(0,Q.jsx)(Re,{agents:u.agents,busy:y,messages:c,onOpen:ee,onChat:W}),F?(0,Q.jsx)(Ie,{agent:F,messages:c,open:!0,onOpenChange:e=>{e||q()},children:(0,Q.jsx)(Fe,{agent:F,toolIds:u.builtinToolIds,zh:i,messages:c,externalError:x,onDirtyChange:ae,onClose:q,onOpenDefaults:te,onChat:()=>W(F.id),onDelete:()=>A({kind:`delete`,agentId:F.id,displayName:de(F,c)})},F.id)}):null,(0,Q.jsx)(Be,{draft:j,busy:y,error:C,messages:c,workingDirectoryMessages:s.chat.workingDirectory,onChange:e=>N(t=>({...t,...e})),onCreate:()=>void z(),onOpenChange:e=>{y||(N(t=>({...t,open:e})),e||E(null))}}),(0,Q.jsx)(J,{open:D!==null,title:D?.kind===`delete`?i?`删除智能体?`:`Delete agent?`:i?`放弃未保存的更改?`:`Discard unsaved changes?`,description:D?.kind===`delete`?i?`删除 ${D.displayName}?此操作无法撤销。`:`Delete ${D.displayName}? This cannot be undone.`:i?`当前更改尚未保存,离开后将丢失。`:`Your changes have not been saved. Leaving will discard them.`,confirmLabel:D?.kind===`delete`?i?`删除`:`Delete`:i?`放弃并离开`:`Discard and leave`,cancelLabel:i?`继续编辑`:`Keep editing`,destructive:!0,overlayClassName:`z-[100]`,contentClassName:`z-[101]`,onConfirm:ie,onCancel:()=>A(null)})]}):(0,Q.jsx)(pe,{className:He,padding:Ve,children:(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:i?`需要本机服务令牌。`:`Local service token required.`})})}export{Ge as AgentsSettingsPanel};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./copy-Dv6d4Dvw.js";import{t as a}from"./messages-DPw2X06D.js";import{t as o}from"./cn-JdwAhgNB.js";import{a as s,n as c,r as l}from"./locale-store-Y1aBayM_.js";import{a as u,i as d,o as f,r as p,s as m,t as h}from"./dist-BGTk37IG.js";import{t as g}from"./copy-to-clipboard-HOJ79TWv.js";import{i as _}from"./vendor-swr-BIWyz7Rc.js";import{t as v}from"./button-CS04eWY9.js";import{t as y}from"./skeleton-BwbyijEw.js";import{i as b,o as x}from"./settings-shell-dialog-layer-BU3UuiJr.js";import{n as S}from"./electron-env-Dit0bHgy.js";import{Ns as C,dl as w,ka as T}from"./index-DU5Eb1V8.js";import{n as E,r as D}from"./settings-page-layout-X1x-2Cp9.js";import{r as O,t as k}from"./settings-form-section-DS80hVSY.js";import{t as A}from"./settings-loading-skeleton-CAmWMaOT.js";var j=n(),M=e(t(),1),N=r();function P(e,t){return e==null?t:e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function F(e,t){return e===`PENDING_UPDATE`?t.pendingUpdate??t.generic:e===`UNINSTALLER_NOT_FOUND`?t.uninstallerNotFound??t.generic:e===`NOT_PACKAGED`?t.notPackaged??t.generic:t.generic}function I(e,t){if(e.platform===`darwin`)return t.uninstallDescDarwin;if(e.platform===`win32`)return t.uninstallDescWin;if(e.platform===`linux`){if(e.linuxPackageKind===`appimage`)return t.uninstallDescLinuxAppImage;if(e.linuxPackageKind===`deb`){let n=e.linuxDebPackageName??`xopc`;return t.uninstallDescLinuxDeb.replace(/\{\{package\}\}/g,n)}return t.uninstallDescLinuxUnknown}return t.uninstallDescLinuxUnknown}var L={info:null,loadError:null,actionError:null,copiedField:null,clearDialogOpen:!1,clearConfirmChecked:!1,clearConfirmText:``,uninstallDialogOpen:!1,removeUserDataOnUninstall:!1,busy:!1};function R({api:e,messages:t,embedded:n=!0}){let[r,a]=(0,M.useReducer)(T,L),{info:s,loadError:c,actionError:l,copiedField:_,clearDialogOpen:y,clearConfirmChecked:S,clearConfirmText:E,uninstallDialogOpen:D,removeUserDataOnUninstall:O,busy:j}=r,R=(0,M.useCallback)(async()=>{if(e?.getUninstallInfo){a({type:`patch`,patch:{loadError:null}});try{a({type:`patch`,patch:{info:await e.getUninstallInfo()}})}catch(e){a({type:`patch`,patch:{loadError:e instanceof Error?e.message:String(e)}})}}},[e]);(0,M.useEffect)(()=>{R()},[R]);let z=async(e,n)=>{if(await g(e)){a({type:`patch`,patch:{actionError:null,copiedField:n}}),window.setTimeout(()=>a({type:`patch`,patch:{copiedField:null}}),2e3);return}a({type:`patch`,patch:{actionError:t.copyFailed}})},B=async()=>{if(e?.clearUserData){a({type:`patch`,patch:{busy:!0,actionError:null}});try{let n=await e.clearUserData();n.ok||a({type:`patch`,patch:{actionError:F(n.error,t.errors)}})}catch(e){a({type:`patch`,patch:{actionError:e instanceof Error?e.message:t.errors.generic}})}finally{a({type:`patch`,patch:{busy:!1,clearDialogOpen:!1,clearConfirmChecked:!1,clearConfirmText:``}})}}},V=async()=>{if(e?.uninstallApp){a({type:`patch`,patch:{busy:!0,actionError:null}});try{let n=await e.uninstallApp({removeUserData:O});n.ok||a({type:`patch`,patch:{actionError:F(n.error,t.errors)}})}catch(e){a({type:`patch`,patch:{actionError:e instanceof Error?e.message:t.errors.generic}})}finally{a({type:`patch`,patch:{busy:!1,uninstallDialogOpen:!1}})}}};if(c)return(0,N.jsx)(`p`,{className:`text-sm text-amber-600 dark:text-amber-400`,role:`alert`,children:c});if(!s)return(0,N.jsx)(A,{rows:2});let H=!s.packaged,U=j||s.pendingUpdate||H,W=!H&&s.uninstallMode!==`unsupported`,G=I(s,t),K=S&&E.trim()===t.clearDataConfirmPhrase;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(k,{children:[n?(0,N.jsxs)(`div`,{className:`mb-4 flex items-center gap-2 text-sm font-semibold text-fg`,children:[(0,N.jsx)(w,{className:`size-4 text-accent`,strokeWidth:1.75}),t.title]}):null,l?(0,N.jsx)(`p`,{className:`mb-3 text-sm text-amber-600 dark:text-amber-400`,role:`alert`,children:l}):null,H?(0,N.jsxs)(`div`,{className:`mb-4 rounded-xl bg-surface-panel/70 px-3 py-2.5 shadow-surface`,children:[(0,N.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:t.devOnlyTitle}),(0,N.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:t.devOnlyBody})]}):null,s.pendingUpdate?(0,N.jsx)(`p`,{className:`mb-3 rounded-xl bg-amber-500/10 px-3 py-2 text-xs text-amber-800 dark:text-amber-200`,children:t.pendingUpdateBlocked}):null,(0,N.jsxs)(`dl`,{className:`space-y-3 text-sm`,children:[(0,N.jsxs)(`div`,{className:`rounded-xl bg-surface-panel/70 p-3 shadow-surface`,children:[(0,N.jsx)(`dt`,{className:`text-xs font-medium text-fg-muted`,children:t.appPath}),(0,N.jsxs)(`dd`,{className:`mt-1 flex items-start justify-between gap-2`,children:[(0,N.jsx)(`code`,{className:`break-all text-xs text-fg`,children:s.appPath}),(0,N.jsxs)(`button`,{type:`button`,className:o(`inline-flex shrink-0 items-center gap-1 rounded-lg border border-edge px-2 py-1 text-xs text-fg hover:bg-surface-hover`,C.press),onClick:()=>void z(s.appPath,`app`),children:[(0,N.jsx)(i,{className:`size-3`,"aria-hidden":!0}),_===`app`?t.copied:t.copyPath]})]})]}),(0,N.jsxs)(`div`,{className:`rounded-xl bg-surface-panel/70 p-3 shadow-surface`,children:[(0,N.jsx)(`dt`,{className:`text-xs font-medium text-fg-muted`,children:t.dataPath}),(0,N.jsxs)(`dd`,{className:`mt-1 flex items-start justify-between gap-2`,children:[(0,N.jsx)(`code`,{className:`break-all text-xs text-fg`,children:s.dataPath}),(0,N.jsxs)(`button`,{type:`button`,className:o(`inline-flex shrink-0 items-center gap-1 rounded-lg border border-edge px-2 py-1 text-xs text-fg hover:bg-surface-hover`,C.press),onClick:()=>void z(s.dataPath,`data`),children:[(0,N.jsx)(i,{className:`size-3`,"aria-hidden":!0}),_===`data`?t.copied:t.copyPath]})]}),(0,N.jsxs)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:[t.dataSize,`: `,P(s.dataSizeBytes,t.dataSizeUnknown)]}),(0,N.jsx)(`p`,{className:`mt-2 text-xs leading-relaxed text-amber-800 dark:text-amber-200`,children:t.sharedDataWarning})]})]}),(0,N.jsxs)(`div`,{className:`mt-4 space-y-3`,children:[(0,N.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-xl bg-surface-panel/70 p-3 shadow-surface sm:flex-row sm:items-center sm:justify-between`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:t.clearData}),(0,N.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:t.clearDataDesc})]}),(0,N.jsx)(`button`,{type:`button`,disabled:U,className:o(`inline-flex shrink-0 items-center justify-center rounded-lg border border-danger/40 bg-danger px-3 py-1.5 text-sm font-medium text-white hover:bg-danger/90 disabled:opacity-50`,C.press),onClick:()=>{a({type:`patch`,patch:{clearConfirmChecked:!1,clearConfirmText:``,clearDialogOpen:!0}})},children:t.clearData})]}),W?(0,N.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-xl bg-surface-panel/70 p-3 shadow-surface sm:flex-row sm:items-center sm:justify-between`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:t.uninstall}),(0,N.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:G})]}),(0,N.jsx)(`button`,{type:`button`,disabled:U,className:o(`inline-flex shrink-0 items-center justify-center rounded-lg border border-edge bg-surface-base px-3 py-1.5 text-sm font-medium text-fg hover:bg-surface-hover disabled:opacity-50`,C.press),onClick:()=>{a({type:`patch`,patch:{removeUserDataOnUninstall:!1,uninstallDialogOpen:!0}})},children:t.uninstall})]}):null]})]}),(0,N.jsx)(h,{open:y,onOpenChange:e=>{e||a({type:`patch`,patch:{clearDialogOpen:!1,clearConfirmChecked:!1,clearConfirmText:``}})},children:(0,N.jsxs)(f,{children:[(0,N.jsx)(u,{className:o(`xopc-dialog-overlay fixed inset-0 bg-scrim backdrop-blur-[1px]`,x)}),(0,N.jsxs)(p,{className:o(`xopc-dialog-content fixed left-1/2 top-1/2 w-[min(100%-2rem,28rem)] -translate-x-1/2 -translate-y-1/2`,b,`rounded-2xl border border-edge bg-surface-overlay p-6 shadow-popover outline-none dark:border-edge`),onOpenAutoFocus:e=>e.preventDefault(),children:[(0,N.jsx)(m,{className:`text-base font-semibold text-fg`,children:t.clearDataConfirmTitle}),(0,N.jsx)(d,{className:`mt-2 text-sm text-fg-muted`,children:t.clearDataConfirmDesc}),(0,N.jsxs)(`label`,{className:`mt-4 flex cursor-pointer items-start gap-2 text-sm text-fg`,children:[(0,N.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox mt-0.5`,checked:S,onChange:e=>a({type:`patch`,patch:{clearConfirmChecked:e.target.checked}})}),(0,N.jsx)(`span`,{children:t.clearDataConfirmCheckbox})]}),(0,N.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,N.jsx)(`label`,{className:`block text-sm font-medium text-fg`,htmlFor:`clear-data-confirm`,children:t.clearDataConfirmLabel}),(0,N.jsx)(`input`,{id:`clear-data-confirm`,type:`text`,autoComplete:`off`,spellCheck:!1,className:o(`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:t.clearDataConfirmPhrase,value:E,onChange:e=>a({type:`patch`,patch:{clearConfirmText:e.target.value}})}),(0,N.jsx)(`p`,{className:`text-xs text-fg-muted`,children:t.clearDataConfirmHint})]}),(0,N.jsxs)(`div`,{className:`mt-6 flex justify-end gap-2`,children:[(0,N.jsx)(v,{type:`button`,variant:`secondary`,disabled:j,onClick:()=>{a({type:`patch`,patch:{clearDialogOpen:!1,clearConfirmChecked:!1,clearConfirmText:``}})},children:t.cancel}),(0,N.jsx)(v,{type:`button`,variant:`secondary`,className:`border-danger/40 bg-danger text-white hover:bg-danger/90 dark:border-danger/40`,disabled:j||!K,onClick:()=>void B(),children:t.confirmClear})]})]})]})}),W?(0,N.jsx)(h,{open:D,onOpenChange:e=>{e||a({type:`patch`,patch:{uninstallDialogOpen:!1}})},children:(0,N.jsxs)(f,{children:[(0,N.jsx)(u,{className:o(`xopc-dialog-overlay fixed inset-0 bg-scrim backdrop-blur-[1px]`,x)}),(0,N.jsxs)(p,{className:o(`xopc-dialog-content fixed left-1/2 top-1/2 w-[min(100%-2rem,28rem)] -translate-x-1/2 -translate-y-1/2`,b,`rounded-2xl border border-edge bg-surface-overlay p-6 shadow-popover outline-none dark:border-edge`),onOpenAutoFocus:e=>e.preventDefault(),children:[(0,N.jsx)(m,{className:`text-base font-semibold text-fg`,children:t.uninstallConfirmTitle}),(0,N.jsx)(d,{className:`mt-2 text-sm text-fg-muted`,children:G}),(0,N.jsxs)(`label`,{className:`mt-4 flex cursor-pointer items-start gap-2 text-sm text-fg`,children:[(0,N.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox mt-0.5`,checked:O,onChange:e=>a({type:`patch`,patch:{removeUserDataOnUninstall:e.target.checked}})}),(0,N.jsx)(`span`,{children:t.removeUserDataCheckbox})]}),O?(0,N.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:t.clearDataConfirmDesc}):null,(0,N.jsxs)(`div`,{className:`mt-6 flex justify-end gap-2`,children:[(0,N.jsx)(v,{type:`button`,variant:`secondary`,disabled:j,onClick:()=>a({type:`patch`,patch:{uninstallDialogOpen:!1}}),children:t.cancel}),(0,N.jsx)(v,{type:`button`,variant:`secondary`,className:`border-danger/40 bg-danger text-white hover:bg-danger/90 dark:border-danger/40`,disabled:j,onClick:()=>void V(),children:t.confirmUninstall})]})]})]})}):null]})}async function z(){return(await s(l(`/api/migrations/status`))).payload}async function B(){await s(l(`/api/migrations/apply`),{method:`POST`,body:`{}`})}function V({messages:e}){let{data:t,error:n,isLoading:r,mutate:i}=_(`settings-migration-status`,z,{refreshInterval:0,revalidateOnFocus:!1}),[a,o]=(0,M.useState)(!1),[s,c]=(0,M.useState)(null);async function l(){o(!0),c(null);try{await B(),await i(),window.dispatchEvent(new CustomEvent(`config-reload`))}catch(e){c(e instanceof Error?e.message:String(e))}finally{o(!1)}}if(r)return(0,N.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-4`,"aria-busy":`true`,children:[(0,N.jsx)(y,{className:`h-5 w-40 max-w-full`}),(0,N.jsx)(y,{className:`mt-2 h-4 w-64 max-w-full`})]});if(n)return(0,N.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-4`,children:[(0,N.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:e.title}),(0,N.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:e.checkFailed})]});let u=t?.items??[],d=u.filter(e=>e.status===`conflict`||e.status===`error`),f=u.filter(e=>e.safety===`auto`&&e.status===`planned`),p=d.length>0||u.some(e=>e.safety!==`auto`);return(0,N.jsxs)(`section`,{className:`rounded-xl bg-surface-hover/20 p-4`,children:[(0,N.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:e.title}),(0,N.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:u.length===0?e.upToDate:p?e.manualAttention:e.safeRepairs.replace(`{{count}}`,String(f.length))})]}),f.length>0&&!p?(0,N.jsx)(v,{type:`button`,variant:`primary`,className:`px-3 py-1.5 text-xs`,onClick:()=>void l(),disabled:a,children:a?e.applying:e.apply}):null]}),u.length>0?(0,N.jsx)(`div`,{className:`mt-3 space-y-2`,children:u.map(e=>(0,N.jsxs)(`div`,{className:`rounded-xl bg-surface-base/55 px-3 py-2`,children:[(0,N.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,N.jsx)(`div`,{className:`truncate text-sm font-medium text-fg`,children:e.title}),(0,N.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2 py-0.5 text-[11px] uppercase tracking-wide text-fg-muted`,children:e.status})]}),(0,N.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:e.message})]},e.id))}):null,s?(0,N.jsx)(`p`,{className:`mt-3 text-sm text-red-500`,children:s}):null]})}function H(){let e=(0,j.c)(28),t=c(U),n;e[0]===t?n=e[1]:(n=a(t),e[0]=t,e[1]=n);let r=n.systemSettings,i=r.desktopApp,o=typeof window<`u`?window.electronAPI?.system:void 0;if(!S()||!o){let t;e[2]===i.title?t=e[3]:(t=(0,N.jsx)(E,{title:i.title}),e[2]=i.title,e[3]=t);let n;e[4]===i.migrations?n=e[5]:(n=(0,N.jsx)(V,{messages:i.migrations}),e[4]=i.migrations,e[5]=n);let a;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(a=O(),e[6]=a):a=e[6];let o;e[7]===r.desktopOnlyTitle?o=e[8]:(o=(0,N.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:r.desktopOnlyTitle}),e[7]=r.desktopOnlyTitle,e[8]=o);let s;e[9]===r.desktopOnlyBody?s=e[10]:(s=(0,N.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:r.desktopOnlyBody}),e[9]=r.desktopOnlyBody,e[10]=s);let c;e[11]!==o||e[12]!==s?(c=(0,N.jsxs)(`div`,{className:a,children:[o,s]}),e[11]=o,e[12]=s,e[13]=c):c=e[13];let l;return e[14]!==t||e[15]!==n||e[16]!==c?(l=(0,N.jsxs)(D,{gap:`gap-3`,children:[t,n,c]}),e[14]=t,e[15]=n,e[16]=c,e[17]=l):l=e[17],l}let s;e[18]===i.title?s=e[19]:(s=(0,N.jsx)(E,{title:i.title}),e[18]=i.title,e[19]=s);let l;e[20]===i.migrations?l=e[21]:(l=(0,N.jsx)(V,{messages:i.migrations}),e[20]=i.migrations,e[21]=l);let u;e[22]===i?u=e[23]:(u=(0,N.jsx)(R,{api:o,messages:i,embedded:!1}),e[22]=i,e[23]=u);let d;return e[24]!==s||e[25]!==l||e[26]!==u?(d=(0,N.jsxs)(D,{gap:`gap-6`,children:[s,l,u]}),e[24]=s,e[25]=l,e[26]=u,e[27]=d):d=e[27],d}function U(e){return e.language}export{H as AppManagementSettingsPanel};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{n as i,r as a}from"./popover-select-0p9PIHRy.js";import{t as o}from"./messages-DPw2X06D.js";import{t as s}from"./cn-JdwAhgNB.js";import{a as c,n as l,r as u}from"./locale-store-Y1aBayM_.js";import{n as d,r as f}from"./gateway-config-swr-B31I6Gbq.js";import{t as p}from"./skeleton-BwbyijEw.js";import{Do as m,Ns as h,Oo as g,Si as _}from"./index-DU5Eb1V8.js";import{n as v,r as y}from"./settings-page-layout-X1x-2Cp9.js";import{t as b}from"./settings-advanced-gate-CpKzZMft.js";var x=e(t(),1),S=n();function C(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function w(e){let t=C(e)?e:{},n=C(t.gateway)?t.gateway:{},r=(C(n.webchat)?n.webchat:{}).activityDetailDefault;return r===`off`||r===`stream`||r===`on`?r:`on`}async function T(e){await c(u(`/api/config`),{method:`PATCH`,body:JSON.stringify({gateway:{webchat:{activityDetailDefault:e}}})}),await d()}var E=r();function D(e){let t=(0,S.c)(13),{title:n,footer:r,children:i,className:a}=e,o;t[0]===a?o=t[1]:(o=s(`min-w-0`,a),t[0]=a,t[1]=o);let c;t[2]===n?c=t[3]:(c=n?(0,E.jsx)(`h2`,{className:`mb-2 px-1 text-xs font-medium text-fg-muted`,children:n}):null,t[2]=n,t[3]=c);let l;t[4]===i?l=t[5]:(l=(0,E.jsx)(`div`,{className:`flex flex-col gap-1 overflow-hidden rounded-xl bg-surface-hover/20 p-1 [&>*]:rounded-lg [&>*]:bg-surface-base/45`,children:i}),t[4]=i,t[5]=l);let u;t[6]===r?u=t[7]:(u=r?(0,E.jsx)(`p`,{className:`mt-2 px-1 text-xs leading-5 text-fg-subtle`,children:r}):null,t[6]=r,t[7]=u);let d;return t[8]!==o||t[9]!==c||t[10]!==l||t[11]!==u?(d=(0,E.jsxs)(`section`,{className:o,children:[c,l,u]}),t[8]=o,t[9]=c,t[10]=l,t[11]=u,t[12]=d):d=t[12],d}var O={default:{light:{canvas:`#ffffff`,panel:`#fafafa`,accent:`#3a6bff`,fg:`#111111`,muted:`#ececec`},dark:{canvas:`#0a0a0a`,panel:`#121212`,accent:`#3a6bff`,fg:`#f5f5f5`,muted:`#222222`}},emerald:{light:{canvas:`#f0fdf4`,panel:`#ffffff`,accent:`#059669`,fg:`#052e16`,muted:`#86efac`},dark:{canvas:`#000000`,panel:`#0a0a0a`,accent:`#10b981`,fg:`#d1fae5`,muted:`#134e2a`}},clay:{light:{canvas:`#fffaf0`,panel:`#ffffff`,accent:`#1a3a3a`,fg:`#0a0a0a`,muted:`#e5e5e5`},dark:{canvas:`#0a1a1a`,panel:`#1a2a2a`,accent:`#ffb084`,fg:`#fffaf0`,muted:`#2a3a3a`}},porcelain:{light:{canvas:`#f6f0e7`,panel:`#fffcf7`,accent:`#985d4d`,fg:`#352e2a`,muted:`#e8d9cf`},dark:{canvas:`#211c19`,panel:`#2b2420`,accent:`#d4a08c`,fg:`#f3eae1`,muted:`#493a32`}},dawn:{light:{canvas:`#accdec`,panel:`#f8fbff`,accent:`#34363a`,fg:`#262626`,muted:`#e7ebf4`},dark:{canvas:`#172433`,panel:`#253342`,accent:`#d9dde2`,fg:`#f3f6fa`,muted:`#415264`}}};function k(e){let t=(0,S.c)(23),{canvas:n,panel:r,accent:i,fg:a,muted:o}=e,s;t[0]===n?s=t[1]:(s={backgroundColor:n},t[0]=n,t[1]=s);let c;t[2]===r?c=t[3]:(c={backgroundColor:r},t[2]=r,t[3]=c);let l;t[4]===i?l=t[5]:(l=(0,E.jsx)(`div`,{className:`size-1 shrink-0 rounded-full`,style:{backgroundColor:i}}),t[4]=i,t[5]=l);let u;t[6]===a?u=t[7]:(u=(0,E.jsx)(`div`,{className:`h-1 min-w-0 flex-1 rounded-full`,style:{backgroundColor:a,opacity:.85}}),t[6]=a,t[7]=u);let d;t[8]!==l||t[9]!==u?(d=(0,E.jsxs)(`div`,{className:`flex items-center gap-1`,children:[l,u]}),t[8]=l,t[9]=u,t[10]=d):d=t[10];let f;t[11]===o?f=t[12]:(f=(0,E.jsx)(`div`,{className:`h-1 w-2/3 max-w-[70%] rounded-full`,style:{backgroundColor:o}}),t[11]=o,t[12]=f);let p;t[13]===o?p=t[14]:(p=(0,E.jsx)(`div`,{className:`size-1/2 max-w-[55%] rounded-full`,style:{backgroundColor:o}}),t[13]=o,t[14]=p);let m;t[15]!==c||t[16]!==d||t[17]!==f||t[18]!==p?(m=(0,E.jsxs)(`div`,{className:`flex flex-col gap-0.5 rounded-sm p-1`,style:c,children:[d,f,p]}),t[15]=c,t[16]=d,t[17]=f,t[18]=p,t[19]=m):m=t[19];let h;return t[20]!==s||t[21]!==m?(h=(0,E.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col justify-center gap-1 p-1.5`,style:s,children:m}),t[20]=s,t[21]=m,t[22]=h):h=t[22],h}function A(e){let t=(0,S.c)(8),{scheme:n}=e,{light:r,dark:i}=O[n],a;t[0]===r?a=t[1]:(a=(0,E.jsx)(k,{...r}),t[0]=r,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,E.jsx)(`div`,{className:`w-px shrink-0 bg-black/12 dark:bg-white/12`,"aria-hidden":!0}),t[2]=o):o=t[2];let s;t[3]===i?s=t[4]:(s=(0,E.jsx)(k,{...i}),t[3]=i,t[4]=s);let c;return t[5]!==a||t[6]!==s?(c=(0,E.jsxs)(`div`,{className:`flex h-11 w-full overflow-hidden rounded-md`,children:[a,o,s]}),t[5]=a,t[6]=s,t[7]=c):c=t[7],c}var j=[{value:`default`,labelKey:`colorSchemeDefault`},{value:`porcelain`,labelKey:`colorSchemePorcelain`},{value:`dawn`,labelKey:`colorSchemeDawn`},{value:`emerald`,labelKey:`colorSchemeLightGreen`},{value:`clay`,labelKey:`colorSchemeClay`}];function M(){let e=(0,S.c)(13),t=l(F),n;e[0]===t?n=e[1]:(n=o(t),e[0]=t,e[1]=n);let r=n.appearanceSettings,i=g(P),a=g(N),c;e[2]===r.colorSchemeTitle?c=e[3]:(c=(0,E.jsx)(`div`,{className:`min-w-0`,children:(0,E.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:r.colorSchemeTitle})}),e[2]=r.colorSchemeTitle,e[3]=c);let u;e[4]!==r||e[5]!==i||e[6]!==a?(u=j.map(e=>{let{value:t,labelKey:n}=e,o=i===t;return(0,E.jsxs)(`button`,{type:`button`,"aria-pressed":o,onClick:()=>a(t),className:s(`flex flex-col gap-2 rounded-xl bg-surface-hover/25 p-2.5 text-left transition-[background-color,box-shadow,transform] duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,h.pressCard,o?`bg-surface-active shadow-surface`:`hover:bg-surface-hover/60`),children:[(0,E.jsx)(A,{scheme:t}),(0,E.jsx)(`span`,{className:s(`text-xs font-medium leading-none`,o?`text-accent-fg`:`text-fg-muted`),children:r[n]})]},t)}),e[4]=r,e[5]=i,e[6]=a,e[7]=u):u=e[7];let d;e[8]===u?d=e[9]:(d=(0,E.jsx)(`div`,{className:`grid grid-cols-2 gap-3 sm:grid-cols-3 xl:grid-cols-5`,children:u}),e[8]=u,e[9]=d);let f;return e[10]!==c||e[11]!==d?(f=(0,E.jsxs)(`div`,{className:`flex flex-col gap-3 px-4 py-3.5 sm:px-5 sm:py-4`,children:[c,d]}),e[10]=c,e[11]=d,e[12]=f):f=e[12],f}function N(e){return e.setColorScheme}function P(e){return e.colorScheme}function F(e){return e.language}function I(){let e=(0,S.c)(28),t=l(L),n;e[0]===t?n=e[1]:(n=o(t),e[0]=t,e[1]=n);let r=n.appearanceSettings,{data:c,isLoading:u}=f(!0),d=c?.payload?.config,m;e[2]===d?m=e[3]:(m=w(d),e[2]=d,e[3]=m);let h=m,[g,_]=(0,x.useState)(h),[v,y]=(0,x.useState)(!1),[b,C]=(0,x.useState)(!1),D,O;e[4]===h?(D=e[5],O=e[6]):(D=()=>_(h),O=[h],e[4]=h,e[5]=D,e[6]=O),(0,x.useEffect)(D,O);let k;e[7]===g?k=e[8]:(k=e=>{let t=g;_(e),y(!0),C(!1),T(e).catch(()=>{_(t),C(!0)}).finally(()=>y(!1))},e[7]=g,e[8]=k);let A=k,j;e[9]===r.activityDetailDefaultTitle?j=e[10]:(j=(0,E.jsx)(`div`,{className:`min-w-0 text-sm font-medium text-fg`,children:r.activityDetailDefaultTitle}),e[9]=r.activityDetailDefaultTitle,e[10]=j);let M;e[11]!==r.activityDetailLevels||e[12]!==A||e[13]!==u||e[14]!==g||e[15]!==v?(M=u?(0,E.jsx)(p,{className:`h-10 w-full rounded-lg sm:max-w-[11rem]`}):(0,E.jsxs)(i,{value:g,disabled:v,onChange:e=>A(e.target.value),triggerClassName:`w-full sm:max-w-[11rem]`,children:[(0,E.jsx)(a,{value:`off`,children:r.activityDetailLevels.off}),(0,E.jsx)(a,{value:`on`,children:r.activityDetailLevels.on}),(0,E.jsx)(a,{value:`stream`,children:r.activityDetailLevels.stream})]}),e[11]=r.activityDetailLevels,e[12]=A,e[13]=u,e[14]=g,e[15]=v,e[16]=M):M=e[16];let N;e[17]!==j||e[18]!==M?(N=(0,E.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between sm:gap-6`,children:[j,M]}),e[17]=j,e[18]=M,e[19]=N):N=e[19];let P;e[20]!==r.activityDetailSaveError||e[21]!==r.activityDetailSaving||e[22]!==b||e[23]!==v?(P=b||v?(0,E.jsx)(`p`,{className:s(`text-xs`,b?`text-red-600 dark:text-red-400`:`text-fg-subtle`),children:b?r.activityDetailSaveError:r.activityDetailSaving}):null,e[20]=r.activityDetailSaveError,e[21]=r.activityDetailSaving,e[22]=b,e[23]=v,e[24]=P):P=e[24];let F;return e[25]!==N||e[26]!==P?(F=(0,E.jsxs)(`div`,{className:`flex flex-col gap-2 px-4 py-3.5 sm:px-5 sm:py-4`,children:[N,P]}),e[25]=N,e[26]=P,e[27]=F):F=e[27],F}function L(e){return e.language}function R(){let e=(0,S.c)(17),t=l(V),n;e[0]===t?n=e[1]:(n=o(t),e[0]=t,e[1]=n);let r=n.appearanceSettings,i=_(B),a=_(z),s;e[2]===r.showRawToolDataTitle?s=e[3]:(s=(0,E.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:r.showRawToolDataTitle}),e[2]=r.showRawToolDataTitle,e[3]=s);let c;e[4]===r.showRawToolDataDescription?c=e[5]:(c=(0,E.jsx)(`p`,{className:`text-xs text-fg-muted`,children:r.showRawToolDataDescription}),e[4]=r.showRawToolDataDescription,e[5]=c);let u;e[6]!==s||e[7]!==c?(u=(0,E.jsxs)(`div`,{className:`min-w-0`,children:[s,c]}),e[6]=s,e[7]=c,e[8]=u):u=e[8];let d;e[9]===a?d=e[10]:(d=e=>a(e.target.checked),e[9]=a,e[10]=d);let f;e[11]!==i||e[12]!==d?(f=(0,E.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,checked:i,onChange:d}),e[11]=i,e[12]=d,e[13]=f):f=e[13];let p;return e[14]!==u||e[15]!==f?(p=(0,E.jsx)(`div`,{className:`px-4 py-3.5 sm:px-5 sm:py-4`,children:(0,E.jsxs)(`label`,{className:`flex items-center justify-between gap-3`,children:[u,f]})}),e[14]=u,e[15]=f,e[16]=p):p=e[16],p}function z(e){return e.setShowRawToolData}function B(e){return e.showRawToolData}function V(e){return e.language}function H(){let e=(0,S.c)(12),t=l(U),n;e[0]===t?n=e[1]:(n=o(t),e[0]=t,e[1]=n);let r=n.appearanceSettings,i;e[2]===r.pageTitle?i=e[3]:(i=(0,E.jsx)(v,{title:r.pageTitle}),e[2]=r.pageTitle,e[3]=i);let a;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,E.jsx)(D,{children:(0,E.jsx)(m,{variant:`page`,sections:[`language`]})}),e[4]=a):a=e[4];let s;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,E.jsxs)(D,{children:[(0,E.jsx)(m,{variant:`page`,sections:[`theme`,`font`]}),(0,E.jsx)(M,{}),(0,E.jsx)(I,{})]}),e[5]=s):s=e[5];let c;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,E.jsx)(R,{}),e[6]=c):c=e[6];let u;e[7]===r.developerGroupTitle?u=e[8]:(u=(0,E.jsx)(b,{children:(0,E.jsx)(D,{title:r.developerGroupTitle,children:c})}),e[7]=r.developerGroupTitle,e[8]=u);let d;return e[9]!==i||e[10]!==u?(d=(0,E.jsxs)(y,{gap:`gap-6`,children:[i,a,s,u]}),e[9]=i,e[10]=u,e[11]=d):d=e[11],d}function U(e){return e.language}export{H as AppearanceSettingsPanel};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{g as i,t as a}from"./chunk-KS7C4IRE-BMYIfy9x.js";import{t as o}from"./check-DUBLcKHA.js";import{t as s}from"./ellipsis-0k4rZLoy.js";import{t as c}from"./external-link-DjqjBmc3.js";import{t as l}from"./markdown-view-BlzX7Ze5.js";import{t as u}from"./loader-circle-CifKLtgG.js";import{t as d}from"./plus-Q2yW6OE7.js";import{t as f}from"./x-B_N4OPjy.js";import{t as p}from"./messages-DPw2X06D.js";import{t as m}from"./cn-JdwAhgNB.js";import{c as h,i as g,n as _,r as v}from"./locale-store-Y1aBayM_.js";import{a as y,i as b,o as x,r as S,s as C,t as w}from"./dist-BGTk37IG.js";import{a as T,i as E}from"./vendor-swr-BIWyz7Rc.js";import{t as D}from"./button-CS04eWY9.js";import{o as O}from"./gateway-realtime-D6ffOiPe.js";import{t as k}from"./skeleton-BwbyijEw.js";import{Bc as A,Bn as j,Hn as M,Ns as N,Rc as P,So as F,Vn as ee,Wn as I,Yu as L,_c as te,_o as R,dl as z,go as B,ho as V,ka as H,od as ne,vc as re,vo as U,yo as W,zn as G,zu as K}from"./index-DU5Eb1V8.js";import{n as q,t as J}from"./capability-header-actions-CR_O9_Vr.js";import{t as Y}from"./page-tabs-_DiuzxyD.js";import{t as ie}from"./agent-plugin-dialog-CdCzMPhC.js";import{t as X}from"./capability-icon-BYm2-nS-.js";var Z=e(t(),1),ae=n();function Q(e){return e===`builtin`||e===`user`?e:`marketplace`}async function oe(e=``){let t=await g(v(`/api/marketplace${e.trim()?`?q=${encodeURIComponent(e.trim())}`:``}`),{cache:`no-store`});if(!t.ok)throw Error(await se(t));let n=await t.json();if(!n.ok||!Array.isArray(n.extensions))throw Error(n.error??`Invalid response`);return n.extensions}async function se(e){try{let t=await e.json();if(typeof t.error==`string`)return t.error;if(t.error&&typeof t.error==`object`&&typeof t.error.message==`string`)return t.error.message;if(typeof t.message==`string`)return t.message}catch{}return e.statusText||`HTTP ${e.status}`}async function ce(e){let t=await g(v(`/api/marketplace/packages/${encodeURIComponent(e.trim())}`),{cache:`no-store`});if(!t.ok)throw Error(await se(t));let n=await t.json();if(!n.ok||!n.payload?.id)throw Error(n.error??`Invalid response`);return n.payload}async function le(e){let t=await g(v(`/api/marketplace/install`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(await se(t));let n=await t.json();if(!n.ok||!n.payload?.extensionId)throw Error(n.error??`Invalid response`);return n.payload}async function ue(e){let t=await g(v(`/api/extensions/${encodeURIComponent(e.extensionId.trim())}/activation`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({enabled:e.enabled})});if(!t.ok)throw Error(await se(t));let n=await t.json();if(!n.ok||!n.payload)throw Error(n.error?.message??`Invalid response`);return n.payload}async function de(e){let t=await g(v(`/api/marketplace/uninstall`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({extensionId:e})});if(!t.ok)throw Error(await se(t));let n=await t.json();if(!n.ok||!n.payload)throw Error(n.error??`Invalid response`);return n.payload}var $=r();function fe(e,t){let n=e.find(e=>e.id===t||e.pluginId===t);return n?n.source===`bundled`?`bundled`:`user`:`absent`}var pe={debounced:``,detailPkg:null,quickInstallPkg:null,rowBusy:null,actionError:null,restartHint:null};function me({className:e,query:t}){let n=_(e=>e.language),r=p(n).extensionsPage,i=h(e=>!!e.conversationId),a=B(),{mutate:o}=T(),[s,c]=(0,Z.useReducer)(H,pe),{debounced:l,detailPkg:d,quickInstallPkg:f,rowBusy:g,actionError:v,restartHint:y}=s,b=i?`marketplace-${l}`:null;(0,Z.useEffect)(()=>{let e=window.setTimeout(()=>c({type:`patch`,patch:{debounced:t.trim()}}),300);return()=>window.clearTimeout(e)},[t]);let{data:x,isLoading:S,error:C}=E(b,()=>oe(l),{revalidateOnFocus:!1}),w=(0,Z.useCallback)(()=>{o(`gateway-extensions-list`),O()},[o]),D=(0,Z.useCallback)(async(e,t)=>{c({type:`patch`,patch:{actionError:null,restartHint:null,rowBusy:e}});try{let n=await le({name:e,overwrite:t});w(),n.requiresGatewayRestart&&c({type:`patch`,patch:{restartHint:r.marketplaceRestartHint}})}catch(e){throw c({type:`patch`,patch:{actionError:e instanceof Error?e.message:r.marketplaceInstallFailed}}),e}finally{c({type:`patch`,patch:{rowBusy:null}})}},[r.marketplaceInstallFailed,r.marketplaceRestartHint,w]),A=(0,Z.useCallback)(async e=>{c({type:`patch`,patch:{actionError:null,restartHint:null,rowBusy:e}});try{let t=await de(e);w(),t.requiresGatewayRestart&&c({type:`patch`,patch:{restartHint:r.marketplaceRestartHint}})}catch(e){throw c({type:`patch`,patch:{actionError:e instanceof Error?e.message:r.marketplaceUninstallFailed}}),e}finally{c({type:`patch`,patch:{rowBusy:null}})}},[r.marketplaceRestartHint,r.marketplaceUninstallFailed,w]),j=x??[];return(0,$.jsxs)(`div`,{className:m(`flex flex-col gap-4`,e),children:[C?(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:C instanceof Error?C.message:r.marketplaceLoadFailed}):null,v?(0,$.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:v}):null,y?(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:y}):null,S&&!x?(0,$.jsx)(`ul`,{className:`flex flex-col gap-3`,"aria-label":r.marketplaceLoading,children:[0,1,2].map(e=>(0,$.jsx)(`li`,{className:`rounded-xl bg-surface-panel p-4 shadow-surface`,children:(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,$.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2.5`,children:[(0,$.jsx)(k,{className:`h-5 w-40`}),(0,$.jsx)(k,{className:`h-4 w-full max-w-xl`}),(0,$.jsx)(k,{className:`h-4 w-2/3 max-w-md`})]}),(0,$.jsx)(k,{className:`h-8 w-20`})]})},e))}):(0,$.jsx)(`ul`,{className:`flex flex-col gap-3`,children:j.length===0?(0,$.jsx)(`li`,{className:`text-sm text-fg-muted`,children:r.marketplaceEmpty}):j.map(e=>{let t=fe(a,e.id),i=g===e.id,o=e.localizations?.[n.startsWith(`zh`)?`zh-CN`:`en`],s=o?.displayName??e.name,l=o?.description??e.description;return(0,$.jsx)(`li`,{className:`list-none`,children:(0,$.jsxs)(`div`,{role:`button`,tabIndex:0,"aria-label":`${s}, ${r.marketplaceDetailTitle}`,onClick:()=>c({type:`patch`,patch:{detailPkg:e.id}}),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),c({type:`patch`,patch:{detailPkg:e.id}}))},className:m(`flex w-full cursor-pointer flex-wrap items-start gap-3 rounded-xl bg-surface-panel p-4 text-left shadow-surface`,`transition-[transform,background-color,box-shadow] duration-150 ease-out`,`hover:bg-surface-hover/40`,`active:scale-[0.992] active:bg-surface-hover/55`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel`,`dark:hover:bg-surface-hover/25 dark:active:bg-surface-hover/35`),children:[(0,$.jsx)(X,{iconUrl:e.branding?.iconUrl,fallback:z}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`h3`,{className:`truncate font-semibold text-fg`,children:s}),s===e.id?null:(0,$.jsx)(`p`,{className:`truncate font-mono text-[10px] text-fg-subtle`,children:e.id})]}),e.verified?(0,$.jsx)(K,{className:`size-4 shrink-0 text-emerald-600 dark:text-emerald-400`,strokeWidth:1.75,"aria-label":`Verified`}):null,e.version?(0,$.jsx)(`span`,{className:`text-xs text-fg-muted`,children:e.version}):null]}),l?(0,$.jsx)(`p`,{className:`mt-1 line-clamp-2 text-sm text-fg-muted`,children:l}):null,(0,$.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:(e.categories??[]).map(e=>(0,$.jsx)(`span`,{className:`rounded-md border border-edge bg-surface-panel px-2 py-0.5 text-[11px] text-fg-muted`,children:e},e))}),(0,$.jsxs)(`p`,{className:`mt-2 flex items-center gap-1.5 text-xs text-fg-muted`,children:[(0,$.jsx)(z,{className:`size-3.5 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}),(0,$.jsx)(`code`,{className:`rounded bg-surface-panel px-1 py-0.5`,children:e.npmPackage})]})]}),(0,$.jsx)(`div`,{role:`group`,className:`flex shrink-0 flex-col items-end gap-2 sm:min-w-[9rem]`,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:t===`bundled`?(0,$.jsx)(`span`,{className:`rounded-md bg-surface-hover px-2 py-1 text-[11px] font-medium text-fg-muted`,children:r.marketplaceBuiltin}):t===`user`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`text-[11px] font-medium text-fg-muted`,children:r.marketplaceInstalled}),e.packageType===`plugin`?(0,$.jsx)(`button`,{type:`button`,onClick:()=>c({type:`patch`,patch:{detailPkg:e.id,quickInstallPkg:null}}),className:m(`inline-flex items-center justify-center rounded-lg border border-edge px-3 py-2 text-xs font-medium text-fg`,`transition-colors active:scale-[0.98] active:bg-surface-hover/80`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`),children:n.startsWith(`zh`)?`管理`:`Manage`}):(0,$.jsxs)(`button`,{type:`button`,disabled:i,onClick:()=>{window.confirm(r.marketplaceUninstallConfirm)&&A(e.id).catch(()=>{})},className:m(`inline-flex items-center justify-center gap-1.5 rounded-lg border border-edge px-3 py-2 text-xs font-medium text-fg`,`transition-colors active:scale-[0.98] active:bg-surface-hover/80`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,`disabled:pointer-events-none disabled:opacity-50`),children:[i?(0,$.jsx)(u,{className:`size-3.5 animate-spin`,"aria-hidden":!0}):(0,$.jsx)(re,{className:`size-3.5`,strokeWidth:2,"aria-hidden":!0}),r.marketplaceUninstall]})]}):(0,$.jsx)(`button`,{type:`button`,onClick:()=>c({type:`patch`,patch:e.packageType===`plugin`?{detailPkg:e.id,quickInstallPkg:e.id}:{detailPkg:e.id,quickInstallPkg:null}}),className:m(`inline-flex w-full items-center justify-center rounded-lg border border-edge px-3 py-2 text-xs font-medium text-fg`,`transition-[transform,background-color] active:scale-[0.98]`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`),children:e.packageType===`plugin`?n.startsWith(`zh`)?`安装`:`Install`:r.marketplaceReview})})]})},e.id)})}),d?(0,$.jsx)(he,{packageName:d,autoInstall:f===d,copy:r,extensions:a,onClose:()=>c({type:`patch`,patch:{detailPkg:null,quickInstallPkg:null}}),onInstall:D,onUninstall:A}):null]})}function he(e){let t=(0,ae.c)(96),{packageName:n,autoInstall:r,copy:i,extensions:o,onClose:s,onInstall:c,onUninstall:d}=e,[p,g]=(0,Z.useState)(!1),[_,v]=(0,Z.useState)(!1),b=h(be)?`ext-mp-detail-${n}`:null,T;t[0]===n?T=t[1]:(T=async()=>ce(n),t[0]=n,t[1]=T);let D;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(D={revalidateOnFocus:!1},t[2]=D):D=t[2];let{data:O,error:A,isLoading:j}=E(b,T,D),M;t[3]!==o||t[4]!==n?(M=fe(o,n),t[3]=o,t[4]=n,t[5]=M):M=t[5];let N=M,F=N===`user`,ee=O?.manifest?.permissions,I,L,R,z,B,V,H,U,W,G,K,q;if(t[6]!==r||t[7]!==i||t[8]!==O||t[9]!==A||t[10]!==o||t[11]!==N||t[12]!==j||t[13]!==s||t[14]!==n||t[15]!==ee||t[16]!==_){V=Symbol.for(`react.early_return_sentinel`);bb0:{let e=ee&&typeof ee==`object`&&!Array.isArray(ee)?Object.entries(ee):[],a;t[29]!==i||t[30]!==O?(a=O?.readme?.trim()||(O?.description?.trim()?`### ${O.name}\n\n${O.description}`:`*${i.marketplaceNoReadme}*`),t[29]=i,t[30]=O,t[31]=a):a=t[31];let c=a;if(O?.format===`agent-plugin`){let e;if(t[32]!==O||t[33]!==o){let n;t[35]===O?n=t[36]:(n=e=>e.pluginId===O.manifest?.name,t[35]=O,t[36]=n),e=o.find(n),t[32]=O,t[33]=o,t[34]=e}else e=t[34];let i=`store:${n}`,a;t[37]!==r||t[38]!==O||t[39]!==s||t[40]!==e||t[41]!==i?(a=(0,$.jsx)(ie,{extension:e,initialSource:i,marketplace:O,autoInstall:r,onClose:s}),t[37]=r,t[38]=O,t[39]=s,t[40]=e,t[41]=i,t[42]=a):a=t[42],V=a;break bb0}R=w,z=!0,t[43]===s?B=t[44]:(B=e=>!e&&s(),t[43]=s,t[44]=B),L=x,t[45]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,$.jsx)(y,{className:`xopc-dialog-overlay fixed inset-0 z-[130] bg-scrim`}),t[45]=q):q=t[45],I=S,W=`xopc-dialog-content fixed left-1/2 top-1/2 z-[131] flex h-[min(44rem,calc(100vh-1.5rem))] w-[min(42rem,calc(100vw-1.5rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay`,G=ye;let u;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(ne,{className:`size-5`}),t[46]=u):u=t[46];let d;t[47]!==i.detailBack||t[48]!==s?(d=(0,$.jsx)(`button`,{type:`button`,onClick:s,className:`inline-flex size-9 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":i.detailBack,children:u}),t[47]=i.detailBack,t[48]=s,t[49]=d):d=t[49];let p;t[50]===i.marketplaceDetailTitle?p=t[51]:(p=(0,$.jsx)(C,{className:`min-w-0 flex-1 truncate text-center text-sm font-semibold text-fg`,children:i.marketplaceDetailTitle}),t[50]=i.marketplaceDetailTitle,t[51]=p);let m;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,$.jsx)(f,{className:`size-5`}),t[52]=m):m=t[52];let h;t[53]!==i.detailClose||t[54]!==s?(h=(0,$.jsx)(`button`,{type:`button`,onClick:s,className:`inline-flex size-9 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":i.detailClose,children:m}),t[53]=i.detailClose,t[54]=s,t[55]=h):h=t[55],t[56]!==d||t[57]!==p||t[58]!==h?(K=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge px-4 py-3`,children:[d,p,h]}),t[56]=d,t[57]=p,t[58]=h,t[59]=K):K=t[59],H=`min-h-0 flex-1 overflow-y-auto p-5`,U=j&&!O?(0,$.jsxs)(`div`,{className:`space-y-4`,"aria-label":i.marketplaceLoading,children:[(0,$.jsx)(k,{className:`h-6 w-48`}),(0,$.jsx)(k,{className:`h-4 w-28`}),(0,$.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,$.jsx)(k,{className:`h-12`}),(0,$.jsx)(k,{className:`h-12`})]}),(0,$.jsx)(k,{className:`h-28 w-full`}),(0,$.jsx)(k,{className:`h-36 w-full`})]}):A?(0,$.jsxs)(`div`,{className:`rounded-lg border border-red-300/70 bg-red-50 p-4 text-sm dark:border-red-900 dark:bg-red-950/30`,children:[(0,$.jsx)(`p`,{className:`font-medium text-red-700 dark:text-red-300`,children:i.marketplaceDetailLoadFailed}),(0,$.jsx)(`p`,{className:`mt-1 break-words text-red-600 dark:text-red-400`,children:A instanceof Error?A.message:i.marketplaceLoadFailed})]}):O?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`h3`,{className:`text-lg font-semibold text-fg`,children:O.name}),(0,$.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:(0,$.jsx)(`code`,{className:`rounded bg-surface-panel px-1 py-0.5`,children:O.id})}),(0,$.jsxs)(`dl`,{className:`mt-3 grid gap-2 text-xs text-fg-muted sm:grid-cols-2`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`font-medium text-fg`,children:i.marketplaceAuthor}),(0,$.jsx)(`dd`,{children:O.author.username})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`font-medium text-fg`,children:i.marketplaceVersion}),(0,$.jsx)(`dd`,{children:O.latestVersion.version})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`font-medium text-fg`,children:i.marketplaceDownloads}),(0,$.jsx)(`dd`,{children:O.downloads})]})]}),N===`bundled`?null:(0,$.jsxs)(`section`,{className:`mt-5 space-y-3 rounded-lg border border-edge bg-surface-base p-4`,children:[(0,$.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[O.installability.available?(0,$.jsx)(P,{className:`mt-0.5 size-5 shrink-0 text-emerald-600 dark:text-emerald-400`,"aria-hidden":!0}):(0,$.jsx)(te,{className:`mt-0.5 size-5 shrink-0 text-amber-600 dark:text-amber-400`,"aria-hidden":!0}),(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`h4`,{className:`text-sm font-semibold text-fg`,children:O.installability.available?i.marketplaceRiskTitle:i.marketplaceUnavailableTitle}),(0,$.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-fg-muted`,children:O.installability.available?i.marketplaceCodeRisk:O.installability.reason??i.marketplaceUnavailableBody})]})]}),O.installability.available?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`dl`,{className:`grid gap-2 text-xs text-fg-muted sm:grid-cols-2`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`font-medium text-fg`,children:i.marketplaceIntegrity}),(0,$.jsx)(`dd`,{children:i.marketplaceIntegrityVerified})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`font-medium text-fg`,children:i.marketplaceDependencies}),(0,$.jsx)(`dd`,{children:O.packageSummary?.dependencyCount??0})]})]}),(0,$.jsxs)(`div`,{className:`text-xs text-fg-muted`,children:[(0,$.jsx)(`p`,{className:`font-medium text-fg`,children:i.marketplacePermissions}),e.length>0?(0,$.jsx)(`ul`,{className:`mt-1 space-y-1`,children:e.map(ve)}):(0,$.jsx)(`p`,{className:`mt-1`,children:i.marketplacePermissionsNone})]}),(O.packageSummary?.lifecycleScripts.length??0)>0?(0,$.jsxs)(`p`,{className:`text-xs leading-relaxed text-amber-700 dark:text-amber-300`,children:[i.marketplaceLifecycleScripts,`: `,O.packageSummary?.lifecycleScripts.join(`, `)]}):null,(0,$.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-2 text-sm text-fg`,children:[(0,$.jsx)(`input`,{type:`checkbox`,checked:_,onChange:e=>v(e.target.checked),className:`mt-0.5 size-4 rounded border-edge accent-[var(--color-accent)]`}),(0,$.jsx)(`span`,{children:i.marketplaceRiskConfirm})]})]}):null]}),O.readme?.trim()?(0,$.jsx)(`h4`,{className:`mb-2 mt-6 text-sm font-semibold text-fg`,children:i.marketplaceDetailReadmeHeading}):null,(0,$.jsx)(`div`,{className:`markdown-content min-w-0 break-words text-sm`,children:(0,$.jsx)(l,{content:c})})]}):null}t[6]=r,t[7]=i,t[8]=O,t[9]=A,t[10]=o,t[11]=N,t[12]=j,t[13]=s,t[14]=n,t[15]=ee,t[16]=_,t[17]=I,t[18]=L,t[19]=R,t[20]=z,t[21]=B,t[22]=V,t[23]=H,t[24]=U,t[25]=W,t[26]=G,t[27]=K,t[28]=q}else I=t[17],L=t[18],R=t[19],z=t[20],B=t[21],V=t[22],H=t[23],U=t[24],W=t[25],G=t[26],K=t[27],q=t[28];if(V!==Symbol.for(`react.early_return_sentinel`))return V;let J;t[60]!==H||t[61]!==U?(J=(0,$.jsx)(`div`,{className:H,children:U}),t[60]=H,t[61]=U,t[62]=J):J=t[62];let Y;t[63]!==p||t[64]!==i.marketplaceBuiltinGoBuiltin||t[65]!==i.marketplaceBuiltinManageHint||t[66]!==i.marketplaceInstall||t[67]!==i.marketplaceReinstall||t[68]!==i.marketplaceReinstallConfirm||t[69]!==i.marketplaceUninstall||t[70]!==i.marketplaceUninstallConfirm||t[71]!==O||t[72]!==N||t[73]!==s||t[74]!==c||t[75]!==d||t[76]!==n||t[77]!==_||t[78]!==F?(Y=O?(0,$.jsx)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-end gap-2 border-t border-edge-subtle px-5 py-4`,children:N===`bundled`?(0,$.jsxs)(`div`,{className:`flex w-full flex-col items-stretch gap-2`,children:[(0,$.jsx)(`p`,{className:`text-sm leading-relaxed text-fg-muted`,children:i.marketplaceBuiltinManageHint}),(0,$.jsx)(a,{to:`/capabilities/extensions?tab=builtin`,onClick:s,className:`inline-flex w-fit items-center justify-center rounded-lg border border-edge px-3 py-2 text-sm font-medium text-fg hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:i.marketplaceBuiltinGoBuiltin})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`button`,{type:`button`,disabled:p||!O.installability.available||!_,onClick:()=>{F&&!window.confirm(i.marketplaceReinstallConfirm)||(g(!0),c(n,F).catch(_e).finally(()=>g(!1)))},className:m(`inline-flex items-center justify-center gap-1.5 rounded-lg px-3 py-2 text-sm font-medium`,`bg-accent text-on-accent shadow-surface hover:bg-accent-hover`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel`,`disabled:pointer-events-none disabled:opacity-50`),children:[p?(0,$.jsx)(u,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,F?i.marketplaceReinstall:i.marketplaceInstall]}),F?(0,$.jsxs)(`button`,{type:`button`,disabled:p,onClick:()=>{window.confirm(i.marketplaceUninstallConfirm)&&(g(!0),d(n).then(()=>s()).catch(ge).finally(()=>g(!1)))},className:m(`inline-flex items-center justify-center gap-1.5 rounded-lg border border-edge px-3 py-2 text-sm font-medium text-fg`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,`disabled:pointer-events-none disabled:opacity-50`),children:[(0,$.jsx)(re,{className:`size-4 shrink-0`,"aria-hidden":!0}),i.marketplaceUninstall]}):null]})}):null,t[63]=p,t[64]=i.marketplaceBuiltinGoBuiltin,t[65]=i.marketplaceBuiltinManageHint,t[66]=i.marketplaceInstall,t[67]=i.marketplaceReinstall,t[68]=i.marketplaceReinstallConfirm,t[69]=i.marketplaceUninstall,t[70]=i.marketplaceUninstallConfirm,t[71]=O,t[72]=N,t[73]=s,t[74]=c,t[75]=d,t[76]=n,t[77]=_,t[78]=F,t[79]=Y):Y=t[79];let X;t[80]!==I||t[81]!==J||t[82]!==Y||t[83]!==W||t[84]!==G||t[85]!==K?(X=(0,$.jsxs)(I,{className:W,onOpenAutoFocus:G,children:[K,J,Y]}),t[80]=I,t[81]=J,t[82]=Y,t[83]=W,t[84]=G,t[85]=K,t[86]=X):X=t[86];let Q;t[87]!==L||t[88]!==X||t[89]!==q?(Q=(0,$.jsxs)(L,{children:[q,X]}),t[87]=L,t[88]=X,t[89]=q,t[90]=Q):Q=t[90];let oe;return t[91]!==R||t[92]!==z||t[93]!==B||t[94]!==Q?(oe=(0,$.jsx)(R,{defaultOpen:z,onOpenChange:B,children:Q}),t[91]=R,t[92]=z,t[93]=B,t[94]=Q,t[95]=oe):oe=t[95],oe}function ge(){}function _e(){}function ve(e){let[t,n]=e;return(0,$.jsxs)(`li`,{className:`break-words`,children:[(0,$.jsx)(`code`,{children:t}),`: `,Array.isArray(n)?n.join(`, `):String(n)]},t)}function ye(e){return e.preventDefault()}function be(e){return!!e.conversationId}function xe({embedded:e=!1,onHeaderActionChange:t}){let n=_(e=>e.language),r=p(n),o=F(e=>e.setPageHeader),c=F(e=>e.clearPageHeader),l=B(),u=R(),[f,h]=i(),g=Q(f.get(`tab`)),v=f.get(`q`)??``,[y,b]=(0,Z.useState)(g),[x,S]=(0,Z.useState)(v),[C,w]=(0,Z.useState)(null),[T,E]=(0,Z.useState)(!1),O=f.toString(),k=(0,Z.useRef)(O);if(k.current!==O){k.current=O;let e=Q(f.get(`tab`)),t=f.get(`q`)??``;b(t=>t===e?t:e),S(e=>e===t?e:t)}(0,Z.useEffect)(()=>{h(e=>{let t=new URLSearchParams(e),n=x.trim();return n?t.set(`q`,n):t.delete(`q`),y===`marketplace`?t.delete(`tab`):t.set(`tab`,y),t.toString()===e.toString()?e:t},{replace:!0})},[y,x,h]);let A=(0,Z.useMemo)(()=>l.filter(e=>e.source===`bundled`),[l]),P=(0,Z.useMemo)(()=>l.filter(e=>e.source!==`bundled`),[l]),te=y===`builtin`?A:P,z=(0,Z.useMemo)(()=>{let e=x.trim().toLowerCase(),t=te;return e&&(t=t.filter(t=>(t.name??``).toLowerCase().includes(e)||t.id.toLowerCase().includes(e)||(t.description??``).toLowerCase().includes(e))),t.toSorted((e,t)=>e.hasUi===t.hasUi?(e.name||e.id).localeCompare(t.name||t.id,n):e.hasUi?-1:1)},[te,x,n]);(0,Z.useEffect)(()=>{w(e=>{if(!e)return e;let t=l.find(t=>t.id===e.id);return t?Se(e)===Se(t)&&e.active===t.active&&JSON.stringify(e)===JSON.stringify(t)?e:t:null})},[l]);let V=(0,Z.useMemo)(()=>({searchLabel:y===`marketplace`?r.extensionsPage.marketplaceSearchPlaceholder:r.extensionsPage.searchPlaceholder,search:(0,$.jsx)(q,{value:x,onChange:S,placeholder:y===`marketplace`?r.extensionsPage.marketplaceSearchPlaceholder:r.extensionsPage.searchPlaceholder}),overflow:(0,$.jsxs)(M,{children:[(0,$.jsx)(I,{asChild:!0,children:(0,$.jsx)(D,{variant:`secondary`,className:`size-9 shrink-0 p-0`,"aria-label":r.capabilitiesHub.moreActions,title:r.capabilitiesHub.moreActions,children:(0,$.jsx)(s,{className:`size-4`,"aria-hidden":!0})})}),(0,$.jsx)(ee,{children:(0,$.jsxs)(G,{align:`end`,sideOffset:6,className:`z-50 min-w-48 rounded-xl border border-edge bg-surface-panel p-1 shadow-popover`,children:[(0,$.jsxs)(j,{className:m(`touch-target flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover`,N.transition),onSelect:()=>E(!0),children:[(0,$.jsx)(d,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),n.startsWith(`zh`)?`安装插件`:`Install plugin`]}),(0,$.jsx)(j,{asChild:!0,children:(0,$.jsxs)(a,{to:`/local-apps`,className:m(`touch-target flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-fg outline-none data-[highlighted]:bg-surface-hover`,N.transition),children:[(0,$.jsx)(L,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),r.extensionsPage.openLocalApps]})})]})})]}),primary:(0,$.jsx)(D,{asChild:!0,variant:`primary`,className:`h-9 shrink-0`,children:(0,$.jsxs)(a,{to:`/local-apps/new`,"aria-label":r.extensionsPage.createLocalApp,children:[(0,$.jsx)(d,{className:`size-4`,"aria-hidden":!0}),(0,$.jsx)(`span`,{className:`hidden sm:inline`,children:r.extensionsPage.createLocalApp})]})})}),[n,r.capabilitiesHub.moreActions,r.extensionsPage,y,x]);if((0,Z.useLayoutEffect)(()=>e?(t?.(V),()=>t?.(null)):(o({startExtra:null,main:(0,$.jsx)(`div`,{className:`min-w-0`,children:(0,$.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:r.extensionsPage.title})}),end:(0,$.jsx)(J,{contribution:V})}),()=>c()),[c,e,V,r.extensionsPage.title,t,o]),u&&y!==`marketplace`)return(0,$.jsx)(ke,{});let H=[{id:`marketplace`,label:r.extensionsPage.tabMarketplace},{id:`builtin`,label:r.extensionsPage.tabBuiltin,count:A.length},{id:`user`,label:r.extensionsPage.tabUser,count:P.length}];return(0,$.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col bg-surface-panel`,children:[(0,$.jsxs)(`div`,{className:m(`mx-auto w-full max-w-7xl px-4 sm:px-6 lg:px-8`,`pb-7 pt-3 lg:pb-9 lg:pt-4`),children:[(0,$.jsx)(`div`,{className:`mb-6 border-b border-edge-subtle pb-3`,children:(0,$.jsx)(Y,{items:H,activeTab:y,onChange:b,ariaLabel:r.extensionsPage.extensionsNavAria,tabIdPrefix:`extensions-tab`,panelIdPrefix:`extensions-panel`,className:`flex-wrap`})}),y===`marketplace`?(0,$.jsx)(me,{query:x}):y===`builtin`&&A.length===0?(0,$.jsx)(je,{message:r.extensionsPage.emptyBuiltin}):y===`user`&&P.length===0?(0,$.jsx)(je,{message:r.extensionsPage.emptyUser}):z.length===0?(0,$.jsx)(`p`,{className:`px-3 py-14 text-center text-sm text-fg-muted sm:px-5 xl:px-6`,children:r.extensionsPage.noSearchResults}):(0,$.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:z.map(e=>(0,$.jsx)(Ee,{extension:e,copy:r.extensionsPage,showSourceBadge:y===`user`,onOpen:()=>w(e)},e.id))})]}),C?C.format===`agent-plugin`?(0,$.jsx)(ie,{extension:C,onClose:()=>w(null)},C.id):(0,$.jsx)(De,{extension:C,copy:r.extensionsPage,onClose:()=>w(null)},C.id):null,T?(0,$.jsx)(ie,{onClose:()=>E(!1)}):null]})}function Se(e){return e.activationEligible??e.active}function Ce(e,t){return e.source===`bundled`?t.providerBundled:e.source===`global`?t.providerGlobal:e.source===`workspace`?t.providerWorkspace:t.providerOther}function we(e,t){return e.source===`global`?t.badgeSourceGlobal:e.source===`workspace`?t.badgeSourceWorkspace:t.badgeSourceOther}function Te(e,t){let n=Se(e);return n&&e.active?t.runStateLive:n&&!e.active?t.runStatePendingOn:!n&&e.active?t.runStatePendingOff:t.runStateOff}function Ee(e){let t=(0,ae.c)(45),{extension:n,copy:r,showSourceBadge:i,onOpen:a}=e,s;t[0]===n?s=t[1]:(s=Se(n),t[0]=n,t[1]=s);let c=s,l=n.hasUi?r.cardTooltipHasUi:r.cardTooltipNoUi,u;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(u=m(`group flex w-full flex-col rounded-xl border border-edge-subtle bg-surface-base p-4 text-left shadow-surface transition-colors`,`hover:bg-surface-hover/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,`dark:hover:bg-surface-hover/25`),t[2]=u):u=t[2];let f=n.name||n.id,p;t[3]===f?p=t[4]:(p=f.charAt(0).toUpperCase(),t[3]=f,t[4]=p);let h;t[5]===p?h=t[6]:(h=(0,$.jsx)(`div`,{className:`flex size-12 shrink-0 items-center justify-center rounded-xl bg-accent-soft text-base font-semibold text-accent-fg`,"aria-hidden":!0,children:p}),t[5]=p,t[6]=h);let g;t[7]===n.name?g=t[8]:(g=(0,$.jsx)(`h2`,{className:`truncate text-sm font-semibold text-fg`,children:n.name}),t[7]=n.name,t[8]=g);let _;t[9]===n.version?_=t[10]:(_=n.version?(0,$.jsxs)(`span`,{className:`text-[11px] text-fg-muted`,children:[`v`,n.version]}):null,t[9]=n.version,t[10]=_);let v;t[11]!==g||t[12]!==_?(v=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[g,_]}),t[11]=g,t[12]=_,t[13]=v):v=t[13];let y;t[14]!==r.statusEnabled||t[15]!==c?(y=c?(0,$.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 rounded-full bg-surface-hover px-2 py-0.5 text-[11px] font-medium text-fg-muted`,children:[(0,$.jsx)(o,{className:`size-3`,strokeWidth:2.5,"aria-hidden":!0}),r.statusEnabled]}):(0,$.jsx)(`span`,{className:`flex size-8 shrink-0 items-center justify-center rounded-full border-2 border-accent text-accent`,"aria-hidden":!0,children:(0,$.jsx)(d,{className:`size-4`,strokeWidth:2.5})}),t[14]=r.statusEnabled,t[15]=c,t[16]=y):y=t[16];let b;t[17]!==v||t[18]!==y?(b=(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[v,y]}),t[17]=v,t[18]=y,t[19]=b):b=t[19];let x;t[20]!==r.cardNoDescription||t[21]!==n.description?(x=n.description?.trim()||r.cardNoDescription,t[20]=r.cardNoDescription,t[21]=n.description,t[22]=x):x=t[22];let S;t[23]===x?S=t[24]:(S=(0,$.jsx)(`p`,{className:`mt-2 line-clamp-2 text-xs leading-relaxed text-fg-muted`,children:x}),t[23]=x,t[24]=S);let C=n.format===`agent-plugin`?`Agent Plugin`:n.hasUi?r.badgeKindUi:r.badgeKindBackend,w;t[25]!==C||t[26]!==l?(w=(0,$.jsx)(`span`,{title:l,className:`rounded-md bg-surface-hover px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide text-fg-muted`,children:C}),t[25]=C,t[26]=l,t[27]=w):w=t[27];let T;t[28]!==r||t[29]!==n||t[30]!==i?(T=n.source===`bundled`?(0,$.jsx)(`span`,{className:`rounded-md bg-surface-hover px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide text-fg-muted`,children:r.badgeBundled}):i?(0,$.jsx)(`span`,{title:Ce(n,r),className:`rounded-md bg-surface-hover px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide text-fg-muted`,children:we(n,r)}):null,t[28]=r,t[29]=n,t[30]=i,t[31]=T):T=t[31];let E;t[32]!==w||t[33]!==T?(E=(0,$.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:[w,T]}),t[32]=w,t[33]=T,t[34]=E):E=t[34];let D;t[35]!==b||t[36]!==S||t[37]!==E?(D=(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[b,S,E]}),t[35]=b,t[36]=S,t[37]=E,t[38]=D):D=t[38];let O;t[39]!==D||t[40]!==h?(O=(0,$.jsxs)(`div`,{className:`flex gap-3`,children:[h,D]}),t[39]=D,t[40]=h,t[41]=O):O=t[41];let k;return t[42]!==a||t[43]!==O?(k=(0,$.jsx)(`button`,{type:`button`,onClick:a,className:u,children:O}),t[42]=a,t[43]=O,t[44]=k):k=t[44],k}function De({extension:e,copy:t,onClose:n}){let{mutate:r}=T(),[i,o]=(0,Z.useState)(null),[s,l]=(0,Z.useState)(null),[d,p]=(0,Z.useState)(!1),h=e.activationEligible===!0,g=(0,Z.useCallback)(async()=>{l(null),p(!1),o(`toggle`);try{let{requiresGatewayRestart:t}=await ue({extensionId:e.id,enabled:!h});await r(`gateway-extensions-list`),O(),p(t)}catch(e){l(e instanceof Error?e.message:t.extensionToggleFailed)}finally{o(null)}},[h,t.extensionToggleFailed,e.id,r]),_=(0,Z.useCallback)(async()=>{if(!(e.source===`bundled`||!window.confirm(t.extensionUninstallConfirm))){l(null),p(!1),o(`uninstall`);try{await de(e.id),await r(`gateway-extensions-list`),O(),n()}catch(e){l(e instanceof Error?e.message:t.marketplaceUninstallFailed),o(null)}}},[t.extensionUninstallConfirm,t.marketplaceUninstallFailed,e.id,e.source,r,n]),v=e.ui?.contributions?.pages??[],E=e.ui?.contributions?.settingsPanels??[],k=e.ui?.contributions?.chatWidgets??[],j=v.find(e=>e.showInNav)??v[0],M=E[0],N=j?V(e.id,j):null,P=M?`/settings/ext/${e.id}/${M.id}`:e.hasConfigSchema||U(e)?`/settings/ext/${e.id}`:null;return(0,$.jsx)(w,{defaultOpen:!0,onOpenChange:e=>!e&&n(),children:(0,$.jsxs)(x,{children:[(0,$.jsx)(y,{className:`xopc-dialog-overlay fixed inset-0 z-[130] bg-scrim`}),(0,$.jsxs)(S,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[131] flex max-h-[min(90vh,44rem)] w-[min(42rem,calc(100vw-1.5rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay`,onOpenAutoFocus:e=>e.preventDefault(),children:[(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge px-4 py-3`,children:[(0,$.jsx)(`button`,{type:`button`,onClick:n,className:`inline-flex size-9 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":t.detailBack,children:(0,$.jsx)(ne,{className:`size-5`})}),(0,$.jsx)(C,{className:`min-w-0 flex-1 truncate text-center text-sm font-semibold text-fg`,children:t.detailTitle}),(0,$.jsxs)(b,{className:`sr-only`,children:[e.name,` (`,e.id,`)`]}),(0,$.jsx)(`button`,{type:`button`,onClick:n,className:`inline-flex size-9 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":t.detailClose,children:(0,$.jsx)(f,{className:`size-5`})})]}),(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-start gap-4`,children:[(0,$.jsx)(`div`,{className:`flex size-16 shrink-0 items-center justify-center rounded-2xl bg-accent-soft text-xl font-semibold text-accent-fg`,"aria-hidden":!0,children:(e.name||e.id).charAt(0).toUpperCase()}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`h3`,{className:`text-lg font-semibold text-fg`,children:e.name}),(0,$.jsxs)(`p`,{className:`mt-0.5 text-sm text-fg-muted`,children:[t.detailProviderPrefix,` `,Ce(e,t)]}),e.version?(0,$.jsxs)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:[`v`,e.version]}):null]})]}),(0,$.jsx)(`p`,{className:`mt-5 text-sm leading-relaxed text-fg`,children:e.description?.trim()||t.detailNoDescription}),e.hasUi?null:(0,$.jsx)(`p`,{className:`mt-3 text-xs text-fg-muted`,children:t.backendOnlyHint}),(0,$.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:Te(e,t)}),e.source===`bundled`?(0,$.jsx)(`p`,{className:`mt-4 rounded-lg bg-surface-hover/40 px-3 py-2 text-xs text-fg-muted shadow-surface dark:bg-surface-hover/20`,children:t.builtinConfigHint}):null,(0,$.jsxs)(`div`,{className:`mt-3 rounded-lg bg-surface-hover/40 p-3 shadow-surface dark:bg-surface-hover/20`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,$.jsx)(`span`,{className:`text-xs font-medium text-fg`,children:t.builtinRuntimeToggle}),(0,$.jsx)(D,{type:`button`,variant:`secondary`,disabled:i!==null,onClick:()=>void g(),className:`shrink-0 py-1.5 text-xs`,children:i===`toggle`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(u,{className:`mr-1.5 size-3.5 shrink-0 animate-spin`,"aria-hidden":!0}),t.builtinToggleBusy]}):h?t.builtinToggleDisable:t.builtinToggleEnable})]}),s?(0,$.jsx)(`p`,{className:`mt-2 text-xs text-rose-600 dark:text-rose-400`,children:s}):null,d?(0,$.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:t.builtinToggleRestartHint}):null,e.source===`bundled`?null:(0,$.jsx)(`div`,{className:`mt-3 flex justify-end border-t border-edge-subtle pt-3`,children:(0,$.jsxs)(D,{type:`button`,variant:`ghost`,disabled:i!==null,onClick:()=>void _(),className:`text-danger hover:bg-danger-soft hover:text-danger`,children:[i===`uninstall`?(0,$.jsx)(u,{className:`size-3.5 animate-spin`,"aria-hidden":!0}):(0,$.jsx)(re,{className:`size-3.5`,"aria-hidden":!0}),t.marketplaceUninstall]})})]}),e.hasUi&&(v.length>0||E.length>0||k.length>0)?(0,$.jsxs)(`section`,{className:`mt-8`,children:[(0,$.jsx)(`h4`,{className:`mb-3 text-sm font-semibold text-fg`,children:t.detailSectionFeatures}),(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[(0,$.jsx)(Oe,{template:t.badgePages,count:v.length,hidden:v.length===0}),(0,$.jsx)(Oe,{template:t.badgeSettings,count:E.length,hidden:E.length===0}),(0,$.jsx)(Oe,{template:t.badgeWidgets,count:k.length,hidden:k.length===0})]})]}):null,W(e)&&(N||P)?(0,$.jsxs)(`div`,{className:`mt-6 flex flex-wrap gap-2 border-t border-edge-subtle pt-4`,children:[N?(0,$.jsxs)(a,{to:N,onClick:n,className:m(`inline-flex items-center gap-1.5 rounded-lg border border-edge px-3 py-2 text-sm font-medium text-fg`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`),children:[(0,$.jsx)(c,{className:`size-4 shrink-0 opacity-80`,"aria-hidden":!0}),t.open]}):null,P?(0,$.jsxs)(a,{to:P,onClick:n,className:m(`inline-flex items-center gap-1.5 rounded-lg border border-edge px-3 py-2 text-sm font-medium text-fg`,`hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`),children:[(0,$.jsx)(A,{className:`size-4 shrink-0 opacity-80`,"aria-hidden":!0}),t.openSettings]}):null]}):null,(0,$.jsx)(`p`,{className:`mt-6 text-[11px] leading-relaxed text-fg-muted`,children:t.restartNote})]})]})]})})}function Oe(e){let t=(0,ae.c)(6),{template:n,count:r,hidden:i}=e;if(i||r===0)return null;let a;if(t[0]!==r||t[1]!==n){let e;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=/\{\{count\}\}/g,t[3]=e):e=t[3],a=n.replace(e,String(r)),t[0]=r,t[1]=n,t[2]=a}else a=t[2];let o;return t[4]===a?o=t[5]:(o=(0,$.jsx)(`span`,{className:`inline-flex items-center rounded-md bg-surface-hover px-2 py-0.5 text-[11px] font-medium text-fg-muted`,children:a}),t[4]=a,t[5]=o),o}function ke(){let e=(0,ae.c)(5),t,n,r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(`div`,{className:`mb-6 h-8 w-40 max-w-full animate-pulse rounded-md bg-surface-hover`}),n=(0,$.jsx)(`div`,{className:`mb-2 h-4 w-full max-w-md animate-pulse rounded bg-surface-hover`}),r=(0,$.jsx)(`div`,{className:`mb-5 h-9 w-full max-w-lg animate-pulse rounded-full bg-surface-hover`}),e[0]=t,e[1]=n,e[2]=r):(t=e[0],n=e[1],r=e[2]);let i;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=[`ap0`,`ap1`,`ap2`,`ap3`,`ap4`,`ap5`],e[3]=i):i=e[3];let a;return e[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col bg-surface-panel`,children:(0,$.jsxs)(`div`,{className:`w-full px-3 pb-8 pt-3 sm:px-5 lg:pt-4 xl:px-6`,children:[t,n,r,(0,$.jsx)(`div`,{className:`mt-6 grid gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:i.map(Ae)})]})}),e[4]=a):a=e[4],a}function Ae(e){return(0,$.jsx)(`div`,{className:`h-36 animate-pulse rounded-xl border border-edge-subtle bg-surface-base shadow-surface`},e)}function je(e){let t=(0,ae.c)(2),{message:n}=e,r;return t[0]===n?r=t[1]:(r=(0,$.jsx)(`div`,{className:`flex min-h-[min(40vh,16rem)] flex-col items-center justify-center rounded-xl border border-edge-subtle bg-surface-base px-4 py-12 text-center shadow-surface`,children:(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:n})}),t[0]=n,t[1]=r),r}export{xe as ExtensionsPage};
|