@nextclaw/ui 0.12.10 → 0.12.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +103 -10
- package/dist/assets/api-DnPN4SyA.js +15 -0
- package/dist/assets/app-manager-provider-M7TngYxx.js +1 -0
- package/dist/assets/app-navigation.config-B5YIdRju.js +1 -0
- package/dist/assets/{book-open-DzdUViDm.js → book-open-B4mOKdz8.js} +1 -1
- package/dist/assets/channels-list-page-Cm-Bbu6u.js +8 -0
- package/dist/assets/chat-C0ZNZtS3.js +58 -0
- package/dist/assets/chat-page-CGHNhXaw.js +1 -0
- package/dist/assets/chunk-JZWAC4HX-BJer-fqD.js +3 -0
- package/dist/assets/config-split-page-B3PRA_AV.js +1 -0
- package/dist/assets/{createLucideIcon-dy5ie7Ox.js → createLucideIcon-C_GFKVuW.js} +1 -1
- package/dist/assets/desktop-update-config-Dfh-3uma.js +1 -0
- package/dist/assets/dialog-D-I7ONHQ.js +5 -0
- package/dist/assets/{dist-Cy7_j6hA.js → dist-DreLBS93.js} +1 -1
- package/dist/assets/doc-browser-CoKIUCJj.js +1 -0
- package/dist/assets/doc-browser-CwgI7ipB.js +1 -0
- package/dist/assets/doc-browser-DYKpRqe-.js +1 -0
- package/dist/assets/doc-browser-context-Dib9sS83.js +1 -0
- package/dist/assets/es2015-DMSUl3fm.js +41 -0
- package/dist/assets/{external-link-kZSAO8nT.js → external-link-DP2IJ7AM.js} +1 -1
- package/dist/assets/folder-BPwc278w.js +1 -0
- package/dist/assets/{hash-BHJC2Ovu.js → hash-CvcvtMBq.js} +1 -1
- package/dist/assets/i18n-BnNAQpVM.js +1 -0
- package/dist/assets/index-Bc6c1kIx.js +2 -0
- package/dist/assets/index-mRmSAB-e.css +1 -0
- package/dist/assets/key-round-BQXmPSxD.js +1 -0
- package/dist/assets/loader-circle-C6gg2m2a.js +1 -0
- package/dist/assets/{LogoBadge-hO7tY7hE.js → logo-badge-uB4SwANR.js} +1 -1
- package/dist/assets/{logos-B7gRObP8.js → logos-BcELLmYh.js} +1 -1
- package/dist/assets/marketplace-page-BCrS-jH6.js +49 -0
- package/dist/assets/marketplace-page-DVrlpB68.js +1 -0
- package/dist/assets/mcp-marketplace-page-CjrxT6wI.js +40 -0
- package/dist/assets/mcp-marketplace-page-pQ_A38fH.js +1 -0
- package/dist/assets/message-square-CLVODA23.js +1 -0
- package/dist/assets/model-config-D4myteLK.js +1 -0
- package/dist/assets/notice-card-DX_NEZTQ.js +1 -0
- package/dist/assets/play-DeNVUA5C.js +1 -0
- package/dist/assets/plus-BptLViq1.js +1 -0
- package/dist/assets/popover-Dm_NQ3Cs.js +1 -0
- package/dist/assets/provider-scoped-model-input-BLHImwI5.js +1 -0
- package/dist/assets/providers-list-DsBFslNi.js +1 -0
- package/dist/assets/{refresh-ccw-COVhNHtN.js → refresh-ccw-CeG203yU.js} +1 -1
- package/dist/assets/remote-CQQykOYe.js +1 -0
- package/dist/assets/{rotate-cw-oHMKJMC8.js → rotate-cw-F7aThvYj.js} +1 -1
- package/dist/assets/runtime-config-page-Bz9r68Rf.js +1 -0
- package/dist/assets/{save-EqJPOF0G.js → save-7ztImRj7.js} +1 -1
- package/dist/assets/search-DZSNKEGp.js +1 -0
- package/dist/assets/search-config-C-6KpgRQ.js +1 -0
- package/dist/assets/secrets-config-MiMElvpm.js +3 -0
- package/dist/assets/select-RgeHgn_-.js +1 -0
- package/dist/assets/sessions-config-page-0KNW9QC_.js +2 -0
- package/dist/assets/setting-row-vwm4XKv2.js +1 -0
- package/dist/assets/settings-DjvNMJde.js +1 -0
- package/dist/assets/skeleton-5Mg6vZHN.js +1 -0
- package/dist/assets/sparkles-CyDTgTM4.js +1 -0
- package/dist/assets/{status-dot-DpPtVzQT.js → status-dot-aQU9Mia4.js} +1 -1
- package/dist/assets/{tabs-custom-YcZUWn3o.js → tabs-custom-C4P7g4vR.js} +1 -1
- package/dist/assets/tag-chip-DGqz3TON.js +1 -0
- package/dist/assets/theme-provider-CUppbOyN.js +1 -0
- package/dist/assets/tooltip-DQlSKhZ_.js +1 -0
- package/dist/assets/{trash-2-mJT6oWa2.js → trash-2-C1cdqL6V.js} +1 -1
- package/dist/assets/use-config-CrsavfWZ.js +1 -0
- package/dist/assets/use-confirm-dialog-D1AnLFlc.js +1 -0
- package/dist/assets/use-infinite-scroll-loader-DZhv-rmv.js +1 -0
- package/dist/assets/use-viewport-layout-CytJAPWM.js +1 -0
- package/dist/assets/x-BjMO7v8q.js +1 -0
- package/dist/index.html +39 -22
- package/module-structure.config.json +7 -0
- package/package.json +5 -5
- package/src/app/components/app-manager-provider.tsx +20 -0
- package/src/{components/providers/I18nProvider.tsx → app/components/i18n-provider.tsx} +1 -1
- package/src/{components → app/components}/layout/app-layout.test.tsx +50 -3
- package/src/app/components/layout/app-layout.tsx +54 -0
- package/src/{components → app/components}/layout/page-layout.tsx +1 -1
- package/src/app/components/layout/runtime-status-entry.test.tsx +101 -0
- package/src/app/components/layout/runtime-status-entry.tsx +95 -0
- package/src/app/components/layout/settings-entry-page.test.tsx +65 -0
- package/src/app/components/layout/settings-entry-page.tsx +13 -0
- package/src/{components → app/components}/layout/sidebar-items.tsx +2 -2
- package/src/{components → app/components}/layout/sidebar.layout.test.tsx +19 -12
- package/src/{components/layout/Sidebar.tsx → app/components/layout/sidebar.tsx} +25 -89
- package/src/{components/providers/ThemeProvider.tsx → app/components/theme-provider.tsx} +2 -2
- package/src/app/configs/app-navigation.config.ts +246 -0
- package/src/{hooks → app/hooks}/use-realtime-query-bridge.ts +36 -20
- package/src/app/hooks/use-viewport-layout.ts +15 -0
- package/src/app/index.tsx +261 -0
- package/src/app/managers/app.manager.ts +12 -0
- package/src/app/managers/viewport-layout.manager.ts +73 -0
- package/src/app/stores/viewport-layout.store.ts +32 -0
- package/src/{test/setup.ts → app/test/vitest-setup.ts} +3 -3
- package/src/{account → features/account}/components/account-panel.tsx +19 -19
- package/src/{components/auth → features/account/components}/login-page.tsx +4 -4
- package/src/{hooks → features/account/hooks}/use-auth.test.ts +1 -1
- package/src/{hooks → features/account/hooks}/use-auth.ts +3 -3
- package/src/features/account/index.ts +7 -0
- package/src/{account → features/account}/managers/account.manager.ts +6 -6
- package/src/{components/agents → features/agents/components}/agent-dialogs.tsx +11 -11
- package/src/{components/agents → features/agents/components}/agents-page.test.tsx +12 -9
- package/src/{components/agents → features/agents/components}/agents-page.tsx +17 -17
- package/src/features/agents/index.ts +1 -0
- package/src/{components/config → features/channels/components}/channel-form-fields-section.tsx +11 -32
- package/src/{components/config/ChannelForm.test.tsx → features/channels/components/config/channel-form.test.tsx} +4 -4
- package/src/features/channels/components/config/channel-form.tsx +382 -0
- package/src/{components → features/channels/components}/config/weixin-channel-auth-section.test.tsx +6 -3
- package/src/features/channels/components/config/weixin-channel-auth-section.tsx +245 -0
- package/src/{hooks → features/channels/hooks}/use-channel-auth.ts +1 -1
- package/src/features/channels/index.ts +5 -0
- package/src/features/channels/pages/channels-list-page.test.tsx +288 -0
- package/src/{components/config/ChannelsList.tsx → features/channels/pages/channels-list-page.tsx} +57 -83
- package/src/{components/config/channel-form-fields.test.ts → features/channels/utils/channel-form-fields.utils.test.ts} +1 -1
- package/src/{components/config/channel-form-fields.ts → features/channels/utils/channel-form-fields.utils.ts} +1 -1
- package/src/{lib/channel-tutorials.ts → features/channels/utils/channel-tutorials.utils.ts} +2 -2
- package/src/{components/chat → features/chat/components}/chat-session-type-option-item.test.tsx +1 -1
- package/src/{components/chat → features/chat/components}/chat-session-type-option-item.tsx +4 -4
- package/src/{components/chat → features/chat/components}/chat-session-workspace-file-preview.test.tsx +4 -4
- package/src/{components/chat → features/chat/components}/chat-session-workspace-file-preview.tsx +12 -32
- package/src/{components/chat → features/chat/components}/chat-session-workspace-panel-nav.tsx +8 -20
- package/src/{components/chat → features/chat/components}/chat-session-workspace-panel.tsx +105 -65
- package/src/features/chat/components/chat-sidebar-list-mode-switch.tsx +28 -0
- package/src/{components/chat → features/chat/components}/chat-sidebar-project-groups.tsx +6 -6
- package/src/{components/chat → features/chat/components}/chat-sidebar-session-item.tsx +10 -10
- package/src/{components/chat/ChatWelcome.test.tsx → features/chat/components/chat-welcome.test.tsx} +1 -1
- package/src/{components/chat/ChatWelcome.tsx → features/chat/components/chat-welcome.tsx} +5 -10
- package/src/features/chat/components/config/sessions-config-detail-pane.tsx +244 -0
- package/src/{components/chat → features/chat/components/conversation}/chat-attachment-upload-limit.test.ts +1 -4
- package/src/features/chat/components/conversation/chat-conversation-header.tsx +146 -0
- package/src/{components/chat → features/chat/components/conversation}/chat-conversation-panel.test.tsx +41 -19
- package/src/{components/chat → features/chat/components/conversation}/chat-conversation-panel.tsx +28 -140
- package/src/{components/chat/containers → features/chat/components/conversation}/chat-input-bar.container.tsx +137 -128
- package/src/{components/chat/containers → features/chat/components/conversation}/chat-message-list.container.test.tsx +2 -2
- package/src/{components/chat/containers → features/chat/components/conversation}/chat-message-list.container.tsx +6 -6
- package/src/{components/chat → features/chat/components/conversation}/session-header/chat-session-header-actions.test.tsx +3 -3
- package/src/{components/chat → features/chat/components/conversation}/session-header/chat-session-header-actions.tsx +6 -6
- package/src/{components/chat → features/chat/components/conversation}/session-header/chat-session-header-menu-item.tsx +1 -1
- package/src/{components/chat → features/chat/components/conversation}/session-header/chat-session-project-badge.test.tsx +3 -3
- package/src/{components/chat → features/chat/components/conversation}/session-header/chat-session-project-badge.tsx +5 -5
- package/src/{components/chat → features/chat/components/conversation}/session-header/chat-session-project-dialog.tsx +2 -2
- package/src/features/chat/components/layout/chat-page-shell.test.tsx +61 -0
- package/src/{components/chat → features/chat/components/layout}/chat-page-shell.tsx +14 -17
- package/src/features/chat/components/layout/chat-sidebar-session-entry.tsx +82 -0
- package/src/features/chat/components/layout/chat-sidebar-toolbar.tsx +205 -0
- package/src/{components/chat/ChatSidebar.test.tsx → features/chat/components/layout/chat-sidebar.test.tsx} +59 -16
- package/src/features/chat/components/layout/chat-sidebar.tsx +415 -0
- package/src/{components/chat/presenter/chat-presenter-context.tsx → features/chat/components/providers/chat-presenter.provider.tsx} +10 -31
- package/src/{components/common → features/chat/components/session}/session-context-icon.tsx +5 -5
- package/src/{components/common/SessionRunBadge.tsx → features/chat/components/session/session-run-badge.tsx} +3 -3
- package/src/{components/chat → features/chat/components}/workspace/chat-session-workspace-file-breadcrumbs.tsx +5 -15
- package/src/{components/chat/chat-input/chat-input-bar.controller.test.tsx → features/chat/hooks/use-chat-input-bar-controller.test.tsx} +1 -1
- package/src/{components → features}/chat/hooks/use-chat-session-label.ts +3 -4
- package/src/{components → features}/chat/hooks/use-chat-session-project.test.tsx +19 -19
- package/src/features/chat/hooks/use-chat-session-project.ts +34 -0
- package/src/{components/chat/useChatSessionTypeState.test.tsx → features/chat/hooks/use-chat-session-type-state.test.tsx} +2 -2
- package/src/{components/chat/useChatSessionTypeState.ts → features/chat/hooks/use-chat-session-type-state.ts} +3 -16
- package/src/{components → features}/chat/hooks/use-chat-session-update.test.tsx +19 -21
- package/src/{components → features}/chat/hooks/use-chat-session-update.ts +5 -7
- package/src/features/chat/hooks/use-chat-sidebar-session-label-editor.ts +49 -0
- package/src/{components/chat/useHydratedNcpAgent.test.tsx → features/chat/hooks/use-hydrated-ncp-agent.test.tsx} +2 -2
- package/src/{components/chat/useNcpAgentRuntime.test.tsx → features/chat/hooks/use-ncp-agent-runtime.test.tsx} +1 -1
- package/src/{components/chat/ncp/page/ncp-chat-derived-state.ts → features/chat/hooks/use-ncp-chat-derived-state.ts} +8 -8
- package/src/{components/chat/ncp/ncp-chat-page-data.ts → features/chat/hooks/use-ncp-chat-page-data.ts} +137 -80
- package/src/{hooks → features/chat/hooks}/use-ncp-chat-session-types.ts +1 -1
- package/src/{components/chat/ncp/session-conversation → features/chat/hooks}/use-ncp-child-session-tabs-view.ts +7 -7
- package/src/{components/chat/ncp/session-conversation → features/chat/hooks}/use-ncp-session-conversation.test.tsx +55 -7
- package/src/features/chat/hooks/use-ncp-session-conversation.ts +121 -0
- package/src/{components/chat/ncp → features/chat/hooks}/use-ncp-session-list-view.ts +6 -6
- package/src/features/chat/index.ts +6 -0
- package/src/{components/chat → features/chat/managers}/chat-recent-models.manager.ts +1 -1
- package/src/{components/chat → features/chat/managers}/chat-recent-skills.manager.ts +1 -1
- package/src/{components → features}/chat/managers/chat-session-list.manager.test.ts +11 -7
- package/src/{components → features}/chat/managers/chat-session-list.manager.ts +8 -10
- package/src/{components/chat/chat-session-preference-sync.test.ts → features/chat/managers/chat-session-preference-sync.manager.test.ts} +18 -14
- package/src/{components/chat/chat-session-preference-sync.ts → features/chat/managers/chat-session-preference-sync.manager.ts} +7 -14
- package/src/{components → features}/chat/managers/chat-stream-actions.manager.ts +3 -2
- package/src/{components → features}/chat/managers/chat-ui.manager.ts +11 -3
- package/src/{components/chat/ncp/tests → features/chat/managers}/ncp-chat-input.manager.test.ts +55 -5
- package/src/{components/chat/ncp → features/chat/managers}/ncp-chat-input.manager.ts +28 -20
- package/src/{components/chat/ncp/ncp-chat.presenter.ts → features/chat/managers/ncp-chat-presenter.manager.ts} +5 -5
- package/src/{components/chat/ncp/tests → features/chat/managers}/ncp-chat-thread.manager.test.ts +11 -10
- package/src/{components/chat/ncp → features/chat/managers}/ncp-chat-thread.manager.ts +11 -13
- package/src/{lib → features/chat/managers}/recent-selection.manager.test.ts +1 -1
- package/src/{lib → features/chat/managers}/recent-selection.manager.ts +14 -14
- package/src/features/chat/pages/chat-page.tsx +6 -0
- package/src/{components/chat/chat-page-runtime.test.ts → features/chat/pages/ncp-chat-page.test.ts} +69 -4
- package/src/{components/chat/ncp → features/chat/pages}/ncp-chat-page.tsx +180 -109
- package/src/features/chat/pages/sessions-config-page.test.tsx +152 -0
- package/src/features/chat/pages/sessions-config-page.tsx +192 -0
- package/src/{components → features}/chat/stores/chat-input.store.ts +3 -3
- package/src/{components → features}/chat/stores/chat-session-list.store.ts +2 -4
- package/src/{components → features}/chat/stores/chat-thread.store.ts +3 -3
- package/src/features/chat/types/chat-input-bar.types.ts +44 -0
- package/src/{components/chat → features/chat/types}/chat-input.types.ts +1 -1
- package/src/features/chat/types/chat-message.types.ts +58 -0
- package/src/{components/chat/chat-stream/types.ts → features/chat/types/chat-stream.types.ts} +1 -1
- package/src/{components/chat/chat-composer-state.test.ts → features/chat/utils/chat-composer-state.utils.test.ts} +1 -1
- package/src/{components/chat/chat-composer-state.ts → features/chat/utils/chat-composer-state.utils.ts} +17 -19
- package/src/features/chat/utils/chat-inline-token.utils.test.ts +87 -0
- package/src/{components/chat → features/chat/utils}/chat-inline-token.utils.ts +22 -39
- package/src/{components/chat/adapters/chat-input-bar.adapter.test.ts → features/chat/utils/chat-input-bar.utils.test.ts} +2 -2
- package/src/{components/chat/adapters/chat-input-bar.adapter.ts → features/chat/utils/chat-input-bar.utils.ts} +18 -196
- package/src/features/chat/utils/chat-input-toolbar.utils.ts +191 -0
- package/src/{lib/chat-message.ts → features/chat/utils/chat-message-core.utils.ts} +1 -1
- package/src/{components/chat/adapters/chat-message-inline-content.adapter.ts → features/chat/utils/chat-message-inline-content.utils.ts} +2 -2
- package/src/features/chat/utils/chat-message-part.utils.ts +233 -0
- package/src/{components/chat/adapters/chat-message.session-request-tool-card.ts → features/chat/utils/chat-message-session-request-tool-card.utils.ts} +2 -2
- package/src/{components/chat/adapters/chat-message.session-spawn-tool-card.test.ts → features/chat/utils/chat-message-session-spawn-tool-card.utils.test.ts} +2 -2
- package/src/{components/chat/adapters/chat-message.summary-truncation.test.ts → features/chat/utils/chat-message-summary-truncation.utils.test.ts} +2 -2
- package/src/{components/chat/adapters/chat-message-tool-agent-id.test.ts → features/chat/utils/chat-message-tool-agent-id.utils.test.ts} +1 -1
- package/src/features/chat/utils/chat-message-tool-card.utils.ts +216 -0
- package/src/{components/chat/adapters/chat-message.adapter.test.ts → features/chat/utils/chat-message.utils.test.ts} +2 -2
- package/src/{components/chat/adapters/chat-message.adapter.ts → features/chat/utils/chat-message.utils.ts} +4 -4
- package/src/features/chat/utils/chat-runtime.utils.ts +235 -0
- package/src/{components/chat/chat-session-display.test.ts → features/chat/utils/chat-session-display.utils.test.ts} +2 -2
- package/src/{components/chat/chat-session-display.ts → features/chat/utils/chat-session-display.utils.ts} +5 -9
- package/src/{components/chat/chat-session-preference-governance.ts → features/chat/utils/chat-session-preference-governance.utils.ts} +51 -64
- package/src/{components/chat/chat-session-route.ts → features/chat/utils/chat-session-route.utils.ts} +1 -1
- package/src/{components/chat/adapters/file-operation/card.ts → features/chat/utils/file-operation/card.utils.ts} +3 -3
- package/src/{components/chat/adapters/file-operation/diff.ts → features/chat/utils/file-operation/diff.utils.ts} +9 -99
- package/src/features/chat/utils/file-operation/parsed-block.utils.ts +98 -0
- package/src/{components/chat/adapters/file-operation/record-readers.ts → features/chat/utils/file-operation/record-readers.utils.ts} +1 -1
- package/src/{components/chat/ncp/ncp-app-client-fetch.test.ts → features/chat/utils/ncp-app-client-fetch.utils.test.ts} +1 -1
- package/src/{components/chat/ncp/ncp-app-client-fetch.ts → features/chat/utils/ncp-app-client-fetch.utils.ts} +3 -0
- package/src/features/chat/utils/ncp-chat-input-availability.utils.test.ts +92 -0
- package/src/features/chat/utils/ncp-chat-input-availability.utils.ts +45 -0
- package/src/{components/chat/ncp/__tests__/ncp-session-adapter.cancelled-tool.test.ts → features/chat/utils/ncp-session-adapter.utils.cancelled-tool.test.ts} +2 -2
- package/src/{components/chat/ncp/ncp-session-adapter.test.ts → features/chat/utils/ncp-session-adapter.utils.test.ts} +3 -3
- package/src/{components/chat/ncp/ncp-session-adapter.ts → features/chat/utils/ncp-session-adapter.utils.ts} +3 -3
- package/src/{lib → features/chat/utils}/session-context.utils.test.ts +3 -3
- package/src/{lib → features/chat/utils}/session-context.utils.ts +3 -3
- package/src/{components/marketplace → features/marketplace/components}/marketplace-list-card.tsx +69 -124
- package/src/{components/marketplace → features/marketplace/components}/marketplace-localization.ts +1 -1
- package/src/{components/marketplace → features/marketplace/components}/marketplace-page-data.ts +2 -2
- package/src/features/marketplace/components/marketplace-page-detail.test.tsx +336 -0
- package/src/features/marketplace/components/marketplace-page-parts.tsx +121 -0
- package/src/{components/marketplace → features/marketplace/components}/marketplace-page.test.tsx +6 -6
- package/src/{components/marketplace → features/marketplace/components}/marketplace-page.tsx +92 -91
- package/src/{components/marketplace → features/marketplace/components}/mcp/mcp-marketplace-card.tsx +4 -4
- package/src/{components/marketplace → features/marketplace/components}/mcp/mcp-marketplace-dialogs.tsx +7 -7
- package/src/{components/marketplace → features/marketplace/components}/mcp/mcp-marketplace-doc.ts +3 -3
- package/src/{components/marketplace → features/marketplace/components}/mcp/mcp-marketplace-page.test.tsx +13 -9
- package/src/features/marketplace/components/mcp/mcp-marketplace-page.tsx +446 -0
- package/src/{hooks/useMarketplace.ts → features/marketplace/hooks/use-marketplace.ts} +5 -5
- package/src/{hooks/useMcpMarketplace.ts → features/marketplace/hooks/use-mcp-marketplace.ts} +3 -3
- package/src/features/marketplace/index.ts +26 -0
- package/src/{components/marketplace/marketplace-installed-cache.test.ts → features/marketplace/utils/marketplace-installed-cache.utils.test.ts} +2 -2
- package/src/{components/marketplace/marketplace-installed-cache.ts → features/marketplace/utils/marketplace-installed-cache.utils.ts} +1 -1
- package/src/{hooks/marketplace-list-pages.ts → features/marketplace/utils/marketplace-list-pages.utils.ts} +1 -1
- package/src/{pwa → features/pwa}/components/pwa-install-entry.test.tsx +2 -2
- package/src/{pwa → features/pwa}/components/pwa-install-entry.tsx +7 -7
- package/src/features/pwa/index.ts +4 -0
- package/src/{pwa/register-pwa.ts → features/pwa/managers/pwa-bootstrap.manager.ts} +2 -2
- package/src/{pwa → features/pwa}/managers/pwa-install.manager.test.ts +3 -3
- package/src/{pwa → features/pwa}/managers/pwa-install.manager.ts +5 -5
- package/src/{pwa → features/pwa}/managers/pwa-runtime.manager.ts +1 -1
- package/src/{pwa → features/pwa}/managers/pwa-shell-theme.manager.test.ts +1 -1
- package/src/{pwa → features/pwa}/managers/pwa-shell-theme.manager.ts +1 -1
- package/src/{pwa → features/pwa}/stores/pwa.store.ts +2 -2
- package/src/{components/remote → features/remote/components}/remote-access-page.test.tsx +5 -6
- package/src/{components/remote → features/remote/components}/remote-access-page.tsx +21 -19
- package/src/{hooks/useRemoteAccess.ts → features/remote/hooks/use-remote-access.ts} +3 -3
- package/src/features/remote/index.ts +27 -0
- package/src/{remote → features/remote}/managers/remote-access.manager.ts +6 -7
- package/src/{remote → features/remote/services}/remote-access-feedback.service.test.ts +3 -3
- package/src/{remote → features/remote/services}/remote-access-feedback.service.ts +2 -2
- package/src/{remote/remote-access.query.ts → features/remote/services/remote-access-query.service.ts} +2 -2
- package/src/{remote → features/remote}/stores/remote-access.store.ts +1 -1
- package/src/features/settings/hooks/use-language-preference.ts +30 -0
- package/src/features/settings/index.ts +2 -0
- package/src/features/settings/pages/language-settings-page.test.tsx +36 -0
- package/src/features/settings/pages/language-settings-page.tsx +56 -0
- package/src/features/system-status/components/config/runtime-agent-list-card.tsx +72 -0
- package/src/features/system-status/components/config/runtime-binding-list-card.tsx +85 -0
- package/src/features/system-status/components/config/runtime-config-editor.tsx +131 -0
- package/src/features/system-status/components/config/runtime-config-overview.tsx +16 -0
- package/src/features/system-status/components/config/runtime-entry-list-card.tsx +58 -0
- package/src/features/system-status/components/config/runtime-settings-card.tsx +73 -0
- package/src/{components/config → features/system-status/components}/desktop-update-config.test.tsx +12 -6
- package/src/features/system-status/components/desktop-update-config.tsx +219 -0
- package/src/features/system-status/components/runtime-control-card.test.tsx +213 -0
- package/src/features/system-status/components/runtime-control-card.tsx +260 -0
- package/src/{components/config → features/system-status/components}/runtime-presence-card.test.tsx +12 -16
- package/src/{components/config → features/system-status/components}/runtime-presence-card.tsx +38 -51
- package/src/features/system-status/components/runtime-security-card.tsx +263 -0
- package/src/{components/config → features/system-status/components}/security-config.tsx +3 -3
- package/src/features/system-status/hooks/use-system-status.ts +104 -0
- package/src/features/system-status/index.ts +4 -0
- package/src/features/system-status/managers/system-status.manager.bootstrap-polling.test.ts +126 -0
- package/src/features/system-status/managers/system-status.manager.test.ts +142 -0
- package/src/features/system-status/managers/system-status.manager.ts +511 -0
- package/src/features/system-status/pages/runtime-config-page.test.tsx +140 -0
- package/src/features/system-status/pages/runtime-config-page.tsx +15 -0
- package/src/features/system-status/stores/system-status.store.ts +32 -0
- package/src/features/system-status/types/system-status.types.ts +73 -0
- package/src/features/system-status/utils/runtime-config-agent.utils.ts +152 -0
- package/src/features/system-status/utils/system-status.utils.test.ts +132 -0
- package/src/features/system-status/utils/system-status.utils.ts +202 -0
- package/src/index.css +1 -1
- package/src/platforms/desktop/components/desktop-app-shell.tsx +52 -0
- package/src/platforms/desktop/index.ts +21 -0
- package/src/{desktop → platforms/desktop}/managers/desktop-presence.manager.ts +3 -3
- package/src/{desktop → platforms/desktop}/managers/desktop-update.manager.ts +3 -3
- package/src/{desktop → platforms/desktop}/stores/desktop-presence.store.ts +1 -1
- package/src/{desktop → platforms/desktop}/stores/desktop-update.store.ts +1 -1
- package/src/{desktop → platforms/desktop/types}/desktop-update.types.ts +4 -0
- package/src/platforms/mobile/components/chat-mobile-shell.tsx +20 -0
- package/src/platforms/mobile/components/mobile-app-shell.test.tsx +42 -0
- package/src/platforms/mobile/components/mobile-app-shell.tsx +48 -0
- package/src/platforms/mobile/components/mobile-bottom-nav.test.tsx +45 -0
- package/src/platforms/mobile/components/mobile-bottom-nav.tsx +71 -0
- package/src/platforms/mobile/components/mobile-settings-shell.tsx +39 -0
- package/src/platforms/mobile/components/mobile-topbar.tsx +41 -0
- package/src/platforms/mobile/index.ts +3 -0
- package/src/shared/components/__tests__/config-split-page.test.tsx +47 -0
- package/src/{components/common/AgentAvatar.tsx → shared/components/common/agent-avatar.tsx} +1 -1
- package/src/{components → shared/components}/common/agent-identity/agent-identity-avatar.tsx +2 -2
- package/src/shared/components/common/agent-identity/index.ts +3 -0
- package/src/{components → shared/components}/common/agent-identity/use-agent-identity.ts +3 -3
- package/src/{components/common/BrandHeader.tsx → shared/components/common/brand-header.tsx} +2 -2
- package/src/{components/common/KeyValueEditor.tsx → shared/components/common/key-value-editor.tsx} +4 -4
- package/src/{components/common/LogoBadge.tsx → shared/components/common/logo-badge.tsx} +1 -1
- package/src/{components/common/MaskedInput.tsx → shared/components/common/masked-input.tsx} +3 -3
- package/src/{components/common/ProviderScopedModelInput.tsx → shared/components/common/provider-scoped-model-input.tsx} +6 -6
- package/src/{components/common/SearchableModelInput.tsx → shared/components/common/searchable-model-input.tsx} +2 -2
- package/src/{components/common/StatusBadge.tsx → shared/components/common/status-badge.tsx} +3 -3
- package/src/{components → shared/components}/common/tag-input.tsx +3 -3
- package/src/{components → shared/components}/config/provider-form-support.ts +3 -3
- package/src/{components/config/ProviderForm.tsx → shared/components/config/provider-form.tsx} +14 -14
- package/src/{components → shared/components}/config/provider-models-section.tsx +7 -7
- package/src/{components → shared/components}/config/providers-list.test.tsx +19 -19
- package/src/{components/config/ProvidersList.tsx → shared/components/config/providers-list.tsx} +56 -54
- package/src/shared/components/config/secrets-config-form.tsx +407 -0
- package/src/shared/components/config/secrets-config.test.tsx +90 -0
- package/src/shared/components/config/secrets-config.tsx +25 -0
- package/src/{components/config → shared/components}/config-split-page.tsx +55 -9
- package/src/{components/config/CronConfig.tsx → shared/components/cron-config.tsx} +63 -96
- package/src/shared/components/doc-browser/doc-browser-context.test.tsx +102 -0
- package/src/{components/doc-browser/DocBrowserContext.tsx → shared/components/doc-browser/doc-browser-context.tsx} +98 -45
- package/src/shared/components/doc-browser/doc-browser.test.tsx +72 -0
- package/src/{components/doc-browser/DocBrowser.tsx → shared/components/doc-browser/doc-browser.tsx} +60 -34
- package/src/shared/components/doc-browser/index.ts +3 -0
- package/src/{components/doc-browser/useDocLinkInterceptor.ts → shared/components/doc-browser/use-doc-link-interceptor.ts} +1 -1
- package/src/{components/config/ModelConfig.test.tsx → shared/components/model-config.test.tsx} +4 -4
- package/src/shared/components/model-config.tsx +151 -0
- package/src/{components → shared/components}/path-picker/server-path-picker-dialog.test.tsx +3 -3
- package/src/{components → shared/components}/path-picker/server-path-picker-dialog.tsx +7 -7
- package/src/{components/config → shared/components}/provider-advanced-settings-section.tsx +5 -18
- package/src/{components/config → shared/components}/provider-auth-section.tsx +7 -24
- package/src/{components/config → shared/components}/provider-enabled-field.tsx +4 -8
- package/src/{components/config → shared/components}/provider-pill-selector.tsx +3 -15
- package/src/{components/config → shared/components}/provider-status-badge.tsx +3 -9
- package/src/{components/config/SearchConfig.test.tsx → shared/components/search-config.test.tsx} +3 -3
- package/src/shared/components/search-config.tsx +496 -0
- package/src/{components → shared/components}/ui/action-link.tsx +1 -1
- package/src/{components → shared/components}/ui/button.tsx +1 -1
- package/src/{components → shared/components}/ui/card.tsx +1 -1
- package/src/{components → shared/components}/ui/config-card.tsx +1 -1
- package/src/{components → shared/components}/ui/confirm-dialog.tsx +3 -3
- package/src/{components → shared/components}/ui/dialog.tsx +1 -1
- package/src/{components/ui/HighlightCard.tsx → shared/components/ui/highlight-card.tsx} +1 -1
- package/src/{components → shared/components}/ui/input.tsx +1 -1
- package/src/{components → shared/components}/ui/label.tsx +1 -1
- package/src/{components → shared/components}/ui/notice-card.tsx +1 -1
- package/src/{components → shared/components}/ui/popover.tsx +1 -1
- package/src/{components → shared/components}/ui/scroll-area.tsx +1 -1
- package/src/{components → shared/components}/ui/select.tsx +1 -1
- package/src/{components → shared/components}/ui/setting-row.tsx +1 -1
- package/src/{components → shared/components}/ui/skeleton.tsx +1 -1
- package/src/{components → shared/components}/ui/status-dot.tsx +1 -1
- package/src/{components → shared/components}/ui/switch.tsx +1 -1
- package/src/{components → shared/components}/ui/tabs-custom.tsx +2 -2
- package/src/{components → shared/components}/ui/tabs.tsx +1 -1
- package/src/{components → shared/components}/ui/tag-chip.tsx +1 -1
- package/src/{components → shared/components}/ui/textarea.tsx +1 -1
- package/src/{components → shared/components}/ui/tooltip.tsx +1 -1
- package/src/{hooks/agents/useAgents.ts → shared/hooks/use-agents.ts} +2 -2
- package/src/{hooks/useConfig.ts → shared/hooks/use-config.ts} +4 -4
- package/src/{hooks/useConfirmDialog.tsx → shared/hooks/use-confirm-dialog.tsx} +2 -2
- package/src/{hooks/server-path → shared/hooks}/use-server-path-browse.ts +1 -1
- package/src/{hooks/server-path → shared/hooks}/use-server-path-read.ts +1 -1
- package/src/{api → shared/lib/api}/api-base.test.ts +2 -2
- package/src/{api → shared/lib/api}/client.test.ts +2 -2
- package/src/{api → shared/lib/api}/client.ts +1 -1
- package/src/{api → shared/lib/api}/config.ts +10 -0
- package/src/shared/lib/api/index.ts +20 -0
- package/src/{api → shared/lib/api}/ncp-session-query-cache.test.ts +2 -2
- package/src/{api → shared/lib/api}/ncp-session-query-cache.ts +1 -1
- package/src/{api → shared/lib/api}/ncp-session.test.ts +3 -3
- package/src/{api → shared/lib/api}/raw-client.test.ts +1 -1
- package/src/{api/raw-client.ts → shared/lib/api/raw-client.utils.ts} +2 -0
- package/src/{api → shared/lib/api}/types.ts +40 -0
- package/src/{lib → shared/lib/app-resource-uri}/app-resource-uri.test.ts +1 -1
- package/src/{lib/config-hints.ts → shared/lib/config-hints/index.ts} +1 -1
- package/src/{lib/i18n.chat.ts → shared/lib/i18n/chat.ts} +8 -0
- package/src/{lib/i18n.ts → shared/lib/i18n/index.ts} +11 -11
- package/src/shared/lib/i18n/runtime/i18n-language-owner.test.ts +94 -0
- package/src/{lib/i18n-runtime → shared/lib/i18n/runtime}/i18n-language-owner.ts +15 -1
- package/src/{lib/provider-models.ts → shared/lib/provider-models/index.ts} +1 -1
- package/src/shared/lib/session-project/index.ts +2 -0
- package/src/{lib → shared/lib}/session-project/workspace-file-breadcrumb.test.ts +1 -1
- package/src/{lib → shared/lib}/session-project/workspace-file-breadcrumb.ts +1 -1
- package/src/{transport/app-client.ts → shared/lib/transport/app-client.service.ts} +11 -12
- package/src/{transport → shared/lib/transport}/app-client.test.ts +15 -5
- package/src/{transport → shared/lib/transport}/index.ts +1 -1
- package/src/{transport/local.transport.ts → shared/lib/transport/local-transport.service.ts} +19 -19
- package/src/{transport/remote.transport.ts → shared/lib/transport/remote-transport.service.ts} +14 -15
- package/src/{transport → shared/lib/transport}/remote.transport.test.ts +5 -5
- package/src/{transport → shared/lib/transport}/sse-stream.test.ts +2 -2
- package/src/{transport/sse-stream.ts → shared/lib/transport/sse-stream.utils.ts} +13 -11
- package/src/{transport → shared/lib/transport}/transport.types.ts +1 -1
- package/src/{lib/ui-document-title.ts → shared/lib/ui-document-title/index.ts} +1 -1
- package/tsconfig.json +20 -0
- package/vite.config.ts +62 -2
- package/vitest.config.ts +21 -1
- package/dist/assets/ChannelsList-M9FTK1Ak.js +0 -8
- package/dist/assets/DocBrowser-CH7-GxlL.js +0 -1
- package/dist/assets/DocBrowser-DMfr0Oow.js +0 -1
- package/dist/assets/DocBrowserContext-BXydqby-.js +0 -1
- package/dist/assets/ModelConfig-CNIgLf0e.js +0 -1
- package/dist/assets/ProviderScopedModelInput-B3HWP4oz.js +0 -1
- package/dist/assets/ProvidersList-CHjMnRhX.js +0 -1
- package/dist/assets/RuntimeConfig-psp8nMSG.js +0 -1
- package/dist/assets/SearchConfig-CSoKip1f.js +0 -1
- package/dist/assets/SecretsConfig-MEt6MjuD.js +0 -3
- package/dist/assets/SessionsConfig-DifCiXwR.js +0 -2
- package/dist/assets/app-query-client-9jNewezV.js +0 -1
- package/dist/assets/chat-page-CLp0UV0Y.js +0 -58
- package/dist/assets/chat-session-display-DsYHx0RZ.js +0 -1
- package/dist/assets/chunk-JZWAC4HX-C5dEc8hV.js +0 -3
- package/dist/assets/client-C-8fH7-c.js +0 -7
- package/dist/assets/config-CBScxsdV.js +0 -1
- package/dist/assets/config-split-page-BUout_Ak.js +0 -1
- package/dist/assets/desktop-update-config-2BS6BMkW.js +0 -1
- package/dist/assets/dist-BruyLa92.js +0 -9
- package/dist/assets/download-BD0ETkB-.js +0 -1
- package/dist/assets/i18n-CpTZLchQ.js +0 -1
- package/dist/assets/index-mW8W2FUu.css +0 -1
- package/dist/assets/index-zDZfXoI4.js +0 -6
- package/dist/assets/infiniteQueryBehavior-CyER9hv0.js +0 -1
- package/dist/assets/loader-circle-Bc2gCU33.js +0 -1
- package/dist/assets/marketplace-page-3qVMnF3d.js +0 -1
- package/dist/assets/marketplace-page-BhFIeQzI.js +0 -49
- package/dist/assets/mcp-marketplace-page-DYfteJ1D.js +0 -40
- package/dist/assets/page-layout-0UcO9H9Z.js +0 -1
- package/dist/assets/play-CKDjSQFL.js +0 -1
- package/dist/assets/plus-CG0QrVY_.js +0 -1
- package/dist/assets/refresh-cw-Bcv40SXy.js +0 -1
- package/dist/assets/remote-access-page-CWHG-sug.js +0 -1
- package/dist/assets/search-BCAlB8nz.js +0 -1
- package/dist/assets/security-config-Slh0Mayz.js +0 -1
- package/dist/assets/select-CVz0t7MF.js +0 -41
- package/dist/assets/setting-row-CbVHAuQt.js +0 -1
- package/dist/assets/skeleton-D5rdKvzy.js +0 -1
- package/dist/assets/switch-CM29eCAR.js +0 -1
- package/dist/assets/tag-chip-DMXdnLcj.js +0 -1
- package/dist/assets/use-infinite-scroll-loader-DJ1L81Dz.js +0 -1
- package/dist/assets/useConfirmDialog-BsVuqu1x.js +0 -1
- package/dist/assets/useMutation-CNcz2fgt.js +0 -1
- package/dist/assets/x-Czwxm82I.js +0 -1
- package/src/app.tsx +0 -271
- package/src/components/chat/ChatSidebar.tsx +0 -486
- package/src/components/chat/README.md +0 -2
- package/src/components/chat/adapters/chat-message-part.adapter.ts +0 -472
- package/src/components/chat/chat-inline-token.utils.test.ts +0 -87
- package/src/components/chat/chat-page.tsx +0 -6
- package/src/components/chat/chat-sidebar-list-mode-switch.tsx +0 -43
- package/src/components/chat/hooks/use-chat-session-project.ts +0 -35
- package/src/components/chat/index.ts +0 -1
- package/src/components/chat/ncp/README.md +0 -3
- package/src/components/chat/ncp/ncp-chat-page-data.test.ts +0 -79
- package/src/components/chat/ncp/session-conversation/use-ncp-session-conversation.ts +0 -72
- package/src/components/chat/nextclaw/index.ts +0 -23
- package/src/components/common/agent-identity/index.ts +0 -3
- package/src/components/config/ChannelForm.tsx +0 -338
- package/src/components/config/ChannelsList.test.tsx +0 -309
- package/src/components/config/ModelConfig.tsx +0 -156
- package/src/components/config/README.md +0 -2
- package/src/components/config/RuntimeConfig.tsx +0 -588
- package/src/components/config/SearchConfig.tsx +0 -513
- package/src/components/config/SecretsConfig.tsx +0 -469
- package/src/components/config/SessionsConfig.tsx +0 -437
- package/src/components/config/desktop-update-config.tsx +0 -271
- package/src/components/config/runtime-config-agent.utils.ts +0 -96
- package/src/components/config/runtime-control-card.test.tsx +0 -311
- package/src/components/config/runtime-control-card.tsx +0 -326
- package/src/components/config/runtime-security-card.tsx +0 -276
- package/src/components/config/weixin-channel-auth-section.tsx +0 -305
- package/src/components/doc-browser/index.ts +0 -3
- package/src/components/layout/AppLayout.tsx +0 -82
- package/src/components/layout/runtime-status-entry.test.tsx +0 -157
- package/src/components/layout/runtime-status-entry.tsx +0 -143
- package/src/components/marketplace/marketplace-page-parts.tsx +0 -94
- package/src/components/marketplace/mcp/mcp-marketplace-page.tsx +0 -414
- package/src/hooks/README.md +0 -3
- package/src/hooks/use-runtime-control.ts +0 -24
- package/src/hooks/useObservable.ts +0 -20
- package/src/lib/chat-runtime-utils.ts +0 -250
- package/src/presenter/app-presenter-context.tsx +0 -20
- package/src/presenter/app.presenter.ts +0 -12
- package/src/runtime-control/runtime-control.manager.ts +0 -118
- package/src/stores/ui.store.ts +0 -23
- /package/dist/assets/{config-hints-BhTmc9P1.js → config-hints-CPNzbMEp.js} +0 -0
- /package/src/{components/layout/Header.tsx → app/components/layout/header.tsx} +0 -0
- /package/src/{styles → app/styles}/design-system.css +0 -0
- /package/src/{account → features/account}/stores/account.store.ts +0 -0
- /package/src/{components/chat/chat-input/chat-input-bar.controller.ts → features/chat/hooks/use-chat-input-bar-controller.ts} +0 -0
- /package/src/{lib/session-run-status.ts → features/chat/types/session-run-status.types.ts} +0 -0
- /package/src/{components/chat/adapters/chat-message.partial-json.ts → features/chat/utils/chat-message-partial-json.utils.ts} +0 -0
- /package/src/{components/chat/adapters/chat-message-tool-agent-id.ts → features/chat/utils/chat-message-tool-agent-id.utils.ts} +0 -0
- /package/src/{components/chat/adapters/file-operation/line-builder.ts → features/chat/utils/file-operation/line-builder.utils.ts} +0 -0
- /package/src/{components/marketplace → features/marketplace/components}/marketplace-detail-doc.ts +0 -0
- /package/src/{pwa → features/pwa/types}/pwa.types.ts +0 -0
- /package/src/{pwa/pwa-install-banner.storage.ts → features/pwa/utils/pwa-install-banner.utils.ts} +0 -0
- /package/src/{hooks → shared/hooks}/use-infinite-scroll-loader.ts +0 -0
- /package/src/{api → shared/lib/api}/agents.ts +0 -0
- /package/src/{api → shared/lib/api}/api-base.ts +0 -0
- /package/src/{api → shared/lib/api}/auth.types.ts +0 -0
- /package/src/{api → shared/lib/api}/channel-auth.ts +0 -0
- /package/src/{api → shared/lib/api}/channel-auth.types.ts +0 -0
- /package/src/{api → shared/lib/api}/chat-session-type.types.ts +0 -0
- /package/src/{api → shared/lib/api}/marketplace.ts +0 -0
- /package/src/{api → shared/lib/api}/mcp-marketplace.ts +0 -0
- /package/src/{api → shared/lib/api}/ncp-attachments.ts +0 -0
- /package/src/{api → shared/lib/api}/ncp-session.ts +0 -0
- /package/src/{api → shared/lib/api}/remote.ts +0 -0
- /package/src/{api → shared/lib/api}/remote.types.ts +0 -0
- /package/src/{api → shared/lib/api}/runtime-control.ts +0 -0
- /package/src/{api → shared/lib/api}/runtime-control.types.ts +0 -0
- /package/src/{api → shared/lib/api}/server-path.ts +0 -0
- /package/src/{lib/app-resource-uri.ts → shared/lib/app-resource-uri/index.ts} +0 -0
- /package/src/{lib/i18n.agents.ts → shared/lib/i18n/agents.ts} +0 -0
- /package/src/{lib/i18n.channel-auth.ts → shared/lib/i18n/channel-auth.ts} +0 -0
- /package/src/{lib/i18n.channels.ts → shared/lib/i18n/channels.ts} +0 -0
- /package/src/{lib → shared/lib/i18n}/desktop-update-labels.utils.ts +0 -0
- /package/src/{lib/i18n.marketplace.ts → shared/lib/i18n/marketplace.ts} +0 -0
- /package/src/{lib/i18n.pwa.ts → shared/lib/i18n/pwa.ts} +0 -0
- /package/src/{lib/i18n.remote.ts → shared/lib/i18n/remote.ts} +0 -0
- /package/src/{lib/i18n-runtime → shared/lib/i18n/runtime}/i18n.path-picker.ts +0 -0
- /package/src/{lib/i18n.runtime-control.ts → shared/lib/i18n/runtime-control.ts} +0 -0
- /package/src/{lib/i18n.search.ts → shared/lib/i18n/search.ts} +0 -0
- /package/src/{lib/logos.ts → shared/lib/logos/index.ts} +0 -0
- /package/src/{lib → shared/lib}/session-project/session-project.utils.ts +0 -0
- /package/src/{lib/theme.ts → shared/lib/theme/index.ts} +0 -0
- /package/src/{transport/transport-websocket-url.ts → shared/lib/transport/transport-websocket-url.utils.ts} +0 -0
- /package/src/{lib/utils.ts → shared/lib/utils/index.ts} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{_ as e,i as t,m as n,n as r,p as i,t as a,u as o}from"./i18n-BnNAQpVM.js";import{At as s,Dt as c,Et as l,kt as u}from"./api-DnPN4SyA.js";import{t as d}from"./createLucideIcon-C_GFKVuW.js";import{h as f,p,y as m}from"./theme-provider-CUppbOyN.js";import{t as h}from"./search-DZSNKEGp.js";import{F as g,N as _,f as v,p as y,w as b}from"./chat-C0ZNZtS3.js";import{a as x,i as S,n as C,r as w,t as T}from"./select-RgeHgn_-.js";import{t as E}from"./hash-CvcvtMBq.js";import{t as D}from"./settings-DjvNMJde.js";import{t as O}from"./use-viewport-layout-CytJAPWM.js";import{S as k,c as A,f as j,m as M}from"./use-config-CrsavfWZ.js";import{a as N,c as P,i as F,o as I}from"./config-split-page-B3PRA_AV.js";import{t as L}from"./use-confirm-dialog-D1AnLFlc.js";var R=d(`Clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polyline`,{points:`12 6 12 12 16 14`,key:`68esgv`}]]),z=d(`Inbox`,[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]),B=e(n(),1),V=i();function H(e){return e===`service`?`system`:e===`tool`?`tool`:e}function U(e){let t=[];for(let n of e.parts){if(n.type===`text`||n.type===`rich-text`||n.type===`reasoning`){t.push(n.text);continue}if(n.type!==`tool-invocation`)continue;let e=n.toolName?.trim()?`[${n.toolName.trim()}]`:`[tool]`;if(n.state===`result`&&typeof n.result==`string`&&n.result.trim()){t.push(`${e} ${n.result.trim()}`);continue}t.push(e)}return t.join(`
|
|
2
|
+
`).trim()}function W({message:e}){let t=H(e.role),n=t===`user`,i=U(e);return(0,V.jsx)(`div`,{className:o(`flex w-full mb-6`,n?`justify-end`:`justify-start`),children:(0,V.jsxs)(`div`,{className:o(`max-w-[85%] rounded-[1.25rem] p-5 flex gap-3 text-sm`,n?`bg-primary text-white rounded-tr-sm`:`bg-gray-50 text-gray-800 rounded-tl-sm border border-gray-100/50`),children:[(0,V.jsx)(`div`,{className:`shrink-0 pt-0.5`,children:n?(0,V.jsx)(g,{className:`w-4 h-4 text-primary-100`}):(0,V.jsx)(m,{className:`w-4 h-4 text-gray-400`})}),(0,V.jsxs)(`div`,{className:`flex-1 space-y-1 overflow-x-hidden`,children:[(0,V.jsxs)(`div`,{className:`flex items-baseline justify-between gap-4 mb-2`,children:[(0,V.jsx)(`span`,{className:o(`font-semibold text-xs capitalize`,n?`text-primary-50`:`text-gray-900`),children:t}),(0,V.jsx)(`span`,{className:o(`text-[10px]`,n?`text-primary-200`:`text-gray-400`),children:r(e.timestamp)})]}),(0,V.jsx)(`div`,{className:`whitespace-pre-wrap break-words leading-relaxed text-[15px]`,children:i||`-`})]})]})})}function G(e){let[n,r]=(0,B.useState)(!1),[i,a]=(0,B.useState)(e.session.label||``),[c,l]=(0,B.useState)(e.session.preferredModel||``);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(s,{variant:`outline`,size:`sm`,onClick:()=>r(e=>!e),className:o(`h-8.5 rounded-lg shadow-none border-gray-200 transition-all text-xs font-semibold`,n?`bg-gray-100 text-gray-900`:`hover:bg-gray-50 hover:text-gray-900`),children:[(0,V.jsx)(D,{className:`w-3.5 h-3.5 mr-1.5`}),t(`sessionsMetadata`)]}),n?(0,V.jsxs)(`div`,{className:`flex items-center gap-3 bg-gray-50/50 p-3 rounded-lg border border-gray-100 animate-slide-in`,children:[(0,V.jsx)(u,{placeholder:t(`sessionsLabelPlaceholder`),value:i,onChange:e=>a(e.target.value),className:`h-8 text-sm bg-white`}),(0,V.jsx)(u,{placeholder:t(`sessionsModelPlaceholder`),value:c,onChange:e=>l(e.target.value),className:`h-8 text-sm bg-white`}),(0,V.jsx)(s,{size:`sm`,onClick:()=>{e.onSave({label:i,preferredModel:c}),r(!1)},className:`h-8 px-4 shrink-0 shadow-none`,disabled:e.isPending,children:t(`sessionsSaveMeta`)})]}):null]})}function K(){return(0,V.jsxs)(`div`,{className:`flex-1 flex flex-col items-center justify-center text-gray-400 p-8 h-full bg-white`,children:[(0,V.jsx)(`div`,{className:`w-20 h-20 bg-gray-50 rounded-3xl flex items-center justify-center mb-6 border border-gray-100 shadow-[0_2px_8px_-2px_rgba(0,0,0,0.02)] rotate-3`,children:(0,V.jsx)(z,{className:`h-8 w-8 text-gray-300 -rotate-3`})}),(0,V.jsx)(`h3`,{className:`text-lg font-bold text-gray-900 mb-2`,children:t(`sessionsNoSelectionTitle`)}),(0,V.jsx)(`p`,{className:`text-sm text-center max-w-sm leading-relaxed`,children:t(`sessionsNoSelectionDescription`)})]})}function q(e){let n=j(e.sessionKey,300),r=k(),i=A(),{confirm:a,ConfirmDialog:o}=L();return(0,V.jsxs)(`div`,{className:`flex-1 min-w-0 flex flex-col overflow-hidden relative bg-white rounded-2xl shadow-sm border border-gray-200`,children:[r.isPending||i.isPending?(0,V.jsx)(`div`,{className:`absolute top-0 left-0 w-full h-1 bg-primary/20 overflow-hidden z-20`,children:(0,V.jsx)(`div`,{className:`h-full bg-primary animate-pulse w-1/3 rounded-r-full`})}):null,e.sessionKey&&e.session&&e.summary&&e.channelLabel?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`div`,{className:`shrink-0 border-b border-gray-100 bg-white px-4 py-4 z-10 space-y-4 sm:px-8 sm:py-5`,children:(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,V.jsx)(`div`,{className:`h-12 w-12 rounded-[14px] bg-gray-50 border border-gray-100 flex items-center justify-center text-gray-400 shrink-0`,children:(0,V.jsx)(E,{className:`h-6 w-6`})}),(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2.5 mb-1.5`,children:[(0,V.jsx)(`h3`,{className:`text-lg font-bold text-gray-900 tracking-tight`,children:e.session.label?.trim()||e.session.key.split(`:`).pop()||e.session.key}),(0,V.jsx)(`span`,{className:`text-[10px] font-bold px-2 py-0.5 rounded-full bg-gray-100 text-gray-500 uppercase tracking-widest`,children:e.channelLabel}),e.summary.status===`running`?(0,V.jsx)(_,{status:`running`,className:`h-4 w-4`}):null]}),(0,V.jsx)(`div`,{className:`text-xs text-gray-500 font-mono break-all line-clamp-1 opacity-70`,title:e.sessionKey,children:e.sessionKey})]})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,V.jsx)(G,{session:e.session,isPending:r.isPending,onSave:t=>{e.sessionKey&&r.mutate({sessionId:e.sessionKey,data:{label:t.label.trim()||null,preferredModel:t.preferredModel.trim()||null}})}},e.session.key),(0,V.jsx)(s,{variant:`outline`,size:`sm`,onClick:async()=>{e.sessionKey&&await a({title:t(`sessionsDeleteConfirm`)+`?`,variant:`destructive`,confirmLabel:t(`sessionsDeleteConfirm`)})&&i.mutate({sessionId:e.sessionKey},{onSuccess:()=>e.onClearSelection()})},className:`h-8.5 rounded-lg shadow-none hover:bg-red-50 hover:text-red-600 hover:border-red-200 border-gray-200 text-xs font-semibold text-red-500`,children:t(`delete`)})]})]})}),(0,V.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-4 relative [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:bg-gray-300/80 [&::-webkit-scrollbar-thumb]:rounded-full sm:p-6`,children:[n.isLoading?(0,V.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-gray-50/50 backdrop-blur-sm z-10`,children:(0,V.jsxs)(`div`,{className:`flex flex-col items-center gap-3 animate-pulse`,children:[(0,V.jsx)(p,{className:`w-6 h-6 text-primary animate-spin`}),(0,V.jsx)(`span`,{className:`text-sm font-medium text-gray-500`,children:t(`sessionsHistoryLoading`)})]})}):null,n.error?(0,V.jsx)(`div`,{className:`text-center p-6 bg-red-50 rounded-xl text-red-600 border border-red-100 text-sm`,children:n.error.message}):null,!n.isLoading&&n.data?.messages.length===0?(0,V.jsxs)(`div`,{className:`h-full flex flex-col items-center justify-center text-gray-400`,children:[(0,V.jsx)(f,{className:`w-12 h-12 mb-3 text-gray-300`}),(0,V.jsx)(`p`,{className:`text-sm`,children:t(`sessionsEmpty`)})]}):null,(0,V.jsx)(`div`,{className:`max-w-3xl mx-auto`,children:(n.data?.messages??[]).map(e=>(0,V.jsx)(W,{message:e},e.id))})]})]}):(0,V.jsx)(K,{}),(0,V.jsx)(o,{})]})}var J=`__unknown_channel__`;function Y(e){let t=e.indexOf(`:`);return t<=0?J:e.slice(0,t).trim()||J}function X(e){return e===J?t(`sessionsUnknownChannel`):e}function Z(e){return(0,V.jsxs)(`button`,{onClick:e.onSelect,className:o(`w-full text-left p-3.5 rounded-xl transition-all duration-200 outline-none focus:outline-none focus:ring-0 group`,e.isSelected?`bg-brand-50 border border-brand-100/50`:`bg-transparent border border-transparent hover:bg-gray-50/80`),children:[(0,V.jsxs)(`div`,{className:`flex items-start justify-between mb-1.5`,children:[(0,V.jsx)(`div`,{className:o(`font-semibold truncate pr-2 flex-1 text-sm`,e.isSelected?`text-brand-800`:`text-gray-900`),children:v(e.session)}),(0,V.jsx)(`div`,{className:o(`text-[10px] font-bold px-2 py-0.5 rounded-full shrink-0 capitalize`,e.isSelected?`bg-white text-brand-600 shadow-[0_1px_2px_rgba(0,0,0,0.02)]`:`bg-gray-100 text-gray-500`),children:e.channelLabel})]}),(0,V.jsxs)(`div`,{className:o(`flex items-center text-xs justify-between mt-2 font-medium`,e.isSelected?`text-brand-600/80`:`text-gray-400`),children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,V.jsx)(`span`,{className:`inline-flex h-3.5 w-3.5 shrink-0 items-center justify-center`,children:e.summary.status===`running`?(0,V.jsx)(_,{status:`running`}):null}),(0,V.jsx)(R,{className:`w-3.5 h-3.5 opacity-70`}),(0,V.jsx)(`span`,{className:`truncate max-w-[100px]`,children:a(e.summary.updatedAt)})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,V.jsx)(f,{className:`w-3.5 h-3.5 opacity-70`}),(0,V.jsx)(`span`,{children:e.summary.messageCount})]})]})]})}function Q(){let{isMobile:e}=O(),[n,r]=(0,B.useState)(``),[i,a]=(0,B.useState)(null),[d,f]=(0,B.useState)(`all`),m=M({limit:100}),g=(0,B.useMemo)(()=>m.data?.sessions??[],[m.data?.sessions]),_=(0,B.useMemo)(()=>b(g),[g]),v=(0,B.useMemo)(()=>new Map(g.map(e=>[e.sessionId,e])),[g]),E=(0,B.useMemo)(()=>_.filter(e=>d!==`all`&&Y(e.key)!==d?!1:y(e,n)),[n,d,_]),D=(0,B.useMemo)(()=>{let e=new Set;for(let t of _)e.add(Y(t.key));return Array.from(e).sort((e,t)=>e===J?1:t===J?-1:e.localeCompare(t))},[_]),k=i&&v.has(i)?i:null,A=(0,B.useMemo)(()=>_.find(e=>e.key===k)??null,[k,_]),j=k?v.get(k)??null:null,L=A?X(Y(A.key)):null;return(0,V.jsxs)(c,{className:`pb-0 xl:flex xl:h-full xl:min-h-0 xl:flex-col`,children:[(0,V.jsx)(l,{title:t(`sessionsPageTitle`),description:t(`sessionsPageDescription`)}),(0,V.jsxs)(F,{className:`xl:min-h-0`,mobileView:e?k?`detail`:`list`:void 0,onMobileBack:()=>a(null),mobileListLabel:t(`sessionsPageTitle`),children:[(0,V.jsxs)(N,{className:`xl:w-[320px] xl:flex-none`,children:[(0,V.jsxs)(P,{className:`space-y-3 px-4 py-4`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,V.jsxs)(`span`,{className:`text-[11px] font-semibold text-gray-400 uppercase tracking-wider`,children:[_.length,` `,t(`sessionsListTitle`)]}),(0,V.jsx)(s,{variant:`ghost`,size:`icon`,className:`h-7 w-7 rounded-lg text-gray-400 hover:text-gray-700 hover:bg-gray-100`,onClick:()=>m.refetch(),children:(0,V.jsx)(p,{className:o(`h-3.5 w-3.5`,m.isFetching&&`animate-spin`)})})]}),(0,V.jsxs)(T,{value:d,onValueChange:f,children:[(0,V.jsx)(S,{className:`w-full h-8.5 rounded-lg bg-gray-50/50 hover:bg-gray-100 border-gray-200 focus:ring-0 shadow-none text-xs font-medium text-gray-700`,children:(0,V.jsx)(x,{placeholder:t(`sessionsAllChannels`)})}),(0,V.jsxs)(C,{className:`rounded-xl shadow-lg border-gray-100 max-w-[280px]`,children:[(0,V.jsx)(w,{value:`all`,className:`rounded-lg text-xs`,children:t(`sessionsAllChannels`)}),D.map(e=>(0,V.jsx)(w,{value:e,className:`rounded-lg text-xs truncate pr-6`,children:X(e)},e))]})]}),(0,V.jsxs)(`div`,{className:`relative w-full`,children:[(0,V.jsx)(h,{className:`h-3.5 w-3.5 absolute left-3 top-2.5 text-gray-400`}),(0,V.jsx)(u,{value:n,onChange:e=>r(e.target.value),placeholder:t(`sessionsSearchPlaceholder`),className:`pl-8 h-8.5 rounded-lg bg-gray-50/50 border-gray-200 focus-visible:bg-white text-xs`})]})]}),(0,V.jsx)(I,{className:`space-y-1 p-3 pb-10`,children:m.isLoading?(0,V.jsx)(`div`,{className:`text-sm text-gray-400 p-4 text-center`,children:t(`sessionsLoading`)}):E.length===0?(0,V.jsxs)(`div`,{className:`text-sm text-gray-400 p-4 text-center border-2 border-dashed border-gray-100 rounded-xl mt-4`,children:[(0,V.jsx)(z,{className:`w-8 h-8 mx-auto mb-2 text-gray-300`}),t(`sessionsEmpty`)]}):E.map(e=>{let t=v.get(e.key);return t?(0,V.jsx)(Z,{session:e,summary:t,channelLabel:X(Y(e.key)),isSelected:k===e.key,onSelect:()=>a(e.key)},e.key):null})})]}),(0,V.jsx)(q,{sessionKey:k,session:A,summary:j,channelLabel:L,onClearSelection:()=>a(null)})]})]})}export{Q as SessionsConfig};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e,m as t,p as n,u as r}from"./i18n-BnNAQpVM.js";import{jt as i}from"./api-DnPN4SyA.js";var a=e(t(),1),o=n(),s=i(`flex items-start justify-between gap-4 rounded-xl border p-4`,{variants:{tone:{default:`border-gray-200 bg-white`,muted:`border-gray-200 bg-gray-50`}},defaultVariants:{tone:`default`}}),c=a.forwardRef(({className:e,tone:t,title:n,description:i,control:a,children:c,...l},u)=>(0,o.jsxs)(`div`,{ref:u,className:r(s({tone:t}),e),...l,children:[(0,o.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2`,children:[(0,o.jsx)(`div`,{className:`text-sm font-medium text-gray-900`,children:n}),i?(0,o.jsx)(`p`,{className:`text-sm leading-6 text-gray-500`,children:i}):null,c]}),a?(0,o.jsx)(`div`,{className:`shrink-0`,children:a}):null]}));c.displayName=`SettingRow`;export{c as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./createLucideIcon-C_GFKVuW.js";var t=e(`Settings`,[[`path`,{d:`M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z`,key:`1qme2f`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as e,u as t}from"./i18n-BnNAQpVM.js";var n=e();function r({className:e,...r}){return(0,n.jsx)(`div`,{className:t(`animate-pulse rounded-md bg-slate-200`,e),...r})}export{r as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./createLucideIcon-C_GFKVuW.js";var t=e(`Sparkles`,[[`path`,{d:`M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z`,key:`4pj2yx`}],[`path`,{d:`M20 3v4`,key:`1olli1`}],[`path`,{d:`M22 5h-4`,key:`1gvqau`}],[`path`,{d:`M4 17v2`,key:`vumght`}],[`path`,{d:`M5 18H3`,key:`zchphs`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,u as t}from"./i18n-
|
|
1
|
+
import{p as e,u as t}from"./i18n-BnNAQpVM.js";var n=e(),r={active:{dot:`bg-emerald-500`,text:`text-emerald-600`,bg:`bg-emerald-50`},ready:{dot:`bg-emerald-500`,text:`text-emerald-600`,bg:`bg-emerald-50`},inactive:{dot:`bg-gray-300`,text:`text-gray-400`,bg:`bg-gray-100/80`},setup:{dot:`bg-gray-300`,text:`text-gray-400`,bg:`bg-gray-100/80`},warning:{dot:`bg-amber-400`,text:`text-amber-600`,bg:`bg-amber-50`}};function i({status:e,label:i,className:a}){let o=r[e];return(0,n.jsxs)(`div`,{className:t(`inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap rounded-full px-2 py-0.5`,o.bg,a),children:[(0,n.jsx)(`span`,{className:t(`h-1.5 w-1.5 rounded-full`,o.dot)}),(0,n.jsx)(`span`,{className:t(`text-[11px] font-medium`,o.text),children:i})]})}export{i as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as e,p as t,r as n,u as r}from"./i18n-
|
|
1
|
+
import{m as e,p as t,r as n,u as r}from"./i18n-BnNAQpVM.js";e();var i=t();function a({tabs:e,activeTab:t,onChange:a,className:o}){return(0,i.jsx)(`div`,{className:r(`flex items-center gap-6 border-b border-gray-200/60 mb-6`,o),children:e.map(e=>{let o=t===e.id;return(0,i.jsxs)(`button`,{onClick:()=>a(e.id),className:r(`relative pb-3 text-[14px] font-medium transition-all duration-fast flex items-center gap-1.5`,o?`text-gray-900`:`text-gray-600 hover:text-gray-900`),children:[e.label,e.count!==void 0&&(0,i.jsx)(`span`,{className:r(`text-[11px] font-medium`,`text-gray-500`),children:n(e.count)}),o&&(0,i.jsx)(`div`,{className:`absolute bottom-0 left-0 right-0 h-[2px] bg-primary rounded-full`})]},e.id)})})}export{a as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e,m as t,p as n,u as r}from"./i18n-BnNAQpVM.js";import{jt as i}from"./api-DnPN4SyA.js";var a=e(t(),1),o=n(),s=i(`inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[11px] font-medium`,{variants:{tone:{subtle:`border-gray-200 bg-gray-50 text-gray-600`,neutral:`border-gray-200 bg-white text-gray-600`,success:`border-emerald-200 bg-emerald-50 text-emerald-700`,warning:`border-amber-200 bg-amber-50 text-amber-800`,danger:`border-rose-200 bg-rose-50 text-rose-600`,info:`border-primary/20 bg-primary/10 text-primary`}},defaultVariants:{tone:`subtle`}}),c=a.forwardRef(({className:e,tone:t,...n},i)=>(0,o.jsx)(`span`,{ref:i,className:r(s({tone:t}),e),...n}));c.displayName=`TagChip`;export{c as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e,i as t,m as n,p as r,u as i}from"./i18n-BnNAQpVM.js";import{At as a,Ct as o,Pt as s,St as c,Tt as l,bt as u,gt as d,wt as ee,xt as te,yt as ne}from"./api-DnPN4SyA.js";import{r as re}from"./chunk-JZWAC4HX-BJer-fqD.js";import{t as f}from"./createLucideIcon-C_GFKVuW.js";import{i as p,n as m,t as h}from"./select-RgeHgn_-.js";import{t as g}from"./x-BjMO7v8q.js";import{t as _}from"./use-config-CrsavfWZ.js";import{n as v,r as ie,t as ae}from"./popover-Dm_NQ3Cs.js";var oe=f(`AlarmClock`,[[`circle`,{cx:`12`,cy:`13`,r:`8`,key:`3y4lt7`}],[`path`,{d:`M12 9v4l2 2`,key:`1c63tq`}],[`path`,{d:`M5 3 2 6`,key:`18tl5t`}],[`path`,{d:`m22 6-3-3`,key:`1opdir`}],[`path`,{d:`M6.38 18.7 4 21`,key:`17xu3x`}],[`path`,{d:`M17.64 18.67 20 21`,key:`kv2oe2`}]]),se=f(`Bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),ce=f(`BrainCircuit`,[[`path`,{d:`M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z`,key:`l5xja`}],[`path`,{d:`M9 13a4.5 4.5 0 0 0 3-4`,key:`10igwf`}],[`path`,{d:`M6.003 5.125A3 3 0 0 0 6.401 6.5`,key:`105sqy`}],[`path`,{d:`M3.477 10.896a4 4 0 0 1 .585-.396`,key:`ql3yin`}],[`path`,{d:`M6 18a4 4 0 0 1-1.967-.516`,key:`2e4loj`}],[`path`,{d:`M12 13h4`,key:`1ku699`}],[`path`,{d:`M12 18h6a2 2 0 0 1 2 2v1`,key:`105ag5`}],[`path`,{d:`M12 8h8`,key:`1lhi5i`}],[`path`,{d:`M16 8V5a2 2 0 0 1 2-2`,key:`u6izg6`}],[`circle`,{cx:`16`,cy:`13`,r:`.5`,key:`ry7gng`}],[`circle`,{cx:`18`,cy:`3`,r:`.5`,key:`1aiba7`}],[`circle`,{cx:`20`,cy:`21`,r:`.5`,key:`yhc1fs`}],[`circle`,{cx:`20`,cy:`8`,r:`.5`,key:`1e43v0`}]]),y=f(`Download`,[[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`polyline`,{points:`7 10 12 15 17 10`,key:`2ggqvy`}],[`line`,{x1:`12`,x2:`12`,y1:`15`,y2:`3`,key:`1vk2je`}]]),le=f(`Languages`,[[`path`,{d:`m5 8 6 6`,key:`1wu5hv`}],[`path`,{d:`m4 14 6-6 2-3`,key:`1k1g8d`}],[`path`,{d:`M2 5h12`,key:`or177f`}],[`path`,{d:`M7 2h1`,key:`1t2jsx`}],[`path`,{d:`m22 22-5-10-5 10`,key:`don7ne`}],[`path`,{d:`M14 18h6`,key:`1m8k6r`}]]),ue=f(`MessageCircle`,[[`path`,{d:`M7.9 20A9 9 0 1 0 4 16.1L2 22Z`,key:`vv11sd`}]]),de=f(`Palette`,[[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`path`,{d:`M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z`,key:`12rzf8`}]]),b=f(`RefreshCw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),fe=f(`Smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),pe=f(`Wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z`,key:`cbrjhi`}]]),x=`nextclaw.ui.theme`,me=[{value:`warm`,labelKey:`themeWarm`},{value:`cool`,labelKey:`themeCool`}],S=`warm`,C=!1,w=new Set;function T(e){return e===`warm`||e===`cool`}function E(e){typeof document>`u`||document.documentElement.setAttribute(`data-theme`,e)}function D(){if(typeof window>`u`)return`warm`;try{let e=window.localStorage.getItem(x);if(T(e))return e}catch{}return`warm`}function O(){return C||=(S=D(),E(S),!0),S}function k(){return C?S:O()}function A(e){if(O(),e!==S){if(S=e,E(S),typeof window<`u`)try{window.localStorage.setItem(x,S)}catch{}w.forEach(e=>e(S))}}function j(e){return w.add(e),()=>{w.delete(e)}}var M=r(),N={healthy:`bg-emerald-500 shadow-[0_0_0_3px_rgba(16,185,129,0.14)]`,attention:`bg-amber-400 shadow-[0_0_0_3px_rgba(251,191,36,0.16)]`,inactive:`bg-gray-300 shadow-[0_0_0_3px_rgba(156,163,175,0.12)]`};function P(){let e=d(),n=e.actionLabel===t(`runtimeStatusRestartAction`),r=async()=>{if(n)try{let e=await ne.runRuntimeControlAction(`restart-service`);s.success(e.message)}catch(e){let n=e instanceof Error?e.message:t(`runtimeControlActionFailed`);s.error(`${t(`runtimeControlActionFailed`)}: ${n}`)}};return(0,M.jsxs)(ae,{children:[(0,M.jsx)(ie,{asChild:!0,children:(0,M.jsx)(`button`,{type:`button`,className:`inline-flex items-center justify-center rounded-full p-0.5 transition-transform hover:scale-105`,"aria-label":e.title,title:e.title,"data-testid":`runtime-status-entry`,children:(0,M.jsx)(`span`,{className:i(`h-2.5 w-2.5 rounded-full`,N[e.tone])})})}),(0,M.jsxs)(v,{align:`start`,sideOffset:10,className:`w-[290px] space-y-3 rounded-2xl border border-gray-200 bg-white p-4`,children:[(0,M.jsxs)(`div`,{className:`space-y-1`,children:[(0,M.jsx)(`div`,{className:`text-sm font-semibold text-gray-900`,children:e.title}),(0,M.jsx)(`p`,{className:`text-xs leading-5 text-gray-600`,children:e.description})]}),e.reasonLines.length>0?(0,M.jsx)(`div`,{className:`space-y-2`,children:e.reasonLines.map(e=>(0,M.jsx)(`div`,{className:`rounded-xl border border-amber-200 bg-amber-50 px-3 py-2 text-xs leading-5 text-amber-900`,children:e},e))}):null,e.actionLabel?(0,M.jsxs)(`div`,{className:`flex items-center justify-between border-t border-gray-100 pt-1`,children:[(0,M.jsx)(`span`,{className:`text-[11px] text-gray-500`,children:t(`runtimeStatusActionHint`)}),(0,M.jsx)(`button`,{type:`button`,onClick:()=>void r(),disabled:e.isBusy,className:`text-sm font-semibold text-sky-600 transition-colors hover:text-sky-700 disabled:text-gray-400`,children:e.isBusy?t(`runtimeStatusRestartingAction`):e.actionLabel})]}):null]})]})}function F({className:e,suffix:t}){let{data:n}=_(),r=n?.name??`NextClaw`,i=n?.productVersion?.trim(),a=t??(0,M.jsx)(P,{});return(0,M.jsxs)(`div`,{className:e??`flex items-center gap-2.5`,children:[(0,M.jsx)(`div`,{className:`h-7 w-7 rounded-lg overflow-hidden flex items-center justify-center`,children:(0,M.jsx)(`img`,{src:`/logo.svg`,alt:r,className:`h-full w-full object-contain`})}),(0,M.jsxs)(`div`,{className:`flex items-baseline gap-2 min-w-0`,children:[(0,M.jsx)(`span`,{className:`truncate text-[15px] font-semibold tracking-[-0.01em] text-gray-800`,children:r}),i?(0,M.jsxs)(`span`,{className:`text-[13px] font-medium text-gray-500`,children:[`v`,i]}):null,a?(0,M.jsx)(`span`,{className:`inline-flex items-center shrink-0`,children:a}):null]})]})}var I={default:{row:`gap-3 px-3 py-2.5 text-[14px]`,icon:`h-[17px] w-[17px]`,value:`text-xs`,gap:`gap-3`},compact:{row:`gap-2.5 px-3 py-2 text-[13px]`,icon:`h-4 w-4`,value:`text-[11px]`,gap:`gap-2.5`}};function L(e){return I[e]}function R({to:e,label:t,icon:n,density:r=`default`,className:a}){let o=L(r);return(0,M.jsx)(re,{to:e,className:({isActive:e})=>i(`group flex w-full items-center rounded-xl font-medium transition-colors duration-base`,o.row,e?`bg-gray-200 text-gray-900 shadow-sm`:`text-gray-600 hover:bg-gray-200/60 hover:text-gray-900`,a),children:({isActive:e})=>(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(n,{className:i(o.icon,`transition-colors`,e?`text-gray-900`:`text-gray-500 group-hover:text-gray-800`)}),(0,M.jsx)(`span`,{className:`min-w-0 flex-1 text-left`,children:t})]})})}function z({label:e,icon:t,onClick:n,density:r=`default`,className:a,labelClassName:o,trailing:s,trailingClassName:c,testId:l,trailingTestId:u}){let d=L(r);return(0,M.jsxs)(`button`,{type:`button`,onClick:n,className:i(`flex w-full items-center rounded-xl font-medium text-gray-600 transition-all duration-base hover:bg-gray-200/60 hover:text-gray-800`,d.row,a),"data-testid":l,children:[(0,M.jsx)(t,{className:i(d.icon,`shrink-0 text-gray-400`)}),(0,M.jsx)(`span`,{className:i(`min-w-0 flex-1 text-left`,o),children:e}),s?(0,M.jsx)(`span`,{className:i(`shrink-0 text-gray-500`,d.value,c),"data-testid":u,children:s}):null]})}function he({label:e,icon:t,value:n,valueLabel:r,onValueChange:a,density:o=`default`,children:s}){let c=L(o);return(0,M.jsxs)(h,{value:n,onValueChange:a,children:[(0,M.jsxs)(p,{className:i(`h-auto w-full rounded-xl border-0 bg-transparent font-medium text-gray-600 shadow-none hover:bg-gray-200/60 focus:ring-0`,c.row),children:[(0,M.jsxs)(`div`,{className:i(`flex min-w-0 items-center`,c.gap),children:[(0,M.jsx)(t,{className:i(c.icon,`text-gray-400`)}),(0,M.jsx)(`span`,{className:`text-left`,children:e})]}),(0,M.jsx)(`span`,{className:i(`ml-auto text-gray-500`,c.value),children:r})]}),(0,M.jsx)(m,{children:s})]})}var B=`nextclaw-pwa-install-banner-dismissed`,V=`nextclaw-pwa-install-banner-dismissed-until`;function H(){let e=W();return e?e.getItem(`nextclaw-pwa-install-banner-dismissed`)===`1`?!0:_e(e):!1}function ge(){let e=W();e?.setItem(B,`1`),e?.removeItem(V)}function U(){let e=W();e?.removeItem(B),e?.removeItem(V)}function W(){if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function _e(e){let t=e.getItem(V);if(!t)return!1;let n=Number.parseInt(t,10);return e.removeItem(V),!Number.isFinite(n)||n<=Date.now()?!1:(e.setItem(B,`1`),!0)}function G(){return{initialized:!1,installability:`unsupported`,installMethod:`none`,blockedReason:`missing-browser-support`,dismissedInstallPrompt:H(),updateAvailable:!1,registrationFailed:!1}}var K=u(()=>G()),q=`nextclaw-pwa-dev-sw-reset`,J=new class{constructor(){this.started=!1,this.registration=null,this.reloadWhenControllerChanges=!1,this.start=async()=>{if(!(this.started||typeof window>`u`)&&(this.started=!0,!(!(`serviceWorker`in navigator)||!this.isEligibleInstallContext()))){if(this.isDevelopmentServer()){await this.cleanupDevelopmentRegistrations();return}try{let e=await navigator.serviceWorker.register(`/sw.js`);this.registration=e,this.bindRegistration(e),navigator.serviceWorker.addEventListener(`controllerchange`,this.handleControllerChange),await this.syncUpdateAvailability()}catch{K.setState({registrationFailed:!0})}}},this.syncUpdateAvailability=async()=>{if(typeof window>`u`||!(`serviceWorker`in navigator)||typeof navigator.serviceWorker.getRegistration!=`function`){K.setState({updateAvailable:!1});return}let e=this.registration??await navigator.serviceWorker.getRegistration(`/sw.js`)??null;K.setState({updateAvailable:this.shouldSurfaceUpdate(e)})},this.applyUpdate=async()=>{let e=this.registration??await navigator.serviceWorker.getRegistration(`/sw.js`)??null;if(!e){window.location.reload();return}e.waiting||await e.update();let t=e.waiting;if(!t){window.location.reload();return}this.reloadWhenControllerChanges=!0,t.postMessage({type:`SKIP_WAIT`})},this.stop=()=>{!this.started||typeof window>`u`||!(`serviceWorker`in navigator)||(navigator.serviceWorker.removeEventListener(`controllerchange`,this.handleControllerChange),this.started=!1,this.registration=null,this.reloadWhenControllerChanges=!1)},this.bindRegistration=e=>{e.addEventListener(`updatefound`,()=>{let t=e.installing;t&&t.addEventListener(`statechange`,()=>{t.state===`installed`&&this.syncUpdateAvailability()})})},this.handleControllerChange=()=>{this.reloadWhenControllerChanges&&(this.reloadWhenControllerChanges=!1,window.location.reload())},this.isEligibleInstallContext=()=>window.isSecureContext||this.isTrustedLocalhost(window.location.hostname),this.isTrustedLocalhost=e=>e===`localhost`||e===`127.0.0.1`||e===`::1`||e===`[::1]`,this.isDevelopmentServer=()=>!1,this.shouldSurfaceUpdate=e=>!e?.waiting||!navigator.serviceWorker.controller?!1:K.getState().installability===`installed`,this.cleanupDevelopmentRegistrations=async()=>{if(typeof navigator.serviceWorker.getRegistrations!=`function`)return;let e=(await navigator.serviceWorker.getRegistrations()).filter(e=>[e.active?.scriptURL,e.installing?.scriptURL,e.waiting?.scriptURL].filter(e=>!!e).some(e=>e.endsWith(`/sw.js`)));if(e.length===0){this.clearDevResetMarker();return}if(await Promise.all(e.map(async e=>await e.unregister())),await this.clearNextClawCaches(),navigator.serviceWorker.controller&&!this.hasDevResetMarker()){this.setDevResetMarker(),window.location.reload();return}this.clearDevResetMarker()},this.clearNextClawCaches=async()=>{if(typeof window>`u`||!(`caches`in window)||typeof caches.keys!=`function`)return;let e=await caches.keys();await Promise.all(e.filter(e=>e.startsWith(`nextclaw-ui-`)).map(async e=>await caches.delete(e)))},this.hasDevResetMarker=()=>{try{return window.sessionStorage.getItem(q)===`1`}catch{return!1}},this.setDevResetMarker=()=>{try{window.sessionStorage.setItem(q,`1`)}catch{}},this.clearDevResetMarker=()=>{try{window.sessionStorage.removeItem(q)}catch{}}}},Y=new class{constructor(){this.started=!1,this.deferredPrompt=null,this.displayModeMediaQuery=null,this.start=()=>{this.started||typeof window>`u`||(this.started=!0,window.addEventListener(`beforeinstallprompt`,this.handleBeforeInstallPrompt),window.addEventListener(`appinstalled`,this.handleAppInstalled),typeof window.matchMedia==`function`&&(this.displayModeMediaQuery=window.matchMedia(`(display-mode: standalone)`),this.bindDisplayModeListener(this.displayModeMediaQuery,this.handleDisplayModeChanged)),this.refreshState())},this.stop=()=>{!this.started||typeof window>`u`||(window.removeEventListener(`beforeinstallprompt`,this.handleBeforeInstallPrompt),window.removeEventListener(`appinstalled`,this.handleAppInstalled),this.displayModeMediaQuery&&=(this.unbindDisplayModeListener(this.displayModeMediaQuery,this.handleDisplayModeChanged),null),this.deferredPrompt=null,this.started=!1)},this.resetForTests=()=>{this.stop(),K.setState(G())},this.refreshState=()=>{let e=this.resolveInstallability();K.setState(t=>({...t,initialized:!0,installability:e.installability,installMethod:e.installMethod,blockedReason:e.blockedReason,dismissedInstallPrompt:H()})),J.syncUpdateAvailability()},this.dismissInstallPrompt=()=>{ge(),K.setState({dismissedInstallPrompt:!0})},this.promptInstall=async()=>{let e=this.resolveInstallability();if(e.installability!==`available`)return`unavailable`;if(e.installMethod===`manual`||!this.deferredPrompt)return`manual`;this.deferredPrompt.prompt();let n=await this.deferredPrompt.userChoice;return this.deferredPrompt=null,n.outcome===`accepted`?(U(),this.refreshState(),s.success(t(`pwaInstallAccepted`)),`accepted`):(this.dismissInstallPrompt(),this.refreshState(),`dismissed`)},this.handleBeforeInstallPrompt=e=>{e.preventDefault(),this.deferredPrompt=e,this.refreshState()},this.handleAppInstalled=()=>{this.deferredPrompt=null,U(),K.setState({dismissedInstallPrompt:!0}),s.success(t(`pwaInstalledToast`)),this.refreshState()},this.handleDisplayModeChanged=()=>{this.refreshState()},this.resolveInstallability=()=>this.isDevelopmentServer()?{installability:`unsupported`,installMethod:`none`,blockedReason:`dev-server`}:this.hasDesktopHost()?{installability:`suppressed`,installMethod:`none`,blockedReason:`desktop-host`}:this.isStandalone()?{installability:`installed`,installMethod:`none`,blockedReason:null}:this.hasInstallSurfaceSupport()?this.isEligibleInstallContext()?{installability:`available`,installMethod:this.deferredPrompt?`prompt`:`manual`,blockedReason:null}:{installability:`unsupported`,installMethod:`none`,blockedReason:`insecure-context`}:{installability:`unsupported`,installMethod:`none`,blockedReason:`missing-browser-support`},this.hasDesktopHost=()=>typeof window<`u`&&!!window.nextclawDesktop,this.hasInstallSurfaceSupport=()=>typeof window<`u`&&typeof window.matchMedia==`function`&&`serviceWorker`in navigator,this.isEligibleInstallContext=()=>typeof window>`u`?!1:window.isSecureContext||this.isTrustedLocalhost(window.location.hostname),this.isTrustedLocalhost=e=>e===`localhost`||e===`127.0.0.1`||e===`::1`||e===`[::1]`,this.isDevelopmentServer=()=>typeof window<`u`&&!1,this.isStandalone=()=>{if(typeof window>`u`)return!1;let e=window.navigator;return typeof window.matchMedia==`function`&&window.matchMedia(`(display-mode: standalone)`).matches||e.standalone===!0},this.bindDisplayModeListener=(e,t)=>{if(`addEventListener`in e){e.addEventListener(`change`,t);return}e.addListener?.(t)},this.unbindDisplayModeListener=(e,t)=>{if(`removeEventListener`in e){e.removeEventListener(`change`,t);return}e.removeListener?.(t)}}};function ve(){let e=K(e=>e.installability);return(0,M.jsx)(`span`,{className:i(`inline-flex items-center rounded-full border px-3 py-1 text-xs font-medium`,e===`installed`?`bg-emerald-50 text-emerald-700 border-emerald-200`:e===`available`?`bg-amber-50 text-amber-700 border-amber-200`:`bg-gray-100 text-gray-600 border-gray-200`),children:ye(e)})}function ye(e){return t(e===`available`?`pwaInstallStatusAvailable`:e===`installed`?`pwaInstallStatusInstalled`:e===`suppressed`?`pwaInstallStatusDesktopHost`:`pwaInstallStatusUnavailable`)}function be(e,n,r){return t(e===`installed`?`pwaInstallCardInstalled`:e===`suppressed`?`pwaInstallCardSuppressed`:e===`available`&&n===`prompt`?`pwaInstallCardPrompt`:e===`available`?`pwaInstallCardManual`:r===`insecure-context`?`pwaInstallCardInsecureContext`:r===`dev-server`?`pwaInstallCardDevServer`:`pwaInstallCardUnsupported`)}function xe(){let e=K(e=>e.installability),n=K(e=>e.installMethod),r=K(e=>e.blockedReason);return(0,M.jsxs)(te,{children:[(0,M.jsxs)(ee,{className:`flex flex-row items-start justify-between gap-4 space-y-0`,children:[(0,M.jsxs)(`div`,{className:`space-y-2`,children:[(0,M.jsx)(l,{children:t(`pwaInstallTitle`)}),(0,M.jsx)(o,{children:t(`pwaInstallDescription`)})]}),(0,M.jsx)(ve,{})]}),(0,M.jsxs)(c,{className:`space-y-4`,children:[(0,M.jsx)(`div`,{className:`rounded-2xl border border-gray-200 bg-gray-50/90 p-4`,children:(0,M.jsx)(`p`,{className:`text-sm leading-6 text-gray-700`,children:be(e,n,r)})}),e===`available`&&n===`prompt`?(0,M.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,M.jsxs)(a,{type:`button`,className:`gap-2`,onClick:()=>{Y.promptInstall()},children:[(0,M.jsx)(y,{className:`h-4 w-4`}),t(`pwaInstallAction`)]}),(0,M.jsx)(`p`,{className:`text-sm text-gray-500`,children:t(`pwaInstallPromptHint`)})]}):null,e===`available`&&n===`manual`?(0,M.jsxs)(`div`,{className:`flex items-start gap-3 rounded-2xl border border-dashed border-gray-300 bg-white p-4`,children:[(0,M.jsx)(fe,{className:`mt-0.5 h-4 w-4 text-gray-500`}),(0,M.jsx)(`p`,{className:`text-sm leading-6 text-gray-600`,children:t(`pwaInstallManualHint`)})]}):null]})]})}function Se(){let e=K(e=>e.installability),n=K(e=>e.installMethod),r=K(e=>e.dismissedInstallPrompt);return e!==`available`||n!==`prompt`||r?null:(0,M.jsxs)(`div`,{className:`fixed bottom-5 right-5 z-50 w-[min(420px,calc(100vw-2rem))] rounded-[26px] border border-gray-200 bg-white/95 p-5 shadow-2xl backdrop-blur-xl`,children:[(0,M.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,M.jsxs)(`div`,{className:`space-y-1`,children:[(0,M.jsx)(`p`,{className:`text-sm font-semibold text-gray-900`,children:t(`pwaInstallBannerTitle`)}),(0,M.jsx)(`p`,{className:`text-sm leading-6 text-gray-600`,children:t(`pwaInstallBannerDescription`)})]}),(0,M.jsx)(`button`,{type:`button`,"aria-label":t(`pwaInstallDismiss`),className:`rounded-full p-1 text-gray-400 transition hover:bg-gray-100 hover:text-gray-600`,onClick:()=>{Y.dismissInstallPrompt()},children:(0,M.jsx)(g,{className:`h-4 w-4`})})]}),(0,M.jsxs)(`div`,{className:`mt-4 flex items-center gap-3`,children:[(0,M.jsxs)(a,{type:`button`,size:`sm`,className:`gap-2`,onClick:()=>{Y.promptInstall()},children:[(0,M.jsx)(y,{className:`h-4 w-4`}),t(`pwaInstallAction`)]}),(0,M.jsx)(a,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>{Y.dismissInstallPrompt()},children:t(`pwaInstallDismiss`)})]})]})}function Ce(){let e=K(e=>e.updateAvailable),n=K(e=>e.installability);return!e||n!==`installed`?null:(0,M.jsxs)(`div`,{className:`fixed top-5 right-5 z-50 w-[min(420px,calc(100vw-2rem))] rounded-[26px] border border-gray-200 bg-white/95 p-5 shadow-2xl backdrop-blur-xl`,children:[(0,M.jsx)(`div`,{className:`flex items-start justify-between gap-4`,children:(0,M.jsxs)(`div`,{className:`space-y-1`,children:[(0,M.jsx)(`p`,{className:`text-sm font-semibold text-gray-900`,children:t(`pwaUpdateBannerTitle`)}),(0,M.jsx)(`p`,{className:`text-sm leading-6 text-gray-600`,children:t(`pwaUpdateBannerDescription`)})]})}),(0,M.jsx)(`div`,{className:`mt-4`,children:(0,M.jsxs)(a,{type:`button`,size:`sm`,className:`gap-2`,onClick:()=>{J.applyUpdate()},children:[(0,M.jsx)(b,{className:`h-4 w-4`}),t(`pwaUpdateAction`)]})})]})}var X=!1;function we(){X||typeof window>`u`||(X=!0,Y.start(),J.start())}var Te={warm:`#F9F8F5`,cool:`#F8FAFB`},Z=new class{constructor(){this.syncTheme=e=>{if(typeof document>`u`)return;let t=Te[e];this.updateThemeMeta(t),this.updateSurfaceBackgrounds(t),document.documentElement.style.colorScheme=`light`},this.syncCurrentTheme=()=>{if(typeof document>`u`)return;let e=document.documentElement.getAttribute(`data-theme`)===`cool`?`cool`:`warm`;this.syncTheme(e)},this.updateThemeMeta=e=>{let t=document.querySelector(`meta[name="theme-color"]`);t instanceof HTMLMetaElement&&(t.content=e)},this.updateSurfaceBackgrounds=e=>{document.documentElement.style.backgroundColor=e,document.body.style.backgroundColor=e;let t=document.getElementById(`root`);t&&(t.style.backgroundColor=e)}}},Q=e(n(),1),$=(0,Q.createContext)(null);function Ee({children:e}){let[t,n]=(0,Q.useState)(()=>O());(0,Q.useEffect)(()=>{Z.syncTheme(t)},[t]),(0,Q.useEffect)(()=>j(e=>{n(e)}),[]);let r=(0,Q.useCallback)(e=>{A(e),n(k())},[]),i=(0,Q.useMemo)(()=>({theme:t,setTheme:r}),[t,r]);return(0,M.jsx)($.Provider,{value:i,children:e})}function De(){let e=(0,Q.useContext)($);if(!e)throw Error(`useTheme must be used within ThemeProvider`);return e}export{y as _,xe as a,oe as b,R as c,me as d,pe as f,le as g,ue as h,Se as i,he as l,de as m,De as n,Ce as o,b as p,we as r,z as s,Ee as t,F as u,ce as v,se as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e,m as t,p as n,u as r}from"./i18n-BnNAQpVM.js";import{_ as i,c as a,d as o,f as s,g as c,h as l,i as u,o as d,u as f}from"./es2015-DMSUl3fm.js";import{t as p}from"./dist-DreLBS93.js";import{C as m,E as h,S as g,T as _,w as v,x as y}from"./select-RgeHgn_-.js";var b=e(t(),1),x=n(),[S,C]=l(`Tooltip`,[h]),w=h(),T=`TooltipProvider`,E=700,D=`tooltip.open`,[O,k]=S(T),A=e=>{let{__scopeTooltip:t,delayDuration:n=E,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=b.useRef(!0),s=b.useRef(!1),c=b.useRef(0);return b.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,x.jsx)(O,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:b.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:b.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:b.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};A.displayName=T;var j=`Tooltip`,[ee,M]=S(j),N=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:c,delayDuration:l}=e,u=k(j,e.__scopeTooltip),d=w(t),[f,p]=b.useState(null),m=s(),h=b.useRef(0),g=c??u.disableHoverableContent,v=l??u.delayDuration,y=b.useRef(!1),[S,C]=o({prop:r,defaultProp:i??!1,onChange:e=>{e?(u.onOpen(),document.dispatchEvent(new CustomEvent(D))):u.onClose(),a?.(e)},caller:j}),T=b.useMemo(()=>S?y.current?`delayed-open`:`instant-open`:`closed`,[S]),E=b.useCallback(()=>{window.clearTimeout(h.current),h.current=0,y.current=!1,C(!0)},[C]),O=b.useCallback(()=>{window.clearTimeout(h.current),h.current=0,C(!1)},[C]),A=b.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{y.current=!0,C(!0),h.current=0},v)},[v,C]);return b.useEffect(()=>()=>{h.current&&=(window.clearTimeout(h.current),0)},[]),(0,x.jsx)(_,{...d,children:(0,x.jsx)(ee,{scope:t,contentId:m,open:S,stateAttribute:T,trigger:f,onTriggerChange:p,onTriggerEnter:b.useCallback(()=>{u.isOpenDelayedRef.current?A():E()},[u.isOpenDelayedRef,A,E]),onTriggerLeave:b.useCallback(()=>{g?O():(window.clearTimeout(h.current),h.current=0)},[O,g]),onOpen:E,onClose:O,disableHoverableContent:g,children:n})})};N.displayName=j;var P=`TooltipTrigger`,F=b.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,o=M(P,n),s=k(P,n),l=w(n),u=c(t,b.useRef(null),o.onTriggerChange),d=b.useRef(!1),f=b.useRef(!1),p=b.useCallback(()=>d.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener(`pointerup`,p),[p]),(0,x.jsx)(g,{asChild:!0,...l,children:(0,x.jsx)(a.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:u,onPointerMove:i(e.onPointerMove,e=>{e.pointerType!==`touch`&&!f.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:i(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:i(e.onPointerDown,()=>{o.open&&o.onClose(),d.current=!0,document.addEventListener(`pointerup`,p,{once:!0})}),onFocus:i(e.onFocus,()=>{d.current||o.onOpen()}),onBlur:i(e.onBlur,o.onClose),onClick:i(e.onClick,o.onClose)})})});F.displayName=P;var I=`TooltipPortal`,[L,R]=S(I,{forceMount:void 0}),z=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=M(I,t);return(0,x.jsx)(L,{scope:t,forceMount:n,children:(0,x.jsx)(p,{present:n||a.open,children:(0,x.jsx)(u,{asChild:!0,container:i,children:r})})})};z.displayName=I;var B=`TooltipContent`,V=b.forwardRef((e,t)=>{let n=R(B,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=M(B,e.__scopeTooltip);return(0,x.jsx)(p,{present:r||o.open,children:o.disableHoverableContent?(0,x.jsx)(K,{side:i,...a,ref:t}):(0,x.jsx)(H,{side:i,...a,ref:t})})}),H=b.forwardRef((e,t)=>{let n=M(B,e.__scopeTooltip),r=k(B,e.__scopeTooltip),i=b.useRef(null),a=c(t,i),[o,s]=b.useState(null),{trigger:l,onClose:u}=n,d=i.current,{onPointerInTransitChange:f}=r,p=b.useCallback(()=>{s(null),f(!1)},[f]),m=b.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=re(r,ne(r,n.getBoundingClientRect())),a=ie(t.getBoundingClientRect());s(oe([...i,...a])),f(!0)},[f]);return b.useEffect(()=>()=>p(),[p]),b.useEffect(()=>{if(l&&d){let e=e=>m(e,d),t=e=>m(e,l);return l.addEventListener(`pointerleave`,e),d.addEventListener(`pointerleave`,t),()=>{l.removeEventListener(`pointerleave`,e),d.removeEventListener(`pointerleave`,t)}}},[l,d,m,p]),b.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=l?.contains(t)||d?.contains(t),i=!ae(n,o);r?p():i&&(p(),u())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[l,d,o,u,p]),(0,x.jsx)(K,{...e,ref:a})}),[U,W]=S(j,{isInside:!1}),G=f(`TooltipContent`),K=b.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=M(B,n),l=w(n),{onClose:u}=c;return b.useEffect(()=>(document.addEventListener(D,u),()=>document.removeEventListener(D,u)),[u]),b.useEffect(()=>{if(c.trigger){let e=e=>{e.target?.contains(c.trigger)&&u()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,u]),(0,x.jsx)(d,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,x.jsxs)(v,{"data-state":c.stateAttribute,...l,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,x.jsx)(G,{children:r}),(0,x.jsx)(U,{scope:n,isInside:!0,children:(0,x.jsx)(y,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});V.displayName=B;var q=`TooltipArrow`,te=b.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=w(n);return W(q,n).isInside?null:(0,x.jsx)(m,{...i,...r,ref:t})});te.displayName=q;function ne(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function re(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function ie(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function ae(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function oe(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0),se(t)}function se(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var J=A,Y=N,X=F,Z=z,Q=V,ce=J,le=Y,ue=X,$=b.forwardRef(({className:e,sideOffset:t=4,...n},i)=>(0,x.jsx)(Z,{children:(0,x.jsx)(Q,{ref:i,sideOffset:t,className:r(`z-[var(--z-tooltip)] overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...n})}));$.displayName=Q.displayName;export{Q as a,Y as c,ue as i,X as l,$ as n,Z as o,ce as r,J as s,le as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./createLucideIcon-
|
|
1
|
+
import{t as e}from"./createLucideIcon-C_GFKVuW.js";var t=e(`Trash2`,[[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6`,key:`4alrt4`}],[`path`,{d:`M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2`,key:`v07s0e`}],[`line`,{x1:`10`,x2:`10`,y1:`11`,y2:`17`,key:`1uufr5`}],[`line`,{x1:`14`,x2:`14`,y1:`11`,y2:`17`,key:`xtxkd`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./i18n-BnNAQpVM.js";import{$ as t,B as n,F as r,Ft as i,G as a,I as o,It as s,J as c,K as l,L as u,N as d,P as f,Pt as p,Q as m,R as h,U as g,V as _,W as v,X as y,Y as b,Z as x,_ as S,et as C,g as w,h as T,m as E,p as D,q as O,v as k,y as A,z as j,zt as M}from"./api-DnPN4SyA.js";function ee(){return s({queryKey:[`config`],queryFn:h,staleTime:3e4,refetchOnWindowFocus:!0})}function N(){return s({queryKey:[`app-meta`],queryFn:u,staleTime:1/0})}function P(){return s({queryKey:[`config-meta`],queryFn:j,staleTime:1/0})}function F(){return s({queryKey:[`config-schema`],queryFn:n,staleTime:1/0})}function I(){let t=M();return i({mutationFn:y,onSuccess:()=>{t.invalidateQueries({queryKey:[`config`]}),p.success(e(`configSaved`))},onError:t=>{p.error(e(`configSaveFailed`)+`: `+t.message)}})}function L(){let n=M();return i({mutationFn:({data:e})=>t(e),onSuccess:()=>{n.invalidateQueries({queryKey:[`config`]}),n.invalidateQueries({queryKey:[`config-meta`]}),p.success(e(`configSavedApplied`))},onError:t=>{p.error(e(`configSaveFailed`)+`: `+t.message)}})}function R(){let t=M();return i({mutationFn:({provider:e,data:t})=>x(e,t),onSuccess:()=>{t.invalidateQueries({queryKey:[`config`]}),t.invalidateQueries({queryKey:[`config-meta`]}),p.success(e(`configSaved`))},onError:t=>{p.error(e(`configSaveFailed`)+`: `+t.message)}})}function z(){let t=M();return i({mutationFn:({data:e})=>d(e??{}),onSuccess:()=>{t.invalidateQueries({queryKey:[`config`]}),t.invalidateQueries({queryKey:[`config-meta`]}),p.success(e(`configSaved`))},onError:t=>{p.error(e(`configSaveFailed`)+`: `+t.message)}})}function B(){let t=M();return i({mutationFn:({provider:e})=>r(e),onSuccess:()=>{t.invalidateQueries({queryKey:[`config`]}),t.invalidateQueries({queryKey:[`config-meta`]}),p.success(e(`configSaved`))},onError:t=>{p.error(e(`configSaveFailed`)+`: `+t.message)}})}function V(){return i({mutationFn:({provider:e,data:t})=>c(e,t)})}function H(){return i({mutationFn:({provider:e,data:t})=>O(e,t)})}function U(){return i({mutationFn:({provider:e,data:t})=>v(e,t)})}function W(){return i({mutationFn:({provider:e})=>g(e)})}function G(){let t=M();return i({mutationFn:({channel:e,data:t})=>b(e,t),onSuccess:()=>{t.invalidateQueries({queryKey:[`config`]}),t.invalidateQueries({queryKey:[`config-meta`]}),p.success(e(`configSavedApplying`))},onError:t=>{p.error(e(`configSaveFailed`)+`: `+t.message)}})}function K(){let t=M();return i({mutationFn:({data:e})=>m(e),onSuccess:()=>{t.invalidateQueries({queryKey:[`config`]}),p.success(e(`configSavedApplied`))},onError:t=>{p.error(e(`configSaveFailed`)+`: `+t.message)}})}function q(){let t=M();return i({mutationFn:({data:e})=>C(e),onSuccess:()=>{t.invalidateQueries({queryKey:[`config`]}),p.success(e(`configSavedApplied`))},onError:t=>{p.error(e(`configSaveFailed`)+`: `+t.message)}})}function J(){return i({mutationFn:({actionId:e,data:t})=>o(e,t),onError:t=>{p.error(e(`error`)+`: `+t.message)}})}function Y(e){return s({queryKey:[`ncp-sessions`,e?.limit??null],queryFn:()=>k(e),staleTime:5e3,retry:!1})}function X(e,t=200){return s({queryKey:[`ncp-session-messages`,e,t],queryFn:()=>w(e,t),enabled:!!e,staleTime:5e3,retry:!1})}function Z(e){return s({queryKey:[`ncp-session-skills`,e.sessionId,e.projectRoot??null],queryFn:()=>S(e.sessionId,{...Object.prototype.hasOwnProperty.call(e,`projectRoot`)?{projectRoot:e.projectRoot??null}:{}}),enabled:!!e.sessionId,staleTime:5e3,retry:!1})}function Q(){let t=M();return i({mutationFn:({sessionId:e})=>T(e),onSuccess:(n,r)=>{D(t,r.sessionId),t.removeQueries({queryKey:[`ncp-session-messages`,r.sessionId]}),p.success(e(`configSavedApplied`))},onError:t=>{p.error(e(`configSaveFailed`)+`: `+t.message)}})}function $(){let t=M();return i({mutationFn:({sessionId:e,data:t})=>A(e,t),onSuccess:n=>{E(t,n),t.invalidateQueries({queryKey:[`ncp-session-skills`,n.sessionId]}),p.success(e(`configSavedApplied`))},onError:t=>{p.error(e(`configSaveFailed`)+`: `+t.message)}})}function te(e={all:!0}){return s({queryKey:[`cron`,e],queryFn:()=>_(e),staleTime:1e4})}function ne(){let t=M();return i({mutationFn:({id:e})=>f(e),onSuccess:()=>{t.invalidateQueries({queryKey:[`cron`]}),p.success(e(`configSavedApplied`))},onError:t=>{p.error(e(`configSaveFailed`)+`: `+t.message)}})}function re(){let t=M();return i({mutationFn:({id:e,enabled:t})=>l(e,{enabled:t}),onSuccess:()=>{t.invalidateQueries({queryKey:[`cron`]}),p.success(e(`configSavedApplied`))},onError:t=>{p.error(e(`configSaveFailed`)+`: `+t.message)}})}function ie(){let t=M();return i({mutationFn:({id:e,force:t})=>a(e,{force:t}),onSuccess:()=>{t.invalidateQueries({queryKey:[`cron`]}),p.success(e(`configSavedApplied`))},onError:t=>{p.error(e(`configSaveFailed`)+`: `+t.message)}})}export{R as C,q as E,$ as S,L as T,H as _,z as a,G as b,Q as c,W as d,X as f,ie as g,U as h,F as i,B as l,Y as m,ee as n,te as o,Z as p,P as r,ne as s,N as t,J as u,V as v,K as w,I as x,re as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e,i as t,m as n,p as r}from"./i18n-BnNAQpVM.js";import{At as i}from"./api-DnPN4SyA.js";import{a,i as o,n as s,o as c,r as l,t as u}from"./dialog-D-I7ONHQ.js";var d=e(n(),1),f=r(),p=({open:e,onOpenChange:n,title:r,description:d,confirmLabel:p=t(`confirm`),cancelLabel:m=t(`cancel`),variant:h=`default`,onConfirm:g,onCancel:_})=>(0,f.jsx)(u,{open:e,onOpenChange:n,children:(0,f.jsxs)(s,{className:`[&>:last-child]:hidden`,onCloseAutoFocus:e=>e.preventDefault(),children:[(0,f.jsxs)(a,{children:[(0,f.jsx)(c,{children:r}),d?(0,f.jsx)(l,{children:d}):null]}),(0,f.jsxs)(o,{className:`gap-2 sm:gap-0`,children:[(0,f.jsx)(i,{type:`button`,variant:`outline`,onClick:()=>{_(),n(!1)},children:m}),(0,f.jsx)(i,{type:`button`,variant:h===`destructive`?`destructive`:`default`,onClick:()=>{g(),n(!1)},children:p})]})]})}),m={open:!1,title:``,description:``,confirmLabel:t(`confirm`),cancelLabel:t(`cancel`),variant:`default`,resolve:null};function h(){let[e,n]=(0,d.useState)(m),r=(0,d.useCallback)(e=>new Promise(r=>{n({open:!0,title:e.title,description:e.description??``,confirmLabel:e.confirmLabel??t(`confirm`),cancelLabel:e.cancelLabel??t(`cancel`),variant:e.variant??`default`,resolve:e=>{r(e),n(e=>({...e,open:!1,resolve:null}))}})}),[]),i=(0,d.useCallback)(e=>{n(t=>(!e&&t.resolve&&t.resolve(!1),{...t,open:e,resolve:e?t.resolve:null}))},[]);return{confirm:r,ConfirmDialog:(0,d.useCallback)(()=>(0,f.jsx)(p,{open:e.open,onOpenChange:i,title:e.title,description:e.description||void 0,confirmLabel:e.confirmLabel,cancelLabel:e.cancelLabel,variant:e.variant,onConfirm:()=>e.resolve?.(!0),onCancel:()=>e.resolve?.(!1)}),[e,i])}}export{h as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e,i as t,m as n,p as r}from"./i18n-BnNAQpVM.js";import{Bt as i,Ht as a,Lt as o,Ut as s,Vt as c}from"./api-DnPN4SyA.js";import{t as l}from"./createLucideIcon-C_GFKVuW.js";import{a as u,i as d,n as f,r as p,t as m}from"./select-RgeHgn_-.js";import{t as h}from"./skeleton-5Mg6vZHN.js";var g=class extends s{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:a()})}getOptimisticResult(e){return e.behavior=a(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:a,isRefetching:o,isError:s,isRefetchError:l}=r,u=n.fetchMeta?.fetchMore?.direction,d=s&&u===`forward`,f=a&&u===`forward`,p=s&&u===`backward`,m=a&&u===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:i(t,n.data),hasPreviousPage:c(t,n.data),isFetchNextPageError:d,isFetchingNextPage:f,isFetchPreviousPageError:p,isFetchingPreviousPage:m,isRefetchError:l&&!d&&!p,isRefetching:o&&!f&&!m}}};function _(e,t){return o(e,g,t)}var v=l(`PackageSearch`,[[`path`,{d:`M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14`,key:`e7tb2h`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`line`,{x1:`12`,x2:`12`,y1:`22`,y2:`12`,key:`a4e8g8`}],[`circle`,{cx:`18.5`,cy:`15.5`,r:`2.5`,key:`b5zd12`}],[`path`,{d:`M20.27 17.27 22 19`,key:`1l4muz`}]]);function y(e){if(!e||e.pages.length===0)return;let t=e.pages.flatMap(e=>e.items);return{...e.pages[e.pages.length-1],items:t,pages:e.pages,loadedItems:t.length,loadedPages:e.pages.length}}var b=r();function x({scope:e,searchText:n,searchPlaceholder:r,sort:i,onSearchTextChange:a,onSortChange:o}){return(0,b.jsx)(`div`,{className:`mb-4`,children:(0,b.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,b.jsxs)(`div`,{className:`relative min-w-0 flex-1`,children:[(0,b.jsx)(v,{className:`absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400`}),(0,b.jsx)(`input`,{value:n,onChange:e=>a(e.target.value),placeholder:r,className:`h-9 w-full rounded-xl border border-gray-200/80 pl-9 pr-3 text-sm focus:outline-none focus:ring-1 focus:ring-primary/40`})]}),e===`all`&&(0,b.jsxs)(m,{value:i,onValueChange:e=>o(e),children:[(0,b.jsx)(d,{className:`h-9 w-[150px] shrink-0 rounded-lg`,children:(0,b.jsx)(u,{})}),(0,b.jsxs)(f,{children:[(0,b.jsx)(p,{value:`relevance`,children:t(`marketplaceSortRelevance`)}),(0,b.jsx)(p,{value:`updated`,children:t(`marketplaceSortUpdated`)})]})]})]})})}function S({count:e}){return(0,b.jsx)(b.Fragment,{children:Array.from({length:e},(e,t)=>(0,b.jsx)(`article`,{className:`rounded-2xl border border-gray-200/40 bg-white px-5 py-4 shadow-sm`,children:(0,b.jsxs)(`div`,{className:`flex items-start justify-between gap-3.5`,children:[(0,b.jsxs)(`div`,{className:`flex min-w-0 flex-1 gap-3`,children:[(0,b.jsx)(h,{className:`h-10 w-10 shrink-0 rounded-xl`}),(0,b.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2 pt-0.5`,children:[(0,b.jsx)(h,{className:`h-4 w-32 max-w-[70%]`}),(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsx)(h,{className:`h-3 w-12`}),(0,b.jsx)(h,{className:`h-3 w-24`})]}),(0,b.jsx)(h,{className:`h-3 w-full`})]})]}),(0,b.jsx)(h,{className:`h-8 w-20 shrink-0 rounded-xl`})]})},`marketplace-skeleton-${t}`))})}function C({hasMore:e,loading:n,sentinelRef:r}){return!e&&!n?null:(0,b.jsxs)(`div`,{className:`py-4`,children:[e&&(0,b.jsx)(`div`,{ref:r,className:`h-1 w-full`,"aria-hidden":`true`}),n&&(0,b.jsx)(`div`,{"data-testid":`marketplace-loading-more`,className:`pt-3 text-center text-xs text-gray-500`,children:t(`loading`)})]})}function w(e){let t=e.trim().toLowerCase().replace(/_/g,`-`),n=[t,t.split(`-`)[0],`en`];return Array.from(new Set(n.filter(Boolean)))}function T(e){return e.trim().toLowerCase().replace(/_/g,`-`)}function E(e,t,n){if(e){let t=Object.entries(e).map(([e,t])=>({locale:T(e),text:typeof t==`string`?t.trim():``})).filter(e=>e.text.length>0);if(t.length>0){let e=new Map(t.map(e=>[e.locale,e.text]));for(let t of n){let n=T(t),r=e.get(n);if(r)return r}for(let e of n){let n=T(e).split(`-`)[0];if(!n)continue;let r=t.find(e=>e.locale===n||e.locale.startsWith(`${n}-`));if(r)return r.text}return t[0]?.text??``}}return t?.trim()??``}function D(e,t){if(!e)return``;for(let n of t)if(T(n).split(`-`)[0]===`zh`&&e.descriptionZh?.trim())return e.descriptionZh.trim();return e.description?.trim()?e.description.trim():e.descriptionZh?.trim()?e.descriptionZh.trim():``}var O=e(n(),1),k=160;function A(e){let t=(0,O.useRef)(null),n=(0,O.useRef)(null),r=(0,O.useRef)(e.onLoadMore),i=(0,O.useRef)(!1);return(0,O.useEffect)(()=>{r.current=e.onLoadMore},[e.onLoadMore]),(0,O.useEffect)(()=>{e.disabled&&(i.current=!1)},[e.disabled]),(0,O.useEffect)(()=>{let a=t.current,o=n.current,s=e.thresholdPx??k;if(e.disabled||!a||!o)return;let c=()=>{i.current||e.disabled||(i.current=!0,Promise.resolve(r.current()).finally(()=>{i.current=!1}))},l=()=>{o.getBoundingClientRect().top-a.getBoundingClientRect().bottom<=s&&c()};if(typeof IntersectionObserver==`function`){let e=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&c()},{root:a,rootMargin:`0px 0px ${s}px 0px`});return e.observe(o),l(),()=>{e.disconnect()}}return a.addEventListener(`scroll`,l,{passive:!0}),l(),()=>{a.removeEventListener(`scroll`,l)}},[e.disabled,e.thresholdPx,e.watchValue]),{containerRef:t,sentinelRef:n}}export{x as a,y as c,E as i,_ as l,w as n,C as o,D as r,S as s,A as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e,m as t}from"./i18n-BnNAQpVM.js";import{bt as n}from"./api-DnPN4SyA.js";function r(e){return typeof e!=`number`||!Number.isFinite(e)?`desktop`:e<=767?`mobile`:`desktop`}function i(){let e=typeof window>`u`?null:window.innerWidth??null;return{mode:r(e),width:e}}var a=n(()=>i()),o=new class{constructor(){this.consumerCount=0,this.started=!1,this.attach=()=>(this.consumerCount+=1,this.consumerCount===1&&this.start(),()=>{this.consumerCount=Math.max(0,this.consumerCount-1),this.consumerCount===0&&this.stop()}),this.start=()=>{this.started||typeof window>`u`||(this.started=!0,window.addEventListener(`resize`,this.handleViewportChange),window.addEventListener(`orientationchange`,this.handleViewportChange),this.syncFromWindow())},this.stop=()=>{!this.started||typeof window>`u`||(window.removeEventListener(`resize`,this.handleViewportChange),window.removeEventListener(`orientationchange`,this.handleViewportChange),this.started=!1)},this.getSnapshot=()=>a.getState(),this.resetForTests=()=>{this.consumerCount=0,this.stop(),a.setState(i())},this.handleViewportChange=()=>{this.syncFromWindow()},this.syncFromWindow=()=>{if(typeof window>`u`)return;let e=window.innerWidth??null;a.setState({width:e,mode:r(e)})}}},s=e(t(),1);function c(){(0,s.useEffect)(()=>o.attach(),[]);let e=a(e=>e.mode);return{mode:e,isMobile:e===`mobile`,isDesktop:e===`desktop`}}export{o as n,c as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./createLucideIcon-C_GFKVuW.js";var t=e(`X`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);export{t};
|
package/dist/index.html
CHANGED
|
@@ -78,28 +78,45 @@
|
|
|
78
78
|
})();
|
|
79
79
|
</script>
|
|
80
80
|
<title>NextClaw</title>
|
|
81
|
-
<script type="module" crossorigin src="/assets/index-
|
|
82
|
-
<link rel="modulepreload" crossorigin href="/assets/i18n-
|
|
83
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
84
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
85
|
-
<link rel="modulepreload" crossorigin href="/assets/createLucideIcon-
|
|
86
|
-
<link rel="modulepreload" crossorigin href="/assets/select-
|
|
87
|
-
<link rel="modulepreload" crossorigin href="/assets/dist-
|
|
88
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
89
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
90
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
91
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
92
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
93
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
94
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
95
|
-
<link rel="modulepreload" crossorigin href="/assets/search-
|
|
96
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
97
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
98
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
99
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
100
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
101
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
102
|
-
<link rel="
|
|
81
|
+
<script type="module" crossorigin src="/assets/index-Bc6c1kIx.js"></script>
|
|
82
|
+
<link rel="modulepreload" crossorigin href="/assets/i18n-BnNAQpVM.js">
|
|
83
|
+
<link rel="modulepreload" crossorigin href="/assets/api-DnPN4SyA.js">
|
|
84
|
+
<link rel="modulepreload" crossorigin href="/assets/es2015-DMSUl3fm.js">
|
|
85
|
+
<link rel="modulepreload" crossorigin href="/assets/createLucideIcon-C_GFKVuW.js">
|
|
86
|
+
<link rel="modulepreload" crossorigin href="/assets/select-RgeHgn_-.js">
|
|
87
|
+
<link rel="modulepreload" crossorigin href="/assets/dist-DreLBS93.js">
|
|
88
|
+
<link rel="modulepreload" crossorigin href="/assets/x-BjMO7v8q.js">
|
|
89
|
+
<link rel="modulepreload" crossorigin href="/assets/dialog-D-I7ONHQ.js">
|
|
90
|
+
<link rel="modulepreload" crossorigin href="/assets/popover-Dm_NQ3Cs.js">
|
|
91
|
+
<link rel="modulepreload" crossorigin href="/assets/tooltip-DQlSKhZ_.js">
|
|
92
|
+
<link rel="modulepreload" crossorigin href="/assets/chunk-JZWAC4HX-BJer-fqD.js">
|
|
93
|
+
<link rel="modulepreload" crossorigin href="/assets/use-config-CrsavfWZ.js">
|
|
94
|
+
<link rel="modulepreload" crossorigin href="/assets/theme-provider-CUppbOyN.js">
|
|
95
|
+
<link rel="modulepreload" crossorigin href="/assets/search-DZSNKEGp.js">
|
|
96
|
+
<link rel="modulepreload" crossorigin href="/assets/book-open-B4mOKdz8.js">
|
|
97
|
+
<link rel="modulepreload" crossorigin href="/assets/external-link-DP2IJ7AM.js">
|
|
98
|
+
<link rel="modulepreload" crossorigin href="/assets/folder-BPwc278w.js">
|
|
99
|
+
<link rel="modulepreload" crossorigin href="/assets/logos-BcELLmYh.js">
|
|
100
|
+
<link rel="modulepreload" crossorigin href="/assets/loader-circle-C6gg2m2a.js">
|
|
101
|
+
<link rel="modulepreload" crossorigin href="/assets/plus-BptLViq1.js">
|
|
102
|
+
<link rel="modulepreload" crossorigin href="/assets/refresh-ccw-CeG203yU.js">
|
|
103
|
+
<link rel="modulepreload" crossorigin href="/assets/settings-DjvNMJde.js">
|
|
104
|
+
<link rel="modulepreload" crossorigin href="/assets/sparkles-CyDTgTM4.js">
|
|
105
|
+
<link rel="modulepreload" crossorigin href="/assets/trash-2-C1cdqL6V.js">
|
|
106
|
+
<link rel="modulepreload" crossorigin href="/assets/doc-browser-context-Dib9sS83.js">
|
|
107
|
+
<link rel="modulepreload" crossorigin href="/assets/doc-browser-CoKIUCJj.js">
|
|
108
|
+
<link rel="modulepreload" crossorigin href="/assets/doc-browser-CwgI7ipB.js">
|
|
109
|
+
<link rel="modulepreload" crossorigin href="/assets/use-viewport-layout-CytJAPWM.js">
|
|
110
|
+
<link rel="modulepreload" crossorigin href="/assets/logo-badge-uB4SwANR.js">
|
|
111
|
+
<link rel="modulepreload" crossorigin href="/assets/skeleton-5Mg6vZHN.js">
|
|
112
|
+
<link rel="modulepreload" crossorigin href="/assets/chat-C0ZNZtS3.js">
|
|
113
|
+
<link rel="modulepreload" crossorigin href="/assets/key-round-BQXmPSxD.js">
|
|
114
|
+
<link rel="modulepreload" crossorigin href="/assets/message-square-CLVODA23.js">
|
|
115
|
+
<link rel="modulepreload" crossorigin href="/assets/app-navigation.config-B5YIdRju.js">
|
|
116
|
+
<link rel="modulepreload" crossorigin href="/assets/notice-card-DX_NEZTQ.js">
|
|
117
|
+
<link rel="modulepreload" crossorigin href="/assets/status-dot-aQU9Mia4.js">
|
|
118
|
+
<link rel="modulepreload" crossorigin href="/assets/app-manager-provider-M7TngYxx.js">
|
|
119
|
+
<link rel="stylesheet" crossorigin href="/assets/index-mRmSAB-e.css">
|
|
103
120
|
</head>
|
|
104
121
|
|
|
105
122
|
<body>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nextclaw/ui",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.12",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
"tailwind-merge": "^2.5.4",
|
|
29
29
|
"zod": "^3.23.8",
|
|
30
30
|
"zustand": "^5.0.2",
|
|
31
|
-
"@nextclaw/ncp": "0.5.
|
|
32
|
-
"@nextclaw/ncp-
|
|
33
|
-
"@nextclaw/
|
|
34
|
-
"@nextclaw/agent-
|
|
31
|
+
"@nextclaw/ncp": "0.5.5",
|
|
32
|
+
"@nextclaw/ncp-react": "0.4.25",
|
|
33
|
+
"@nextclaw/agent-chat-ui": "0.3.9",
|
|
34
|
+
"@nextclaw/ncp-http-agent-client": "0.3.17",
|
|
35
35
|
"@nextclaw/agent-chat": "0.1.10"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { createContext, useContext, type ReactNode } from 'react';
|
|
2
|
+
import { appManager, type AppManager } from '@/app/managers/app.manager';
|
|
3
|
+
|
|
4
|
+
const AppManagerContext = createContext<AppManager | null>(null);
|
|
5
|
+
|
|
6
|
+
type AppManagerProviderProps = {
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export function AppManagerProvider({ children }: AppManagerProviderProps) {
|
|
11
|
+
return <AppManagerContext.Provider value={appManager}>{children}</AppManagerContext.Provider>;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function useAppManager() {
|
|
15
|
+
const manager = useContext(AppManagerContext);
|
|
16
|
+
if (!manager) {
|
|
17
|
+
throw new Error('useAppManager must be used inside AppManagerProvider');
|
|
18
|
+
}
|
|
19
|
+
return manager;
|
|
20
|
+
}
|
|
@@ -1,10 +1,22 @@
|
|
|
1
1
|
import { render, screen } from "@testing-library/react";
|
|
2
2
|
import { MemoryRouter, Route, Routes } from "react-router-dom";
|
|
3
3
|
import { describe, expect, it, vi } from "vitest";
|
|
4
|
-
import { AppLayout } from "@/components/layout/
|
|
5
|
-
import { I18nProvider } from "@/components/
|
|
4
|
+
import { AppLayout } from "@/app/components/layout/app-layout";
|
|
5
|
+
import { I18nProvider } from "@/app/components/i18n-provider";
|
|
6
6
|
|
|
7
|
-
vi.
|
|
7
|
+
const { useViewportLayoutMock } = vi.hoisted(() => ({
|
|
8
|
+
useViewportLayoutMock: vi.fn(() => ({
|
|
9
|
+
mode: "desktop" as "mobile" | "desktop",
|
|
10
|
+
isMobile: false,
|
|
11
|
+
isDesktop: true,
|
|
12
|
+
})),
|
|
13
|
+
}));
|
|
14
|
+
|
|
15
|
+
vi.mock("@/app/hooks/use-viewport-layout", () => ({
|
|
16
|
+
useViewportLayout: useViewportLayoutMock,
|
|
17
|
+
}));
|
|
18
|
+
|
|
19
|
+
vi.mock("@/app/components/layout/sidebar", () => ({
|
|
8
20
|
Sidebar: () => (
|
|
9
21
|
<aside data-testid="settings-sidebar-header">Settings Sidebar</aside>
|
|
10
22
|
),
|
|
@@ -59,4 +71,39 @@ describe("AppLayout", () => {
|
|
|
59
71
|
expect(main?.className).toContain("overflow-auto");
|
|
60
72
|
expect(main?.className).not.toContain("xl:overflow-hidden");
|
|
61
73
|
});
|
|
74
|
+
|
|
75
|
+
it("switches to the mobile shell when the viewport layout is mobile", () => {
|
|
76
|
+
useViewportLayoutMock.mockReturnValue({
|
|
77
|
+
mode: "mobile",
|
|
78
|
+
isMobile: true,
|
|
79
|
+
isDesktop: false,
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
const { container } = render(
|
|
83
|
+
<I18nProvider>
|
|
84
|
+
<MemoryRouter initialEntries={["/chat"]}>
|
|
85
|
+
<Routes>
|
|
86
|
+
<Route
|
|
87
|
+
path="*"
|
|
88
|
+
element={
|
|
89
|
+
<AppLayout>
|
|
90
|
+
<div data-testid="chat-content">Chat Content</div>
|
|
91
|
+
</AppLayout>
|
|
92
|
+
}
|
|
93
|
+
/>
|
|
94
|
+
</Routes>
|
|
95
|
+
</MemoryRouter>
|
|
96
|
+
</I18nProvider>,
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
expect(screen.getByTestId("chat-content")).toBeTruthy();
|
|
100
|
+
expect(screen.queryByTestId("settings-sidebar-header")).toBeNull();
|
|
101
|
+
expect(container.querySelector("aside")).toBeNull();
|
|
102
|
+
|
|
103
|
+
useViewportLayoutMock.mockReturnValue({
|
|
104
|
+
mode: "desktop",
|
|
105
|
+
isMobile: false,
|
|
106
|
+
isDesktop: true,
|
|
107
|
+
});
|
|
108
|
+
});
|
|
62
109
|
});
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { useEffect } from "react";
|
|
2
|
+
import { useLocation } from "react-router-dom";
|
|
3
|
+
import {
|
|
4
|
+
DocBrowserProvider,
|
|
5
|
+
useDocBrowser,
|
|
6
|
+
} from "@/shared/components/doc-browser/doc-browser-context";
|
|
7
|
+
import { useDocLinkInterceptor } from "@/shared/components/doc-browser/use-doc-link-interceptor";
|
|
8
|
+
import { useI18n } from "@/app/components/i18n-provider";
|
|
9
|
+
import { useViewportLayout } from "@/app/hooks/use-viewport-layout";
|
|
10
|
+
import { DesktopAppShell } from "@/platforms/desktop";
|
|
11
|
+
import { MobileAppShell } from "@/platforms/mobile";
|
|
12
|
+
import { resolveUiDocumentTitle } from "@/shared/lib/ui-document-title";
|
|
13
|
+
|
|
14
|
+
interface AppLayoutProps {
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function AppLayoutInner({ children }: AppLayoutProps) {
|
|
19
|
+
const { isOpen, mode } = useDocBrowser();
|
|
20
|
+
useDocLinkInterceptor();
|
|
21
|
+
const { pathname } = useLocation();
|
|
22
|
+
const { language } = useI18n();
|
|
23
|
+
const { isMobile } = useViewportLayout();
|
|
24
|
+
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
document.title = resolveUiDocumentTitle(pathname);
|
|
27
|
+
}, [pathname, language]);
|
|
28
|
+
|
|
29
|
+
if (isMobile) {
|
|
30
|
+
return (
|
|
31
|
+
<MobileAppShell pathname={pathname} isDocBrowserOpen={isOpen}>
|
|
32
|
+
{children}
|
|
33
|
+
</MobileAppShell>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<DesktopAppShell
|
|
39
|
+
pathname={pathname}
|
|
40
|
+
isDocBrowserOpen={isOpen}
|
|
41
|
+
docBrowserMode={mode}
|
|
42
|
+
>
|
|
43
|
+
{children}
|
|
44
|
+
</DesktopAppShell>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function AppLayout({ children }: AppLayoutProps) {
|
|
49
|
+
return (
|
|
50
|
+
<DocBrowserProvider>
|
|
51
|
+
<AppLayoutInner>{children}</AppLayoutInner>
|
|
52
|
+
</DocBrowserProvider>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { render, screen, waitFor } from '@testing-library/react';
|
|
2
|
+
import userEvent from '@testing-library/user-event';
|
|
3
|
+
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
|
4
|
+
import { toast } from 'sonner';
|
|
5
|
+
import { RuntimeStatusEntry } from '@/app/components/layout/runtime-status-entry';
|
|
6
|
+
import { setLanguage } from '@/shared/lib/i18n';
|
|
7
|
+
|
|
8
|
+
const mocks = vi.hoisted(() => ({
|
|
9
|
+
useRuntimeStatusBadgeView: vi.fn(),
|
|
10
|
+
runRuntimeControlAction: vi.fn(),
|
|
11
|
+
}));
|
|
12
|
+
|
|
13
|
+
vi.mock('sonner', () => ({
|
|
14
|
+
toast: {
|
|
15
|
+
success: vi.fn(),
|
|
16
|
+
error: vi.fn(),
|
|
17
|
+
},
|
|
18
|
+
}));
|
|
19
|
+
|
|
20
|
+
vi.mock('@/features/system-status', () => ({
|
|
21
|
+
useRuntimeStatusBadgeView: (...args: unknown[]) =>
|
|
22
|
+
mocks.useRuntimeStatusBadgeView(...args),
|
|
23
|
+
systemStatusManager: {
|
|
24
|
+
runRuntimeControlAction: (...args: unknown[]) =>
|
|
25
|
+
mocks.runRuntimeControlAction(...args),
|
|
26
|
+
},
|
|
27
|
+
}));
|
|
28
|
+
|
|
29
|
+
describe('RuntimeStatusEntry', () => {
|
|
30
|
+
beforeEach(() => {
|
|
31
|
+
setLanguage('zh');
|
|
32
|
+
vi.clearAllMocks();
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it('shows a compact pending-restart entry with reasons and a restart action', async () => {
|
|
36
|
+
const user = userEvent.setup();
|
|
37
|
+
|
|
38
|
+
mocks.useRuntimeStatusBadgeView.mockReturnValue({
|
|
39
|
+
tone: 'attention',
|
|
40
|
+
title: '待重启',
|
|
41
|
+
description:
|
|
42
|
+
'这些改动已经保存,但不会自动重启。你可以在这里查看原因,并在方便的时候手动重启。',
|
|
43
|
+
reasonLines: [
|
|
44
|
+
'plugins 改动将在重启后生效。',
|
|
45
|
+
'ui 改动将在重启后生效。',
|
|
46
|
+
],
|
|
47
|
+
actionLabel: '立即重启',
|
|
48
|
+
isBusy: false,
|
|
49
|
+
});
|
|
50
|
+
mocks.runRuntimeControlAction.mockResolvedValue({
|
|
51
|
+
accepted: true,
|
|
52
|
+
action: 'restart-service',
|
|
53
|
+
lifecycle: 'restarting-service',
|
|
54
|
+
message: 'Restart scheduled. This page may disconnect for a few seconds.',
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
render(<RuntimeStatusEntry />);
|
|
58
|
+
|
|
59
|
+
await user.click(screen.getByTestId('runtime-status-entry'));
|
|
60
|
+
|
|
61
|
+
expect(screen.getByText('待重启')).toBeTruthy();
|
|
62
|
+
expect(
|
|
63
|
+
screen.getByText(
|
|
64
|
+
'这些改动已经保存,但不会自动重启。你可以在这里查看原因,并在方便的时候手动重启。'
|
|
65
|
+
)
|
|
66
|
+
).toBeTruthy();
|
|
67
|
+
expect(screen.getByText('plugins 改动将在重启后生效。')).toBeTruthy();
|
|
68
|
+
expect(screen.getByText('ui 改动将在重启后生效。')).toBeTruthy();
|
|
69
|
+
|
|
70
|
+
await user.click(screen.getByRole('button', { name: '立即重启' }));
|
|
71
|
+
|
|
72
|
+
await waitFor(() => {
|
|
73
|
+
expect(mocks.runRuntimeControlAction).toHaveBeenCalledWith(
|
|
74
|
+
'restart-service'
|
|
75
|
+
);
|
|
76
|
+
});
|
|
77
|
+
expect(toast.success).toHaveBeenCalledWith(
|
|
78
|
+
'Restart scheduled. This page may disconnect for a few seconds.'
|
|
79
|
+
);
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
it('shows a healthy status without restart controls when no action is needed', async () => {
|
|
83
|
+
const user = userEvent.setup();
|
|
84
|
+
|
|
85
|
+
mocks.useRuntimeStatusBadgeView.mockReturnValue({
|
|
86
|
+
tone: 'healthy',
|
|
87
|
+
title: '系统正常',
|
|
88
|
+
description: '所有系统状态都正常。',
|
|
89
|
+
reasonLines: [],
|
|
90
|
+
actionLabel: null,
|
|
91
|
+
isBusy: false,
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
render(<RuntimeStatusEntry />);
|
|
95
|
+
|
|
96
|
+
await user.click(screen.getByTestId('runtime-status-entry'));
|
|
97
|
+
|
|
98
|
+
expect(screen.getByText('系统正常')).toBeTruthy();
|
|
99
|
+
expect(screen.queryByRole('button', { name: '立即重启' })).toBeNull();
|
|
100
|
+
});
|
|
101
|
+
});
|