@nextclaw/ui 0.13.13 → 0.14.1-beta.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 +47 -0
- package/dist/assets/{api-D0hARyyl.js → api-C6EDHBDR.js} +7 -7
- package/dist/assets/channels-list-page-DKj6m1Hc.js +8 -0
- package/dist/assets/chat-page-BXngLJY6.js +105 -0
- package/dist/assets/config-split-page-CjlmJy8X.js +1 -0
- package/dist/assets/{confirm-dialog-CTcaBp-8.js → confirm-dialog-B39X0pYp.js} +2 -2
- package/dist/assets/desktop-update-config-DfUQ8nly.js +1 -0
- package/dist/assets/{dist-C59BKqbX.js → dist-BIYV2-Ia.js} +1 -1
- package/dist/assets/{dist-Di6EHp2x.js → dist-CmMro3nV.js} +1 -1
- package/dist/assets/doc-browser-B6Wc_TIY.js +1 -0
- package/dist/assets/doc-browser-CDtUtcim.js +1 -0
- package/dist/assets/doc-browser-context-DZbC9zVB.js +1 -0
- package/dist/assets/{ellipsis-hXUNwi63.js → ellipsis-DDpgTzgx.js} +1 -1
- package/dist/assets/{external-link-J0fCK-vu.js → external-link-D2cBOCqn.js} +1 -1
- package/dist/assets/index-DTb_XVIH.js +103 -0
- package/dist/assets/index-ayiPYhf1.css +1 -0
- package/dist/assets/mcp-marketplace-page-DZ9H0v05.js +1 -0
- package/dist/assets/mcp-marketplace-page-cnVWf7QQ.js +40 -0
- package/dist/assets/model-config-page-Bcb35AVv.js +1 -0
- package/dist/assets/plus-CYE1onU2.js +1 -0
- package/dist/assets/provider-scoped-model-input-kdoNp4HG.js +1 -0
- package/dist/assets/providers-config-page-CQSibSwO.js +1 -0
- package/dist/assets/{react-C7HsxuKH.js → react-DYQXXGbH.js} +1 -1
- package/dist/assets/remote-BlJDbXOI.js +1 -0
- package/dist/assets/rotate-cw-BWbvFDAX.js +1 -0
- package/dist/assets/runtime-config-page-Tn2yLQ0c.js +1 -0
- package/dist/assets/{save-Z1QTovIt.js → save-BNVTgBVn.js} +1 -1
- package/dist/assets/search-CKCzwLId.js +1 -0
- package/dist/assets/search-config-page-DG5Q2hF1.js +1 -0
- package/dist/assets/secrets-config-page-BXn5Uuwp.js +3 -0
- package/dist/assets/select-CIRwTNP4.js +41 -0
- package/dist/assets/{tag-chip-3kpiMTST.js → tag-chip-DKhVFtTE.js} +1 -1
- package/dist/assets/use-config-DgKM9VIU.js +1 -0
- package/dist/assets/x-Cm3JjYut.js +1 -0
- package/dist/index.html +14 -27
- package/package.json +9 -8
- package/src/app/index.tsx +8 -4
- package/src/app/presenters/app.presenter.ts +2 -0
- 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/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} +132 -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 +152 -0
- package/src/features/chat/components/conversation/chat-conversation-header.tsx +26 -89
- package/src/features/chat/components/conversation/chat-conversation-panel.tsx +13 -379
- 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 -46
- 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 +92 -31
- package/src/features/chat/features/input/hooks/use-chat-input-bar-query-state.ts +118 -0
- 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 -17
- 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}/chat-input-bar.utils.ts +1 -24
- package/src/features/chat/{utils → features/input/utils}/chat-input-toolbar.utils.ts +0 -27
- package/src/features/chat/{utils → features/input/utils}/ncp-chat-input-availability.utils.ts +6 -6
- package/src/features/chat/features/message/components/__tests__/chat-inline-panel-app-card.test.tsx +89 -0
- package/src/features/chat/{components/conversation → features/message/components/__tests__}/chat-message-list.container.test.tsx +46 -3
- package/src/features/chat/features/message/components/chat-inline-panel-app-card.tsx +115 -0
- package/src/features/chat/{components/conversation → features/message/components}/chat-message-list.container.tsx +13 -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 +172 -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/features/message/utils/chat-inline-panel-app-card.utils.ts +51 -0
- 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 +188 -0
- package/src/features/chat/{utils → features/message/utils}/chat-message-tool-card.utils.ts +5 -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 +53 -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 +85 -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 +30 -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 +34 -28
- package/src/features/chat/features/session/components/session-header/chat-session-metadata-dialog.tsx +46 -0
- 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/features/session/hooks/__tests__/use-selected-session-context-window-indicator.test.tsx +63 -0
- 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/features/session/hooks/use-selected-session-context-window-indicator.ts +15 -0
- 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 +10 -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/{utils → features/session/utils}/ncp-session-adapter.utils.ts +2 -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 +24 -94
- package/src/features/chat/features/session-type/utils/chat-session-type.utils.ts +109 -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 +17 -6
- package/src/features/chat/managers/__tests__/chat-input.manager.test.ts +383 -0
- package/src/features/chat/managers/__tests__/chat-query.manager.test.ts +39 -0
- package/src/features/chat/managers/__tests__/chat-run-snapshot.manager.test.ts +129 -0
- package/src/features/chat/managers/__tests__/chat-run.manager.test.ts +236 -0
- package/src/features/chat/managers/{chat-session-list.manager.test.ts → __tests__/chat-session-list.manager.test.ts} +98 -78
- package/src/features/chat/managers/__tests__/chat-session-preference-sync.manager.test.ts +219 -0
- package/src/features/chat/managers/__tests__/chat-thread.manager.test.ts +652 -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} +37 -14
- package/src/features/chat/managers/chat-draft-intent.manager.ts +46 -0
- package/src/features/chat/managers/{ncp-chat-input.manager.ts → chat-input.manager.ts} +118 -45
- package/src/features/chat/managers/chat-query.manager.ts +48 -0
- package/src/features/chat/managers/chat-run.manager.ts +110 -0
- package/src/features/chat/managers/chat-session-list.manager.ts +45 -15
- package/src/features/chat/managers/chat-session-preference-sync.manager.ts +77 -5
- package/src/features/chat/managers/{ncp-chat-thread.manager.ts → chat-thread.manager.ts} +67 -36
- package/src/features/chat/managers/chat-ui.manager.ts +51 -9
- package/src/features/chat/managers/recent-selection.manager.ts +21 -67
- package/src/features/chat/pages/{ncp-chat-page.test.ts → __tests__/ncp-chat-page.test.ts} +95 -12
- package/src/features/chat/pages/ncp-chat-page.tsx +139 -397
- package/src/features/chat/presenters/chat.presenter.ts +39 -0
- package/src/features/chat/stores/chat-input.store.ts +12 -2
- package/src/features/chat/stores/chat-thread.store.ts +0 -19
- package/src/features/chat/stores/ncp-chat-query.store.ts +25 -0
- package/src/features/chat/stores/recent-selection.store.ts +85 -0
- package/src/features/chat/types/chat-input-bar.types.ts +0 -1
- 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/curated-shelves/marketplace-curated-shelves.tsx +15 -61
- package/src/features/marketplace/components/marketplace-external-skill-source-action.tsx +1 -1
- 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.tsx +105 -451
- 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 +1 -1
- 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/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/components/__tests__/panel-apps-list.test.tsx +137 -0
- package/src/features/panel-apps/components/panel-apps-list.tsx +119 -5
- package/src/features/panel-apps/index.ts +2 -0
- package/src/features/panel-apps/utils/{panel-app-view.utils.test.ts → __tests__/panel-app-view.utils.test.ts} +1 -1
- package/src/features/panel-apps/utils/panel-app-entry-match.utils.ts +17 -0
- 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 +5 -5
- 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/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/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/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/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 +10 -0
- package/src/shared/lib/api/ncp-session.types.ts +1 -0
- package/src/shared/lib/api/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/i18n/locales/en-US/chat.json +6 -0
- package/src/shared/lib/i18n/locales/en-US/core.json +1 -0
- package/src/shared/lib/i18n/locales/en-US/doc-browser.json +10 -0
- package/src/shared/lib/i18n/locales/zh-CN/chat.json +6 -0
- package/src/shared/lib/i18n/locales/zh-CN/core.json +1 -0
- package/src/shared/lib/i18n/locales/zh-CN/doc-browser.json +10 -0
- package/src/shared/lib/i18n/locales/zh-CN/marketplace.json +1 -1
- 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/{navigation-history.utils.test.ts → __tests__/navigation-history.utils.test.ts} +1 -1
- 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-C7EsUuEJ.js +0 -3
- package/dist/assets/arrow-left-CzSkR5L6.js +0 -1
- package/dist/assets/book-open-DmeQPqkd.js +0 -1
- package/dist/assets/channels-list-page-B0yiiH01.js +0 -8
- package/dist/assets/chat-page-ChPjx_X9.js +0 -105
- package/dist/assets/config-split-page-BzfZSyAr.js +0 -1
- package/dist/assets/desktop-update-config-CExpdkqD.js +0 -1
- package/dist/assets/doc-browser-EZbnEcdk.js +0 -1
- package/dist/assets/doc-browser-XIwe1Tg-.js +0 -1
- package/dist/assets/doc-browser-context-BzEA1lm1.js +0 -1
- package/dist/assets/es2015-CJlVSTh-.js +0 -41
- package/dist/assets/host-capabilities-DjiRQ0Q9.js +0 -1
- package/dist/assets/index-DfZTO6Pi.js +0 -101
- package/dist/assets/index-mIb_YMrc.css +0 -1
- package/dist/assets/key-round-BzYZ0Nno.js +0 -1
- package/dist/assets/loader-circle-BbdIlBbQ.js +0 -1
- package/dist/assets/mcp-marketplace-page-L22aCzHX.js +0 -40
- package/dist/assets/mcp-marketplace-page-f80Jmv37.js +0 -1
- package/dist/assets/model-config-DkD7vSQT.js +0 -1
- package/dist/assets/notice-card-CD9Ok62G.js +0 -1
- package/dist/assets/play-DHuSeKs8.js +0 -1
- package/dist/assets/plus-DrV685KC.js +0 -1
- package/dist/assets/popover-CoBu3mbV.js +0 -1
- package/dist/assets/provider-models-C9VRroK3.js +0 -1
- package/dist/assets/provider-scoped-model-input-DZlmTCJU.js +0 -1
- package/dist/assets/providers-list-CVkWiqIy.js +0 -1
- package/dist/assets/refresh-cw-CVo4nWpq.js +0 -1
- package/dist/assets/remote-Bznw9iji.js +0 -1
- package/dist/assets/rotate-cw-CXDpRO6D.js +0 -1
- package/dist/assets/runtime-config-page-5IycbIxs.js +0 -1
- package/dist/assets/search-8nY6PGm0.js +0 -1
- package/dist/assets/search-config-DEH80WkC.js +0 -1
- package/dist/assets/secrets-config-Gzo5nDJG.js +0 -3
- package/dist/assets/status-dot-C1-FKgvv.js +0 -1
- package/dist/assets/tabs-BqkKwx1R.js +0 -1
- package/dist/assets/tabs-custom-DOkaJZmt.js +0 -1
- package/dist/assets/tooltip-Bw-mXQAM.js +0 -1
- package/dist/assets/trash-2-CmIwAJIT.js +0 -1
- package/dist/assets/x-CSRTOZnM.js +0 -1
- package/src/features/chat/components/chat-session-workspace-panel-nav.tsx +0 -264
- package/src/features/chat/components/chat-session-workspace-panel.tsx +0 -380
- 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-input-bar-controller.test.tsx +0 -152
- package/src/features/chat/hooks/use-chat-input-bar-controller.ts +0 -142
- 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/hooks/use-selected-session-context-window-indicator.ts +0 -18
- package/src/features/chat/managers/chat-session-preference-sync.manager.test.ts +0 -77
- 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 -369
- 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 -132
- package/src/shared/components/resizable-right-panel/resizable-right-panel.test.tsx +0 -38
- 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/dist/assets/{config-hints-fGnUjDe9.js → config-hints-CTqBnCDp.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/{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/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-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/chat/stores/{chat-thread.store.test.ts → __tests__/chat-thread.store.test.ts} +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/{marketplace-page.test.tsx → __tests__/marketplace-page.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/marketplace/hooks/{use-marketplace.test.tsx → __tests__/use-marketplace.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/components/{side-dock.test.tsx → __tests__/side-dock.test.tsx} +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/{ui → actions}/action-link.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/host-capabilities/{host-capability.manager.test.ts → __tests__/host-capability.manager.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
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import type { ResolvedChildSessionTab } from "@/features/chat/features/ncp/hooks/use-ncp-child-session-tabs-view";
|
|
2
|
+
import { shouldShowUnreadSessionIndicator } from "@/features/chat/stores/chat-session-list.store";
|
|
3
|
+
import type { ChatWorkspaceFileTab } from "@/features/chat/stores/chat-thread.store";
|
|
4
|
+
import { t } from "@/shared/lib/i18n";
|
|
5
|
+
|
|
6
|
+
export type WorkspaceSelection =
|
|
7
|
+
| {
|
|
8
|
+
kind: "child-session";
|
|
9
|
+
tab: ResolvedChildSessionTab;
|
|
10
|
+
}
|
|
11
|
+
| {
|
|
12
|
+
kind: "file";
|
|
13
|
+
file: ChatWorkspaceFileTab;
|
|
14
|
+
}
|
|
15
|
+
| {
|
|
16
|
+
kind: "cron";
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export type WorkspaceTabViewModel = {
|
|
20
|
+
key: string;
|
|
21
|
+
kind: "child-session" | "file" | "cron";
|
|
22
|
+
title: string;
|
|
23
|
+
tooltip: string;
|
|
24
|
+
active: boolean;
|
|
25
|
+
agentId?: string | null;
|
|
26
|
+
showUnreadDot?: boolean;
|
|
27
|
+
viewMode?: "preview" | "diff";
|
|
28
|
+
onSelect: () => void;
|
|
29
|
+
onClose?: () => void;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export function readWorkspaceFileTitle(file: ChatWorkspaceFileTab): string {
|
|
33
|
+
const fileName = file.path.split("/").filter(Boolean).pop();
|
|
34
|
+
return file.label?.trim() || fileName || file.path;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function resolveWorkspaceSelection(params: {
|
|
38
|
+
activePanelKind?: "child-session" | "file" | "cron" | null;
|
|
39
|
+
activeChildSessionKey: string | null;
|
|
40
|
+
activeWorkspaceFileKey: string | null;
|
|
41
|
+
childSessionTabs: ResolvedChildSessionTab[];
|
|
42
|
+
workspaceFileTabs: readonly ChatWorkspaceFileTab[];
|
|
43
|
+
sessionCronJobCount: number;
|
|
44
|
+
}): WorkspaceSelection | null {
|
|
45
|
+
const {
|
|
46
|
+
activePanelKind,
|
|
47
|
+
activeChildSessionKey,
|
|
48
|
+
activeWorkspaceFileKey,
|
|
49
|
+
childSessionTabs,
|
|
50
|
+
workspaceFileTabs,
|
|
51
|
+
sessionCronJobCount,
|
|
52
|
+
} = params;
|
|
53
|
+
|
|
54
|
+
if (activePanelKind === "cron" && sessionCronJobCount > 0) {
|
|
55
|
+
return { kind: "cron" };
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (activePanelKind !== "child-session" && activeWorkspaceFileKey) {
|
|
59
|
+
const activeFile = workspaceFileTabs.find(
|
|
60
|
+
(file) => file.key === activeWorkspaceFileKey,
|
|
61
|
+
);
|
|
62
|
+
if (activeFile) {
|
|
63
|
+
return {
|
|
64
|
+
kind: "file",
|
|
65
|
+
file: activeFile,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (activePanelKind !== "file" && activeChildSessionKey) {
|
|
71
|
+
const activeChild = childSessionTabs.find(
|
|
72
|
+
(tab) => tab.sessionKey === activeChildSessionKey,
|
|
73
|
+
);
|
|
74
|
+
if (activeChild) {
|
|
75
|
+
return {
|
|
76
|
+
kind: "child-session",
|
|
77
|
+
tab: activeChild,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (childSessionTabs[0]) {
|
|
83
|
+
return {
|
|
84
|
+
kind: "child-session",
|
|
85
|
+
tab: childSessionTabs[0],
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (workspaceFileTabs[0]) {
|
|
90
|
+
return {
|
|
91
|
+
kind: "file",
|
|
92
|
+
file: workspaceFileTabs[0],
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if (sessionCronJobCount > 0) {
|
|
97
|
+
return { kind: "cron" };
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export function buildWorkspaceTabsViewModel(params: {
|
|
104
|
+
resolvedChildTabs: ResolvedChildSessionTab[];
|
|
105
|
+
workspaceFileTabs: readonly ChatWorkspaceFileTab[];
|
|
106
|
+
sessionCronJobCount: number;
|
|
107
|
+
activeSelection: WorkspaceSelection | null;
|
|
108
|
+
optimisticReadAtBySessionKey: Record<string, string>;
|
|
109
|
+
onSelectSession: (sessionKey: string) => void;
|
|
110
|
+
onSelectFile: (fileKey: string) => void;
|
|
111
|
+
onCloseFile: (fileKey: string) => void;
|
|
112
|
+
onSelectCronJobs: () => void;
|
|
113
|
+
}): WorkspaceTabViewModel[] {
|
|
114
|
+
const {
|
|
115
|
+
resolvedChildTabs,
|
|
116
|
+
workspaceFileTabs,
|
|
117
|
+
sessionCronJobCount,
|
|
118
|
+
activeSelection,
|
|
119
|
+
optimisticReadAtBySessionKey,
|
|
120
|
+
onSelectSession,
|
|
121
|
+
onSelectFile,
|
|
122
|
+
onCloseFile,
|
|
123
|
+
onSelectCronJobs,
|
|
124
|
+
} = params;
|
|
125
|
+
|
|
126
|
+
const childTabs = resolvedChildTabs.map((tab) => {
|
|
127
|
+
const optimisticReadAt = optimisticReadAtBySessionKey[tab.sessionKey];
|
|
128
|
+
const effectiveReadAt =
|
|
129
|
+
optimisticReadAt && tab.readAt
|
|
130
|
+
? optimisticReadAt.localeCompare(tab.readAt) > 0
|
|
131
|
+
? optimisticReadAt
|
|
132
|
+
: tab.readAt
|
|
133
|
+
: (optimisticReadAt ?? tab.readAt);
|
|
134
|
+
|
|
135
|
+
return {
|
|
136
|
+
key: `child:${tab.sessionKey}`,
|
|
137
|
+
kind: "child-session" as const,
|
|
138
|
+
title: tab.title,
|
|
139
|
+
tooltip: tab.title,
|
|
140
|
+
agentId: tab.agentId,
|
|
141
|
+
active:
|
|
142
|
+
activeSelection?.kind === "child-session" &&
|
|
143
|
+
activeSelection.tab.sessionKey === tab.sessionKey,
|
|
144
|
+
showUnreadDot: shouldShowUnreadSessionIndicator({
|
|
145
|
+
active:
|
|
146
|
+
activeSelection?.kind === "child-session" &&
|
|
147
|
+
activeSelection.tab.sessionKey === tab.sessionKey,
|
|
148
|
+
lastMessageAt: tab.lastMessageAt,
|
|
149
|
+
readAt: effectiveReadAt,
|
|
150
|
+
runStatus: tab.runStatus,
|
|
151
|
+
}),
|
|
152
|
+
onSelect: () => onSelectSession(tab.sessionKey),
|
|
153
|
+
};
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
const fileTabs = workspaceFileTabs.map((file) => ({
|
|
157
|
+
key: `file:${file.key}`,
|
|
158
|
+
kind: "file" as const,
|
|
159
|
+
title: readWorkspaceFileTitle(file),
|
|
160
|
+
tooltip: file.path,
|
|
161
|
+
viewMode: file.viewMode,
|
|
162
|
+
active:
|
|
163
|
+
activeSelection?.kind === "file" && activeSelection.file.key === file.key,
|
|
164
|
+
onSelect: () => onSelectFile(file.key),
|
|
165
|
+
onClose: () => onCloseFile(file.key),
|
|
166
|
+
}));
|
|
167
|
+
|
|
168
|
+
const cronTab =
|
|
169
|
+
sessionCronJobCount > 0
|
|
170
|
+
? [
|
|
171
|
+
{
|
|
172
|
+
key: "cron:session",
|
|
173
|
+
kind: "cron" as const,
|
|
174
|
+
title: t("chatWorkspaceSessionCronJobs"),
|
|
175
|
+
tooltip: t("chatWorkspaceSessionCronJobs"),
|
|
176
|
+
active: activeSelection?.kind === "cron",
|
|
177
|
+
onSelect: onSelectCronJobs,
|
|
178
|
+
},
|
|
179
|
+
]
|
|
180
|
+
: [];
|
|
181
|
+
|
|
182
|
+
return [...childTabs, ...fileTabs, ...cronTab];
|
|
183
|
+
}
|
|
@@ -1,6 +1,17 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
1
|
+
export { ChatConversationPanel } from "./components/conversation/chat-conversation-panel";
|
|
2
|
+
export { ChatSidebar } from "./components/layout/chat-sidebar";
|
|
3
|
+
export { ChatPresenterProvider } from "./components/providers/chat-presenter.provider";
|
|
4
|
+
export { usePresenter } from "./components/providers/chat-presenter.provider";
|
|
5
|
+
export { ChatPresenter } from "./presenters/chat.presenter";
|
|
6
|
+
export { ChatDraftIntentManager } from "./managers/chat-draft-intent.manager";
|
|
7
|
+
export { useChatInputStore } from "./stores/chat-input.store";
|
|
8
|
+
export { useChatSessionListStore } from "./stores/chat-session-list.store";
|
|
9
|
+
export { useChatThreadStore } from "./stores/chat-thread.store";
|
|
10
|
+
export { useNcpChatSessionTypes } from "./features/session-type/hooks/use-ncp-chat-session-types";
|
|
11
|
+
export {
|
|
12
|
+
buildSessionTypeOptions,
|
|
13
|
+
normalizeSessionType,
|
|
14
|
+
resolveAgentRuntimeSessionType,
|
|
15
|
+
resolveSessionTypeLabel,
|
|
16
|
+
type ChatSessionTypeOption,
|
|
17
|
+
} from "./features/session-type/utils/chat-session-type.utils";
|
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
import { createChatComposerTextNode } from '@nextclaw/agent-chat-ui';
|
|
2
|
+
import { RUNTIME_DEFAULT_MODEL_VALUE } from '@nextclaw/shared';
|
|
3
|
+
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
|
4
|
+
import { ChatInputManager } from '@/features/chat/managers/chat-input.manager';
|
|
5
|
+
import { useChatInputStore } from '@/features/chat/stores/chat-input.store';
|
|
6
|
+
import { useChatSessionListStore } from '@/features/chat/stores/chat-session-list.store';
|
|
7
|
+
import { useChatThreadStore } from '@/features/chat/stores/chat-thread.store';
|
|
8
|
+
import { useSystemStatusStore } from '@/features/system-status';
|
|
9
|
+
|
|
10
|
+
function resetChatInputManagerStoreState() {
|
|
11
|
+
useChatInputStore.setState({
|
|
12
|
+
snapshot: {
|
|
13
|
+
...useChatInputStore.getState().snapshot,
|
|
14
|
+
draft: 'hello from current thread',
|
|
15
|
+
composerNodes: [createChatComposerTextNode('hello from current thread')],
|
|
16
|
+
attachments: [],
|
|
17
|
+
selectedSkills: [],
|
|
18
|
+
composerFocusRequest: null,
|
|
19
|
+
selectedSessionType: 'native',
|
|
20
|
+
selectedModel: 'gpt-5',
|
|
21
|
+
selectedThinkingLevel: null,
|
|
22
|
+
isProviderStateResolved: true,
|
|
23
|
+
modelOptions: [
|
|
24
|
+
{
|
|
25
|
+
value: 'gpt-5',
|
|
26
|
+
modelLabel: 'GPT-5',
|
|
27
|
+
providerLabel: 'OpenAI',
|
|
28
|
+
thinkingCapability: null,
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
useSystemStatusStore.setState({
|
|
34
|
+
state: {
|
|
35
|
+
...useSystemStatusStore.getState().state,
|
|
36
|
+
lifecyclePhase: 'ready',
|
|
37
|
+
bootstrapStatus: {
|
|
38
|
+
phase: 'ready',
|
|
39
|
+
ncpAgent: {
|
|
40
|
+
state: 'ready',
|
|
41
|
+
},
|
|
42
|
+
extensionLoading: {
|
|
43
|
+
state: 'ready',
|
|
44
|
+
loadedExtensionCount: 1,
|
|
45
|
+
totalExtensionCount: 1,
|
|
46
|
+
},
|
|
47
|
+
channels: {
|
|
48
|
+
state: 'ready',
|
|
49
|
+
enabled: [],
|
|
50
|
+
},
|
|
51
|
+
remote: {
|
|
52
|
+
state: 'pending',
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
useChatSessionListStore.setState({
|
|
58
|
+
optimisticReadAtBySessionKey: {},
|
|
59
|
+
snapshot: {
|
|
60
|
+
...useChatSessionListStore.getState().snapshot,
|
|
61
|
+
selectedSessionKey: 'stale-selected-session',
|
|
62
|
+
selectedAgentId: 'main',
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
useChatThreadStore.setState({
|
|
66
|
+
snapshot: {
|
|
67
|
+
...useChatThreadStore.getState().snapshot,
|
|
68
|
+
sessionKey: 'current-route-session',
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
describe('ChatInputManager', () => {
|
|
74
|
+
beforeEach(resetChatInputManagerStoreState);
|
|
75
|
+
|
|
76
|
+
it('sends through the current thread session when selected session state is stale', async () => {
|
|
77
|
+
const chatRunManager = {
|
|
78
|
+
sendMessage: vi.fn().mockResolvedValue(undefined),
|
|
79
|
+
stopCurrentRun: vi.fn().mockResolvedValue(undefined),
|
|
80
|
+
} as unknown as ConstructorParameters<typeof ChatInputManager>[0];
|
|
81
|
+
const sessionListManager = {
|
|
82
|
+
ensureDraftSession: vi.fn(() => 'draft-session'),
|
|
83
|
+
} as unknown as ConstructorParameters<typeof ChatInputManager>[1];
|
|
84
|
+
const manager = new ChatInputManager(
|
|
85
|
+
chatRunManager,
|
|
86
|
+
sessionListManager,
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
await manager.send();
|
|
90
|
+
|
|
91
|
+
expect(chatRunManager.sendMessage).toHaveBeenCalledTimes(1);
|
|
92
|
+
expect(chatRunManager.sendMessage).toHaveBeenCalledWith(
|
|
93
|
+
expect.objectContaining({
|
|
94
|
+
sessionKey: 'current-route-session',
|
|
95
|
+
message: 'hello from current thread',
|
|
96
|
+
}),
|
|
97
|
+
);
|
|
98
|
+
expect(sessionListManager.ensureDraftSession).not.toHaveBeenCalled();
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
it('sends without a session key while /chat is still in blank-draft mode', async () => {
|
|
102
|
+
useChatThreadStore.setState({
|
|
103
|
+
snapshot: {
|
|
104
|
+
...useChatThreadStore.getState().snapshot,
|
|
105
|
+
sessionKey: null,
|
|
106
|
+
},
|
|
107
|
+
});
|
|
108
|
+
useChatSessionListStore.setState({
|
|
109
|
+
snapshot: {
|
|
110
|
+
...useChatSessionListStore.getState().snapshot,
|
|
111
|
+
selectedSessionKey: null,
|
|
112
|
+
},
|
|
113
|
+
});
|
|
114
|
+
const chatRunManager = {
|
|
115
|
+
sendMessage: vi.fn().mockResolvedValue(undefined),
|
|
116
|
+
stopCurrentRun: vi.fn().mockResolvedValue(undefined),
|
|
117
|
+
} as unknown as ConstructorParameters<typeof ChatInputManager>[0];
|
|
118
|
+
const sessionListManager = {
|
|
119
|
+
ensureDraftSession: vi.fn(() => 'materialized-draft-session'),
|
|
120
|
+
} as unknown as ConstructorParameters<typeof ChatInputManager>[1];
|
|
121
|
+
const manager = new ChatInputManager(
|
|
122
|
+
chatRunManager,
|
|
123
|
+
sessionListManager,
|
|
124
|
+
);
|
|
125
|
+
|
|
126
|
+
await manager.send();
|
|
127
|
+
|
|
128
|
+
expect(sessionListManager.ensureDraftSession).toHaveBeenCalledWith('native');
|
|
129
|
+
expect(chatRunManager.sendMessage).toHaveBeenCalledWith(
|
|
130
|
+
expect.not.objectContaining({
|
|
131
|
+
sessionKey: expect.any(String),
|
|
132
|
+
}),
|
|
133
|
+
);
|
|
134
|
+
expect(chatRunManager.sendMessage).toHaveBeenCalledWith(
|
|
135
|
+
expect.objectContaining({
|
|
136
|
+
message: 'hello from current thread',
|
|
137
|
+
}),
|
|
138
|
+
);
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
it('does not send while the runtime is still blocked during startup', async () => {
|
|
142
|
+
useChatInputStore.setState({
|
|
143
|
+
snapshot: {
|
|
144
|
+
...useChatInputStore.getState().snapshot,
|
|
145
|
+
isProviderStateResolved: false,
|
|
146
|
+
modelOptions: [],
|
|
147
|
+
},
|
|
148
|
+
});
|
|
149
|
+
useSystemStatusStore.setState({
|
|
150
|
+
state: {
|
|
151
|
+
...useSystemStatusStore.getState().state,
|
|
152
|
+
lifecyclePhase: 'cold-starting',
|
|
153
|
+
bootstrapStatus: {
|
|
154
|
+
...useSystemStatusStore.getState().state.bootstrapStatus!,
|
|
155
|
+
phase: 'kernel-starting',
|
|
156
|
+
ncpAgent: {
|
|
157
|
+
state: 'pending',
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
});
|
|
162
|
+
const chatRunManager = {
|
|
163
|
+
sendMessage: vi.fn().mockResolvedValue(undefined),
|
|
164
|
+
stopCurrentRun: vi.fn().mockResolvedValue(undefined),
|
|
165
|
+
} as unknown as ConstructorParameters<typeof ChatInputManager>[0];
|
|
166
|
+
const sessionListManager = {
|
|
167
|
+
ensureDraftSession: vi.fn(() => 'draft-session'),
|
|
168
|
+
} as unknown as ConstructorParameters<typeof ChatInputManager>[1];
|
|
169
|
+
const manager = new ChatInputManager(
|
|
170
|
+
chatRunManager,
|
|
171
|
+
sessionListManager,
|
|
172
|
+
);
|
|
173
|
+
|
|
174
|
+
await manager.send();
|
|
175
|
+
|
|
176
|
+
expect(chatRunManager.sendMessage).not.toHaveBeenCalled();
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
it('still attempts to send when provider metadata is stale or the session type is marked unavailable', async () => {
|
|
180
|
+
useChatInputStore.setState({
|
|
181
|
+
snapshot: {
|
|
182
|
+
...useChatInputStore.getState().snapshot,
|
|
183
|
+
isProviderStateResolved: true,
|
|
184
|
+
modelOptions: [],
|
|
185
|
+
sessionTypeUnavailable: true,
|
|
186
|
+
},
|
|
187
|
+
});
|
|
188
|
+
const chatRunManager = {
|
|
189
|
+
sendMessage: vi.fn().mockResolvedValue(undefined),
|
|
190
|
+
stopCurrentRun: vi.fn().mockResolvedValue(undefined),
|
|
191
|
+
} as unknown as ConstructorParameters<typeof ChatInputManager>[0];
|
|
192
|
+
const sessionListManager = {
|
|
193
|
+
ensureDraftSession: vi.fn(() => 'draft-session'),
|
|
194
|
+
} as unknown as ConstructorParameters<typeof ChatInputManager>[1];
|
|
195
|
+
const manager = new ChatInputManager(
|
|
196
|
+
chatRunManager,
|
|
197
|
+
sessionListManager,
|
|
198
|
+
);
|
|
199
|
+
|
|
200
|
+
await manager.send();
|
|
201
|
+
|
|
202
|
+
expect(chatRunManager.sendMessage).toHaveBeenCalledTimes(1);
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
it('includes the current thread project root in the run payload', async () => {
|
|
206
|
+
useChatThreadStore.setState({
|
|
207
|
+
snapshot: {
|
|
208
|
+
...useChatThreadStore.getState().snapshot,
|
|
209
|
+
sessionKey: 'current-route-session',
|
|
210
|
+
sessionProjectRoot: '/tmp/project-alpha',
|
|
211
|
+
},
|
|
212
|
+
});
|
|
213
|
+
const chatRunManager = {
|
|
214
|
+
sendMessage: vi.fn().mockResolvedValue(undefined),
|
|
215
|
+
stopCurrentRun: vi.fn().mockResolvedValue(undefined),
|
|
216
|
+
} as unknown as ConstructorParameters<typeof ChatInputManager>[0];
|
|
217
|
+
const sessionListManager = {
|
|
218
|
+
ensureDraftSession: vi.fn(() => 'draft-session'),
|
|
219
|
+
} as unknown as ConstructorParameters<typeof ChatInputManager>[1];
|
|
220
|
+
const manager = new ChatInputManager(
|
|
221
|
+
chatRunManager,
|
|
222
|
+
sessionListManager,
|
|
223
|
+
);
|
|
224
|
+
|
|
225
|
+
await manager.send();
|
|
226
|
+
|
|
227
|
+
expect(chatRunManager.sendMessage).toHaveBeenCalledWith(
|
|
228
|
+
expect.objectContaining({
|
|
229
|
+
projectRoot: '/tmp/project-alpha',
|
|
230
|
+
}),
|
|
231
|
+
);
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
it('restores the composer when sending through the run manager fails', async () => {
|
|
235
|
+
const chatRunManager = {
|
|
236
|
+
sendMessage: vi.fn().mockRejectedValue(new Error('send failed')),
|
|
237
|
+
stopCurrentRun: vi.fn().mockResolvedValue(undefined),
|
|
238
|
+
} as unknown as ConstructorParameters<typeof ChatInputManager>[0];
|
|
239
|
+
const sessionListManager = {
|
|
240
|
+
ensureDraftSession: vi.fn(() => 'draft-session'),
|
|
241
|
+
} as unknown as ConstructorParameters<typeof ChatInputManager>[1];
|
|
242
|
+
const manager = new ChatInputManager(
|
|
243
|
+
chatRunManager,
|
|
244
|
+
sessionListManager,
|
|
245
|
+
);
|
|
246
|
+
const originalComposerNodes = useChatInputStore.getState().snapshot.composerNodes;
|
|
247
|
+
|
|
248
|
+
await expect(manager.send()).rejects.toThrow('send failed');
|
|
249
|
+
|
|
250
|
+
expect(useChatInputStore.getState().snapshot.draft).toBe('hello from current thread');
|
|
251
|
+
expect(useChatInputStore.getState().snapshot.composerNodes).toEqual(originalComposerNodes);
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
it('creates and consumes one-shot composer focus requests', () => {
|
|
255
|
+
const manager = new ChatInputManager(
|
|
256
|
+
{} as ConstructorParameters<typeof ChatInputManager>[0],
|
|
257
|
+
{} as ConstructorParameters<typeof ChatInputManager>[1],
|
|
258
|
+
);
|
|
259
|
+
|
|
260
|
+
manager.requestComposerFocusAtEnd();
|
|
261
|
+
|
|
262
|
+
const request = useChatInputStore.getState().snapshot.composerFocusRequest;
|
|
263
|
+
expect(request).toEqual({ id: 1, placement: 'end' });
|
|
264
|
+
|
|
265
|
+
manager.consumeComposerFocusRequest(999);
|
|
266
|
+
expect(useChatInputStore.getState().snapshot.composerFocusRequest).toEqual(request);
|
|
267
|
+
|
|
268
|
+
manager.consumeComposerFocusRequest(request!.id);
|
|
269
|
+
expect(useChatInputStore.getState().snapshot.composerFocusRequest).toBeNull();
|
|
270
|
+
});
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
describe('ChatInputManager configuration sync', () => {
|
|
274
|
+
beforeEach(resetChatInputManagerStoreState);
|
|
275
|
+
|
|
276
|
+
it('syncs session model and thinking preferences inside the input manager', () => {
|
|
277
|
+
useChatInputStore.setState({
|
|
278
|
+
snapshot: {
|
|
279
|
+
...useChatInputStore.getState().snapshot,
|
|
280
|
+
modelOptions: [
|
|
281
|
+
{
|
|
282
|
+
value: 'anthropic/claude-sonnet-4',
|
|
283
|
+
modelLabel: 'claude-sonnet-4',
|
|
284
|
+
providerLabel: 'Anthropic',
|
|
285
|
+
thinkingCapability: {
|
|
286
|
+
supported: ['off', 'medium'],
|
|
287
|
+
default: 'medium',
|
|
288
|
+
},
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
value: 'openai/gpt-5',
|
|
292
|
+
modelLabel: 'gpt-5',
|
|
293
|
+
providerLabel: 'OpenAI',
|
|
294
|
+
thinkingCapability: {
|
|
295
|
+
supported: ['off', 'high'],
|
|
296
|
+
default: 'high',
|
|
297
|
+
},
|
|
298
|
+
},
|
|
299
|
+
],
|
|
300
|
+
},
|
|
301
|
+
});
|
|
302
|
+
useChatThreadStore.setState({
|
|
303
|
+
snapshot: {
|
|
304
|
+
...useChatThreadStore.getState().snapshot,
|
|
305
|
+
sessionKey: 'session-1',
|
|
306
|
+
},
|
|
307
|
+
});
|
|
308
|
+
const manager = new ChatInputManager(
|
|
309
|
+
{} as ConstructorParameters<typeof ChatInputManager>[0],
|
|
310
|
+
{} as ConstructorParameters<typeof ChatInputManager>[1],
|
|
311
|
+
);
|
|
312
|
+
|
|
313
|
+
manager.syncSessionPreferences({
|
|
314
|
+
selectedSessionExists: true,
|
|
315
|
+
selectedSessionPreferredModel: 'openai/gpt-5',
|
|
316
|
+
selectedSessionPreferredThinking: 'high',
|
|
317
|
+
fallbackPreferredModel: 'anthropic/claude-sonnet-4',
|
|
318
|
+
});
|
|
319
|
+
|
|
320
|
+
expect(useChatInputStore.getState().snapshot).toMatchObject({
|
|
321
|
+
selectedModel: 'openai/gpt-5',
|
|
322
|
+
selectedThinkingLevel: 'high',
|
|
323
|
+
});
|
|
324
|
+
});
|
|
325
|
+
|
|
326
|
+
it('sends the runtime-default sentinel so the backend can ignore stale session model metadata', async () => {
|
|
327
|
+
useChatInputStore.setState({
|
|
328
|
+
snapshot: {
|
|
329
|
+
...useChatInputStore.getState().snapshot,
|
|
330
|
+
selectedSessionType: 'codex',
|
|
331
|
+
selectedModel: RUNTIME_DEFAULT_MODEL_VALUE,
|
|
332
|
+
},
|
|
333
|
+
});
|
|
334
|
+
const chatRunManager = {
|
|
335
|
+
sendMessage: vi.fn().mockResolvedValue(undefined),
|
|
336
|
+
stopCurrentRun: vi.fn().mockResolvedValue(undefined),
|
|
337
|
+
} as unknown as ConstructorParameters<typeof ChatInputManager>[0];
|
|
338
|
+
const sessionListManager = {
|
|
339
|
+
ensureDraftSession: vi.fn(() => 'draft-session'),
|
|
340
|
+
} as unknown as ConstructorParameters<typeof ChatInputManager>[1];
|
|
341
|
+
const manager = new ChatInputManager(chatRunManager, sessionListManager);
|
|
342
|
+
|
|
343
|
+
await manager.send();
|
|
344
|
+
|
|
345
|
+
expect(chatRunManager.sendMessage).toHaveBeenCalledWith(
|
|
346
|
+
expect.objectContaining({
|
|
347
|
+
sessionType: 'codex',
|
|
348
|
+
model: RUNTIME_DEFAULT_MODEL_VALUE,
|
|
349
|
+
}),
|
|
350
|
+
);
|
|
351
|
+
});
|
|
352
|
+
|
|
353
|
+
it('resolves and clears pending project root overrides inside the input manager', () => {
|
|
354
|
+
useChatInputStore.setState({
|
|
355
|
+
snapshot: {
|
|
356
|
+
...useChatInputStore.getState().snapshot,
|
|
357
|
+
pendingProjectRoot: '/tmp/project-alpha',
|
|
358
|
+
pendingProjectRootSessionKey: 'session-1',
|
|
359
|
+
},
|
|
360
|
+
});
|
|
361
|
+
const manager = new ChatInputManager(
|
|
362
|
+
{} as ConstructorParameters<typeof ChatInputManager>[0],
|
|
363
|
+
{} as ConstructorParameters<typeof ChatInputManager>[1],
|
|
364
|
+
);
|
|
365
|
+
|
|
366
|
+
expect(
|
|
367
|
+
manager.resolveProjectRootForSend({
|
|
368
|
+
sessionKey: 'session-1',
|
|
369
|
+
selectedSessionProjectRoot: '/tmp/server-project',
|
|
370
|
+
}),
|
|
371
|
+
).toBe('/tmp/project-alpha');
|
|
372
|
+
|
|
373
|
+
manager.clearPendingProjectRootOverrideForSession({
|
|
374
|
+
sessionKey: 'session-1',
|
|
375
|
+
selectedSessionProjectRoot: '/tmp/project-alpha',
|
|
376
|
+
});
|
|
377
|
+
|
|
378
|
+
expect(useChatInputStore.getState().snapshot).toMatchObject({
|
|
379
|
+
pendingProjectRoot: null,
|
|
380
|
+
pendingProjectRootSessionKey: null,
|
|
381
|
+
});
|
|
382
|
+
});
|
|
383
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
|
2
|
+
import { ChatQueryManager } from '@/features/chat/managers/chat-query.manager';
|
|
3
|
+
import { useChatQueryStore } from '@/features/chat/stores/ncp-chat-query.store';
|
|
4
|
+
import type { ChatQuerySnapshot } from '@/features/chat/stores/ncp-chat-query.store';
|
|
5
|
+
|
|
6
|
+
function createQuery<TData>(data: TData) {
|
|
7
|
+
return {
|
|
8
|
+
data,
|
|
9
|
+
error: null,
|
|
10
|
+
fetchStatus: 'idle',
|
|
11
|
+
isFetched: true,
|
|
12
|
+
isFetching: false,
|
|
13
|
+
isLoading: false,
|
|
14
|
+
isSuccess: true,
|
|
15
|
+
status: 'success',
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
describe('ChatQueryManager', () => {
|
|
20
|
+
beforeEach(() => {
|
|
21
|
+
useChatQueryStore.setState({ snapshot: {} });
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it('skips store writes when only query wrapper identity changes', () => {
|
|
25
|
+
const manager = new ChatQueryManager();
|
|
26
|
+
const sessions = { sessions: [] };
|
|
27
|
+
manager.syncSnapshot({
|
|
28
|
+
sessionsQuery: createQuery(sessions) as unknown as ChatQuerySnapshot['sessionsQuery'],
|
|
29
|
+
});
|
|
30
|
+
const setSnapshot = vi.spyOn(useChatQueryStore.getState(), 'setSnapshot');
|
|
31
|
+
|
|
32
|
+
manager.syncSnapshot({
|
|
33
|
+
sessionsQuery: createQuery(sessions) as unknown as ChatQuerySnapshot['sessionsQuery'],
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
expect(setSnapshot).not.toHaveBeenCalled();
|
|
37
|
+
setSnapshot.mockRestore();
|
|
38
|
+
});
|
|
39
|
+
});
|