@nextclaw/ui 0.13.12 → 0.14.0
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 +43 -0
- package/dist/assets/{api-DmxQnm30.js → api-B50yVdT8.js} +7 -7
- package/dist/assets/app-presenter-provider-BI-ewLbO.js +3 -0
- package/dist/assets/arrow-left-BOCJyLbQ.js +1 -0
- package/dist/assets/book-open-Bd2Xbrrc.js +1 -0
- package/dist/assets/channels-list-page-moJkpxtU.js +8 -0
- package/dist/assets/chat-page-CO27cl4v.js +105 -0
- package/dist/assets/config-split-page-CsQ2rIdq.js +1 -0
- package/dist/assets/{confirm-dialog-BWRNsRgb.js → confirm-dialog-DRSelLdI.js} +2 -2
- package/dist/assets/desktop-update-config-qa-SynOc.js +1 -0
- package/dist/assets/{dist-DzM2ZEVN.js → dist-D19wiQwB.js} +1 -1
- package/dist/assets/{dist-CyWdaJvr.js → dist-NZRV-BxD.js} +1 -1
- package/dist/assets/doc-browser-2ddUJCA0.js +1 -0
- package/dist/assets/doc-browser-BjHUczQb.js +1 -0
- package/dist/assets/doc-browser-context-C8KPbj-p.js +1 -0
- package/dist/assets/{ellipsis-BDgTYNDX.js → ellipsis-BYy8TP0A.js} +1 -1
- package/dist/assets/{es2015-WqekV0OK.js → es2015-BUIIKCNh.js} +1 -1
- package/dist/assets/{external-link-BLjo8z2a.js → external-link-528k6MDD.js} +1 -1
- package/dist/assets/host-capabilities-9bB_998Z.js +1 -0
- package/dist/assets/index-CMNrRhnG.js +101 -0
- package/dist/assets/index-UTmTW1eU.css +1 -0
- package/dist/assets/{key-round-Du8x3sWa.js → key-round-D3vD9dj7.js} +1 -1
- package/dist/assets/loader-circle-DV9TSRns.js +1 -0
- package/dist/assets/mcp-marketplace-page-CS5Lh3oA.js +1 -0
- package/dist/assets/mcp-marketplace-page-DEOMcWb0.js +40 -0
- package/dist/assets/model-config-page-BSc4o7pb.js +1 -0
- package/dist/assets/{notice-card-3a7FmAz-.js → notice-card-qqlbsOoR.js} +1 -1
- package/dist/assets/plus-Bf9qhPDO.js +1 -0
- package/dist/assets/{popover-BlJLguiZ.js → popover-BnmPOXe3.js} +1 -1
- package/dist/assets/provider-scoped-model-input-Ca56s475.js +1 -0
- package/dist/assets/providers-config-page-D8Kf4U3u.js +1 -0
- package/dist/assets/{react-BVjl1ZaK.js → react-Dsotw5vM.js} +1 -1
- package/dist/assets/{refresh-cw-DFR87zei.js → refresh-cw-Bmx4wc9P.js} +1 -1
- package/dist/assets/remote-DNMEy_c4.js +1 -0
- package/dist/assets/rotate-cw-CL0sVBel.js +1 -0
- package/dist/assets/runtime-config-page-CUFtKr0U.js +1 -0
- package/dist/assets/{save-BDmIlHvN.js → save-CHDnDTok.js} +1 -1
- package/dist/assets/search-D7L-TCH-.js +1 -0
- package/dist/assets/search-config-page-CA3RVAef.js +1 -0
- package/dist/assets/secrets-config-page-95yaH1fa.js +3 -0
- package/dist/assets/{status-dot-SVPjIyG5.js → status-dot-Dm4h-bjn.js} +1 -1
- package/dist/assets/tabs-CJvw5Lqp.js +1 -0
- package/dist/assets/{tag-chip-Cdwb3JSH.js → tag-chip-Cr8GwpRE.js} +1 -1
- package/dist/assets/{tooltip-CKGxLGnG.js → tooltip-Bxzi6aDL.js} +1 -1
- package/dist/assets/{trash-2-yLA8BEcE.js → trash-2-CSfX-BvU.js} +1 -1
- package/dist/assets/use-config-TzwzTgg0.js +1 -0
- package/dist/assets/x-fkIWvi07.js +1 -0
- package/dist/index.html +27 -25
- package/package.json +9 -8
- package/src/app/index.tsx +8 -4
- package/src/features/account/components/account-panel.tsx +3 -3
- package/src/features/account/hooks/{use-auth.test.ts → __tests__/use-auth.test.ts} +1 -1
- package/src/features/account/managers/account.manager.ts +6 -5
- package/src/features/agents/components/{agents-page.test.tsx → __tests__/agents-page.test.tsx} +41 -2
- package/src/features/agents/components/agent-dialogs.tsx +2 -2
- package/src/features/agents/components/agents-page.tsx +1 -1
- package/src/features/channels/components/config/channel-form.tsx +1 -1
- package/src/features/channels/pages/channels-list-page.tsx +18 -15
- package/src/features/channels/utils/{channel-form-fields.utils.test.ts → __tests__/channel-form-fields.utils.test.ts} +1 -1
- package/src/features/chat/components/{chat-welcome.test.tsx → __tests__/chat-welcome.test.tsx} +1 -1
- package/src/features/chat/components/conversation/{chat-conversation-header.test.tsx → __tests__/chat-conversation-header.test.tsx} +25 -32
- package/src/features/chat/components/conversation/{chat-conversation-panel.test.tsx → __tests__/chat-conversation-panel.test.tsx} +201 -37
- package/src/features/chat/components/conversation/chat-conversation-alerts.tsx +37 -0
- package/src/features/chat/components/conversation/chat-conversation-content.tsx +91 -0
- package/src/features/chat/components/conversation/chat-conversation-header-section.tsx +151 -0
- package/src/features/chat/components/conversation/chat-conversation-header.tsx +26 -89
- package/src/features/chat/components/conversation/chat-conversation-panel.tsx +13 -376
- package/src/features/chat/components/conversation/chat-conversation-parent-banner.tsx +16 -0
- package/src/features/chat/components/conversation/chat-conversation-skeleton.tsx +86 -0
- package/src/features/chat/components/conversation/chat-conversation-workspace-section.tsx +42 -0
- package/src/features/chat/components/layout/{chat-page-shell.test.tsx → __tests__/chat-page-shell.test.tsx} +1 -1
- package/src/features/chat/components/layout/__tests__/chat-sidebar-read-state.test.tsx +167 -0
- package/src/features/chat/components/layout/__tests__/chat-sidebar.test.tsx +834 -0
- package/src/features/chat/components/layout/chat-page-shell.tsx +11 -30
- package/src/features/chat/components/layout/chat-sidebar-toolbar.tsx +33 -53
- package/src/features/chat/components/layout/chat-sidebar-utility-menu.tsx +1 -1
- package/src/features/chat/components/layout/chat-sidebar.tsx +156 -202
- package/src/features/chat/components/providers/chat-presenter.provider.tsx +13 -44
- package/src/features/chat/{components/conversation → features/input/components/__tests__}/chat-attachment-upload-limit.test.ts +1 -1
- package/src/features/chat/{components/conversation → features/input/components}/chat-input-bar.container.tsx +133 -31
- package/src/features/chat/{hooks → features/input/hooks/__tests__}/use-chat-input-bar-controller.test.tsx +1 -1
- package/src/features/chat/{utils → features/input/utils/__tests__}/chat-composer-state.utils.test.ts +1 -1
- package/src/features/chat/{utils → features/input/utils/__tests__}/chat-inline-token.utils.test.ts +1 -1
- package/src/features/chat/{utils → features/input/utils/__tests__}/chat-input-bar.utils.test.ts +2 -2
- package/src/features/chat/{utils → features/input/utils/__tests__}/ncp-chat-input-availability.utils.test.ts +2 -1
- package/src/features/chat/{utils → features/input/utils}/ncp-chat-input-availability.utils.ts +6 -6
- package/src/features/chat/{components/conversation → features/message/components/__tests__}/chat-message-list.container.test.tsx +38 -3
- package/src/features/chat/{components/conversation → features/message/components}/chat-message-list.container.tsx +9 -13
- package/src/features/chat/{utils → features/message/utils/__tests__}/chat-message-invalid-tool-arguments.utils.test.ts +2 -2
- package/src/features/chat/{utils → features/message/utils/__tests__}/chat-message-session-spawn-tool-card.utils.test.ts +2 -2
- package/src/features/chat/features/message/utils/__tests__/chat-message-show-content-tool-card.utils.test.ts +54 -0
- package/src/features/chat/{utils → features/message/utils/__tests__}/chat-message-summary-truncation.utils.test.ts +2 -2
- package/src/features/chat/{utils → features/message/utils/__tests__}/chat-message-tool-agent-id.utils.test.ts +1 -1
- package/src/features/chat/{utils → features/message/utils/__tests__}/chat-message.utils.test.ts +2 -2
- package/src/features/chat/{utils → features/message/utils}/chat-message-inline-content.utils.ts +1 -1
- package/src/features/chat/{utils → features/message/utils}/chat-message-part.utils.ts +15 -2
- package/src/features/chat/{utils → features/message/utils}/chat-message-session-request-tool-card.utils.ts +1 -1
- package/src/features/chat/features/message/utils/chat-message-show-content-tool-card.utils.ts +165 -0
- package/src/features/chat/{utils → features/message/utils}/chat-message-tool-card.utils.ts +1 -1
- package/src/features/chat/{utils → features/message/utils}/chat-message.utils.ts +1 -1
- package/src/features/chat/features/ncp/hooks/__tests__/use-hydrated-ncp-agent.test.tsx +57 -0
- package/src/features/chat/{hooks → features/ncp/hooks/__tests__}/use-ncp-agent-runtime.test.tsx +2 -2
- package/src/features/chat/features/ncp/hooks/__tests__/use-ncp-chat-derived-state.test.tsx +22 -0
- package/src/features/chat/features/ncp/hooks/__tests__/use-ncp-chat-query-store-sync.test.tsx +101 -0
- package/src/features/chat/{hooks → features/ncp/hooks/__tests__}/use-ncp-session-conversation.test.tsx +1 -1
- package/src/features/chat/features/ncp/hooks/__tests__/use-ui-show-content-event.test.tsx +52 -0
- package/src/features/chat/features/ncp/hooks/use-ncp-chat-derived-state.ts +37 -0
- package/src/features/chat/features/ncp/hooks/use-ncp-chat-query-store-sync.ts +28 -0
- package/src/features/chat/{hooks → features/ncp/hooks}/use-ncp-child-session-tabs-view.ts +4 -4
- package/src/features/chat/{hooks → features/ncp/hooks}/use-ncp-session-conversation.ts +1 -1
- package/src/features/chat/{hooks → features/ncp/hooks}/use-ncp-session-list-view.ts +3 -3
- package/src/features/chat/features/ncp/hooks/use-ncp-session-queries.ts +32 -0
- package/src/features/chat/features/ncp/hooks/use-ui-show-content-event.ts +14 -0
- package/src/features/chat/features/ncp/utils/ncp-chat-query-derived.utils.ts +77 -0
- package/src/features/chat/{utils → features/runtime/utils/__tests__}/ncp-app-client-fetch.utils.test.ts +1 -1
- package/src/features/chat/{utils → features/runtime/utils/__tests__}/ncp-chat-runtime-availability.utils.test.ts +1 -1
- package/src/features/chat/{utils → features/runtime/utils}/chat-runtime.utils.ts +1 -1
- package/src/features/chat/{components → features/session/components}/chat-sidebar-project-groups.tsx +21 -42
- package/src/features/chat/{components/layout → features/session/components}/chat-sidebar-session-entry.tsx +40 -13
- package/src/features/chat/{components → features/session/components}/chat-sidebar-session-item.tsx +36 -44
- package/src/features/chat/features/session/components/chat-sidebar-session-list.tsx +78 -0
- package/src/features/chat/{components/session → features/session/components}/session-context-icon.tsx +1 -1
- package/src/features/chat/{components/conversation/session-header → features/session/components/session-header/__tests__}/chat-session-header-actions.test.tsx +3 -3
- package/src/features/chat/{components/conversation/session-header → features/session/components/session-header/__tests__}/chat-session-project-badge.test.tsx +3 -3
- package/src/features/chat/{components/conversation → features/session/components}/session-header/chat-session-header-actions.tsx +15 -27
- package/src/features/chat/{components/conversation → features/session/components}/session-header/chat-session-project-badge.tsx +1 -1
- package/src/features/chat/{hooks → features/session/hooks/__tests__}/use-chat-session-project.test.tsx +2 -2
- package/src/features/chat/{hooks → features/session/hooks/__tests__}/use-chat-session-update.test.tsx +1 -1
- package/src/features/chat/{hooks → features/session/hooks}/use-chat-session-project.ts +1 -1
- package/src/features/chat/{hooks → features/session/hooks}/use-chat-session-update.ts +17 -0
- package/src/features/chat/{hooks → features/session/hooks}/use-chat-sidebar-session-label-editor.ts +1 -1
- package/src/features/chat/{hooks → features/session/hooks}/use-selected-session-context-window-indicator.ts +1 -1
- package/src/features/chat/{utils → features/session/utils/__tests__}/chat-session-display.utils.test.ts +1 -1
- package/src/features/chat/{utils → features/session/utils/__tests__}/chat-session-route.utils.test.ts +1 -1
- package/src/features/chat/{utils → features/session/utils/__tests__}/ncp-session-adapter.utils.cancelled-tool.test.ts +2 -2
- package/src/features/chat/{utils → features/session/utils/__tests__}/ncp-session-adapter.utils.test.ts +2 -2
- package/src/features/chat/{utils → features/session/utils/__tests__}/session-context.utils.test.ts +1 -1
- package/src/features/chat/features/session/utils/chat-run-metadata.utils.ts +60 -0
- package/src/features/chat/{utils → features/session/utils}/chat-session-preference-governance.utils.ts +0 -128
- package/src/features/chat/features/session/utils/chat-sidebar-session-groups.utils.ts +144 -0
- package/src/features/chat/{components → features/session-type/components/__tests__}/chat-session-type-option-item.test.tsx +1 -1
- package/src/features/chat/{components → features/session-type/components}/chat-session-type-option-item.tsx +7 -16
- package/src/features/chat/features/session-type/components/chat-sidebar-create-menu.tsx +42 -0
- package/src/features/chat/{hooks → features/session-type/hooks/__tests__}/use-chat-session-type-state.test.tsx +1 -1
- package/src/features/chat/{hooks → features/session-type/hooks}/use-chat-session-type-state.ts +23 -94
- package/src/features/chat/features/session-type/utils/chat-session-type.utils.ts +105 -0
- package/src/features/chat/{components → features/workspace/components/__tests__}/chat-session-workspace-file-preview.test.tsx +1 -1
- package/src/features/chat/{components → features/workspace/components}/chat-session-workspace-file-preview.tsx +2 -2
- package/src/features/chat/features/workspace/components/chat-session-workspace-panel-content.tsx +156 -0
- package/src/features/chat/features/workspace/components/chat-session-workspace-panel-nav.tsx +84 -0
- package/src/features/chat/features/workspace/components/chat-session-workspace-panel.tsx +138 -0
- package/src/features/chat/{components/workspace → features/workspace/components}/session-cron-job-content.tsx +1 -1
- package/src/features/chat/features/workspace/hooks/use-chat-conversation-workspace-state.ts +63 -0
- package/src/features/chat/features/workspace/utils/__tests__/chat-workspace-panel-view-model.utils.test.ts +103 -0
- package/src/features/chat/features/workspace/utils/chat-workspace-panel-view-model.utils.ts +183 -0
- package/src/features/chat/index.ts +16 -6
- package/src/features/chat/managers/__tests__/chat-input.manager.test.ts +355 -0
- package/src/features/chat/managers/__tests__/chat-query.manager.test.ts +39 -0
- package/src/features/chat/managers/__tests__/chat-run.manager.test.ts +202 -0
- package/src/features/chat/managers/{chat-session-list.manager.test.ts → __tests__/chat-session-list.manager.test.ts} +98 -74
- package/src/features/chat/managers/{chat-session-preference-sync.manager.test.ts → __tests__/chat-session-preference-sync.manager.test.ts} +1 -1
- package/src/features/chat/managers/__tests__/chat-thread.manager.test.ts +622 -0
- package/src/features/chat/managers/__tests__/chat-ui.manager.test.ts +126 -0
- package/src/features/chat/managers/{recent-selection.manager.test.ts → __tests__/recent-selection.manager.test.ts} +1 -1
- package/src/features/chat/managers/{ncp-chat-input.manager.ts → chat-input.manager.ts} +108 -35
- package/src/features/chat/managers/chat-query.manager.ts +48 -0
- package/src/features/chat/managers/chat-run.manager.ts +107 -0
- package/src/features/chat/managers/chat-session-list.manager.ts +47 -15
- package/src/features/chat/managers/chat-session-preference-sync.manager.ts +60 -5
- package/src/features/chat/managers/{ncp-chat-thread.manager.ts → chat-thread.manager.ts} +210 -37
- package/src/features/chat/managers/chat-ui.manager.ts +55 -9
- package/src/features/chat/pages/{ncp-chat-page.test.ts → __tests__/ncp-chat-page.test.ts} +49 -12
- package/src/features/chat/pages/ncp-chat-page.tsx +123 -399
- package/src/features/chat/presenters/chat.presenter.ts +39 -0
- package/src/features/chat/stores/__tests__/chat-thread.store.test.ts +148 -0
- package/src/features/chat/stores/chat-input.store.ts +5 -1
- package/src/features/chat/stores/chat-thread.store.ts +287 -28
- package/src/features/chat/stores/ncp-chat-query.store.ts +25 -0
- package/src/features/chat/types/chat-input.types.ts +1 -0
- package/src/features/chat/types/chat-message.types.ts +1 -0
- package/src/features/chat/types/chat-run.types.ts +41 -0
- package/src/{shared → features/cron}/components/cron-config.tsx +1 -1
- package/src/features/cron/hooks/use-cron-jobs.ts +58 -0
- package/src/features/cron/index.ts +7 -0
- package/src/features/marketplace/components/{marketplace-page.test.tsx → __tests__/marketplace-page.test.tsx} +37 -1
- package/src/features/marketplace/components/curated-shelves/marketplace-curated-shelves.tsx +15 -61
- package/src/features/marketplace/components/marketplace-external-skill-source-action.tsx +14 -0
- package/src/features/marketplace/components/marketplace-item-list-view.tsx +167 -0
- package/src/features/marketplace/components/marketplace-list-card.tsx +27 -31
- package/src/features/marketplace/components/marketplace-page-data.ts +0 -6
- package/src/features/marketplace/components/marketplace-page-parts.tsx +10 -2
- package/src/features/marketplace/components/marketplace-page.tsx +110 -434
- package/src/features/marketplace/components/mcp/mcp-marketplace-card.tsx +1 -1
- package/src/features/marketplace/components/mcp/mcp-marketplace-dialogs.tsx +1 -1
- package/src/features/marketplace/components/mcp/mcp-marketplace-page.tsx +2 -1
- package/src/features/marketplace/hooks/__tests__/use-marketplace.test.tsx +109 -0
- package/src/features/marketplace/hooks/use-marketplace-item-actions.ts +101 -0
- package/src/features/marketplace/hooks/use-marketplace-item-detail.ts +109 -0
- package/src/features/marketplace/hooks/use-marketplace-list-model.ts +160 -0
- package/src/features/marketplace/hooks/use-marketplace.ts +3 -5
- package/src/features/marketplace/utils/{marketplace-installed-cache.utils.test.ts → __tests__/marketplace-installed-cache.utils.test.ts} +1 -1
- package/src/features/panel-apps/components/{panel-app-list-item.test.tsx → __tests__/panel-app-list-item.test.tsx} +1 -1
- package/src/features/panel-apps/components/{panel-app-toolbar.test.tsx → __tests__/panel-app-toolbar.test.tsx} +1 -1
- package/src/features/panel-apps/utils/{panel-app-view.utils.test.ts → __tests__/panel-app-view.utils.test.ts} +1 -1
- package/src/features/pwa/managers/{pwa-service-worker-cache.manager.test.ts → __tests__/pwa-service-worker-cache.manager.test.ts} +1 -1
- package/src/features/remote/components/remote-access-page.tsx +2 -2
- package/src/features/remote/services/{remote-access-feedback.service.test.ts → __tests__/remote-access-feedback.service.test.ts} +1 -1
- package/src/{shared → features/settings}/components/config/provider-form.tsx +7 -7
- package/src/{shared/components → features/settings/components/config}/provider-status-badge.tsx +1 -1
- package/src/{shared/components/model-config.test.tsx → features/settings/pages/__tests__/model-config-page.test.tsx} +40 -5
- package/src/{shared/components/config/providers-list.test.tsx → features/settings/pages/__tests__/providers-config-page.test.tsx} +48 -5
- package/src/{shared/components/search-config.test.tsx → features/settings/pages/__tests__/search-config-page.test.tsx} +3 -3
- package/src/{shared/components/config/secrets-config.test.tsx → features/settings/pages/__tests__/secrets-config-page.test.tsx} +3 -3
- package/src/{shared/components/model-config.tsx → features/settings/pages/model-config-page.tsx} +1 -1
- package/src/{shared/components/config/providers-list.tsx → features/settings/pages/providers-config-page.tsx} +3 -3
- package/src/{shared/components/search-config.tsx → features/settings/pages/search-config-page.tsx} +1 -1
- package/src/{shared/components/config/secrets-config.tsx → features/settings/pages/secrets-config-page.tsx} +2 -2
- package/src/{shared/components/config/provider-form-support.test.ts → features/settings/utils/__tests__/provider-form-support.utils.test.ts} +1 -1
- package/src/features/side-dock/components/{side-dock.test.tsx → __tests__/side-dock.test.tsx} +25 -0
- package/src/features/side-dock/components/side-dock.tsx +13 -0
- package/src/features/system-status/components/{runtime-control-card.test.tsx → __tests__/runtime-control-card.test.tsx} +1 -1
- package/src/features/system-status/components/{runtime-presence-card.test.tsx → __tests__/runtime-presence-card.test.tsx} +1 -1
- package/src/features/system-status/components/desktop-update-config.tsx +2 -1
- package/src/features/system-status/components/runtime-presence-card.tsx +2 -2
- package/src/features/system-status/managers/{system-status.manager.bootstrap-polling.test.ts → __tests__/system-status.manager.bootstrap-polling.test.ts} +1 -1
- package/src/features/system-status/managers/{system-status.manager.test.ts → __tests__/system-status.manager.test.ts} +1 -1
- package/src/features/system-status/utils/{system-status.utils.test.ts → __tests__/system-status.utils.test.ts} +1 -1
- package/src/platforms/desktop/types/desktop-update.types.ts +9 -0
- package/src/shared/components/actions/action-link.tsx +49 -0
- package/src/shared/components/common/{agent-avatar.test.tsx → __tests__/agent-avatar.test.tsx} +1 -1
- package/src/shared/components/common/agent-identity/use-agent-identity.ts +3 -8
- package/src/shared/components/common/brand-header.tsx +1 -1
- package/src/shared/components/common/tag-input.tsx +1 -1
- package/src/shared/components/doc-browser/{doc-browser-context.test.tsx → __tests__/doc-browser-context.test.tsx} +1 -1
- package/src/shared/components/doc-browser/doc-browser-tab-strip.tsx +64 -161
- package/src/shared/components/doc-browser/doc-browser.tsx +4 -4
- package/src/shared/components/doc-browser/managers/doc-browser.manager.ts +39 -32
- package/src/shared/components/resizable-right-panel/__tests__/resizable-right-panel.test.tsx +66 -0
- package/src/shared/components/resizable-right-panel/resizable-right-panel.tsx +11 -8
- package/src/shared/components/ui/actions/icon-action-button.tsx +53 -0
- package/src/shared/components/ui/tab-strip/__tests__/compact-tab-strip.test.tsx +52 -0
- package/src/shared/components/ui/tab-strip/compact-tab-strip.tsx +228 -0
- package/src/shared/hooks/use-app-meta.ts +10 -0
- package/src/shared/hooks/use-config.ts +1 -148
- package/src/shared/lib/api/{ncp-session.test.ts → __tests__/ncp-session.test.ts} +3 -3
- package/src/shared/lib/api/{raw-client.test.ts → __tests__/raw-client.test.ts} +1 -1
- package/src/shared/lib/api/chat-session-type.types.ts +3 -0
- package/src/shared/lib/cadence/services/{adaptive-cadence.service.test.ts → __tests__/adaptive-cadence.service.test.ts} +1 -1
- package/src/shared/lib/host-capabilities/__tests__/host-capability.manager.test.ts +50 -0
- package/src/shared/lib/host-capabilities/host-capability.manager.ts +62 -0
- package/src/shared/lib/host-capabilities/index.ts +1 -0
- package/src/shared/lib/i18n/README.md +16 -3
- package/src/shared/lib/i18n/index.ts +93 -426
- package/src/shared/lib/i18n/locales/en-US/agents.json +49 -0
- package/src/shared/lib/i18n/locales/en-US/channel-auth.json +51 -0
- package/src/shared/lib/i18n/locales/en-US/channels.json +50 -0
- package/src/shared/lib/i18n/locales/en-US/chat.json +183 -0
- package/src/shared/lib/i18n/locales/en-US/core.json +311 -0
- package/src/shared/lib/i18n/locales/en-US/cron.json +32 -0
- package/src/shared/lib/i18n/locales/en-US/desktop-update.json +90 -0
- package/src/shared/lib/i18n/locales/en-US/doc-browser.json +87 -0
- package/src/shared/lib/i18n/locales/en-US/marketplace.json +72 -0
- package/src/shared/lib/i18n/locales/en-US/path-picker.json +12 -0
- package/src/shared/lib/i18n/locales/en-US/pwa.json +26 -0
- package/src/shared/lib/i18n/locales/en-US/remote.json +168 -0
- package/src/shared/lib/i18n/locales/en-US/runtime-control.json +105 -0
- package/src/shared/lib/i18n/locales/en-US/search.json +28 -0
- package/src/shared/lib/i18n/locales/zh-CN/agents.json +49 -0
- package/src/shared/lib/i18n/locales/zh-CN/channel-auth.json +51 -0
- package/src/shared/lib/i18n/locales/zh-CN/channels.json +50 -0
- package/src/shared/lib/i18n/locales/zh-CN/chat.json +183 -0
- package/src/shared/lib/i18n/locales/zh-CN/core.json +311 -0
- package/src/shared/lib/i18n/locales/zh-CN/cron.json +32 -0
- package/src/shared/lib/i18n/locales/zh-CN/desktop-update.json +90 -0
- package/src/shared/lib/i18n/locales/zh-CN/doc-browser.json +87 -0
- package/src/shared/lib/i18n/locales/zh-CN/marketplace.json +72 -0
- package/src/shared/lib/i18n/locales/zh-CN/path-picker.json +12 -0
- package/src/shared/lib/i18n/locales/zh-CN/pwa.json +26 -0
- package/src/shared/lib/i18n/locales/zh-CN/remote.json +168 -0
- package/src/shared/lib/i18n/locales/zh-CN/runtime-control.json +105 -0
- package/src/shared/lib/i18n/locales/zh-CN/search.json +28 -0
- package/src/shared/lib/i18n/runtime/{i18n-language-owner.test.ts → __tests__/i18n-language-owner.test.ts} +2 -2
- package/src/shared/lib/navigation-history/__tests__/navigation-history.utils.test.ts +60 -0
- package/src/shared/lib/navigation-history/index.ts +1 -0
- package/src/shared/lib/navigation-history/navigation-history.utils.ts +105 -0
- package/src/shared/lib/provider-models/{index.test.ts → __tests__/index.test.ts} +1 -1
- package/src/shared/lib/transport/{app-client.test.ts → __tests__/app-client.test.ts} +3 -3
- package/src/shared/lib/transport/{remote.transport.test.ts → __tests__/remote.transport.test.ts} +1 -1
- package/src/shared/lib/transport/{sse-stream.test.ts → __tests__/sse-stream.test.ts} +1 -1
- package/tsconfig.json +2 -5
- package/vite.config.ts +4 -4
- package/vitest.config.ts +4 -0
- package/dist/assets/app-presenter-provider-CDSjiqfE.js +0 -3
- package/dist/assets/arrow-left-Dd45Mvr1.js +0 -1
- package/dist/assets/channels-list-page-D-WYFmcG.js +0 -8
- package/dist/assets/chat-page-D1X8YNTC.js +0 -105
- package/dist/assets/config-split-page-CdJEkWxv.js +0 -1
- package/dist/assets/desktop-update-config-DOi5R1fX.js +0 -1
- package/dist/assets/doc-browser-D5FJcAyz.js +0 -1
- package/dist/assets/doc-browser-DewXa6oX.js +0 -1
- package/dist/assets/doc-browser-context-CpL2m4Sp.js +0 -1
- package/dist/assets/index-Q891JiF_.css +0 -1
- package/dist/assets/index-ZDJP_uJc.js +0 -101
- package/dist/assets/loader-circle-Dz4FssYC.js +0 -1
- package/dist/assets/mcp-marketplace-page-LmMhKH5a.js +0 -1
- package/dist/assets/mcp-marketplace-page-RqISBSqO.js +0 -40
- package/dist/assets/model-config-JUsW1Khb.js +0 -1
- package/dist/assets/play-BziM-Y34.js +0 -1
- package/dist/assets/plus-DrpyArC8.js +0 -1
- package/dist/assets/provider-models-C_yOh6DE.js +0 -1
- package/dist/assets/provider-scoped-model-input-IMD4W0jD.js +0 -1
- package/dist/assets/providers-list-BsDpxNzy.js +0 -1
- package/dist/assets/remote-DjhVMpVd.js +0 -1
- package/dist/assets/rotate-cw-DMBnsYKm.js +0 -1
- package/dist/assets/runtime-config-page-DzbTVebD.js +0 -1
- package/dist/assets/search-CjHGYvTI.js +0 -1
- package/dist/assets/search-config-CJ6OPxAf.js +0 -1
- package/dist/assets/secrets-config-CYOHWL7P.js +0 -3
- package/dist/assets/tabs-Czd2mj6z.js +0 -1
- package/dist/assets/tabs-custom-Ix4nkp2h.js +0 -1
- package/dist/assets/x-dpDISboO.js +0 -1
- package/src/features/chat/components/chat-session-workspace-panel-nav.tsx +0 -232
- package/src/features/chat/components/chat-session-workspace-panel.tsx +0 -371
- package/src/features/chat/components/layout/chat-sidebar-read-state.test.tsx +0 -145
- package/src/features/chat/components/layout/chat-sidebar.test.tsx +0 -896
- package/src/features/chat/hooks/use-chat-session-label.ts +0 -18
- package/src/features/chat/hooks/use-hydrated-ncp-agent.test.tsx +0 -90
- package/src/features/chat/hooks/use-ncp-chat-derived-state.ts +0 -181
- package/src/features/chat/hooks/use-ncp-chat-page-data.test.tsx +0 -70
- package/src/features/chat/hooks/use-ncp-chat-page-data.ts +0 -260
- package/src/features/chat/managers/chat-stream-actions.manager.ts +0 -35
- package/src/features/chat/managers/ncp-chat-input.manager.test.ts +0 -232
- package/src/features/chat/managers/ncp-chat-presenter.manager.ts +0 -28
- package/src/features/chat/managers/ncp-chat-thread.manager.test.ts +0 -241
- package/src/features/chat/types/chat-stream.types.ts +0 -32
- package/src/features/chat/utils/chat-session-preference-governance.utils.test.tsx +0 -114
- package/src/features/marketplace/components/marketplace-catalog-grid.tsx +0 -114
- package/src/shared/components/resizable-right-panel/resizable-right-panel.test.tsx +0 -38
- package/src/shared/components/ui/action-link.tsx +0 -27
- package/src/shared/components/ui/config-card.tsx +0 -71
- package/src/shared/components/ui/highlight-card.tsx +0 -40
- package/src/shared/components/ui/tabs-custom.tsx +0 -49
- package/src/shared/lib/i18n/agents.ts +0 -85
- package/src/shared/lib/i18n/channel-auth.constants.ts +0 -87
- package/src/shared/lib/i18n/channels.ts +0 -53
- package/src/shared/lib/i18n/chat-labels.utils.ts +0 -206
- package/src/shared/lib/i18n/cron-labels.utils.ts +0 -32
- package/src/shared/lib/i18n/desktop-update-labels.utils.ts +0 -165
- package/src/shared/lib/i18n/marketplace-labels.utils.ts +0 -78
- package/src/shared/lib/i18n/pwa.ts +0 -62
- package/src/shared/lib/i18n/remote.ts +0 -273
- package/src/shared/lib/i18n/runtime/doc-browser-labels.utils.ts +0 -120
- package/src/shared/lib/i18n/runtime/i18n.path-picker.ts +0 -12
- package/src/shared/lib/i18n/runtime-control-labels.utils.ts +0 -180
- package/src/shared/lib/i18n/search.ts +0 -37
- /package/dist/assets/{config-hints-Ceiol9x4.js → config-hints-Cl2XAhzV.js} +0 -0
- /package/src/{app.test.tsx → __tests__/app.test.tsx} +0 -0
- /package/src/app/components/layout/{app-layout.test.tsx → __tests__/app-layout.test.tsx} +0 -0
- /package/src/app/components/layout/{runtime-status-entry.test.tsx → __tests__/runtime-status-entry.test.tsx} +0 -0
- /package/src/app/components/layout/{settings-entry-page.test.tsx → __tests__/settings-entry-page.test.tsx} +0 -0
- /package/src/app/components/layout/{sidebar.layout.test.tsx → __tests__/sidebar.layout.test.tsx} +0 -0
- /package/src/features/channels/components/config/{channel-form.test.tsx → __tests__/channel-form.test.tsx} +0 -0
- /package/src/features/channels/components/config/{weixin-channel-auth-section.test.tsx → __tests__/weixin-channel-auth-section.test.tsx} +0 -0
- /package/src/features/channels/pages/{channels-list-page.test.tsx → __tests__/channels-list-page.test.tsx} +0 -0
- /package/src/features/chat/{hooks → features/input/hooks}/use-chat-input-bar-controller.ts +0 -0
- /package/src/features/chat/{utils → features/input/utils}/chat-composer-state.utils.ts +0 -0
- /package/src/features/chat/{utils → features/input/utils}/chat-inline-token.utils.ts +0 -0
- /package/src/features/chat/{utils → features/input/utils}/chat-input-bar.utils.ts +0 -0
- /package/src/features/chat/{utils → features/input/utils}/chat-input-toolbar.utils.ts +0 -0
- /package/src/features/chat/{utils → features/message/utils}/chat-message-core.utils.ts +0 -0
- /package/src/features/chat/{utils → features/message/utils}/chat-message-partial-json.utils.ts +0 -0
- /package/src/features/chat/{utils → features/message/utils}/chat-message-tool-agent-id.utils.ts +0 -0
- /package/src/features/chat/{utils → features/message/utils}/file-operation/card.utils.ts +0 -0
- /package/src/features/chat/{utils → features/message/utils}/file-operation/diff.utils.ts +0 -0
- /package/src/features/chat/{utils → features/message/utils}/file-operation/line-builder.utils.ts +0 -0
- /package/src/features/chat/{utils → features/message/utils}/file-operation/parsed-block.utils.ts +0 -0
- /package/src/features/chat/{utils → features/message/utils}/file-operation/record-readers.utils.ts +0 -0
- /package/src/features/chat/{utils → features/runtime/utils}/ncp-app-client-fetch.utils.ts +0 -0
- /package/src/features/chat/{utils → features/runtime/utils}/ncp-chat-runtime-availability.utils.ts +0 -0
- /package/src/features/chat/{components/conversation → features/session/components}/session-header/chat-session-header-menu-item.tsx +0 -0
- /package/src/features/chat/{components/conversation → features/session/components}/session-header/chat-session-project-dialog.tsx +0 -0
- /package/src/features/chat/{components/session → features/session/components}/session-run-badge.tsx +0 -0
- /package/src/features/chat/{utils → features/session/utils}/chat-context-window-indicator.utils.ts +0 -0
- /package/src/features/chat/{utils → features/session/utils}/chat-session-display.utils.ts +0 -0
- /package/src/features/chat/{utils → features/session/utils}/chat-session-route.utils.ts +0 -0
- /package/src/features/chat/{utils → features/session/utils}/ncp-session-adapter.utils.ts +0 -0
- /package/src/features/chat/{utils → features/session/utils}/ncp-session-context-metadata.utils.ts +0 -0
- /package/src/features/chat/{utils → features/session/utils}/session-context.utils.ts +0 -0
- /package/src/features/chat/{hooks → features/session-type/hooks}/use-ncp-chat-session-types.ts +0 -0
- /package/src/features/chat/{components/workspace → features/workspace/components}/chat-session-workspace-file-breadcrumbs.tsx +0 -0
- /package/src/features/marketplace/components/{marketplace-page-detail.test.tsx → __tests__/marketplace-page-detail.test.tsx} +0 -0
- /package/src/features/marketplace/components/curated-shelves/{marketplace-curated-scene-route.test.tsx → __tests__/marketplace-curated-scene-route.test.tsx} +0 -0
- /package/src/features/marketplace/components/detail-doc/{marketplace-detail-doc.test.ts → __tests__/marketplace-detail-doc.test.ts} +0 -0
- /package/src/features/marketplace/components/mcp/{mcp-marketplace-page.test.tsx → __tests__/mcp-marketplace-page.test.tsx} +0 -0
- /package/src/features/panel-apps/managers/{panel-app-bridge.manager.test.ts → __tests__/panel-app-bridge.manager.test.ts} +0 -0
- /package/src/features/panel-apps/utils/{panel-app-doc-browser.utils.test.ts → __tests__/panel-app-doc-browser.utils.test.ts} +0 -0
- /package/src/features/pwa/components/{pwa-install-entry.test.tsx → __tests__/pwa-install-entry.test.tsx} +0 -0
- /package/src/features/pwa/managers/{pwa-install.manager.test.ts → __tests__/pwa-install.manager.test.ts} +0 -0
- /package/src/features/pwa/managers/{pwa-shell-theme.manager.test.ts → __tests__/pwa-shell-theme.manager.test.ts} +0 -0
- /package/src/features/remote/components/{remote-access-page.test.tsx → __tests__/remote-access-page.test.tsx} +0 -0
- /package/src/features/right-panel-resources/utils/{right-panel-resource-route-resolver.utils.test.ts → __tests__/right-panel-resource-route-resolver.utils.test.ts} +0 -0
- /package/src/features/right-panel-resources/utils/{right-panel-resource-uri.utils.test.ts → __tests__/right-panel-resource-uri.utils.test.ts} +0 -0
- /package/src/features/service-apps/components/{service-apps-panel.test.tsx → __tests__/service-apps-panel.test.tsx} +0 -0
- /package/src/{shared/components → features/settings/components/config}/provider-advanced-settings-section.tsx +0 -0
- /package/src/{shared/components → features/settings/components/config}/provider-auth-section.tsx +0 -0
- /package/src/{shared → features/settings}/components/config/provider-models-section.tsx +0 -0
- /package/src/{shared/components → features/settings/components/config}/provider-pill-selector.tsx +0 -0
- /package/src/{shared → features/settings}/components/config/secrets-config-form.tsx +0 -0
- /package/src/features/settings/pages/{language-settings-page.test.tsx → __tests__/language-settings-page.test.tsx} +0 -0
- /package/src/{shared/components/config/provider-form-support.ts → features/settings/utils/provider-form-support.utils.ts} +0 -0
- /package/src/features/side-dock/managers/{side-dock.manager.test.ts → __tests__/side-dock.manager.test.ts} +0 -0
- /package/src/features/side-dock/utils/{side-dock-item.utils.test.ts → __tests__/side-dock-item.utils.test.ts} +0 -0
- /package/src/features/system-status/components/{desktop-update-config.test.tsx → __tests__/desktop-update-config.test.tsx} +0 -0
- /package/src/features/system-status/pages/{runtime-config-page.test.tsx → __tests__/runtime-config-page.test.tsx} +0 -0
- /package/src/platforms/desktop/components/{desktop-app-shell.test.tsx → __tests__/desktop-app-shell.test.tsx} +0 -0
- /package/src/platforms/mobile/components/{mobile-app-shell.test.tsx → __tests__/mobile-app-shell.test.tsx} +0 -0
- /package/src/platforms/mobile/components/{mobile-bottom-nav.test.tsx → __tests__/mobile-bottom-nav.test.tsx} +0 -0
- /package/src/shared/components/common/{brand-header.test.tsx → __tests__/brand-header.test.tsx} +0 -0
- /package/src/shared/components/doc-browser/{doc-browser.test.tsx → __tests__/doc-browser.test.tsx} +0 -0
- /package/src/shared/components/{ui → feedback}/notice-card.tsx +0 -0
- /package/src/shared/components/path-picker/{server-path-picker-dialog.test.tsx → __tests__/server-path-picker-dialog.test.tsx} +0 -0
- /package/src/shared/components/{ui → settings}/setting-row.tsx +0 -0
- /package/src/shared/components/{ui → status}/status-dot.tsx +0 -0
- /package/src/shared/components/{ui → tags}/tag-chip.tsx +0 -0
- /package/src/shared/lib/api/{api-base.test.ts → __tests__/api-base.test.ts} +0 -0
- /package/src/shared/lib/api/{client.test.ts → __tests__/client.test.ts} +0 -0
- /package/src/shared/lib/api/{ncp-session-query-cache.utils.test.ts → __tests__/ncp-session-query-cache.utils.test.ts} +0 -0
- /package/src/shared/lib/app-resource-uri/{app-resource-uri.test.ts → __tests__/app-resource-uri.test.ts} +0 -0
- /package/src/shared/lib/resource-uri/utils/{resource-uri-resolver.utils.test.ts → __tests__/resource-uri-resolver.utils.test.ts} +0 -0
- /package/src/shared/lib/session-project/{workspace-file-breadcrumb.test.ts → __tests__/workspace-file-breadcrumb.test.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e}from"./dist-
|
|
1
|
+
import{c as e}from"./dist-NZRV-BxD.js";var t=e(`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`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{D as e}from"./app-presenter-provider-BI-ewLbO.js";export{e as RemoteAccessPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as e}from"./dist-NZRV-BxD.js";var t=e(`RotateCw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as e,p as t,r as n,u as r,v as i}from"./react-Dsotw5vM.js";import{At as a,It as o,Lt as s,Mt as c,Nt as l,Ot as u,Pt as d,Rt as f,St as p,Vt as m,_t as h,jt as g,kt as _,mt as v,xt as y,yt as b}from"./api-B50yVdT8.js";import{t as x}from"./loader-circle-DV9TSRns.js";import{t as S}from"./plus-Bf9qhPDO.js";import{t as ee}from"./rotate-cw-CL0sVBel.js";import{t as C}from"./save-CHDnDTok.js";import{t as w}from"./trash-2-CSfX-BvU.js";import{t as T}from"./notice-card-qqlbsOoR.js";import{B as E,G as D,H as O,J as k,R as te,U as A,V as j,W as M,Z as ne,z as N}from"./index-CMNrRhnG.js";import{g as P,t as F}from"./use-config-TzwzTgg0.js";var I=i(e(),1),L=t(),R={healthy:`runtimeControlHealthy`,"starting-service":`runtimeControlStartingService`,"restarting-service":`runtimeControlRestartingService`,"stopping-service":`runtimeControlStoppingService`,"restarting-app":`runtimeControlRestartingApp`,recovering:`runtimeControlRecovering`,failed:`runtimeControlFailed`},z={running:`runtimeControlServiceRunning`,stopped:`runtimeControlServiceStopped`,starting:`runtimeControlServiceStarting`,stopping:`runtimeControlServiceStopping`,restarting:`runtimeControlServiceRestarting`},B={"desktop-embedded":`runtimeControlEnvironmentDesktop`,"managed-local-service":`runtimeControlEnvironmentManagedService`,"self-hosted-web":`runtimeControlEnvironmentSelfHosted`,"shared-web":`runtimeControlEnvironmentSharedWeb`};function V(e){return n(R[e]??`runtimeControlUnavailable`)}function H(e){return n(z[e]??`runtimeControlServiceUnknown`)}function U(e){return n(B[e.environment])}function W(e,t){return t===`start-service`?e?.canStartService:t===`stop-service`?e?.canStopService:e?.canRestartService}function G(e){return e?[{action:`start-service`,capability:e.canStartService,label:n(`runtimeControlStartService`),icon:`play`},{action:`restart-service`,capability:e.canRestartService,label:n(`runtimeControlRestartService`),icon:`rotate`},{action:`stop-service`,capability:e.canStopService,label:n(`runtimeControlStopService`),icon:`square`,variant:`destructive`},{action:`restart-app`,capability:e.canRestartApp,label:n(`runtimeControlRestartApp`),icon:`rotate`,variant:`secondary`}].filter(e=>e.capability.available||!!e.capability.reasonIfUnavailable):[]}function K(e){let{busy:t,icon:n}=e;return t?(0,L.jsx)(x,{className:`mr-2 h-4 w-4 animate-spin`}):n===`play`?(0,L.jsx)(ne,{className:`mr-2 h-4 w-4`}):n===`square`?(0,L.jsx)(k,{className:`mr-2 h-4 w-4`}):(0,L.jsx)(ee,{className:`mr-2 h-4 w-4`})}function q(){let{busy:e,busyAction:t,controlView:r,errorMessage:i,pendingRestart:o,visibleLifecycle:l,visibleMessage:d,visibleServiceState:f}=h(),v=G(r??void 0),b=async e=>{let t=W(r,e);if(!t?.available){m.error(p(t?.reasonIfUnavailable)??n(`runtimeControlLoadFailed`));return}if(!(e===`stop-service`&&t.requiresConfirmation&&!window.confirm(n(`runtimeControlStopServiceConfirm`))))try{let t=await y.runRuntimeControlAction(e);m.success(p(t.message)??t.message)}catch(e){let t=e instanceof Error?e.message:n(`runtimeControlActionFailed`);m.error(`${n(`runtimeControlActionFailed`)}: ${t}`)}},x=async()=>{if(!r?.canRestartApp.available){m.error(p(r?.canRestartApp.reasonIfUnavailable)??n(`runtimeRestartAppUnavailable`));return}if(window.confirm(n(`runtimeControlRestartAppConfirm`)))try{let e=await y.runRuntimeControlAction(`restart-app`);m.success(p(e.message)??e.message)}catch(e){let t=e instanceof Error?e.message:n(`runtimeControlActionFailed`);m.error(`${n(`runtimeControlActionFailed`)}: ${t}`)}};return(0,L.jsxs)(u,{children:[(0,L.jsxs)(g,{children:[(0,L.jsx)(c,{children:n(`runtimeControlTitle`)}),(0,L.jsx)(a,{children:n(`runtimeControlDescription`)})]}),(0,L.jsxs)(_,{className:`space-y-4`,children:[(0,L.jsxs)(`div`,{className:`space-y-3 rounded-xl border border-gray-200 bg-gray-50 p-4`,children:[(0,L.jsxs)(`div`,{className:`flex flex-col gap-1 md:flex-row md:items-center md:justify-between`,children:[(0,L.jsx)(`div`,{className:`text-sm font-medium text-gray-900`,children:H(f)}),(0,L.jsx)(`div`,{className:`text-xs text-gray-500`,children:r?U(r):n(`runtimeControlLoading`)})]}),(0,L.jsx)(`p`,{className:`text-sm text-gray-600`,children:d}),(0,L.jsx)(`div`,{className:`text-xs text-gray-500`,children:V(l)}),r?.managementHint?(0,L.jsx)(`p`,{className:`text-xs text-gray-500`,children:p(r.managementHint)}):null,i&&!e?(0,L.jsx)(`p`,{className:`text-sm text-amber-700`,children:i}):null]}),o?(0,L.jsxs)(`div`,{className:`space-y-3 rounded-xl border border-amber-200 bg-amber-50 p-4`,children:[(0,L.jsx)(`div`,{className:`text-sm font-medium text-amber-900`,children:n(`runtimeControlPendingRestartTitle`)}),(0,L.jsx)(`p`,{className:`text-sm text-amber-800`,children:n(`runtimeControlPendingRestartDescription`)}),o.changedPaths.length>0?(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsx)(`div`,{className:`text-xs font-medium uppercase tracking-[0.08em] text-amber-700`,children:n(`runtimeControlPendingRestartPaths`)}),(0,L.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:o.changedPaths.map(e=>(0,L.jsx)(`span`,{className:`rounded-full border border-amber-200 bg-white px-2.5 py-1 text-xs text-amber-800`,children:e},e))})]}):null]}):null,(0,L.jsx)(`div`,{className:`flex flex-col gap-3 md:flex-row md:flex-wrap`,children:v.map(n=>(0,L.jsxs)(s,{type:`button`,variant:n.variant??`default`,onClick:()=>{if(n.action===`restart-app`){x();return}b(n.action)},disabled:!n.capability.available||e,children:[(0,L.jsx)(K,{icon:n.icon,busy:t===n.action}),n.label]},n.action))}),v.filter(e=>!e.capability.available&&e.capability.reasonIfUnavailable).map(e=>(0,L.jsx)(`p`,{className:`text-xs text-gray-500`,children:p(e.capability.reasonIfUnavailable)},`${e.action}-reason`))]})]})}var J=f(`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`}}),Y=I.forwardRef(({className:e,tone:t,title:n,description:i,control:a,children:o,...s},c)=>(0,L.jsxs)(`div`,{ref:c,className:r(J({tone:t}),e),...s,children:[(0,L.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2`,children:[(0,L.jsx)(`div`,{className:`text-sm font-medium text-gray-900`,children:n}),i?(0,L.jsx)(`p`,{className:`text-sm leading-6 text-gray-500`,children:i}):null,o]}),a?(0,L.jsx)(`div`,{className:`shrink-0`,children:a}):null]}));Y.displayName=`SettingRow`;function X(e){let{description:t,title:n}=e;return(0,L.jsx)(T,{tone:`neutral`,title:n,description:t})}function Z(e){let{children:t}=e;return(0,L.jsxs)(u,{children:[(0,L.jsxs)(g,{children:[(0,L.jsx)(c,{children:n(`runtimePresenceTitle`)}),(0,L.jsx)(a,{children:n(`runtimePresenceDescription`)})]}),(0,L.jsx)(_,{children:t})]})}function re(){let e=b().runtimeControlView?.environment,t=D(e=>e.supported),r=D(e=>e.initialized),i=D(e=>e.busyAction),a=D(e=>e.snapshot);return(0,I.useEffect)(()=>{if(e===`desktop-embedded`){M.start();return}M.markUnsupported()},[e]),e===`desktop-embedded`?(0,L.jsx)(Z,{children:(0,L.jsxs)(`div`,{className:`space-y-4`,children:[(0,L.jsx)(T,{tone:`neutral`,title:n(`runtimePresenceBehaviorLabel`),description:a?.closeToBackground?n(`runtimePresenceBehaviorBackground`):n(`runtimePresenceBehaviorQuit`),className:`rounded-xl`}),!r||t&&!a?(0,L.jsx)(`p`,{className:`text-sm text-gray-500`,children:n(`runtimePresenceLoading`)}):null,a?(0,L.jsxs)(`div`,{className:`space-y-4`,children:[(0,L.jsx)(Y,{title:n(`runtimePresenceCloseToBackground`),description:n(`runtimePresenceCloseToBackgroundHelp`),control:(0,L.jsx)(v,{id:`runtime-presence-close-background`,"aria-label":n(`runtimePresenceCloseToBackground`),checked:a.closeToBackground,disabled:i===`saving-preferences`,onCheckedChange:e=>{M.updatePreferences({closeToBackground:e})}})}),(0,L.jsx)(Y,{title:n(`runtimePresenceLaunchAtLogin`),description:a.supportsLaunchAtLogin?n(`runtimePresenceLaunchAtLoginHelp`):a.launchAtLoginReason??n(`runtimePresenceLaunchAtLoginUnavailable`),control:(0,L.jsx)(v,{id:`runtime-presence-launch-login`,"aria-label":n(`runtimePresenceLaunchAtLogin`),checked:a.launchAtLogin,disabled:!a.supportsLaunchAtLogin||i===`saving-preferences`,onCheckedChange:e=>{M.updatePreferences({launchAtLogin:e})}})})]}):null]})}):e===`managed-local-service`?(0,L.jsx)(Z,{children:(0,L.jsx)(X,{title:n(`runtimePresenceManagedLocalTitle`),description:n(`runtimePresenceManagedLocalDescription`)})}):e===`self-hosted-web`?(0,L.jsx)(Z,{children:(0,L.jsx)(X,{title:n(`runtimePresenceSelfHostedTitle`),description:n(`runtimePresenceSelfHostedDescription`)})}):e===`shared-web`?(0,L.jsx)(Z,{children:(0,L.jsx)(X,{title:n(`runtimePresenceSharedTitle`),description:n(`runtimePresenceSharedDescription`)})}):(0,L.jsx)(Z,{children:(0,L.jsx)(`p`,{className:`text-sm text-gray-500`,children:n(`runtimePresenceLoading`)})})}function ie(){return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(l,{title:n(`runtimePageTitle`),description:n(`runtimePageDescription`)}),(0,L.jsx)(q,{}),(0,L.jsx)(re,{}),(0,L.jsx)(te,{})]})}var Q={wireDialect:`acp`,processScope:`per-session`,command:``,args:[`acp`],env:{},cwd:``,startupTimeoutMs:8e3,probeTimeoutMs:3e3,requestTimeoutMs:12e4};function ae(){return{id:``,default:!1,workspace:``,model:``,runtime:``,contextTokens:void 0,maxToolIterations:void 0}}function oe(){return{agentId:``,match:{channel:``,accountId:``}}}function se(){return{id:``,enabled:!0,label:``,type:`narp-stdio`,config:Q,configText:JSON.stringify(Q,null,2)}}function ce(e){return{id:e.id??``,default:!!e.default,displayName:e.displayName??``,description:e.description??``,avatar:e.avatar??``,workspace:e.workspace??``,model:e.model??``,runtime:e.runtime??e.engine??``,contextTokens:e.contextTokens,maxToolIterations:e.maxToolIterations}}function le(e){return{agentId:e.agentId??``,match:{channel:e.match?.channel??``,accountId:e.match?.accountId??``,peer:e.match?.peer?{kind:e.match.peer.kind,id:e.match.peer.id}:void 0}}}function $(e){let t=e.trim();if(!t)return;let n=Number.parseInt(t,10);return Number.isFinite(n)?n:void 0}function ue(e){return{companionEnabled:e.companion?.enabled===!0,agents:(e.agents.list??[]).map(ce),bindings:(e.bindings??[]).map(le),runtimeEntries:Object.entries(e.agents.runtimes?.entries??{}).map(([e,t])=>({id:e,enabled:t.enabled!==!1,label:t.label??``,type:t.type,config:t.config??{},configText:JSON.stringify(t.config??{},null,2)})),dmScope:e.session?.dmScope??`per-channel-peer`,defaultContextTokens:e.agents.defaults.contextTokens??2e5,defaultEngine:e.agents.defaults.engine??`native`}}function de(e){let t={id:e.id.trim()};e.default&&(t.default=!0),e.displayName?.trim()&&(t.displayName=e.displayName.trim()),e.description?.trim()&&(t.description=e.description.trim()),e.avatar?.trim()&&(t.avatar=e.avatar.trim()),e.workspace?.trim()&&(t.workspace=e.workspace.trim()),e.model?.trim()&&(t.model=e.model.trim());let n=e.runtime?.trim()??e.engine?.trim();return n&&(t.engine=n),typeof e.contextTokens==`number`&&(t.contextTokens=Math.max(1e3,e.contextTokens)),typeof e.maxToolIterations==`number`&&(t.maxToolIterations=e.maxToolIterations),t}function fe(e){let t=e.agents.map((e,t)=>{if(!e.id.trim())throw Error(n(`agentIdRequiredError`).replace(`{index}`,String(t)));return de(e)}),r=t.map(e=>e.id).filter((e,t,n)=>n.indexOf(e)!==t);if(r.length>0)throw Error(`${n(`duplicateAgentId`)}: ${r[0]}`);let i=e.bindings.map((t,r)=>{let i=t.agentId.trim(),a=t.match.channel.trim(),o=t.match.accountId?.trim()??``,s=t.match.peer?.kind,c=t.match.peer?.id?.trim()??``;if(!i)throw Error(n(`bindingAgentIdRequired`).replace(`{index}`,String(r)));if(!e.knownAgentIds.has(i))throw Error(`${n(`bindingAgentIdNotFound`).replace(`{index}`,String(r))}: ${i}`);if(!a)throw Error(n(`bindingChannelRequired`).replace(`{index}`,String(r)));let l={agentId:i,match:{channel:a}};if(o&&(l.match.accountId=o),s){if(!c)throw Error(n(`bindingPeerIdRequired`).replace(`{index}`,String(r)));l.match.peer={kind:s,id:c}}return l}),a=e.runtimeEntries.reduce((e,t,r)=>{let i=t.id.trim(),a=t.type.trim();if(!i)throw Error(n(`runtimeEntryIdRequired`).replace(`{index}`,String(r)));if(!a)throw Error(n(`runtimeEntryTypeRequired`).replace(`{id}`,i));if(e[i])throw Error(`${n(`runtimeEntryDuplicate`)}: ${i}`);let o=t.configText.trim()?JSON.parse(t.configText):{};if(o&&(typeof o!=`object`||Array.isArray(o)))throw Error(n(`runtimeEntryConfigObjectRequired`).replace(`{id}`,i));return e[i]={enabled:t.enabled!==!1,...t.label?.trim()?{label:t.label.trim()}:{},type:a,config:o??{}},e},{});return{companion:{enabled:e.companionEnabled},agents:{defaults:{contextTokens:Math.max(1e3,e.defaultContextTokens),engine:e.defaultEngine.trim()||`native`},list:t,runtimes:{entries:a}},bindings:i,session:{dmScope:e.dmScope}}}function pe(e){return(0,L.jsxs)(u,{children:[(0,L.jsxs)(g,{children:[(0,L.jsx)(c,{children:n(`agentList`)}),(0,L.jsx)(a,{children:n(`agentListHelp`)})]}),(0,L.jsxs)(_,{className:`space-y-3`,children:[e.agents.map((t,r)=>(0,L.jsxs)(`div`,{className:`rounded-xl border border-gray-200 p-3 space-y-3`,children:[(0,L.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3`,children:[(0,L.jsx)(o,{value:t.id,onChange:t=>e.onUpdateAgent(r,{id:t.target.value}),placeholder:n(`agentIdPlaceholder`)}),(0,L.jsx)(o,{value:t.workspace??``,onChange:t=>e.onUpdateAgent(r,{workspace:t.target.value}),placeholder:n(`workspaceOverridePlaceholder`)}),(0,L.jsx)(o,{value:t.model??``,onChange:t=>e.onUpdateAgent(r,{model:t.target.value}),placeholder:n(`modelOverridePlaceholder`)}),(0,L.jsx)(o,{value:t.runtime??t.engine??``,onChange:t=>e.onUpdateAgent(r,{runtime:t.target.value}),placeholder:n(`engineOverridePlaceholder`)}),(0,L.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-2`,children:[(0,L.jsx)(o,{type:`number`,min:1e3,step:1e3,value:t.contextTokens??``,onChange:t=>e.onUpdateAgent(r,{contextTokens:$(t.target.value)}),placeholder:n(`contextTokensPlaceholder`)}),(0,L.jsx)(o,{type:`number`,min:1,value:t.maxToolIterations??``,onChange:t=>e.onUpdateAgent(r,{maxToolIterations:$(t.target.value)}),placeholder:n(`maxToolsPlaceholder`)})]})]}),(0,L.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-gray-600`,children:[(0,L.jsx)(v,{checked:!!t.default,onCheckedChange:t=>e.onSetDefaultAgent(r,t)}),(0,L.jsx)(`span`,{children:n(`defaultAgent`)})]}),(0,L.jsxs)(s,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>e.onRemoveAgent(r),children:[(0,L.jsx)(w,{className:`h-4 w-4 mr-1`}),n(`remove`)]})]})]},`${r}-${t.id}`)),(0,L.jsxs)(s,{type:`button`,variant:`outline`,onClick:e.onAddAgent,children:[(0,L.jsx)(S,{className:`h-4 w-4 mr-2`}),n(`addAgent`)]})]})]})}function me(e){return(0,L.jsxs)(u,{children:[(0,L.jsxs)(g,{children:[(0,L.jsx)(c,{children:n(`bindings`)}),(0,L.jsx)(a,{children:n(`bindingsHelp`)})]}),(0,L.jsxs)(_,{className:`space-y-3`,children:[e.bindings.map((t,r)=>{let i=t.match.peer?.kind??``;return(0,L.jsxs)(`div`,{className:`rounded-xl border border-gray-200 p-3 space-y-3`,children:[(0,L.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3`,children:[(0,L.jsx)(o,{value:t.agentId,onChange:n=>e.onUpdateBinding(r,{...t,agentId:n.target.value}),placeholder:n(`targetAgentIdPlaceholder`)}),(0,L.jsx)(o,{value:t.match.channel,onChange:n=>e.onUpdateBinding(r,{...t,match:{...t.match,channel:n.target.value}}),placeholder:n(`channelPlaceholder`)}),(0,L.jsx)(o,{value:t.match.accountId??``,onChange:n=>e.onUpdateBinding(r,{...t,match:{...t.match,accountId:n.target.value}}),placeholder:n(`accountIdOptionalPlaceholder`)}),(0,L.jsxs)(N,{value:i||`__none__`,onValueChange:n=>{let i=n===`__none__`?``:n;e.onUpdateBinding(r,i?{...t,match:{...t.match,peer:{kind:i,id:t.match.peer?.id??``}}}:{...t,match:{...t.match,peer:void 0}})},children:[(0,L.jsx)(O,{children:(0,L.jsx)(A,{})}),(0,L.jsxs)(E,{children:[(0,L.jsx)(j,{value:`__none__`,children:n(`peerKindOptional`)}),(0,L.jsx)(j,{value:`direct`,children:n(`peerKindDirect`)}),(0,L.jsx)(j,{value:`group`,children:n(`peerKindGroup`)}),(0,L.jsx)(j,{value:`channel`,children:n(`peerKindChannel`)})]})]}),(0,L.jsx)(o,{value:t.match.peer?.id??``,onChange:n=>e.onUpdateBinding(r,{...t,match:{...t.match,peer:i?{kind:i,id:n.target.value}:void 0}}),placeholder:n(`peerIdPlaceholder`)})]}),(0,L.jsx)(`div`,{className:`flex justify-end`,children:(0,L.jsxs)(s,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>e.onRemoveBinding(r),children:[(0,L.jsx)(w,{className:`h-4 w-4 mr-1`}),n(`remove`)]})})]},`${r}-${t.agentId}`)}),(0,L.jsxs)(s,{type:`button`,variant:`outline`,onClick:e.onAddBinding,children:[(0,L.jsx)(S,{className:`h-4 w-4 mr-2`}),n(`addBinding`)]})]})]})}function he(e){return(0,L.jsxs)(u,{children:[(0,L.jsxs)(g,{children:[(0,L.jsx)(c,{children:n(`runtimeEntries`)}),(0,L.jsx)(a,{children:n(`runtimeEntriesHelp`)})]}),(0,L.jsxs)(_,{className:`space-y-3`,children:[e.entries.map((t,r)=>(0,L.jsxs)(`div`,{className:`rounded-xl border border-gray-200 p-3 space-y-3`,children:[(0,L.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3`,children:[(0,L.jsx)(o,{value:t.id,onChange:t=>e.onUpdateEntry(r,{id:t.target.value}),placeholder:n(`runtimeEntryIdPlaceholder`)}),(0,L.jsx)(o,{value:t.label??``,onChange:t=>e.onUpdateEntry(r,{label:t.target.value}),placeholder:n(`runtimeEntryLabelPlaceholder`)}),(0,L.jsx)(o,{value:t.type,onChange:t=>e.onUpdateEntry(r,{type:t.target.value}),placeholder:n(`runtimeEntryTypePlaceholder`)}),(0,L.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg border border-gray-200 px-3 py-2`,children:[(0,L.jsx)(`span`,{className:`text-sm text-gray-700`,children:n(`enabled`)}),(0,L.jsx)(v,{checked:t.enabled!==!1,onCheckedChange:t=>e.onUpdateEntry(r,{enabled:t})})]})]}),(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsx)(`label`,{className:`text-sm font-medium text-gray-800`,children:n(`runtimeEntryConfigJson`)}),(0,L.jsx)(`textarea`,{className:`min-h-32 w-full rounded-md border border-gray-200 px-3 py-2 text-sm font-mono`,value:t.configText,onChange:t=>e.onUpdateEntry(r,{configText:t.target.value}),spellCheck:!1})]}),(0,L.jsx)(`div`,{className:`flex justify-end`,children:(0,L.jsxs)(s,{type:`button`,variant:`outline`,onClick:()=>e.onRemoveEntry(r),children:[(0,L.jsx)(w,{className:`mr-2 h-4 w-4`}),n(`delete`)]})})]},`${r}-${t.id||`runtime-entry`}`)),(0,L.jsxs)(s,{type:`button`,variant:`outline`,onClick:e.onAddEntry,children:[(0,L.jsx)(S,{className:`mr-2 h-4 w-4`}),n(`addRuntimeEntry`)]})]})]})}var ge=[{value:`main`,labelKey:`dmScopeMain`},{value:`per-peer`,labelKey:`dmScopePerPeer`},{value:`per-channel-peer`,labelKey:`dmScopePerChannelPeer`},{value:`per-account-channel-peer`,labelKey:`dmScopePerAccountChannelPeer`}];function _e(e){return(0,L.jsxs)(u,{children:[(0,L.jsxs)(g,{children:[(0,L.jsx)(c,{children:n(`dmScope`)}),(0,L.jsx)(a,{children:n(`dmScopeHelp`)})]}),(0,L.jsxs)(_,{className:`space-y-4`,children:[(0,L.jsxs)(`div`,{className:`flex items-start justify-between gap-4 rounded-md border border-gray-200 px-4 py-3`,children:[(0,L.jsxs)(`div`,{className:`space-y-1`,children:[(0,L.jsx)(`div`,{className:`text-sm font-medium text-gray-800`,children:n(`runtimeCompanionEnabled`)}),(0,L.jsx)(`p`,{className:`text-xs text-gray-500`,children:n(`runtimeCompanionEnabledHelp`)})]}),(0,L.jsx)(v,{checked:e.companionEnabled,onCheckedChange:e.onCompanionEnabledChange})]}),(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsx)(`label`,{className:`text-sm font-medium text-gray-800`,children:n(`defaultContextTokens`)}),(0,L.jsx)(o,{type:`number`,min:1e3,step:1e3,value:e.defaultContextTokens,onChange:t=>e.onDefaultContextTokensChange(Math.max(1e3,Number.parseInt(t.target.value,10)||1e3))}),(0,L.jsx)(`p`,{className:`text-xs text-gray-500`,children:n(`defaultContextTokensHelp`)})]}),(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsx)(`label`,{className:`text-sm font-medium text-gray-800`,children:n(`defaultEngine`)}),(0,L.jsx)(o,{value:e.defaultEngine,onChange:t=>e.onDefaultEngineChange(t.target.value),placeholder:n(`defaultEnginePlaceholder`)}),(0,L.jsx)(`p`,{className:`text-xs text-gray-500`,children:n(`defaultEngineHelp`)})]}),(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsx)(`label`,{className:`text-sm font-medium text-gray-800`,children:n(`dmScope`)}),(0,L.jsxs)(N,{value:e.dmScope,onValueChange:t=>e.onDmScopeChange(t),children:[(0,L.jsx)(O,{children:(0,L.jsx)(A,{})}),(0,L.jsx)(E,{children:ge.map(e=>(0,L.jsx)(j,{value:e.value,children:n(e.labelKey)},e.value))})]})]})]})]})}function ve(e){let t=(0,I.useMemo)(()=>ue(e.config),[e.config]),[r,i]=(0,I.useState)(t.agents),[a,o]=(0,I.useState)(t.bindings),[c,l]=(0,I.useState)(t.runtimeEntries),[u,f]=(0,I.useState)(t.dmScope),[p,h]=(0,I.useState)(t.companionEnabled),[g,_]=(0,I.useState)(t.defaultContextTokens),[v,y]=(0,I.useState)(t.defaultEngine),b=(0,I.useMemo)(()=>{let e=new Set([`main`]);return r.forEach(t=>{let n=t.id.trim();n&&e.add(n)}),e},[r]);return(0,L.jsxs)(d,{className:`space-y-6`,children:[(0,L.jsx)(ie,{}),(0,L.jsx)(_e,{companionEnabled:p,dmScope:u,defaultContextTokens:g,defaultEngine:v,onCompanionEnabledChange:h,onDmScopeChange:f,onDefaultContextTokensChange:_,onDefaultEngineChange:y}),(0,L.jsx)(he,{entries:c,onUpdateEntry:(e,t)=>l(n=>n.map((n,r)=>r===e?{...n,...t}:n)),onRemoveEntry:e=>l(t=>t.filter((t,n)=>n!==e)),onAddEntry:()=>l(e=>[...e,se()])}),(0,L.jsx)(pe,{agents:r,onUpdateAgent:(e,t)=>{i(n=>n.map((n,r)=>r===e?{...n,...t}:n))},onRemoveAgent:e=>i(t=>t.filter((t,n)=>n!==e)),onAddAgent:()=>i(e=>[...e,ae()]),onSetDefaultAgent:(e,t)=>i(n=>t?n.map((t,n)=>({...t,default:n===e})):n.map((t,n)=>n===e?{...t,default:!1}:t))}),(0,L.jsx)(me,{bindings:a,onUpdateBinding:(e,t)=>{o(n=>n.map((n,r)=>r===e?t:n))},onRemoveBinding:e=>o(t=>t.filter((t,n)=>n!==e)),onAddBinding:()=>o(e=>[...e,oe()])}),(0,L.jsx)(`div`,{className:`flex justify-end`,children:(0,L.jsxs)(s,{type:`button`,onClick:()=>{try{let t=fe({companionEnabled:p,agents:r,bindings:a,runtimeEntries:c,dmScope:u,defaultContextTokens:g,defaultEngine:v,knownAgentIds:b});e.updateRuntime.mutate({data:t})}catch(e){m.error(e instanceof Error?e.message:String(e))}},disabled:e.updateRuntime.isPending,children:[(0,L.jsx)(C,{className:`h-4 w-4 mr-2`}),e.updateRuntime.isPending?n(`saving`):n(`saveRuntimeSettings`)]})})]})}function ye(){let{data:e,isLoading:t}=F(),r=P();return t||!e?(0,L.jsx)(`div`,{className:`p-8 text-gray-400`,children:n(`runtimeLoading`)}):(0,L.jsx)(ve,{config:e,updateRuntime:r})}export{ye as RuntimeConfig};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e}from"./dist-
|
|
1
|
+
import{c as e}from"./dist-NZRV-BxD.js";var t=e(`Save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as e}from"./dist-NZRV-BxD.js";var t=e(`Search`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as e,p as t,r as n,v as r}from"./react-Dsotw5vM.js";import{Ft as i,It as a,Lt as o,Nt as s,Pt as c}from"./api-B50yVdT8.js";import{t as l}from"./external-link-528k6MDD.js";import{t as u}from"./key-round-D3vD9dj7.js";import{t as d}from"./search-D7L-TCH-.js";import{B as f,H as p,K as m,U as h,V as g,z as _}from"./index-CMNrRhnG.js";import{_ as v,n as y,t as b}from"./use-config-TzwzTgg0.js";import{a as x,c as S,i as C,n as w,o as T,s as E,t as D}from"./config-split-page-CsQ2rIdq.js";var O=r(e(),1),k=t(),A=[{value:`noLimit`,label:`searchFreshnessNoLimit`},{value:`oneDay`,label:`searchFreshnessOneDay`},{value:`oneWeek`,label:`searchFreshnessOneWeek`},{value:`oneMonth`,label:`searchFreshnessOneMonth`},{value:`oneYear`,label:`searchFreshnessOneYear`}],j=[{value:`basic`,label:`searchDepthBasic`},{value:`advanced`,label:`searchDepthAdvanced`}],M=[{value:`true`,label:`enabled`},{value:`false`,label:`disabled`}],N={bocha:`searchProviderBochaDescription`,tavily:`searchProviderTavilyDescription`,brave:`searchProviderBraveDescription`};function P(e){return{activeProvider:e.provider,enabledProviders:e.enabledProviders,maxResults:String(e.defaults.maxResults),providers:{bocha:{apiKey:``,baseUrl:e.providers.bocha.baseUrl,summary:!!e.providers.bocha.summary,freshness:e.providers.bocha.freshness??`noLimit`},tavily:{apiKey:``,baseUrl:e.providers.tavily.baseUrl,searchDepth:e.providers.tavily.searchDepth??`basic`,includeAnswer:!!e.providers.tavily.includeAnswer},brave:{apiKey:``,baseUrl:e.providers.brave.baseUrl}}}}function F(e){return{provider:e.activeProvider,enabledProviders:e.enabledProviders,defaults:{maxResults:Number(e.maxResults)||10},providers:{bocha:{apiKey:e.providers.bocha.apiKey||void 0,baseUrl:e.providers.bocha.baseUrl,summary:e.providers.bocha.summary,freshness:e.providers.bocha.freshness},tavily:{apiKey:e.providers.tavily.apiKey||void 0,baseUrl:e.providers.tavily.baseUrl,searchDepth:e.providers.tavily.searchDepth,includeAnswer:e.providers.tavily.includeAnswer},brave:{apiKey:e.providers.brave.apiKey||void 0,baseUrl:e.providers.brave.baseUrl}}}}function I(e){let{label:t,value:n,onChange:r,placeholder:o,type:s=`text`,inputMode:c}=e;return(0,k.jsxs)(`div`,{className:`space-y-2`,children:[(0,k.jsx)(i,{children:t}),(0,k.jsx)(a,{type:s,value:n,onChange:e=>r(e.target.value),placeholder:o,inputMode:c,className:`rounded-xl`})]})}function L(e){let{label:t,value:r,options:a,onChange:o}=e;return(0,k.jsxs)(`div`,{className:`space-y-2`,children:[(0,k.jsx)(i,{children:t}),(0,k.jsxs)(_,{value:r,onValueChange:o,children:[(0,k.jsx)(p,{className:`rounded-xl`,children:(0,k.jsx)(h,{})}),(0,k.jsx)(f,{children:a.map(e=>(0,k.jsx)(g,{value:e.value,children:n(e.label)},e.value))})]})]})}function R({docsUrl:e}){return e?(0,k.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,children:(0,k.jsxs)(o,{type:`button`,variant:`outline`,className:`rounded-xl`,children:[(0,k.jsx)(l,{className:`mr-2 h-4 w-4`}),n(`searchProviderOpenDocs`)]})}):null}function z(e){let{draft:t,provider:r,search:i,selectedDocsUrl:a,updateProviderDraft:o}=e;if(r===`bocha`){let{bocha:e}=t.providers;return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(I,{label:n(`apiKey`),value:e.apiKey,onChange:e=>o(`bocha`,{apiKey:e}),placeholder:i.providers.bocha.apiKeyMasked||n(`enterApiKey`),type:`password`}),(0,k.jsx)(I,{label:n(`searchProviderBaseUrl`),value:e.baseUrl,onChange:e=>o(`bocha`,{baseUrl:e})}),(0,k.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,k.jsx)(L,{label:n(`searchProviderSummary`),value:e.summary?`true`:`false`,options:M,onChange:e=>o(`bocha`,{summary:e===`true`})}),(0,k.jsx)(L,{label:n(`searchProviderFreshness`),value:e.freshness,options:A,onChange:e=>o(`bocha`,{freshness:e})})]}),(0,k.jsx)(R,{docsUrl:a??`https://open.bocha.cn`})]})}if(r===`tavily`){let{tavily:e}=t.providers;return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(I,{label:n(`apiKey`),value:e.apiKey,onChange:e=>o(`tavily`,{apiKey:e}),placeholder:i.providers.tavily.apiKeyMasked||n(`enterApiKey`),type:`password`}),(0,k.jsx)(I,{label:n(`searchProviderBaseUrl`),value:e.baseUrl,onChange:e=>o(`tavily`,{baseUrl:e})}),(0,k.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,k.jsx)(L,{label:n(`searchProviderSearchDepth`),value:e.searchDepth,options:j,onChange:e=>o(`tavily`,{searchDepth:e})}),(0,k.jsx)(L,{label:n(`searchProviderIncludeAnswer`),value:e.includeAnswer?`true`:`false`,options:M,onChange:e=>o(`tavily`,{includeAnswer:e===`true`})})]}),(0,k.jsx)(R,{docsUrl:a})]})}let{brave:s}=t.providers;return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(I,{label:n(`apiKey`),value:s.apiKey,onChange:e=>o(`brave`,{apiKey:e}),placeholder:i.providers.brave.apiKeyMasked||n(`enterApiKey`),type:`password`}),(0,k.jsx)(I,{label:n(`searchProviderBaseUrl`),value:s.baseUrl,onChange:e=>o(`brave`,{baseUrl:e})})]})}function B(e){let{draft:t,providers:r,search:i,selectedProvider:a,onSelect:o}=e;return(0,k.jsxs)(x,{children:[(0,k.jsx)(S,{className:`px-4 py-4`,children:(0,k.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-gray-500`,children:n(`searchChannels`)})}),(0,k.jsx)(T,{className:`space-y-2 p-3`,children:r.map(e=>{let r=i.providers[e.name],s=t.enabledProviders.includes(e.name);return(0,k.jsx)(D,{onClick:()=>o(e.name),active:a===e.name,className:`p-3`,children:(0,k.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,k.jsxs)(`div`,{className:`min-w-0`,children:[(0,k.jsx)(`p`,{className:`truncate text-sm font-semibold text-gray-900`,children:e.displayName}),(0,k.jsx)(`p`,{className:`line-clamp-2 text-[11px] text-gray-500`,children:n(N[e.name])})]}),(0,k.jsxs)(`div`,{className:`flex flex-col items-end gap-1`,children:[(0,k.jsx)(`span`,{className:`rounded-full bg-gray-100 px-2 py-0.5 text-[11px] font-medium text-gray-600`,children:r.apiKeySet?n(`searchStatusConfigured`):n(`searchStatusNeedsSetup`)}),s?(0,k.jsx)(`span`,{className:`rounded-full bg-emerald-50 px-2 py-0.5 text-[11px] font-medium text-emerald-700`,children:n(`searchProviderActivated`)}):null]})]})},e.name)})})]})}function V(e){let{initialDraft:t,providers:r,search:i,onSubmit:a,isPending:s}=e,{isMobile:c}=m(),[l,f]=(0,O.useState)(c?null:i.provider),[p,h]=(0,O.useState)(t),g=l&&r.some(e=>e.name===l)?l:c?null:i.provider,_=r.find(e=>e.name===g)??null,v=g?i.providers[g]:null,y=g?p.enabledProviders.includes(g):!1,b=v?.docsUrl??_?.docsUrl;return(0,k.jsxs)(C,{className:`xl:min-h-0`,mobileView:c?g?`detail`:`list`:void 0,onMobileBack:()=>f(null),mobileListLabel:n(`searchPageTitle`),children:[(0,k.jsx)(B,{draft:p,providers:r,search:i,selectedProvider:g??i.provider,onSelect:f}),_?(0,k.jsx)(x,{children:(0,k.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),a(p)},className:`flex min-h-0 flex-1 flex-col`,children:[(0,k.jsx)(S,{className:`px-6 py-5`,children:(0,k.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,k.jsx)(`div`,{className:`flex h-10 w-10 items-center justify-center rounded-xl bg-primary text-white`,children:(0,k.jsx)(d,{className:`h-5 w-5`})}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`h3`,{className:`text-lg font-semibold text-gray-900`,children:_.displayName}),(0,k.jsx)(`p`,{className:`text-sm text-gray-500`,children:_.description})]})]}),(0,k.jsx)(o,{type:`button`,variant:y?`secondary`:`outline`,className:`rounded-xl`,onClick:()=>{let e=y?p.enabledProviders.filter(e=>e!==g):g?[...p.enabledProviders,g]:p.enabledProviders,t={...p,enabledProviders:e};h(t),a(t)},children:n(y?`searchProviderDeactivate`:`searchProviderActivate`)})]})}),(0,k.jsxs)(T,{className:`space-y-6 px-6 py-5`,children:[(0,k.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,k.jsx)(L,{label:n(`searchActiveProvider`),value:p.activeProvider,options:r.map(e=>({value:e.name,label:e.displayName})),onChange:e=>h({...p,activeProvider:e})}),(0,k.jsx)(I,{label:n(`searchDefaultMaxResults`),value:p.maxResults,onChange:e=>h({...p,maxResults:e}),inputMode:`numeric`})]}),(0,k.jsx)(z,{draft:p,provider:g,search:i,selectedDocsUrl:b,updateProviderDraft:(e,t)=>{h(n=>({...n,providers:{...n.providers,[e]:{...n.providers[e],...t}}}))}})]}),(0,k.jsx)(E,{className:`flex justify-end px-6 py-4`,children:(0,k.jsxs)(o,{type:`submit`,disabled:s,children:[(0,k.jsx)(u,{className:`mr-2 h-4 w-4`}),n(s?`saving`:`saveChanges`)]})})]})}):(0,k.jsx)(w,{children:(0,k.jsx)(`p`,{className:`text-sm text-gray-500`,children:n(`searchNoProviderSelected`)})})]})}function H(){let{data:e}=b(),{data:t}=y(),r=v(),i=t?.search??[],a=e?.search;return!a||i.length===0?(0,k.jsx)(`div`,{className:`p-8`,children:n(`loading`)}):(0,k.jsxs)(c,{className:`pb-0 xl:flex xl:h-full xl:min-h-0 xl:flex-col`,children:[(0,k.jsx)(s,{title:n(`searchPageTitle`),description:n(`searchPageDescription`)}),(0,k.jsx)(V,{initialDraft:P(a),providers:i,search:a,onSubmit:e=>r.mutate({data:F(e)}),isPending:r.isPending},JSON.stringify(a))]})}export{H as SearchConfigPage};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{h as e,p as t,r as n,v as r}from"./react-Dsotw5vM.js";import{At as i,Ft as a,It as o,Lt as s,Mt as c,Nt as l,Ot as u,Pt as d,Vt as f,jt as p,kt as m,mt as h}from"./api-B50yVdT8.js";import{t as g}from"./plus-Bf9qhPDO.js";import{t as _}from"./save-CHDnDTok.js";import{t as v}from"./trash-2-CSfX-BvU.js";import{B as y,H as b,U as x,V as S,z as C}from"./index-CMNrRhnG.js";import{t as w,v as T}from"./use-config-TzwzTgg0.js";var E=r(e(),1),D=t(),O=[`env`,`file`,`exec`];function k(e=``){return{alias:e,source:`env`,prefix:``,path:``,command:``,argsText:``,cwd:``,timeoutMs:5e3}}function A(){return{path:``,source:`env`,provider:``,id:``}}function j(e,t){return t.source===`env`?{...k(e),source:`env`,prefix:t.prefix??``}:t.source===`file`?{...k(e),source:`file`,path:t.path}:{...k(e),source:`exec`,command:t.command,argsText:(t.args??[]).join(`
|
|
2
|
+
`),cwd:t.cwd??``,timeoutMs:t.timeoutMs??5e3}}function M(e){return e.source===`env`?{source:`env`,...e.prefix.trim()?{prefix:e.prefix.trim()}:{}}:e.source===`file`?{source:`file`,path:e.path.trim(),format:`json`}:{source:`exec`,command:e.command.trim(),args:e.argsText.split(`
|
|
3
|
+
`).map(e=>e.trim()).filter(Boolean),...e.cwd.trim()?{cwd:e.cwd.trim()}:{},timeoutMs:Math.max(1,Math.trunc(e.timeoutMs||5e3))}}function N(e){return e?{enabled:!!e.enabled,defaultEnv:e.defaults.env??``,defaultFile:e.defaults.file??``,defaultExec:e.defaults.exec??``,providers:Object.entries(e.providers).map(([e,t])=>j(e,t)),refs:Object.entries(e.refs).map(([e,t])=>({path:e,source:t.source,provider:t.provider??``,id:t.id}))}:{enabled:!0,defaultEnv:``,defaultFile:``,defaultExec:``,providers:[],refs:[]}}function P(e){return{enabled:e.enabled,defaults:{env:e.defaultEnv||null,file:e.defaultFile||null,exec:e.defaultExec||null},providers:Object.fromEntries(e.providers.map(e=>[e.alias.trim(),M(e)]).filter(([e])=>e)),refs:Object.fromEntries(e.refs.map(e=>[e.path.trim(),{source:e.source,...e.provider.trim()?{provider:e.provider.trim()}:{},id:e.id.trim()}]).filter(([e,t])=>e&&t.id))}}function F(e){let{defaultEnv:t,defaultFile:r,defaultExec:o,providerAliases:s,onChange:l}=e;return(0,D.jsxs)(u,{children:[(0,D.jsxs)(p,{children:[(0,D.jsx)(c,{children:n(`secrets`)}),(0,D.jsx)(i,{children:n(`secretsEnabledHelp`)})]}),(0,D.jsx)(m,{className:`space-y-4`,children:[{label:n(`defaultEnvProvider`),value:t,key:`defaultEnv`},{label:n(`defaultFileProvider`),value:r,key:`defaultFile`},{label:n(`defaultExecProvider`),value:o,key:`defaultExec`}].map(e=>(0,D.jsxs)(`div`,{className:`space-y-2`,children:[(0,D.jsx)(a,{children:e.label}),(0,D.jsxs)(C,{value:e.value||`__none__`,onValueChange:t=>l(e.key,t===`__none__`?``:t),children:[(0,D.jsx)(b,{children:(0,D.jsx)(x,{placeholder:n(`noneOption`)})}),(0,D.jsxs)(y,{children:[(0,D.jsx)(S,{value:`__none__`,children:n(`noneOption`)}),s.map(e=>(0,D.jsx)(S,{value:e,children:e},e))]})]})]},e.key))})]})}function I(e){let{providers:t,onUpdate:r,onRemove:a,onAdd:l}=e;return(0,D.jsxs)(u,{children:[(0,D.jsxs)(p,{children:[(0,D.jsx)(c,{children:n(`secretProvidersTitle`)}),(0,D.jsx)(i,{children:n(`secretProvidersDescription`)})]}),(0,D.jsxs)(m,{className:`space-y-3`,children:[t.map((e,t)=>(0,D.jsxs)(`div`,{className:`space-y-3 rounded-xl border border-gray-200 p-3`,children:[(0,D.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 md:grid-cols-3`,children:[(0,D.jsx)(o,{value:e.alias,onChange:e=>r(t,{alias:e.target.value}),placeholder:n(`providerAlias`)}),(0,D.jsxs)(C,{value:e.source,onValueChange:e=>r(t,{source:e}),children:[(0,D.jsx)(b,{children:(0,D.jsx)(x,{})}),(0,D.jsx)(y,{children:O.map(e=>(0,D.jsx)(S,{value:e,children:e},e))})]}),(0,D.jsxs)(s,{type:`button`,variant:`outline`,onClick:()=>a(t),children:[(0,D.jsx)(v,{className:`mr-2 h-4 w-4`}),n(`removeProvider`)]})]}),e.source===`env`?(0,D.jsx)(o,{value:e.prefix,onChange:e=>r(t,{prefix:e.target.value}),placeholder:n(`envPrefix`)}):null,e.source===`file`?(0,D.jsx)(o,{value:e.path,onChange:e=>r(t,{path:e.target.value}),placeholder:n(`secretFilePath`)}):null,e.source===`exec`?(0,D.jsxs)(`div`,{className:`space-y-2`,children:[(0,D.jsx)(o,{value:e.command,onChange:e=>r(t,{command:e.target.value}),placeholder:n(`secretExecCommand`)}),(0,D.jsx)(`textarea`,{className:`min-h-[84px] w-full rounded-lg border border-gray-200 bg-white px-3 py-2 text-xs font-mono`,value:e.argsText,onChange:e=>r(t,{argsText:e.target.value}),placeholder:n(`secretExecArgs`)}),(0,D.jsxs)(`div`,{className:`grid grid-cols-1 gap-2 md:grid-cols-2`,children:[(0,D.jsx)(o,{value:e.cwd,onChange:e=>r(t,{cwd:e.target.value}),placeholder:n(`secretExecCwd`)}),(0,D.jsx)(o,{type:`number`,min:1,value:e.timeoutMs,onChange:e=>r(t,{timeoutMs:Number.parseInt(e.target.value,10)||5e3}),placeholder:n(`secretExecTimeoutMs`)})]})]}):null]},`provider-${t}`)),(0,D.jsxs)(s,{type:`button`,variant:`outline`,onClick:l,children:[(0,D.jsx)(g,{className:`mr-2 h-4 w-4`}),n(`addSecretProvider`)]})]})]})}function L(e){let{refs:t,providerAliases:r,onUpdate:a,onRemove:l,onAdd:d}=e;return(0,D.jsxs)(u,{children:[(0,D.jsxs)(p,{children:[(0,D.jsx)(c,{children:n(`secretRefsTitle`)}),(0,D.jsx)(i,{children:n(`secretRefsDescription`)})]}),(0,D.jsxs)(m,{className:`space-y-3`,children:[t.map((e,t)=>(0,D.jsx)(`div`,{className:`space-y-3 rounded-xl border border-gray-200 p-3`,children:(0,D.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 md:grid-cols-2`,children:[(0,D.jsx)(o,{value:e.path,onChange:e=>a(t,{path:e.target.value}),placeholder:n(`secretConfigPath`)}),(0,D.jsx)(o,{value:e.id,onChange:e=>a(t,{id:e.target.value}),placeholder:n(`secretId`)}),(0,D.jsxs)(C,{value:e.source,onValueChange:e=>a(t,{source:e}),children:[(0,D.jsx)(b,{children:(0,D.jsx)(x,{})}),(0,D.jsx)(y,{children:O.map(e=>(0,D.jsx)(S,{value:e,children:e},e))})]}),(0,D.jsxs)(`div`,{className:`grid grid-cols-[1fr_auto] gap-2`,children:[(0,D.jsxs)(C,{value:e.provider||`__none__`,onValueChange:e=>a(t,{provider:e===`__none__`?``:e}),children:[(0,D.jsx)(b,{children:(0,D.jsx)(x,{placeholder:n(`secretProviderAlias`)})}),(0,D.jsxs)(y,{children:[(0,D.jsx)(S,{value:`__none__`,children:n(`noneOption`)}),r.map(e=>(0,D.jsx)(S,{value:e,children:e},e))]})]}),(0,D.jsx)(s,{type:`button`,variant:`outline`,onClick:()=>l(t),children:(0,D.jsx)(v,{className:`h-4 w-4`})})]})]})},`ref-${t}`)),(0,D.jsxs)(s,{type:`button`,variant:`outline`,onClick:d,children:[(0,D.jsx)(g,{className:`mr-2 h-4 w-4`}),n(`addSecretRef`)]})]})]})}function R(e){let{initialState:t,isPending:r,onSubmit:a}=e,[o,g]=(0,E.useState)(t),v=(0,E.useMemo)(()=>{let e=o.providers.map(e=>e.alias.trim()).filter(Boolean);return Array.from(new Set(e))},[o.providers]);return(0,D.jsxs)(d,{className:`space-y-6`,children:[(0,D.jsx)(l,{title:n(`secretsPageTitle`),description:n(`secretsPageDescription`)}),(0,D.jsxs)(u,{children:[(0,D.jsxs)(p,{children:[(0,D.jsx)(c,{children:n(`secrets`)}),(0,D.jsx)(i,{children:n(`secretsEnabledHelp`)})]}),(0,D.jsxs)(m,{className:`space-y-4`,children:[(0,D.jsxs)(`div`,{className:`flex items-center justify-between rounded-xl border border-gray-200 p-3`,children:[(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`p`,{className:`text-sm font-medium text-gray-800`,children:n(`enabled`)}),(0,D.jsx)(`p`,{className:`text-xs text-gray-500`,children:n(`secretsEnabledHelp`)})]}),(0,D.jsx)(h,{checked:o.enabled,onCheckedChange:e=>g(t=>({...t,enabled:e}))})]}),(0,D.jsx)(F,{defaultEnv:o.defaultEnv,defaultFile:o.defaultFile,defaultExec:o.defaultExec,providerAliases:v,onChange:(e,t)=>g(n=>({...n,[e]:t}))})]})]}),(0,D.jsx)(I,{providers:o.providers,onUpdate:(e,t)=>{g(n=>({...n,providers:n.providers.map((n,r)=>r===e?{...n,...t}:n)}))},onRemove:e=>g(t=>({...t,providers:t.providers.filter((t,n)=>n!==e)})),onAdd:()=>g(e=>({...e,providers:[...e.providers,k()]}))}),(0,D.jsx)(L,{refs:o.refs,providerAliases:v,onUpdate:(e,t)=>{g(n=>({...n,refs:n.refs.map((n,r)=>r===e?{...n,...t}:n)}))},onRemove:e=>g(t=>({...t,refs:t.refs.filter((t,n)=>n!==e)})),onAdd:()=>g(e=>({...e,refs:[...e.refs,A()]}))}),(0,D.jsx)(`div`,{className:`flex justify-end`,children:(0,D.jsxs)(s,{type:`button`,onClick:()=>{try{let e={};for(let[t,r]of o.providers.entries()){let i=r.alias.trim();if(!i)throw Error(`${n(`providerAlias`)} #${t+1} ${n(`isRequired`)}`);if(e[i])throw Error(`${n(`providerAlias`)}: ${i} (${n(`duplicate`)})`);if(r.source===`file`&&!r.path.trim())throw Error(`${n(`secretFilePath`)} #${t+1} ${n(`isRequired`)}`);if(r.source===`exec`&&!r.command.trim())throw Error(`${n(`secretExecCommand`)} #${t+1} ${n(`isRequired`)}`);e[i]=M(r)}let t={};for(let[r,i]of o.refs.entries()){let a=i.path.trim(),o=i.id.trim();if(!a)throw Error(`${n(`secretConfigPath`)} #${r+1} ${n(`isRequired`)}`);if(!o)throw Error(`${n(`secretId`)} #${r+1} ${n(`isRequired`)}`);let s=i.provider.trim();if(s&&!e[s])throw Error(`${n(`secretProviderAlias`)}: ${s} ${n(`notFound`)}`);t[a]={source:i.source,...s?{provider:s}:{},id:o}}a({enabled:o.enabled,defaultEnv:o.defaultEnv.trim(),defaultFile:o.defaultFile.trim(),defaultExec:o.defaultExec.trim(),providers:Object.entries(e).map(([e,t])=>j(e,t)),refs:Object.entries(t).map(([e,t])=>({path:e,source:t.source,provider:t.provider??``,id:t.id}))})}catch(e){f.error(e instanceof Error?e.message:String(e))}},disabled:r,children:[(0,D.jsx)(_,{className:`mr-2 h-4 w-4`}),n(r?`saving`:`save`)]})})]})}function z(){let{data:e,isLoading:t}=w(),r=T();return t?(0,D.jsx)(`div`,{className:`p-8 text-gray-400`,children:n(`loading`)}):(0,D.jsx)(R,{initialState:N(e?.secrets),isPending:r.isPending,onSubmit:e=>r.mutate({data:P(e)})},JSON.stringify(e?.secrets??null))}export{z as SecretsConfigPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{p as e,u as t}from"./react-Dsotw5vM.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as e,p as t,u as n,v as r}from"./react-Dsotw5vM.js";var i=r(e(),1),a=t(),o=i.createContext(null);function s({defaultValue:e,value:t,onValueChange:n,children:r}){return(0,a.jsx)(o.Provider,{value:{value:t,onValueChange:n},children:r})}function c({children:e,className:t}){return(0,a.jsx)(`div`,{className:n(`inline-flex h-9 items-center justify-center rounded-xl bg-gray-100/80 p-1 text-gray-500`,t),children:e})}function l({value:e,children:t,className:r}){let s=i.useContext(o);if(!s)throw Error(`TabsTrigger must be used within Tabs`);let c=s.value===e;return(0,a.jsx)(`button`,{type:`button`,onClick:()=>s.onValueChange(e),"aria-pressed":c,"data-state":c?`active`:`inactive`,className:n(`inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-[13px] font-medium ring-offset-white transition-all duration-fast focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50`,c?`bg-white text-gray-900 shadow-sm`:`hover:bg-white/50 hover:text-gray-800 text-gray-600`,r),children:t})}function u({value:e,children:t,className:r}){let s=i.useContext(o);if(!s)throw Error(`TabsContent must be used within Tabs`);return s.value===e?(0,a.jsx)(`div`,{className:n(`mt-2 animate-fade-in`,r),children:t}):null}export{l as i,u as n,c as r,s as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{h as e,p as t,u as n,v as r}from"./react-Dsotw5vM.js";import{Rt as i}from"./api-B50yVdT8.js";var a=r(e(),1),o=t(),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,...r},i)=>(0,o.jsx)(`span`,{ref:i,className:n(s({tone:t}),e),...r}));c.displayName=`TagChip`;export{c as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{h as e,p as t,u as n,v as r}from"./react-Dsotw5vM.js";import{a as i,b as a,c as o,f as s,g as c,h as l,i as u,l as d,m as f,o as p,r as m,s as h,t as g,u as _,x as v,y}from"./dist-NZRV-BxD.js";import{t as b}from"./dist-D19wiQwB.js";var x=o(`Boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),S=r(e(),1),C=t(),[w,T]=y(`Tooltip`,[h]),E=h(),D=`TooltipProvider`,O=700,k=`tooltip.open`,[A,j]=w(D),M=e=>{let{__scopeTooltip:t,delayDuration:n=O,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=S.useRef(!0),s=S.useRef(!1),c=S.useRef(0);return S.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,C.jsx)(A,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:S.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:S.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:S.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};M.displayName=D;var N=`Tooltip`,[ee,P]=w(N),F=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,u=j(N,e.__scopeTooltip),d=E(t),[f,m]=S.useState(null),h=c(),g=S.useRef(0),_=o??u.disableHoverableContent,v=s??u.delayDuration,y=S.useRef(!1),[b,x]=l({prop:r,defaultProp:i??!1,onChange:e=>{e?(u.onOpen(),document.dispatchEvent(new CustomEvent(k))):u.onClose(),a?.(e)},caller:N}),w=S.useMemo(()=>b?y.current?`delayed-open`:`instant-open`:`closed`,[b]),T=S.useCallback(()=>{window.clearTimeout(g.current),g.current=0,y.current=!1,x(!0)},[x]),D=S.useCallback(()=>{window.clearTimeout(g.current),g.current=0,x(!1)},[x]),O=S.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{y.current=!0,x(!0),g.current=0},v)},[v,x]);return S.useEffect(()=>()=>{g.current&&=(window.clearTimeout(g.current),0)},[]),(0,C.jsx)(p,{...d,children:(0,C.jsx)(ee,{scope:t,contentId:h,open:b,stateAttribute:w,trigger:f,onTriggerChange:m,onTriggerEnter:S.useCallback(()=>{u.isOpenDelayedRef.current?O():T()},[u.isOpenDelayedRef,O,T]),onTriggerLeave:S.useCallback(()=>{_?D():(window.clearTimeout(g.current),g.current=0)},[D,_]),onOpen:T,onClose:D,disableHoverableContent:_,children:n})})};F.displayName=N;var I=`TooltipTrigger`,L=S.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=P(I,n),o=j(I,n),c=E(n),l=a(t,S.useRef(null),i.onTriggerChange),u=S.useRef(!1),d=S.useRef(!1),f=S.useCallback(()=>u.current=!1,[]);return S.useEffect(()=>()=>document.removeEventListener(`pointerup`,f),[f]),(0,C.jsx)(m,{asChild:!0,...c,children:(0,C.jsx)(s.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:l,onPointerMove:v(e.onPointerMove,e=>{e.pointerType!==`touch`&&!d.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),d.current=!0)}),onPointerLeave:v(e.onPointerLeave,()=>{i.onTriggerLeave(),d.current=!1}),onPointerDown:v(e.onPointerDown,()=>{i.open&&i.onClose(),u.current=!0,document.addEventListener(`pointerup`,f,{once:!0})}),onFocus:v(e.onFocus,()=>{u.current||i.onOpen()}),onBlur:v(e.onBlur,i.onClose),onClick:v(e.onClick,i.onClose)})})});L.displayName=I;var R=`TooltipPortal`,[z,B]=w(R,{forceMount:void 0}),V=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=P(R,t);return(0,C.jsx)(z,{scope:t,forceMount:n,children:(0,C.jsx)(b,{present:n||a.open,children:(0,C.jsx)(d,{asChild:!0,container:i,children:r})})})};V.displayName=R;var H=`TooltipContent`,U=S.forwardRef((e,t)=>{let n=B(H,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=P(H,e.__scopeTooltip);return(0,C.jsx)(b,{present:r||o.open,children:o.disableHoverableContent?(0,C.jsx)(K,{side:i,...a,ref:t}):(0,C.jsx)(W,{side:i,...a,ref:t})})}),W=S.forwardRef((e,t)=>{let n=P(H,e.__scopeTooltip),r=j(H,e.__scopeTooltip),i=S.useRef(null),o=a(t,i),[s,c]=S.useState(null),{trigger:l,onClose:u}=n,d=i.current,{onPointerInTransitChange:f}=r,p=S.useCallback(()=>{c(null),f(!1)},[f]),m=S.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=ae(r,ie(r,n.getBoundingClientRect())),a=oe(t.getBoundingClientRect());c(ce([...i,...a])),f(!0)},[f]);return S.useEffect(()=>()=>p(),[p]),S.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]),S.useEffect(()=>{if(s){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=l?.contains(t)||d?.contains(t),i=!se(n,s);r?p():i&&(p(),u())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[l,d,s,u,p]),(0,C.jsx)(K,{...e,ref:o})}),[G,te]=w(N,{isInside:!1}),ne=f(`TooltipContent`),K=S.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=P(H,n),u=E(n),{onClose:d}=l;return S.useEffect(()=>(document.addEventListener(k,d),()=>document.removeEventListener(k,d)),[d]),S.useEffect(()=>{if(l.trigger){let e=e=>{e.target?.contains(l.trigger)&&d()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]),(0,C.jsx)(_,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,C.jsxs)(i,{"data-state":l.stateAttribute,...u,...c,ref:t,style:{...c.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,C.jsx)(ne,{children:r}),(0,C.jsx)(G,{scope:n,isInside:!0,children:(0,C.jsx)(g,{id:l.contentId,role:`tooltip`,children:a||r})})]})})});U.displayName=H;var q=`TooltipArrow`,re=S.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=E(n);return te(q,n).isInside?null:(0,C.jsx)(u,{...i,...r,ref:t})});re.displayName=q;function ie(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 ae(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 oe(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 se(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 ce(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),le(t)}function le(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=M,Y=F,X=L,Z=V,Q=U,ue=J,de=Y,fe=X,$=S.forwardRef(({className:e,sideOffset:t=4,...r},i)=>(0,C.jsx)(Z,{children:(0,C.jsx)(Q,{ref:i,sideOffset:t,className:n(`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),...r})}));$.displayName=Q.displayName;export{Q as a,Y as c,fe as i,X as l,$ as n,Z as o,ue as r,J as s,de as t,x as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e}from"./dist-
|
|
1
|
+
import{c as e}from"./dist-NZRV-BxD.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{r as e}from"./react-Dsotw5vM.js";import{$ as t,F as n,G as r,H as i,Ht as a,J as o,L as s,M as c,P as l,Q as u,R as d,U as f,Ut as p,Vt as m,W as h,X as g,Y as _,Z as v,en as y,et as b,tt as x,z as S}from"./api-B50yVdT8.js";function C(){return p({queryKey:[`config`],queryFn:s,staleTime:3e4,refetchOnWindowFocus:!0})}function w(){return p({queryKey:[`config-meta`],queryFn:d,staleTime:1/0})}function T(){return p({queryKey:[`providers`],queryFn:f,staleTime:3e4,refetchOnWindowFocus:!0})}function E(){return p({queryKey:[`provider-templates`],queryFn:i,staleTime:1/0})}function D(){return p({queryKey:[`config-schema`],queryFn:S,staleTime:1/0})}function O(){let t=y();return a({mutationFn:v,onSuccess:()=>{t.invalidateQueries({queryKey:[`config`]}),m.success(e(`configSaved`))},onError:t=>{m.error(e(`configSaveFailed`)+`: `+t.message)}})}function k(){let t=y();return a({mutationFn:({data:e})=>b(e),onSuccess:()=>{t.invalidateQueries({queryKey:[`config`]}),t.invalidateQueries({queryKey:[`config-meta`]}),m.success(e(`configSavedApplied`))},onError:t=>{m.error(e(`configSaveFailed`)+`: `+t.message)}})}function A(){let t=y();return a({mutationFn:({provider:e,data:t})=>u(e,t),onSuccess:(n,r)=>{t.invalidateQueries({queryKey:[`providers`]}),t.invalidateQueries({queryKey:[`config`]}),r.silentSuccess||m.success(e(`configSaved`))},onError:t=>{m.error(e(`configSaveFailed`)+`: `+t.message)}})}function j(){let t=y();return a({mutationFn:({data:e})=>c(e??{}),onSuccess:()=>{t.invalidateQueries({queryKey:[`providers`]}),t.invalidateQueries({queryKey:[`config`]}),m.success(e(`configSaved`))},onError:t=>{m.error(e(`configSaveFailed`)+`: `+t.message)}})}function M(){let t=y();return a({mutationFn:({provider:e})=>l(e),onSuccess:()=>{t.invalidateQueries({queryKey:[`providers`]}),t.invalidateQueries({queryKey:[`config`]}),m.success(e(`configSaved`))},onError:t=>{m.error(e(`configSaveFailed`)+`: `+t.message)}})}function N(){return a({mutationFn:({provider:e,data:t})=>_(e,t)})}function P(){return a({mutationFn:({provider:e,data:t})=>o(e,t)})}function F(){return a({mutationFn:({provider:e,data:t})=>r(e,t)})}function I(){return a({mutationFn:({provider:e})=>h(e)})}function L(){let t=y();return a({mutationFn:({channel:e,data:t})=>g(e,t),onSuccess:()=>{t.invalidateQueries({queryKey:[`config`]}),t.invalidateQueries({queryKey:[`config-meta`]}),m.success(e(`configSavedApplying`))},onError:t=>{m.error(e(`configSaveFailed`)+`: `+t.message)}})}function R(){let n=y();return a({mutationFn:({data:e})=>t(e),onSuccess:()=>{n.invalidateQueries({queryKey:[`config`]}),m.success(e(`configSavedApplied`))},onError:t=>{m.error(e(`configSaveFailed`)+`: `+t.message)}})}function z(){let t=y();return a({mutationFn:({data:e})=>x(e),onSuccess:()=>{t.invalidateQueries({queryKey:[`config`]}),m.success(e(`configSavedApplied`))},onError:t=>{m.error(e(`configSaveFailed`)+`: `+t.message)}})}function B(){return a({mutationFn:({actionId:e,data:t})=>n(e,t),onError:t=>{m.error(e(`error`)+`: `+t.message)}})}export{k as _,M as a,F as c,P as d,N as f,R as g,A as h,j as i,E as l,O as m,w as n,B as o,L as p,D as r,I as s,C as t,T as u,z as v};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as e}from"./dist-NZRV-BxD.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
|
@@ -105,31 +105,33 @@
|
|
|
105
105
|
})();
|
|
106
106
|
</script>
|
|
107
107
|
<title>NextClaw</title>
|
|
108
|
-
<script type="module" crossorigin src="/assets/index-
|
|
109
|
-
<link rel="modulepreload" crossorigin href="/assets/react-
|
|
110
|
-
<link rel="modulepreload" crossorigin href="/assets/dist-
|
|
111
|
-
<link rel="modulepreload" crossorigin href="/assets/es2015-
|
|
112
|
-
<link rel="modulepreload" crossorigin href="/assets/dist-
|
|
113
|
-
<link rel="modulepreload" crossorigin href="/assets/api-
|
|
114
|
-
<link rel="modulepreload" crossorigin href="/assets/x-
|
|
115
|
-
<link rel="modulepreload" crossorigin href="/assets/confirm-dialog-
|
|
116
|
-
<link rel="modulepreload" crossorigin href="/assets/popover-
|
|
117
|
-
<link rel="modulepreload" crossorigin href="/assets/tooltip-
|
|
118
|
-
<link rel="modulepreload" crossorigin href="/assets/arrow-left-
|
|
119
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
120
|
-
<link rel="modulepreload" crossorigin href="/assets/key-round-
|
|
121
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
122
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
123
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
124
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
125
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
126
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
127
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
128
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
129
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
130
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
131
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
132
|
-
<link rel="
|
|
108
|
+
<script type="module" crossorigin src="/assets/index-CMNrRhnG.js"></script>
|
|
109
|
+
<link rel="modulepreload" crossorigin href="/assets/react-Dsotw5vM.js">
|
|
110
|
+
<link rel="modulepreload" crossorigin href="/assets/dist-NZRV-BxD.js">
|
|
111
|
+
<link rel="modulepreload" crossorigin href="/assets/es2015-BUIIKCNh.js">
|
|
112
|
+
<link rel="modulepreload" crossorigin href="/assets/dist-D19wiQwB.js">
|
|
113
|
+
<link rel="modulepreload" crossorigin href="/assets/api-B50yVdT8.js">
|
|
114
|
+
<link rel="modulepreload" crossorigin href="/assets/x-fkIWvi07.js">
|
|
115
|
+
<link rel="modulepreload" crossorigin href="/assets/confirm-dialog-DRSelLdI.js">
|
|
116
|
+
<link rel="modulepreload" crossorigin href="/assets/popover-BnmPOXe3.js">
|
|
117
|
+
<link rel="modulepreload" crossorigin href="/assets/tooltip-Bxzi6aDL.js">
|
|
118
|
+
<link rel="modulepreload" crossorigin href="/assets/arrow-left-BOCJyLbQ.js">
|
|
119
|
+
<link rel="modulepreload" crossorigin href="/assets/book-open-Bd2Xbrrc.js">
|
|
120
|
+
<link rel="modulepreload" crossorigin href="/assets/key-round-D3vD9dj7.js">
|
|
121
|
+
<link rel="modulepreload" crossorigin href="/assets/loader-circle-DV9TSRns.js">
|
|
122
|
+
<link rel="modulepreload" crossorigin href="/assets/plus-Bf9qhPDO.js">
|
|
123
|
+
<link rel="modulepreload" crossorigin href="/assets/refresh-cw-Bmx4wc9P.js">
|
|
124
|
+
<link rel="modulepreload" crossorigin href="/assets/trash-2-CSfX-BvU.js">
|
|
125
|
+
<link rel="modulepreload" crossorigin href="/assets/doc-browser-context-C8KPbj-p.js">
|
|
126
|
+
<link rel="modulepreload" crossorigin href="/assets/notice-card-qqlbsOoR.js">
|
|
127
|
+
<link rel="modulepreload" crossorigin href="/assets/status-dot-Dm4h-bjn.js">
|
|
128
|
+
<link rel="modulepreload" crossorigin href="/assets/tabs-CJvw5Lqp.js">
|
|
129
|
+
<link rel="modulepreload" crossorigin href="/assets/host-capabilities-9bB_998Z.js">
|
|
130
|
+
<link rel="modulepreload" crossorigin href="/assets/app-presenter-provider-BI-ewLbO.js">
|
|
131
|
+
<link rel="modulepreload" crossorigin href="/assets/external-link-528k6MDD.js">
|
|
132
|
+
<link rel="modulepreload" crossorigin href="/assets/search-D7L-TCH-.js">
|
|
133
|
+
<link rel="modulepreload" crossorigin href="/assets/doc-browser-2ddUJCA0.js">
|
|
134
|
+
<link rel="stylesheet" crossorigin href="/assets/index-UTmTW1eU.css">
|
|
133
135
|
</head>
|
|
134
136
|
|
|
135
137
|
<body>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nextclaw/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -28,13 +28,14 @@
|
|
|
28
28
|
"tailwind-merge": "^2.5.4",
|
|
29
29
|
"zod": "^3.23.8",
|
|
30
30
|
"zustand": "^5.0.2",
|
|
31
|
-
"@nextclaw/
|
|
32
|
-
"@nextclaw/
|
|
33
|
-
"@nextclaw/client
|
|
34
|
-
"@nextclaw/ncp": "0.
|
|
35
|
-
"@nextclaw/
|
|
36
|
-
"@nextclaw/
|
|
37
|
-
"@nextclaw/
|
|
31
|
+
"@nextclaw/client-sdk": "0.4.3",
|
|
32
|
+
"@nextclaw/ncp": "0.6.3",
|
|
33
|
+
"@nextclaw/ncp-http-agent-client": "0.3.45",
|
|
34
|
+
"@nextclaw/ncp-toolkit": "0.5.38",
|
|
35
|
+
"@nextclaw/shared": "0.3.0",
|
|
36
|
+
"@nextclaw/agent-chat": "0.2.13",
|
|
37
|
+
"@nextclaw/agent-chat-ui": "0.5.0",
|
|
38
|
+
"@nextclaw/ncp-react": "0.4.53"
|
|
38
39
|
},
|
|
39
40
|
"devDependencies": {
|
|
40
41
|
"@testing-library/react": "^16.3.0",
|
package/src/app/index.tsx
CHANGED
|
@@ -23,16 +23,19 @@ import {
|
|
|
23
23
|
import { startNextClawPwa } from "@/pwa/register-pwa";
|
|
24
24
|
|
|
25
25
|
const ModelConfigPage = lazy(async () => ({
|
|
26
|
-
default: (await import("@/
|
|
26
|
+
default: (await import("@/features/settings/pages/model-config-page"))
|
|
27
|
+
.ModelConfigPage,
|
|
27
28
|
}));
|
|
28
29
|
const ChatPage = lazy(async () => ({
|
|
29
30
|
default: (await import("@/components/chat/chat-page")).ChatPage,
|
|
30
31
|
}));
|
|
31
32
|
const SearchConfigPage = lazy(async () => ({
|
|
32
|
-
default: (await import("@/
|
|
33
|
+
default: (await import("@/features/settings/pages/search-config-page"))
|
|
34
|
+
.SearchConfigPage,
|
|
33
35
|
}));
|
|
34
36
|
const ProvidersListPage = lazy(async () => ({
|
|
35
|
-
default: (await import("@/
|
|
37
|
+
default: (await import("@/features/settings/pages/providers-config-page"))
|
|
38
|
+
.ProvidersConfigPage,
|
|
36
39
|
}));
|
|
37
40
|
const ChannelsListPage = lazy(async () => ({
|
|
38
41
|
default: (await import("@/components/config/ChannelsList")).ChannelsList,
|
|
@@ -48,7 +51,8 @@ const SecurityConfigPage = lazy(async () => ({
|
|
|
48
51
|
default: (await import("@/components/config/security-config")).SecurityConfig,
|
|
49
52
|
}));
|
|
50
53
|
const SecretsConfigPage = lazy(async () => ({
|
|
51
|
-
default: (await import("@/
|
|
54
|
+
default: (await import("@/features/settings/pages/secrets-config-page"))
|
|
55
|
+
.SecretsConfigPage,
|
|
52
56
|
}));
|
|
53
57
|
const RemoteAccessPage = lazy(async () => ({
|
|
54
58
|
default: (await import("@/features/remote")).RemoteAccessPage,
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from "@/shared/components/ui/dialog";
|
|
9
9
|
import { Input } from "@/shared/components/ui/input";
|
|
10
10
|
import { Label } from "@/shared/components/ui/label";
|
|
11
|
-
import { NoticeCard } from "@/shared/components/
|
|
11
|
+
import { NoticeCard } from "@/shared/components/feedback/notice-card";
|
|
12
12
|
import { useRemoteStatus } from "@/features/remote";
|
|
13
13
|
import { formatDateTime, t } from "@/shared/lib/i18n";
|
|
14
14
|
import { useAppPresenter } from "@/app/components/app-presenter-provider";
|
|
@@ -124,7 +124,7 @@ function SignedOutAccountSection(props: {
|
|
|
124
124
|
authStatusMessage?: string | null;
|
|
125
125
|
authVerificationUri?: string | null;
|
|
126
126
|
onStartBrowserSignIn: () => Promise<void>;
|
|
127
|
-
onResumeBrowserSignIn: () => void
|
|
127
|
+
onResumeBrowserSignIn: () => Promise<void>;
|
|
128
128
|
}) {
|
|
129
129
|
const {
|
|
130
130
|
authSessionId,
|
|
@@ -165,7 +165,7 @@ function SignedOutAccountSection(props: {
|
|
|
165
165
|
: t("remoteBrowserAuthAction")}
|
|
166
166
|
</Button>
|
|
167
167
|
{authVerificationUri ? (
|
|
168
|
-
<Button variant="outline" onClick={onResumeBrowserSignIn}>
|
|
168
|
+
<Button variant="outline" onClick={() => void onResumeBrowserSignIn()}>
|
|
169
169
|
{t("remoteBrowserAuthResume")}
|
|
170
170
|
</Button>
|
|
171
171
|
) : null}
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
isTransientAuthStatusBootstrapError,
|
|
4
4
|
resolveAuthStatusBootstrapRetryDelay,
|
|
5
5
|
shouldRetryAuthStatusBootstrap
|
|
6
|
-
} from '
|
|
6
|
+
} from '../use-auth';
|
|
7
7
|
|
|
8
8
|
describe('auth status bootstrap retry policy', () => {
|
|
9
9
|
it('retries transient transport failures during startup', () => {
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
import { formatDateTime, t } from '@/shared/lib/i18n';
|
|
10
10
|
import { toast } from 'sonner';
|
|
11
11
|
import { useAccountStore } from '@/features/account/stores/account.store';
|
|
12
|
+
import { hostCapabilityManager } from '@/shared/lib/host-capabilities';
|
|
12
13
|
|
|
13
14
|
type BrowserSignInCompletion = {
|
|
14
15
|
resolve: (status: RemoteAccessView) => void;
|
|
@@ -71,8 +72,8 @@ export class AccountManager {
|
|
|
71
72
|
intervalMs: result.intervalMs,
|
|
72
73
|
statusMessage: t('remoteBrowserAuthWaiting')
|
|
73
74
|
});
|
|
74
|
-
const opened =
|
|
75
|
-
if (!opened) {
|
|
75
|
+
const opened = await hostCapabilityManager.openExternalUrl(result.verificationUri);
|
|
76
|
+
if (!opened.opened) {
|
|
76
77
|
useAccountStore.getState().setAuthStatusMessage(t('remoteBrowserAuthPopupBlocked'));
|
|
77
78
|
}
|
|
78
79
|
this.scheduleBrowserAuthPoll();
|
|
@@ -83,12 +84,12 @@ export class AccountManager {
|
|
|
83
84
|
}
|
|
84
85
|
};
|
|
85
86
|
|
|
86
|
-
resumeBrowserSignIn = () => {
|
|
87
|
+
resumeBrowserSignIn = async () => {
|
|
87
88
|
const verificationUri = useAccountStore.getState().authVerificationUri;
|
|
88
89
|
if (!verificationUri) {
|
|
89
90
|
return;
|
|
90
91
|
}
|
|
91
|
-
|
|
92
|
+
await hostCapabilityManager.openExternalUrl(verificationUri);
|
|
92
93
|
};
|
|
93
94
|
|
|
94
95
|
logout = async () => {
|
|
@@ -125,7 +126,7 @@ export class AccountManager {
|
|
|
125
126
|
return;
|
|
126
127
|
}
|
|
127
128
|
const targetUrl = new URL(path, `${webBase.replace(/\/+$/, '')}/`).toString();
|
|
128
|
-
|
|
129
|
+
await hostCapabilityManager.openExternalUrl(targetUrl);
|
|
129
130
|
};
|
|
130
131
|
|
|
131
132
|
private scheduleBrowserAuthPoll = () => {
|
package/src/features/agents/components/{agents-page.test.tsx → __tests__/agents-page.test.tsx}
RENAMED
|
@@ -5,8 +5,8 @@ import { beforeEach, describe, expect, it, vi } from "vitest";
|
|
|
5
5
|
import { AgentsPage } from "@/features/agents";
|
|
6
6
|
import type * as ChatFeature from "@/features/chat";
|
|
7
7
|
import {
|
|
8
|
+
ChatPresenter,
|
|
8
9
|
ChatPresenterProvider,
|
|
9
|
-
NcpChatPresenter,
|
|
10
10
|
useChatInputStore,
|
|
11
11
|
useChatSessionListStore,
|
|
12
12
|
useChatThreadStore,
|
|
@@ -110,6 +110,41 @@ vi.mock("@/shared/hooks/use-agents", () => ({
|
|
|
110
110
|
vi.mock("@/shared/hooks/use-config", () => ({
|
|
111
111
|
useConfig: () => mocks.configQuery,
|
|
112
112
|
useConfigMeta: () => mocks.configMetaQuery,
|
|
113
|
+
useProviders: () => ({
|
|
114
|
+
data: {
|
|
115
|
+
providers: Object.fromEntries(
|
|
116
|
+
Object.entries(mocks.configQuery.data.providers).map(([providerId, provider]) => [
|
|
117
|
+
providerId,
|
|
118
|
+
{
|
|
119
|
+
providerId,
|
|
120
|
+
providerType: providerId,
|
|
121
|
+
isBuiltInType: false,
|
|
122
|
+
isCustom: false,
|
|
123
|
+
enabled: provider.enabled,
|
|
124
|
+
apiKeySet: provider.apiKeySet,
|
|
125
|
+
models: provider.models,
|
|
126
|
+
},
|
|
127
|
+
]),
|
|
128
|
+
),
|
|
129
|
+
},
|
|
130
|
+
isFetched: true,
|
|
131
|
+
isSuccess: true,
|
|
132
|
+
}),
|
|
133
|
+
useProviderTemplates: () => ({
|
|
134
|
+
data: {
|
|
135
|
+
providerTemplates: mocks.configMetaQuery.data.providers.map((provider) => ({
|
|
136
|
+
id: provider.name,
|
|
137
|
+
providerType: provider.name,
|
|
138
|
+
displayName: provider.displayName,
|
|
139
|
+
modelPrefix: provider.modelPrefix,
|
|
140
|
+
defaultModels: provider.defaultModels,
|
|
141
|
+
keywords: provider.keywords,
|
|
142
|
+
envKey: provider.envKey,
|
|
143
|
+
})),
|
|
144
|
+
},
|
|
145
|
+
isFetched: true,
|
|
146
|
+
isSuccess: true,
|
|
147
|
+
}),
|
|
113
148
|
}));
|
|
114
149
|
|
|
115
150
|
vi.mock("@/features/chat", async (importOriginal) => {
|
|
@@ -121,7 +156,11 @@ vi.mock("@/features/chat", async (importOriginal) => {
|
|
|
121
156
|
});
|
|
122
157
|
|
|
123
158
|
function renderAgentsPage() {
|
|
124
|
-
const presenter = new
|
|
159
|
+
const presenter = new ChatPresenter({
|
|
160
|
+
docBrowserManager: {
|
|
161
|
+
open: vi.fn(),
|
|
162
|
+
},
|
|
163
|
+
} as unknown as ConstructorParameters<typeof ChatPresenter>[0]);
|
|
125
164
|
return render(
|
|
126
165
|
<MemoryRouter>
|
|
127
166
|
<ChatPresenterProvider presenter={presenter}>
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
normalizeSessionType,
|
|
5
5
|
resolveSessionTypeLabel,
|
|
6
6
|
type ChatSessionTypeOption,
|
|
7
|
-
} from "@/features/chat
|
|
7
|
+
} from "@/features/chat";
|
|
8
8
|
import { ProviderScopedModelInput } from "@/shared/components/common/provider-scoped-model-input";
|
|
9
9
|
import { Button } from "@/shared/components/ui/button";
|
|
10
|
-
import { NoticeCard } from "@/shared/components/
|
|
10
|
+
import { NoticeCard } from "@/shared/components/feedback/notice-card";
|
|
11
11
|
import {
|
|
12
12
|
Select,
|
|
13
13
|
SelectContent,
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
PopoverContent,
|
|
27
27
|
PopoverTrigger,
|
|
28
28
|
} from "@/shared/components/ui/popover";
|
|
29
|
-
import { TagChip } from "@/shared/components/
|
|
29
|
+
import { TagChip } from "@/shared/components/tags/tag-chip";
|
|
30
30
|
import { PageLayout } from "@/app/components/layout/page-layout";
|
|
31
31
|
import { t } from "@/shared/lib/i18n";
|
|
32
32
|
import { buildProviderModelCatalog } from "@/shared/lib/provider-models";
|
|
@@ -5,7 +5,7 @@ import { BookOpen, ChevronDown } from 'lucide-react';
|
|
|
5
5
|
import { toast } from 'sonner';
|
|
6
6
|
import { LogoBadge } from '@/shared/components/common/logo-badge';
|
|
7
7
|
import { Button } from '@/shared/components/ui/button';
|
|
8
|
-
import { StatusDot } from '@/shared/components/
|
|
8
|
+
import { StatusDot } from '@/shared/components/status/status-dot';
|
|
9
9
|
import { nextclawClient } from '@/shared/lib/api';
|
|
10
10
|
import { useConfig, useConfigMeta, useConfigSchema, useExecuteConfigAction, useUpdateChannel } from '@/shared/hooks/use-config';
|
|
11
11
|
import type { ConfigActionManifest, ConfigUiHints } from '@/shared/lib/api';
|
|
@@ -3,8 +3,8 @@ import { ExternalLink, MessageSquare, Search } from 'lucide-react';
|
|
|
3
3
|
import { LogoBadge } from '@/shared/components/common/logo-badge';
|
|
4
4
|
import { PageHeader, PageLayout } from '@/app/components/layout/page-layout';
|
|
5
5
|
import { Input } from '@/shared/components/ui/input';
|
|
6
|
-
import { StatusDot } from '@/shared/components/
|
|
7
|
-
import { Tabs } from '@/shared/components/ui/tabs
|
|
6
|
+
import { StatusDot } from '@/shared/components/status/status-dot';
|
|
7
|
+
import { Tabs, TabsList, TabsTrigger } from '@/shared/components/ui/tabs';
|
|
8
8
|
import { ChannelForm } from '@/features/channels/components/config/channel-form';
|
|
9
9
|
import { useConfig, useConfigMeta, useConfigSchema } from '@/shared/hooks/use-config';
|
|
10
10
|
import { ConfigSelectionCard, ConfigSplitEmptyState, ConfigSplitPage, ConfigSplitPaneBody, ConfigSplitPaneHeader, ConfigSplitSidebar } from '@/shared/components/config-split-page';
|
|
@@ -85,19 +85,22 @@ export function ChannelsList() {
|
|
|
85
85
|
>
|
|
86
86
|
<ConfigSplitSidebar>
|
|
87
87
|
<ConfigSplitPaneHeader className="px-4 pt-4">
|
|
88
|
-
<Tabs
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
88
|
+
<Tabs value={activeTab} onValueChange={setActiveTab}>
|
|
89
|
+
<TabsList className="mb-0 h-auto gap-3 border-b-0 bg-transparent p-0">
|
|
90
|
+
<TabsTrigger value="enabled" className="gap-1.5 px-0 pb-3">
|
|
91
|
+
{t('channelsTabEnabled')}
|
|
92
|
+
<span className="text-[11px] font-medium text-gray-500">
|
|
93
|
+
{channels.filter((channel) => channelConfigs?.[channel.name]?.enabled).length}
|
|
94
|
+
</span>
|
|
95
|
+
</TabsTrigger>
|
|
96
|
+
<TabsTrigger value="all" className="gap-1.5 px-0 pb-3">
|
|
97
|
+
{t('channelsTabAll')}
|
|
98
|
+
<span className="text-[11px] font-medium text-gray-500">
|
|
99
|
+
{channels.length}
|
|
100
|
+
</span>
|
|
101
|
+
</TabsTrigger>
|
|
102
|
+
</TabsList>
|
|
103
|
+
</Tabs>
|
|
101
104
|
</ConfigSplitPaneHeader>
|
|
102
105
|
|
|
103
106
|
<div className="border-b border-gray-100 px-4 py-3">
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, expect, it } from 'vitest';
|
|
2
|
-
import { buildChannelFormDefinitions } from '
|
|
2
|
+
import { buildChannelFormDefinitions } from '../channel-form-fields.utils';
|
|
3
3
|
|
|
4
4
|
describe('buildChannelFormDefinitions', () => {
|
|
5
5
|
it('keeps default channels on a single all-fields layout', () => {
|
package/src/features/chat/components/{chat-welcome.test.tsx → __tests__/chat-welcome.test.tsx}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { render, screen } from '@testing-library/react';
|
|
2
2
|
import { fireEvent } from '@testing-library/react';
|
|
3
3
|
import { describe, expect, it, vi } from 'vitest';
|
|
4
|
-
import { ChatWelcome } from '
|
|
4
|
+
import { ChatWelcome } from '../chat-welcome';
|
|
5
5
|
|
|
6
6
|
describe('ChatWelcome', () => {
|
|
7
7
|
it('renders a lightweight draft agent select and allows switching', () => {
|