@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
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as e,g as t,m as n,y as r}from"./react-C7HsxuKH.js";var i=r(t(),1),a=n(),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:t,className:n}){return(0,a.jsx)(`div`,{className:e(`inline-flex h-9 items-center justify-center rounded-xl bg-gray-100/80 p-1 text-gray-500`,n),children:t})}function l({value:t,children:n,className:r}){let s=i.useContext(o);if(!s)throw Error(`TabsTrigger must be used within Tabs`);let c=s.value===t;return(0,a.jsx)(`button`,{type:`button`,onClick:()=>s.onValueChange(t),"aria-pressed":c,"data-state":c?`active`:`inactive`,className:e(`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:n})}function u({value:t,children:n,className:r}){let s=i.useContext(o);if(!s)throw Error(`TabsContent must be used within Tabs`);return s.value===t?(0,a.jsx)(`div`,{className:e(`mt-2 animate-fade-in`,r),children:n}):null}export{l as i,u as n,c as r,s as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as e,g as t,m as n,r}from"./react-C7HsxuKH.js";t();var i=n();function a({tabs:t,activeTab:n,onChange:a,className:o}){return(0,i.jsx)(`div`,{className:e(`flex items-center gap-6 border-b border-gray-200/60 mb-6`,o),children:t.map(t=>{let o=n===t.id;return(0,i.jsxs)(`button`,{onClick:()=>a(t.id),className:e(`relative pb-3 text-[14px] font-medium transition-all duration-fast flex items-center gap-1.5`,o?`text-gray-900`:`text-gray-600 hover:text-gray-900`),children:[t.label,t.count!==void 0&&(0,i.jsx)(`span`,{className:e(`text-[11px] font-medium`,`text-gray-500`),children:r(t.count)}),o&&(0,i.jsx)(`div`,{className:`absolute bottom-0 left-0 right-0 h-[2px] bg-primary rounded-full`})]},t.id)})})}export{a as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as e,g as t,m as n,y as r}from"./react-C7HsxuKH.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-C59BKqbX.js";import{t as b}from"./dist-Di6EHp2x.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(t(),1),C=n(),[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:t,sideOffset:n=4,...r},i)=>(0,C.jsx)(Z,{children:(0,C.jsx)(Q,{ref:i,sideOffset:n,className:e(`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`,t),...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 +0,0 @@
|
|
|
1
|
-
import{c as e}from"./dist-C59BKqbX.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};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as e}from"./dist-C59BKqbX.js";var t=e(`X`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);export{t};
|
|
@@ -1,264 +0,0 @@
|
|
|
1
|
-
import { AlarmClock, ArrowLeft, ArrowRight, FileCode2, MessageSquareText, X } from "lucide-react";
|
|
2
|
-
import type { ResolvedChildSessionTab } from "@/features/chat/hooks/use-ncp-child-session-tabs-view";
|
|
3
|
-
import type { ChatWorkspaceFileTab } from "@/features/chat/stores/chat-thread.store";
|
|
4
|
-
import { AgentIdentityAvatar } from "@/shared/components/common/agent-identity";
|
|
5
|
-
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/shared/components/ui/tooltip";
|
|
6
|
-
import { t } from "@/shared/lib/i18n";
|
|
7
|
-
import { cn } from "@/shared/lib/utils";
|
|
8
|
-
|
|
9
|
-
export type WorkspaceSelection =
|
|
10
|
-
| {
|
|
11
|
-
kind: "child-session";
|
|
12
|
-
tab: ResolvedChildSessionTab;
|
|
13
|
-
}
|
|
14
|
-
| {
|
|
15
|
-
kind: "file";
|
|
16
|
-
file: ChatWorkspaceFileTab;
|
|
17
|
-
}
|
|
18
|
-
| {
|
|
19
|
-
kind: "cron";
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export type WorkspaceTabViewModel = {
|
|
23
|
-
key: string;
|
|
24
|
-
kind: "child-session" | "file" | "cron";
|
|
25
|
-
title: string;
|
|
26
|
-
tooltip: string;
|
|
27
|
-
active: boolean;
|
|
28
|
-
agentId?: string | null;
|
|
29
|
-
showUnreadDot?: boolean;
|
|
30
|
-
viewMode?: "preview" | "diff";
|
|
31
|
-
onSelect: () => void;
|
|
32
|
-
onClose?: () => void;
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export function readWorkspaceFileTitle(file: ChatWorkspaceFileTab): string {
|
|
36
|
-
const label = file.label?.trim();
|
|
37
|
-
if (label) {
|
|
38
|
-
return label;
|
|
39
|
-
}
|
|
40
|
-
return file.path.split("/").filter(Boolean).pop() || file.path;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export function resolveWorkspaceSelection(params: {
|
|
44
|
-
activePanelKind?: "child-session" | "file" | "cron" | null;
|
|
45
|
-
activeChildSessionKey: string | null;
|
|
46
|
-
activeWorkspaceFileKey: string | null;
|
|
47
|
-
childSessionTabs: ResolvedChildSessionTab[];
|
|
48
|
-
workspaceFileTabs: readonly ChatWorkspaceFileTab[];
|
|
49
|
-
sessionCronJobCount: number;
|
|
50
|
-
}): WorkspaceSelection | null {
|
|
51
|
-
const {
|
|
52
|
-
activePanelKind,
|
|
53
|
-
activeChildSessionKey,
|
|
54
|
-
activeWorkspaceFileKey,
|
|
55
|
-
childSessionTabs,
|
|
56
|
-
workspaceFileTabs,
|
|
57
|
-
sessionCronJobCount,
|
|
58
|
-
} = params;
|
|
59
|
-
|
|
60
|
-
if (activePanelKind === "cron" && sessionCronJobCount > 0) {
|
|
61
|
-
return { kind: "cron" };
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
if (activePanelKind !== "child-session" && activeWorkspaceFileKey) {
|
|
65
|
-
const activeFile = workspaceFileTabs.find(
|
|
66
|
-
(file) => file.key === activeWorkspaceFileKey,
|
|
67
|
-
);
|
|
68
|
-
if (activeFile) {
|
|
69
|
-
return {
|
|
70
|
-
kind: "file",
|
|
71
|
-
file: activeFile,
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
if (activePanelKind !== "file" && activeChildSessionKey) {
|
|
77
|
-
const activeChild = childSessionTabs.find(
|
|
78
|
-
(tab) => tab.sessionKey === activeChildSessionKey,
|
|
79
|
-
);
|
|
80
|
-
if (activeChild) {
|
|
81
|
-
return {
|
|
82
|
-
kind: "child-session",
|
|
83
|
-
tab: activeChild,
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
if (childSessionTabs[0]) {
|
|
89
|
-
return {
|
|
90
|
-
kind: "child-session",
|
|
91
|
-
tab: childSessionTabs[0],
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
if (workspaceFileTabs[0]) {
|
|
96
|
-
return {
|
|
97
|
-
kind: "file",
|
|
98
|
-
file: workspaceFileTabs[0],
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
if (sessionCronJobCount > 0) {
|
|
103
|
-
return { kind: "cron" };
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
return null;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
function WorkspaceTabIcon({ agentId, kind }: Pick<WorkspaceTabViewModel, "agentId" | "kind">) {
|
|
110
|
-
if (kind === "cron") {
|
|
111
|
-
return <AlarmClock className="h-3.5 w-3.5 shrink-0 text-gray-400" />;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
if (kind === "file") {
|
|
115
|
-
return <FileCode2 className="h-3.5 w-3.5 shrink-0 text-gray-400" />;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
if (agentId) {
|
|
119
|
-
return (
|
|
120
|
-
<AgentIdentityAvatar agentId={agentId} className="h-3.5 w-3.5 shrink-0" />
|
|
121
|
-
);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
return <MessageSquareText className="h-3.5 w-3.5 shrink-0 text-gray-400" />;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
function WorkspaceTabItem({ tab }: { tab: WorkspaceTabViewModel }) {
|
|
128
|
-
return (
|
|
129
|
-
<Tooltip>
|
|
130
|
-
<TooltipTrigger asChild>
|
|
131
|
-
<div
|
|
132
|
-
className={cn(
|
|
133
|
-
"group flex max-w-[180px] min-w-0 items-center gap-1.5 border-r border-gray-200/70 border-b-2 px-2.5 py-2 transition-colors",
|
|
134
|
-
tab.active
|
|
135
|
-
? "border-b-primary bg-white text-gray-900"
|
|
136
|
-
: "border-b-transparent bg-gray-50/85 text-gray-500 hover:bg-gray-100",
|
|
137
|
-
)}
|
|
138
|
-
>
|
|
139
|
-
{tab.onClose ? (
|
|
140
|
-
<button
|
|
141
|
-
type="button"
|
|
142
|
-
onClick={(event) => {
|
|
143
|
-
event.stopPropagation();
|
|
144
|
-
tab.onClose?.();
|
|
145
|
-
}}
|
|
146
|
-
className="relative inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-md text-gray-400 transition-colors hover:bg-gray-200 hover:text-gray-700"
|
|
147
|
-
aria-label={t("chatWorkspaceCloseFile")}
|
|
148
|
-
>
|
|
149
|
-
<span className="flex items-center justify-center group-hover:hidden">
|
|
150
|
-
<WorkspaceTabIcon kind={tab.kind} agentId={tab.agentId} />
|
|
151
|
-
</span>
|
|
152
|
-
<X className="hidden h-3.5 w-3.5 group-hover:block" />
|
|
153
|
-
</button>
|
|
154
|
-
) : (
|
|
155
|
-
<WorkspaceTabIcon kind={tab.kind} agentId={tab.agentId} />
|
|
156
|
-
)}
|
|
157
|
-
<button
|
|
158
|
-
type="button"
|
|
159
|
-
onClick={tab.onSelect}
|
|
160
|
-
className="flex min-w-0 flex-1 items-center gap-1.5 text-left"
|
|
161
|
-
>
|
|
162
|
-
<span className="min-w-0 truncate text-[12px] font-medium">
|
|
163
|
-
{tab.title}
|
|
164
|
-
</span>
|
|
165
|
-
{tab.kind === "file" && tab.viewMode === "diff" ? (
|
|
166
|
-
<span className="shrink-0 rounded border border-amber-200 bg-amber-50 px-1 py-0 text-[9px] font-medium uppercase tracking-[0.08em] text-amber-700">
|
|
167
|
-
{t("chatWorkspaceDiff")}
|
|
168
|
-
</span>
|
|
169
|
-
) : null}
|
|
170
|
-
{tab.showUnreadDot ? (
|
|
171
|
-
<span
|
|
172
|
-
aria-label={t("chatSessionUnread")}
|
|
173
|
-
className="h-2 w-2 shrink-0 rounded-full bg-primary"
|
|
174
|
-
/>
|
|
175
|
-
) : null}
|
|
176
|
-
</button>
|
|
177
|
-
</div>
|
|
178
|
-
</TooltipTrigger>
|
|
179
|
-
<TooltipContent side="bottom" className="max-w-[320px] text-xs">
|
|
180
|
-
{tab.tooltip}
|
|
181
|
-
</TooltipContent>
|
|
182
|
-
</Tooltip>
|
|
183
|
-
);
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
export function WorkspaceTabsBar({
|
|
187
|
-
canGoBack,
|
|
188
|
-
canGoForward,
|
|
189
|
-
onClose,
|
|
190
|
-
onGoBack,
|
|
191
|
-
onGoForward,
|
|
192
|
-
tabs,
|
|
193
|
-
}: {
|
|
194
|
-
canGoBack: boolean;
|
|
195
|
-
canGoForward: boolean;
|
|
196
|
-
onClose: () => void;
|
|
197
|
-
onGoBack: () => void;
|
|
198
|
-
onGoForward: () => void;
|
|
199
|
-
tabs: readonly WorkspaceTabViewModel[];
|
|
200
|
-
}) {
|
|
201
|
-
return (
|
|
202
|
-
<TooltipProvider delayDuration={250}>
|
|
203
|
-
<div
|
|
204
|
-
data-testid="workspace-tabs-bar"
|
|
205
|
-
className="flex min-w-0 items-stretch border-b border-gray-200/70 bg-gray-50/85"
|
|
206
|
-
>
|
|
207
|
-
<div className="workspace-horizontal-scrollbar min-w-0 flex-1 overflow-x-auto overflow-y-hidden">
|
|
208
|
-
<div
|
|
209
|
-
data-testid="workspace-tabs-scroll"
|
|
210
|
-
className="flex min-w-max items-stretch"
|
|
211
|
-
>
|
|
212
|
-
{tabs.map((tab) => (
|
|
213
|
-
<WorkspaceTabItem key={tab.key} tab={tab} />
|
|
214
|
-
))}
|
|
215
|
-
</div>
|
|
216
|
-
</div>
|
|
217
|
-
<Tooltip>
|
|
218
|
-
<TooltipTrigger asChild>
|
|
219
|
-
<span className="ml-1 inline-flex self-center">
|
|
220
|
-
<button
|
|
221
|
-
type="button"
|
|
222
|
-
onClick={onGoBack}
|
|
223
|
-
disabled={!canGoBack}
|
|
224
|
-
className="flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-900 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 disabled:cursor-not-allowed disabled:text-gray-300 disabled:hover:bg-transparent"
|
|
225
|
-
aria-label={t("chatWorkspaceBack")}
|
|
226
|
-
>
|
|
227
|
-
<ArrowLeft className="h-4 w-4" />
|
|
228
|
-
</button>
|
|
229
|
-
</span>
|
|
230
|
-
</TooltipTrigger>
|
|
231
|
-
<TooltipContent side="bottom" className="text-xs">
|
|
232
|
-
{t("chatWorkspaceBack")}
|
|
233
|
-
</TooltipContent>
|
|
234
|
-
</Tooltip>
|
|
235
|
-
<Tooltip>
|
|
236
|
-
<TooltipTrigger asChild>
|
|
237
|
-
<span className="inline-flex self-center">
|
|
238
|
-
<button
|
|
239
|
-
type="button"
|
|
240
|
-
onClick={onGoForward}
|
|
241
|
-
disabled={!canGoForward}
|
|
242
|
-
className="flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-900 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 disabled:cursor-not-allowed disabled:text-gray-300 disabled:hover:bg-transparent"
|
|
243
|
-
aria-label={t("chatWorkspaceForward")}
|
|
244
|
-
>
|
|
245
|
-
<ArrowRight className="h-4 w-4" />
|
|
246
|
-
</button>
|
|
247
|
-
</span>
|
|
248
|
-
</TooltipTrigger>
|
|
249
|
-
<TooltipContent side="bottom" className="text-xs">
|
|
250
|
-
{t("chatWorkspaceForward")}
|
|
251
|
-
</TooltipContent>
|
|
252
|
-
</Tooltip>
|
|
253
|
-
<button
|
|
254
|
-
type="button"
|
|
255
|
-
onClick={onClose}
|
|
256
|
-
className="mx-1 flex h-7 w-7 shrink-0 self-center items-center justify-center rounded-md text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-900 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40"
|
|
257
|
-
aria-label={t("chatWorkspaceClosePanel")}
|
|
258
|
-
>
|
|
259
|
-
<X className="h-4 w-4" />
|
|
260
|
-
</button>
|
|
261
|
-
</div>
|
|
262
|
-
</TooltipProvider>
|
|
263
|
-
);
|
|
264
|
-
}
|
|
@@ -1,380 +0,0 @@
|
|
|
1
|
-
import { useEffect, useMemo, useRef } from "react";
|
|
2
|
-
import { FolderGit2, Loader2 } from "lucide-react";
|
|
3
|
-
import type {
|
|
4
|
-
ChatFileOpenActionViewModel,
|
|
5
|
-
ChatToolActionViewModel,
|
|
6
|
-
} from "@nextclaw/agent-chat-ui";
|
|
7
|
-
import type { CronJobView } from "@/shared/lib/api";
|
|
8
|
-
import { useStickyBottomScroll } from "@nextclaw/agent-chat-ui";
|
|
9
|
-
import { ChatMessageListContainer } from "@/features/chat/components/conversation/chat-message-list.container";
|
|
10
|
-
import {
|
|
11
|
-
useNcpChildSessionTabsView,
|
|
12
|
-
type ResolvedChildSessionTab,
|
|
13
|
-
} from "@/features/chat/hooks/use-ncp-child-session-tabs-view";
|
|
14
|
-
import { useNcpSessionConversation } from "@/features/chat/hooks/use-ncp-session-conversation";
|
|
15
|
-
import {
|
|
16
|
-
shouldShowUnreadSessionIndicator,
|
|
17
|
-
useChatSessionListStore,
|
|
18
|
-
} from "@/features/chat/stores/chat-session-list.store";
|
|
19
|
-
import type {
|
|
20
|
-
ChatChildSessionTab,
|
|
21
|
-
ChatWorkspaceNavigationEntry,
|
|
22
|
-
ChatWorkspaceFileTab,
|
|
23
|
-
} from "@/features/chat/stores/chat-thread.store";
|
|
24
|
-
import {
|
|
25
|
-
readWorkspaceFileTitle,
|
|
26
|
-
resolveWorkspaceSelection,
|
|
27
|
-
type WorkspaceTabViewModel,
|
|
28
|
-
WorkspaceTabsBar,
|
|
29
|
-
} from "./chat-session-workspace-panel-nav";
|
|
30
|
-
import { usePresenter } from "@/features/chat/components/providers/chat-presenter.provider";
|
|
31
|
-
import { ChatSessionWorkspaceFilePreview } from "./chat-session-workspace-file-preview";
|
|
32
|
-
import { AgentIdentityAvatar } from "@/shared/components/common/agent-identity";
|
|
33
|
-
import { SessionCronJobContent } from "@/features/chat/components/workspace/session-cron-job-content";
|
|
34
|
-
import { ResizableRightPanel } from "@/shared/components/resizable-right-panel/resizable-right-panel";
|
|
35
|
-
import { t } from "@/shared/lib/i18n";
|
|
36
|
-
import { cn } from "@/shared/lib/utils";
|
|
37
|
-
import {
|
|
38
|
-
canGoBackInNavigationHistory,
|
|
39
|
-
canGoForwardInNavigationHistory,
|
|
40
|
-
} from "@/shared/lib/navigation-history";
|
|
41
|
-
|
|
42
|
-
type ChatSessionWorkspacePanelProps = {
|
|
43
|
-
sessionKey: string | null;
|
|
44
|
-
childSessionTabs: readonly ChatChildSessionTab[];
|
|
45
|
-
activeChildSessionKey: string | null;
|
|
46
|
-
workspaceFileTabs: readonly ChatWorkspaceFileTab[];
|
|
47
|
-
activeWorkspaceFileKey: string | null;
|
|
48
|
-
workspaceNavigationHistory?: readonly ChatWorkspaceNavigationEntry[];
|
|
49
|
-
workspaceNavigationHistoryIndex?: number;
|
|
50
|
-
activePanelKind?: "child-session" | "file" | "cron" | null;
|
|
51
|
-
sessionCronJobs?: readonly CronJobView[];
|
|
52
|
-
sessionProjectRoot: string | null;
|
|
53
|
-
sessionWorkingDir: string | null;
|
|
54
|
-
displayMode?: "docked" | "overlay";
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
function ChildSessionContent({
|
|
58
|
-
sessionKey,
|
|
59
|
-
onToolAction,
|
|
60
|
-
onFileOpen,
|
|
61
|
-
}: {
|
|
62
|
-
sessionKey: string;
|
|
63
|
-
onToolAction?: (action: ChatToolActionViewModel) => void;
|
|
64
|
-
onFileOpen: (action: ChatFileOpenActionViewModel) => void;
|
|
65
|
-
}) {
|
|
66
|
-
const agent = useNcpSessionConversation(sessionKey);
|
|
67
|
-
const messages = agent.visibleMessages;
|
|
68
|
-
const scrollRef = useRef<HTMLDivElement>(null);
|
|
69
|
-
const { onScroll } = useStickyBottomScroll({
|
|
70
|
-
scrollRef,
|
|
71
|
-
resetKey: sessionKey,
|
|
72
|
-
isLoading: agent.isHydrating,
|
|
73
|
-
hasContent: messages.length > 0,
|
|
74
|
-
contentVersion: messages[messages.length - 1] ?? null,
|
|
75
|
-
stickyThresholdPx: 20,
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
return (
|
|
79
|
-
<div
|
|
80
|
-
ref={scrollRef}
|
|
81
|
-
onScroll={onScroll}
|
|
82
|
-
className="h-full overflow-y-auto custom-scrollbar"
|
|
83
|
-
>
|
|
84
|
-
{agent.isHydrating ? (
|
|
85
|
-
<div className="flex h-full items-center justify-center text-sm text-gray-500">
|
|
86
|
-
<Loader2 className="mr-2 h-4 w-4 animate-spin" />
|
|
87
|
-
{t("chatChildSessionLoading")}
|
|
88
|
-
</div>
|
|
89
|
-
) : agent.hydrateError ? (
|
|
90
|
-
<div className="px-4 py-5 text-sm text-rose-600">
|
|
91
|
-
{agent.hydrateError.message}
|
|
92
|
-
</div>
|
|
93
|
-
) : messages.length === 0 && !agent.isRunning ? (
|
|
94
|
-
<div className="px-4 py-5 text-sm text-gray-500">
|
|
95
|
-
{t("chatChildSessionEmpty")}
|
|
96
|
-
</div>
|
|
97
|
-
) : (
|
|
98
|
-
<div className="px-4 py-5">
|
|
99
|
-
<ChatMessageListContainer
|
|
100
|
-
messages={messages}
|
|
101
|
-
isSending={agent.isRunning}
|
|
102
|
-
onToolAction={onToolAction}
|
|
103
|
-
onFileOpen={onFileOpen}
|
|
104
|
-
/>
|
|
105
|
-
</div>
|
|
106
|
-
)}
|
|
107
|
-
</div>
|
|
108
|
-
);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
function ChildSessionMetaChip({ value }: { value: string }) {
|
|
112
|
-
return (
|
|
113
|
-
<span className="inline-flex max-w-full items-center rounded border border-gray-200 bg-gray-50 px-2 py-0.5 text-[10px] font-medium text-gray-600">
|
|
114
|
-
<span className="truncate">{value}</span>
|
|
115
|
-
</span>
|
|
116
|
-
);
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
function ChildSessionMetaStrip({ tab }: { tab: ResolvedChildSessionTab }) {
|
|
120
|
-
const metaItems = [
|
|
121
|
-
tab.sessionTypeLabel,
|
|
122
|
-
tab.preferredModel,
|
|
123
|
-
tab.projectName,
|
|
124
|
-
].filter((value): value is string => Boolean(value?.trim()));
|
|
125
|
-
|
|
126
|
-
if (metaItems.length === 0 && !tab.projectRoot) {
|
|
127
|
-
return null;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
return (
|
|
131
|
-
<div className="mt-3 space-y-2">
|
|
132
|
-
{metaItems.length > 0 ? (
|
|
133
|
-
<div className="flex flex-wrap gap-1.5">
|
|
134
|
-
{metaItems.map((item) => (
|
|
135
|
-
<ChildSessionMetaChip key={item} value={item} />
|
|
136
|
-
))}
|
|
137
|
-
</div>
|
|
138
|
-
) : null}
|
|
139
|
-
{tab.projectRoot ? (
|
|
140
|
-
<div
|
|
141
|
-
title={tab.projectRoot}
|
|
142
|
-
className="truncate rounded border border-gray-200 bg-gray-50 px-2 py-1.5 font-mono text-[11px] text-gray-500"
|
|
143
|
-
>
|
|
144
|
-
{tab.projectRoot}
|
|
145
|
-
</div>
|
|
146
|
-
) : null}
|
|
147
|
-
</div>
|
|
148
|
-
);
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
function WorkspaceActiveChildHeader({ tab }: { tab: ResolvedChildSessionTab }) {
|
|
152
|
-
return (
|
|
153
|
-
<div className="border-b border-gray-200/70 px-4 py-3">
|
|
154
|
-
<div className="flex min-w-0 items-center gap-2 text-sm font-semibold text-gray-900">
|
|
155
|
-
{tab.agentId ? (
|
|
156
|
-
<AgentIdentityAvatar
|
|
157
|
-
agentId={tab.agentId}
|
|
158
|
-
className="h-4 w-4 shrink-0"
|
|
159
|
-
/>
|
|
160
|
-
) : (
|
|
161
|
-
<FolderGit2 className="h-4 w-4 shrink-0 text-gray-400" />
|
|
162
|
-
)}
|
|
163
|
-
<span className="truncate">{tab.title}</span>
|
|
164
|
-
</div>
|
|
165
|
-
<ChildSessionMetaStrip tab={tab} />
|
|
166
|
-
</div>
|
|
167
|
-
);
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
function buildWorkspaceTabsViewModel(params: {
|
|
171
|
-
resolvedChildTabs: ResolvedChildSessionTab[];
|
|
172
|
-
workspaceFileTabs: readonly ChatWorkspaceFileTab[];
|
|
173
|
-
sessionCronJobCount: number;
|
|
174
|
-
activeSelection: ReturnType<typeof resolveWorkspaceSelection>;
|
|
175
|
-
optimisticReadAtBySessionKey: Record<string, string>;
|
|
176
|
-
onSelectSession: (sessionKey: string) => void;
|
|
177
|
-
onSelectFile: (fileKey: string) => void;
|
|
178
|
-
onCloseFile: (fileKey: string) => void;
|
|
179
|
-
onSelectCronJobs: () => void;
|
|
180
|
-
}): WorkspaceTabViewModel[] {
|
|
181
|
-
const {
|
|
182
|
-
resolvedChildTabs,
|
|
183
|
-
workspaceFileTabs,
|
|
184
|
-
sessionCronJobCount,
|
|
185
|
-
activeSelection,
|
|
186
|
-
optimisticReadAtBySessionKey,
|
|
187
|
-
onSelectSession,
|
|
188
|
-
onSelectFile,
|
|
189
|
-
onCloseFile,
|
|
190
|
-
onSelectCronJobs,
|
|
191
|
-
} = params;
|
|
192
|
-
|
|
193
|
-
const childTabs = resolvedChildTabs.map((tab) => {
|
|
194
|
-
const optimisticReadAt = optimisticReadAtBySessionKey[tab.sessionKey];
|
|
195
|
-
const effectiveReadAt =
|
|
196
|
-
optimisticReadAt && tab.readAt
|
|
197
|
-
? optimisticReadAt.localeCompare(tab.readAt) > 0
|
|
198
|
-
? optimisticReadAt
|
|
199
|
-
: tab.readAt
|
|
200
|
-
: (optimisticReadAt ?? tab.readAt);
|
|
201
|
-
return {
|
|
202
|
-
key: `child:${tab.sessionKey}`,
|
|
203
|
-
kind: "child-session" as const,
|
|
204
|
-
title: tab.title,
|
|
205
|
-
tooltip: tab.title,
|
|
206
|
-
agentId: tab.agentId,
|
|
207
|
-
active:
|
|
208
|
-
activeSelection?.kind === "child-session" &&
|
|
209
|
-
activeSelection.tab.sessionKey === tab.sessionKey,
|
|
210
|
-
showUnreadDot: shouldShowUnreadSessionIndicator({
|
|
211
|
-
active:
|
|
212
|
-
activeSelection?.kind === "child-session" &&
|
|
213
|
-
activeSelection.tab.sessionKey === tab.sessionKey,
|
|
214
|
-
lastMessageAt: tab.lastMessageAt,
|
|
215
|
-
readAt: effectiveReadAt,
|
|
216
|
-
runStatus: tab.runStatus,
|
|
217
|
-
}),
|
|
218
|
-
onSelect: () => onSelectSession(tab.sessionKey),
|
|
219
|
-
};
|
|
220
|
-
});
|
|
221
|
-
|
|
222
|
-
const fileTabs = workspaceFileTabs.map((file) => ({
|
|
223
|
-
key: `file:${file.key}`,
|
|
224
|
-
kind: "file" as const,
|
|
225
|
-
title: readWorkspaceFileTitle(file),
|
|
226
|
-
tooltip: file.path,
|
|
227
|
-
viewMode: file.viewMode,
|
|
228
|
-
active:
|
|
229
|
-
activeSelection?.kind === "file" && activeSelection.file.key === file.key,
|
|
230
|
-
onSelect: () => onSelectFile(file.key),
|
|
231
|
-
onClose: () => onCloseFile(file.key),
|
|
232
|
-
}));
|
|
233
|
-
|
|
234
|
-
const cronTab =
|
|
235
|
-
sessionCronJobCount > 0
|
|
236
|
-
? [
|
|
237
|
-
{
|
|
238
|
-
key: "cron:session",
|
|
239
|
-
kind: "cron" as const,
|
|
240
|
-
title: t("chatWorkspaceSessionCronJobs"),
|
|
241
|
-
tooltip: t("chatWorkspaceSessionCronJobs"),
|
|
242
|
-
active: activeSelection?.kind === "cron",
|
|
243
|
-
onSelect: onSelectCronJobs,
|
|
244
|
-
},
|
|
245
|
-
]
|
|
246
|
-
: [];
|
|
247
|
-
|
|
248
|
-
return [...childTabs, ...fileTabs, ...cronTab];
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
export function ChatSessionWorkspacePanel({
|
|
252
|
-
sessionKey,
|
|
253
|
-
childSessionTabs,
|
|
254
|
-
activeChildSessionKey,
|
|
255
|
-
workspaceFileTabs,
|
|
256
|
-
activeWorkspaceFileKey,
|
|
257
|
-
workspaceNavigationHistory = [],
|
|
258
|
-
workspaceNavigationHistoryIndex = 0,
|
|
259
|
-
activePanelKind,
|
|
260
|
-
sessionCronJobs = [],
|
|
261
|
-
sessionProjectRoot,
|
|
262
|
-
sessionWorkingDir,
|
|
263
|
-
displayMode = "docked",
|
|
264
|
-
}: ChatSessionWorkspacePanelProps) {
|
|
265
|
-
const presenter = usePresenter();
|
|
266
|
-
const resolvedChildTabs = useNcpChildSessionTabsView(childSessionTabs);
|
|
267
|
-
const optimisticReadAtBySessionKey = useChatSessionListStore(
|
|
268
|
-
(state) => state.optimisticReadAtBySessionKey,
|
|
269
|
-
);
|
|
270
|
-
const activeSelection = resolveWorkspaceSelection({
|
|
271
|
-
activeChildSessionKey,
|
|
272
|
-
activeWorkspaceFileKey,
|
|
273
|
-
activePanelKind,
|
|
274
|
-
childSessionTabs: resolvedChildTabs,
|
|
275
|
-
workspaceFileTabs,
|
|
276
|
-
sessionCronJobCount: sessionCronJobs.length,
|
|
277
|
-
});
|
|
278
|
-
const workspaceHistory = {
|
|
279
|
-
entries: workspaceNavigationHistory,
|
|
280
|
-
index: workspaceNavigationHistoryIndex,
|
|
281
|
-
};
|
|
282
|
-
|
|
283
|
-
useEffect(() => {
|
|
284
|
-
if (
|
|
285
|
-
activeSelection?.kind !== "child-session" ||
|
|
286
|
-
activeSelection.tab.runStatus === "running"
|
|
287
|
-
) {
|
|
288
|
-
return;
|
|
289
|
-
}
|
|
290
|
-
const activeTabReadAt = activeSelection.tab.lastMessageAt?.trim() ?? null;
|
|
291
|
-
if (!activeTabReadAt) {
|
|
292
|
-
return;
|
|
293
|
-
}
|
|
294
|
-
presenter.chatSessionListManager.markSessionRead(
|
|
295
|
-
activeSelection.tab.sessionKey,
|
|
296
|
-
activeTabReadAt,
|
|
297
|
-
activeSelection.tab.readAt ?? null,
|
|
298
|
-
);
|
|
299
|
-
}, [activeSelection, presenter]);
|
|
300
|
-
|
|
301
|
-
const workspaceTabs = useMemo<WorkspaceTabViewModel[]>(
|
|
302
|
-
() =>
|
|
303
|
-
buildWorkspaceTabsViewModel({
|
|
304
|
-
resolvedChildTabs,
|
|
305
|
-
workspaceFileTabs,
|
|
306
|
-
sessionCronJobCount: sessionCronJobs.length,
|
|
307
|
-
activeSelection,
|
|
308
|
-
optimisticReadAtBySessionKey,
|
|
309
|
-
onSelectSession: presenter.chatThreadManager.selectChildSessionDetail,
|
|
310
|
-
onSelectFile: presenter.chatThreadManager.selectWorkspaceFile,
|
|
311
|
-
onCloseFile: presenter.chatThreadManager.closeWorkspaceFile,
|
|
312
|
-
onSelectCronJobs: () => {
|
|
313
|
-
if (sessionKey)
|
|
314
|
-
presenter.chatThreadManager.openSessionCronPanel(sessionKey);
|
|
315
|
-
},
|
|
316
|
-
}),
|
|
317
|
-
[
|
|
318
|
-
activeSelection,
|
|
319
|
-
optimisticReadAtBySessionKey,
|
|
320
|
-
presenter.chatThreadManager,
|
|
321
|
-
resolvedChildTabs,
|
|
322
|
-
sessionKey,
|
|
323
|
-
workspaceFileTabs,
|
|
324
|
-
sessionCronJobs.length,
|
|
325
|
-
],
|
|
326
|
-
);
|
|
327
|
-
|
|
328
|
-
if (!activeSelection) {
|
|
329
|
-
return null;
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
return (
|
|
333
|
-
<ResizableRightPanel
|
|
334
|
-
className={cn(
|
|
335
|
-
displayMode === "overlay"
|
|
336
|
-
? "bg-white"
|
|
337
|
-
: "hidden border-gray-200/70 bg-white/95 backdrop-blur-sm md:flex",
|
|
338
|
-
)}
|
|
339
|
-
defaultWidth={480}
|
|
340
|
-
minWidth={360}
|
|
341
|
-
maxWidth={860}
|
|
342
|
-
overlay={displayMode === "overlay"}
|
|
343
|
-
>
|
|
344
|
-
<WorkspaceTabsBar
|
|
345
|
-
tabs={workspaceTabs}
|
|
346
|
-
canGoBack={canGoBackInNavigationHistory(workspaceHistory)}
|
|
347
|
-
canGoForward={canGoForwardInNavigationHistory(workspaceHistory)}
|
|
348
|
-
onGoBack={presenter.chatThreadManager.goBackWorkspacePanel}
|
|
349
|
-
onGoForward={presenter.chatThreadManager.goForwardWorkspacePanel}
|
|
350
|
-
onClose={presenter.chatThreadManager.closeWorkspacePanel}
|
|
351
|
-
/>
|
|
352
|
-
|
|
353
|
-
<div className="flex min-h-0 flex-1 flex-col bg-white">
|
|
354
|
-
{activeSelection.kind === "child-session" ? (
|
|
355
|
-
<>
|
|
356
|
-
<WorkspaceActiveChildHeader tab={activeSelection.tab} />
|
|
357
|
-
<div className="flex-1 min-h-0">
|
|
358
|
-
<ChildSessionContent
|
|
359
|
-
sessionKey={activeSelection.tab.sessionKey}
|
|
360
|
-
onToolAction={
|
|
361
|
-
presenter.chatThreadManager.openSessionFromToolAction
|
|
362
|
-
}
|
|
363
|
-
onFileOpen={presenter.chatThreadManager.openFilePreview}
|
|
364
|
-
/>
|
|
365
|
-
</div>
|
|
366
|
-
</>
|
|
367
|
-
) : activeSelection.kind === "file" ? (
|
|
368
|
-
<ChatSessionWorkspaceFilePreview
|
|
369
|
-
file={activeSelection.file}
|
|
370
|
-
sessionProjectRoot={sessionProjectRoot}
|
|
371
|
-
sessionWorkingDir={sessionWorkingDir}
|
|
372
|
-
onFileOpen={presenter.chatThreadManager.openFilePreview}
|
|
373
|
-
/>
|
|
374
|
-
) : (
|
|
375
|
-
<SessionCronJobContent jobs={sessionCronJobs} />
|
|
376
|
-
)}
|
|
377
|
-
</div>
|
|
378
|
-
</ResizableRightPanel>
|
|
379
|
-
);
|
|
380
|
-
}
|