@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,24 +1,45 @@
|
|
|
1
1
|
import { render } from "@testing-library/react";
|
|
2
2
|
import type { NcpMessage } from "@nextclaw/ncp";
|
|
3
3
|
import { beforeEach, expect, it, vi } from "vitest";
|
|
4
|
-
import { ChatMessageListContainer } from "
|
|
4
|
+
import { ChatMessageListContainer } from "@/features/chat/features/message/components/chat-message-list.container";
|
|
5
5
|
|
|
6
6
|
const captures = vi.hoisted(() => ({
|
|
7
|
-
renders: [] as Array<{
|
|
7
|
+
renders: [] as Array<{
|
|
8
|
+
messages: unknown[];
|
|
9
|
+
onToolAction?: (action: unknown) => void;
|
|
10
|
+
renderPanelAppCard?: (panelApp: unknown) => unknown;
|
|
11
|
+
texts?: Record<string, unknown>;
|
|
12
|
+
}>,
|
|
8
13
|
language: "en",
|
|
14
|
+
openFilePreview: vi.fn(),
|
|
15
|
+
handleToolAction: vi.fn(),
|
|
9
16
|
}));
|
|
10
17
|
|
|
11
18
|
vi.mock("@nextclaw/agent-chat-ui", async (importOriginal) => {
|
|
12
19
|
const actual = await importOriginal();
|
|
13
20
|
return {
|
|
14
21
|
...(actual as object),
|
|
15
|
-
ChatMessageList: (props: {
|
|
22
|
+
ChatMessageList: (props: {
|
|
23
|
+
messages: unknown[];
|
|
24
|
+
onToolAction?: (action: unknown) => void;
|
|
25
|
+
renderPanelAppCard?: (panelApp: unknown) => unknown;
|
|
26
|
+
texts?: Record<string, unknown>;
|
|
27
|
+
}) => {
|
|
16
28
|
captures.renders.push(props);
|
|
17
29
|
return <div data-testid="chat-message-list" />;
|
|
18
30
|
},
|
|
19
31
|
};
|
|
20
32
|
});
|
|
21
33
|
|
|
34
|
+
vi.mock("@/features/chat/components/providers/chat-presenter.provider", () => ({
|
|
35
|
+
usePresenter: () => ({
|
|
36
|
+
chatThreadManager: {
|
|
37
|
+
openFilePreview: captures.openFilePreview,
|
|
38
|
+
handleToolAction: captures.handleToolAction,
|
|
39
|
+
},
|
|
40
|
+
}),
|
|
41
|
+
}));
|
|
42
|
+
|
|
22
43
|
vi.mock("@/app/components/i18n-provider", () => ({
|
|
23
44
|
useI18n: () => ({ language: captures.language }),
|
|
24
45
|
}));
|
|
@@ -31,6 +52,8 @@ vi.mock("@/shared/lib/i18n", () => ({
|
|
|
31
52
|
beforeEach(() => {
|
|
32
53
|
captures.renders = [];
|
|
33
54
|
captures.language = "en";
|
|
55
|
+
captures.openFilePreview.mockReset();
|
|
56
|
+
captures.handleToolAction.mockReset();
|
|
34
57
|
});
|
|
35
58
|
|
|
36
59
|
it("reuses adapted message references when the source message object is unchanged", () => {
|
|
@@ -216,6 +239,26 @@ it("passes localized attachment card texts to the shared chat UI", () => {
|
|
|
216
239
|
});
|
|
217
240
|
});
|
|
218
241
|
|
|
242
|
+
it("delegates tool actions to the chat thread manager owner", () => {
|
|
243
|
+
const toolAction = {
|
|
244
|
+
kind: "open-session",
|
|
245
|
+
sessionId: "child-session-1",
|
|
246
|
+
sessionKind: "child",
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
render(<ChatMessageListContainer messages={[]} isSending={false} />);
|
|
250
|
+
|
|
251
|
+
captures.renders[captures.renders.length - 1]?.onToolAction?.(toolAction);
|
|
252
|
+
|
|
253
|
+
expect(captures.handleToolAction).toHaveBeenCalledWith(toolAction);
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
it("passes the inline panel app renderer to the shared chat UI", () => {
|
|
257
|
+
render(<ChatMessageListContainer messages={[]} isSending={false} />);
|
|
258
|
+
|
|
259
|
+
expect(captures.renders[captures.renders.length - 1]?.renderPanelAppCard).toEqual(expect.any(Function));
|
|
260
|
+
});
|
|
261
|
+
|
|
219
262
|
it("renders context compaction as an in-flow divider instead of a chat message", () => {
|
|
220
263
|
const beforeMessage = {
|
|
221
264
|
id: "message-before",
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { useEffect, useId, useMemo, useRef } from 'react';
|
|
2
|
+
import type { ChatPanelAppCardViewModel } from '@nextclaw/agent-chat-ui';
|
|
3
|
+
import { AppWindow, Maximize2 } from 'lucide-react';
|
|
4
|
+
import { getPresenter } from '@/app/presenters/app.presenter';
|
|
5
|
+
import { findPanelAppEntryByDisplayId, usePanelApps } from '@/features/panel-apps';
|
|
6
|
+
import { createPanelAppRightPanelResourceTarget } from '@/features/right-panel-resources';
|
|
7
|
+
import {
|
|
8
|
+
createInlinePanelAppCardUrl,
|
|
9
|
+
createFallbackPanelAppContentPath,
|
|
10
|
+
createInlinePanelAppTab,
|
|
11
|
+
PANEL_APP_INLINE_CARD_MAX_HEIGHT_PX,
|
|
12
|
+
PANEL_APP_INLINE_IFRAME_SANDBOX,
|
|
13
|
+
} from '@/features/chat/features/message/utils/chat-inline-panel-app-card.utils';
|
|
14
|
+
import { useDocBrowser } from '@/shared/components/doc-browser';
|
|
15
|
+
import { IconActionButton } from '@/shared/components/ui/actions/icon-action-button';
|
|
16
|
+
import { t } from '@/shared/lib/i18n';
|
|
17
|
+
|
|
18
|
+
export function ChatInlinePanelAppCard({
|
|
19
|
+
panelApp,
|
|
20
|
+
}: {
|
|
21
|
+
panelApp: ChatPanelAppCardViewModel;
|
|
22
|
+
}) {
|
|
23
|
+
const docBrowser = useDocBrowser();
|
|
24
|
+
const iframeRef = useRef<HTMLIFrameElement>(null);
|
|
25
|
+
const iframeId = useId();
|
|
26
|
+
const panelApps = usePanelApps();
|
|
27
|
+
const entry = useMemo(
|
|
28
|
+
() => findPanelAppEntryByDisplayId(panelApps.data?.entries ?? [], panelApp.appId),
|
|
29
|
+
[panelApp.appId, panelApps.data?.entries],
|
|
30
|
+
);
|
|
31
|
+
const target = entry ? createPanelAppRightPanelResourceTarget(entry) : null;
|
|
32
|
+
const title = panelApp.title ?? target?.title ?? panelApp.appId;
|
|
33
|
+
const url = panelApps.isLoading
|
|
34
|
+
? ''
|
|
35
|
+
: target?.url ?? createFallbackPanelAppContentPath(panelApp.appId);
|
|
36
|
+
const cardUrl = useMemo(
|
|
37
|
+
() => (url ? createInlinePanelAppCardUrl(url) : ''),
|
|
38
|
+
[url],
|
|
39
|
+
);
|
|
40
|
+
const tab = useMemo(
|
|
41
|
+
() => createInlinePanelAppTab({
|
|
42
|
+
appId: entry?.id ?? panelApp.appId,
|
|
43
|
+
title,
|
|
44
|
+
url,
|
|
45
|
+
}),
|
|
46
|
+
[entry?.id, panelApp.appId, title, url],
|
|
47
|
+
);
|
|
48
|
+
const iframeInstanceId = `${tab.id}:${tab.navVersion}:${iframeId}`;
|
|
49
|
+
const openExpanded = () => {
|
|
50
|
+
if (target) {
|
|
51
|
+
docBrowser.openTarget(target);
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
docBrowser.open(url, {
|
|
55
|
+
dedupeKey: tab.dedupeKey,
|
|
56
|
+
kind: tab.kind,
|
|
57
|
+
title,
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
if (!url) {
|
|
63
|
+
return undefined;
|
|
64
|
+
}
|
|
65
|
+
const handleMessage = (event: MessageEvent) => {
|
|
66
|
+
getPresenter().panelAppBridgeManager.handleIframeMessage({
|
|
67
|
+
event,
|
|
68
|
+
iframe: iframeRef.current,
|
|
69
|
+
iframeInstanceId,
|
|
70
|
+
tab,
|
|
71
|
+
});
|
|
72
|
+
};
|
|
73
|
+
window.addEventListener('message', handleMessage);
|
|
74
|
+
return () => window.removeEventListener('message', handleMessage);
|
|
75
|
+
}, [iframeInstanceId, tab, url]);
|
|
76
|
+
|
|
77
|
+
if (!url) {
|
|
78
|
+
return (
|
|
79
|
+
<div
|
|
80
|
+
className="h-[320px] min-h-[220px] w-full animate-pulse rounded-lg border border-[#eee3d1] bg-gradient-to-b from-white to-amber-50/60"
|
|
81
|
+
style={{ maxHeight: PANEL_APP_INLINE_CARD_MAX_HEIGHT_PX }}
|
|
82
|
+
/>
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return (
|
|
87
|
+
<div className="w-full max-w-[42rem] overflow-hidden rounded-lg border border-[#eee3d1] bg-white shadow-[0_1px_2px_rgba(30,20,10,0.04)]">
|
|
88
|
+
<div className="flex h-9 items-center justify-between gap-2 border-b border-[#f1e7d4] bg-[#fffaf2] px-2.5">
|
|
89
|
+
<div className="flex min-w-0 items-center gap-2 text-xs font-medium text-[#5c4933]">
|
|
90
|
+
<AppWindow className="h-3.5 w-3.5 shrink-0 text-primary" />
|
|
91
|
+
<span className="truncate">{title}</span>
|
|
92
|
+
</div>
|
|
93
|
+
<IconActionButton
|
|
94
|
+
className="h-7 w-7 rounded-md text-[#7a6145] hover:bg-white hover:text-[#2f2212]"
|
|
95
|
+
icon={<Maximize2 className="h-3.5 w-3.5" />}
|
|
96
|
+
label={t('chatPanelCardExpand')}
|
|
97
|
+
onClick={openExpanded}
|
|
98
|
+
/>
|
|
99
|
+
</div>
|
|
100
|
+
<div
|
|
101
|
+
className="relative h-[420px] min-h-[220px] max-h-[min(60vh,420px)] overflow-hidden bg-white"
|
|
102
|
+
>
|
|
103
|
+
<iframe
|
|
104
|
+
ref={iframeRef}
|
|
105
|
+
key={iframeInstanceId}
|
|
106
|
+
src={cardUrl}
|
|
107
|
+
title={title}
|
|
108
|
+
sandbox={PANEL_APP_INLINE_IFRAME_SANDBOX}
|
|
109
|
+
scrolling="auto"
|
|
110
|
+
className="h-full w-full border-0 bg-white"
|
|
111
|
+
/>
|
|
112
|
+
</div>
|
|
113
|
+
</div>
|
|
114
|
+
);
|
|
115
|
+
}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { useMemo } from "react";
|
|
2
2
|
import type { NcpMessage } from "@nextclaw/ncp";
|
|
3
3
|
import {
|
|
4
|
-
type ChatFileOpenActionViewModel,
|
|
5
|
-
type ChatToolActionViewModel,
|
|
6
4
|
type ChatMessageViewModel,
|
|
7
5
|
ChatMessageList,
|
|
8
6
|
} from "@nextclaw/agent-chat-ui";
|
|
7
|
+
import { usePresenter } from "@/features/chat/components/providers/chat-presenter.provider";
|
|
9
8
|
import {
|
|
10
9
|
adaptChatMessage,
|
|
11
10
|
type ChatMessageAdapterTexts,
|
|
12
11
|
type ChatMessageSource,
|
|
13
|
-
} from "@/features/chat/utils/chat-message.utils";
|
|
14
|
-
import { readInlineTokensFromMetadata } from "@/features/chat/utils/chat-inline-token.utils";
|
|
15
|
-
import { adaptNcpMessageToUiMessage } from "@/features/chat/utils/ncp-session-adapter.utils";
|
|
12
|
+
} from "@/features/chat/features/message/utils/chat-message.utils";
|
|
13
|
+
import { readInlineTokensFromMetadata } from "@/features/chat/features/input/utils/chat-inline-token.utils";
|
|
14
|
+
import { adaptNcpMessageToUiMessage } from "@/features/chat/features/session/utils/ncp-session-adapter.utils";
|
|
16
15
|
import {
|
|
17
16
|
readContextCompactionTimeline,
|
|
18
17
|
type ContextCompactionTimelineView,
|
|
19
|
-
} from "@/features/chat/utils/ncp-session-context-metadata.utils";
|
|
18
|
+
} from "@/features/chat/features/session/utils/ncp-session-context-metadata.utils";
|
|
20
19
|
import { AgentIdentityAvatar } from "@/shared/components/common/agent-identity";
|
|
20
|
+
import { ChatInlinePanelAppCard } from "@/features/chat/features/message/components/chat-inline-panel-app-card";
|
|
21
21
|
import { useI18n } from "@/app/components/i18n-provider";
|
|
22
22
|
import { formatDateTime, t } from "@/shared/lib/i18n";
|
|
23
23
|
|
|
@@ -25,8 +25,6 @@ type ChatMessageListContainerProps = {
|
|
|
25
25
|
messages: readonly NcpMessage[];
|
|
26
26
|
isSending: boolean;
|
|
27
27
|
className?: string;
|
|
28
|
-
onToolAction?: (action: ChatToolActionViewModel) => void;
|
|
29
|
-
onFileOpen?: (action: ChatFileOpenActionViewModel) => void;
|
|
30
28
|
};
|
|
31
29
|
|
|
32
30
|
const messageViewModelCache = new WeakMap<
|
|
@@ -69,6 +67,7 @@ function buildChatMessageAdapterTexts(
|
|
|
69
67
|
toolStatusCompletedLabel: t("chatToolStatusCompleted"),
|
|
70
68
|
toolStatusFailedLabel: t("chatToolStatusFailed"),
|
|
71
69
|
toolStatusCancelledLabel: t("chatToolStatusCancelled"),
|
|
70
|
+
showContentActionLabel: t("chatShowContentAction"),
|
|
72
71
|
imageAttachmentLabel: t("chatImageAttachment"),
|
|
73
72
|
fileAttachmentLabel: t("chatFileAttachment"),
|
|
74
73
|
unknownPartLabel: t("chatUnknownPart"),
|
|
@@ -235,9 +234,8 @@ export function ChatMessageListContainer({
|
|
|
235
234
|
messages: rawMessages,
|
|
236
235
|
isSending,
|
|
237
236
|
className,
|
|
238
|
-
onToolAction,
|
|
239
|
-
onFileOpen,
|
|
240
237
|
}: ChatMessageListContainerProps) {
|
|
238
|
+
const presenter = usePresenter();
|
|
241
239
|
const { language } = useI18n();
|
|
242
240
|
const texts = useMemo<ChatMessageAdapterTexts>(
|
|
243
241
|
() => buildChatMessageAdapterTexts(language),
|
|
@@ -292,7 +290,6 @@ export function ChatMessageListContainer({
|
|
|
292
290
|
() => buildTimelineItems({ rawMessages, messages }),
|
|
293
291
|
[messages, rawMessages],
|
|
294
292
|
);
|
|
295
|
-
|
|
296
293
|
return (
|
|
297
294
|
<div className={className}>
|
|
298
295
|
{timelineItems.map((item, index) =>
|
|
@@ -305,14 +302,17 @@ export function ChatMessageListContainer({
|
|
|
305
302
|
isSending={index === timelineItems.length - 1 ? isSending : false}
|
|
306
303
|
hasAssistantDraft={hasAssistantDraft}
|
|
307
304
|
texts={messageTexts}
|
|
308
|
-
onToolAction={
|
|
309
|
-
onFileOpen={
|
|
305
|
+
onToolAction={presenter.chatThreadManager.handleToolAction}
|
|
306
|
+
onFileOpen={presenter.chatThreadManager.openFilePreview}
|
|
310
307
|
renderToolAgent={(agentId) => (
|
|
311
308
|
<AgentIdentityAvatar
|
|
312
309
|
agentId={agentId}
|
|
313
310
|
className="h-4 w-4 shrink-0"
|
|
314
311
|
/>
|
|
315
312
|
)}
|
|
313
|
+
renderPanelAppCard={(panelApp) => (
|
|
314
|
+
<ChatInlinePanelAppCard panelApp={panelApp} />
|
|
315
|
+
)}
|
|
316
316
|
/>
|
|
317
317
|
),
|
|
318
318
|
)}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ToolInvocationStatus, type UiMessage } from "@nextclaw/agent-chat";
|
|
2
|
-
import { adaptChatMessages } from "
|
|
3
|
-
import type { ChatMessageSource } from "
|
|
2
|
+
import { adaptChatMessages } from "../chat-message.utils";
|
|
3
|
+
import type { ChatMessageSource } from "../chat-message.utils";
|
|
4
4
|
|
|
5
5
|
const defaultTexts = {
|
|
6
6
|
roleLabels: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ToolInvocationStatus, type UiMessage } from "@nextclaw/agent-chat";
|
|
2
|
-
import { adaptChatMessages } from "
|
|
3
|
-
import type { ChatMessageSource } from "
|
|
2
|
+
import { adaptChatMessages } from "../chat-message.utils";
|
|
3
|
+
import type { ChatMessageSource } from "../chat-message.utils";
|
|
4
4
|
|
|
5
5
|
const defaultTexts = {
|
|
6
6
|
roleLabels: {
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { buildShowContentToolCard } from "@/features/chat/features/message/utils/chat-message-show-content-tool-card.utils";
|
|
3
|
+
import { buildToolCard } from "@/features/chat/features/message/utils/chat-message-tool-card.utils";
|
|
4
|
+
import type { ChatMessageAdapterTexts } from "@/features/chat/types/chat-message.types";
|
|
5
|
+
|
|
6
|
+
const TEXTS: ChatMessageAdapterTexts = {
|
|
7
|
+
fileAttachmentLabel: "File",
|
|
8
|
+
imageAttachmentLabel: "Image",
|
|
9
|
+
reasoningLabel: "Reasoning",
|
|
10
|
+
roleLabels: {
|
|
11
|
+
assistant: "Assistant",
|
|
12
|
+
fallback: "Message",
|
|
13
|
+
system: "System",
|
|
14
|
+
tool: "Tool",
|
|
15
|
+
user: "User",
|
|
16
|
+
},
|
|
17
|
+
showContentActionLabel: "Show content",
|
|
18
|
+
toolCallLabel: "Tool call",
|
|
19
|
+
toolInputLabel: "Input",
|
|
20
|
+
toolNoOutputLabel: "No output",
|
|
21
|
+
toolOutputLabel: "Output",
|
|
22
|
+
toolResultLabel: "Tool result",
|
|
23
|
+
toolStatusCancelledLabel: "Cancelled",
|
|
24
|
+
toolStatusCompletedLabel: "Completed",
|
|
25
|
+
toolStatusFailedLabel: "Failed",
|
|
26
|
+
toolStatusPreparingLabel: "Preparing",
|
|
27
|
+
toolStatusRunningLabel: "Running",
|
|
28
|
+
unknownPartLabel: "Unknown",
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
describe("buildShowContentToolCard", () => {
|
|
32
|
+
it("builds a show-content action from a normalized show_content result", () => {
|
|
33
|
+
const card = buildShowContentToolCard({
|
|
34
|
+
invocation: {
|
|
35
|
+
status: "result",
|
|
36
|
+
toolCallId: "call-show-content",
|
|
37
|
+
toolName: "show_content",
|
|
38
|
+
result: {
|
|
39
|
+
ok: true,
|
|
40
|
+
action: "showContent",
|
|
41
|
+
request: {
|
|
42
|
+
target: {
|
|
43
|
+
type: "file",
|
|
44
|
+
payload: {
|
|
45
|
+
path: "docs/example.md",
|
|
46
|
+
line: 2,
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
title: "Example",
|
|
50
|
+
purpose: "read",
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
actionLabel: "Show content",
|
|
55
|
+
statusLabel: "Completed",
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
expect(card).toMatchObject({
|
|
59
|
+
kind: "result",
|
|
60
|
+
name: "show_content",
|
|
61
|
+
detail: "Example",
|
|
62
|
+
statusTone: "success",
|
|
63
|
+
statusLabel: "Completed",
|
|
64
|
+
action: {
|
|
65
|
+
kind: "show-content",
|
|
66
|
+
label: "Show content",
|
|
67
|
+
request: {
|
|
68
|
+
target: {
|
|
69
|
+
type: "file",
|
|
70
|
+
payload: {
|
|
71
|
+
path: "docs/example.md",
|
|
72
|
+
line: 2,
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
title: "Example",
|
|
76
|
+
purpose: "read",
|
|
77
|
+
placement: "side_panel",
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
it("builds an inline panel app card while keeping the expand action on side panel placement", () => {
|
|
84
|
+
const card = buildShowContentToolCard({
|
|
85
|
+
invocation: {
|
|
86
|
+
status: "result",
|
|
87
|
+
toolCallId: "call-show-content",
|
|
88
|
+
toolName: "show_content",
|
|
89
|
+
result: {
|
|
90
|
+
ok: true,
|
|
91
|
+
action: "showContent",
|
|
92
|
+
request: {
|
|
93
|
+
target: {
|
|
94
|
+
type: "panel_app",
|
|
95
|
+
payload: {
|
|
96
|
+
appId: "reader",
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
title: "Reader",
|
|
100
|
+
purpose: "interact",
|
|
101
|
+
placement: "inline",
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
actionLabel: "Show content",
|
|
106
|
+
statusLabel: "Completed",
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
expect(card).toMatchObject({
|
|
110
|
+
panelApp: {
|
|
111
|
+
appId: "reader",
|
|
112
|
+
title: "Reader",
|
|
113
|
+
action: {
|
|
114
|
+
kind: "show-content",
|
|
115
|
+
label: "Show content",
|
|
116
|
+
request: {
|
|
117
|
+
target: {
|
|
118
|
+
type: "panel_app",
|
|
119
|
+
payload: {
|
|
120
|
+
appId: "reader",
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
title: "Reader",
|
|
124
|
+
purpose: "interact",
|
|
125
|
+
placement: "side_panel",
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
it("preserves inline panel app data when converting to the shared chat tool view model", () => {
|
|
133
|
+
const card = buildShowContentToolCard({
|
|
134
|
+
invocation: {
|
|
135
|
+
status: "result",
|
|
136
|
+
toolCallId: "call-show-content",
|
|
137
|
+
toolName: "show_content",
|
|
138
|
+
result: {
|
|
139
|
+
ok: true,
|
|
140
|
+
action: "showContent",
|
|
141
|
+
request: {
|
|
142
|
+
target: {
|
|
143
|
+
type: "panel_app",
|
|
144
|
+
payload: {
|
|
145
|
+
appId: "weather-card",
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
title: "Weather",
|
|
149
|
+
purpose: "interact",
|
|
150
|
+
placement: "inline",
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
actionLabel: "Show content",
|
|
155
|
+
statusLabel: "Completed",
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
expect(card).not.toBeNull();
|
|
159
|
+
expect(buildToolCard(card!, TEXTS)).toMatchObject({
|
|
160
|
+
panelApp: {
|
|
161
|
+
appId: "weather-card",
|
|
162
|
+
title: "Weather",
|
|
163
|
+
action: {
|
|
164
|
+
kind: "show-content",
|
|
165
|
+
request: {
|
|
166
|
+
placement: "side_panel",
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
});
|
|
171
|
+
});
|
|
172
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ToolInvocationStatus, type UiMessage } from "@nextclaw/agent-chat";
|
|
2
|
-
import { adaptChatMessages } from "
|
|
3
|
-
import type { ChatMessageSource } from "
|
|
2
|
+
import { adaptChatMessages } from "../chat-message.utils";
|
|
3
|
+
import type { ChatMessageSource } from "../chat-message.utils";
|
|
4
4
|
import type { ChatMessagePartViewModel } from "@nextclaw/agent-chat-ui";
|
|
5
5
|
|
|
6
6
|
const defaultTexts = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ToolInvocationStatus } from "@nextclaw/agent-chat";
|
|
2
|
-
import { adaptChatMessages, type ChatMessageSource } from "
|
|
2
|
+
import { adaptChatMessages, type ChatMessageSource } from "../chat-message.utils";
|
|
3
3
|
|
|
4
4
|
const defaultTexts = {
|
|
5
5
|
roleLabels: {
|
package/src/features/chat/{utils → features/message/utils/__tests__}/chat-message.utils.test.ts
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ToolInvocationStatus, type UiMessage } from "@nextclaw/agent-chat";
|
|
2
|
-
import { adaptChatMessages } from "
|
|
3
|
-
import type { ChatMessageSource } from "
|
|
2
|
+
import { adaptChatMessages } from "../chat-message.utils";
|
|
3
|
+
import type { ChatMessageSource } from "../chat-message.utils";
|
|
4
4
|
|
|
5
5
|
function toSource(uiMessages: UiMessage[]): ChatMessageSource[] {
|
|
6
6
|
return uiMessages as unknown as ChatMessageSource[];
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createPanelAppResourceUri,
|
|
3
|
+
RIGHT_PANEL_PANEL_APP_TAB_KIND,
|
|
4
|
+
} from '@/features/right-panel-resources';
|
|
5
|
+
import type { DocBrowserTab } from '@/shared/components/doc-browser/doc-browser-context';
|
|
6
|
+
|
|
7
|
+
export const PANEL_APP_INLINE_IFRAME_SANDBOX = [
|
|
8
|
+
'allow-scripts',
|
|
9
|
+
'allow-forms',
|
|
10
|
+
'allow-modals',
|
|
11
|
+
'allow-popups',
|
|
12
|
+
'allow-popups-to-escape-sandbox',
|
|
13
|
+
'allow-downloads',
|
|
14
|
+
'allow-pointer-lock',
|
|
15
|
+
'allow-presentation',
|
|
16
|
+
].join(' ');
|
|
17
|
+
|
|
18
|
+
export const PANEL_APP_INLINE_CARD_MAX_HEIGHT_PX = 420;
|
|
19
|
+
|
|
20
|
+
const PANEL_APP_INLINE_CARD_SEARCH_PARAMS = {
|
|
21
|
+
nextclawDisplayMode: 'card',
|
|
22
|
+
nextclawPlacement: 'inline',
|
|
23
|
+
} as const;
|
|
24
|
+
|
|
25
|
+
export function createFallbackPanelAppContentPath(appId: string): string {
|
|
26
|
+
return `/api/panel-apps/${encodeURIComponent(appId)}/content`;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function createInlinePanelAppCardUrl(url: string): string {
|
|
30
|
+
const separator = url.includes('?') ? '&' : '?';
|
|
31
|
+
return `${url}${separator}${new URLSearchParams(PANEL_APP_INLINE_CARD_SEARCH_PARAMS).toString()}`;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function createInlinePanelAppTab(params: {
|
|
35
|
+
appId: string;
|
|
36
|
+
title: string;
|
|
37
|
+
url: string;
|
|
38
|
+
}): DocBrowserTab {
|
|
39
|
+
const { appId, title, url } = params;
|
|
40
|
+
return {
|
|
41
|
+
currentUrl: url,
|
|
42
|
+
dedupeKey: `panel-app:${appId}`,
|
|
43
|
+
history: [url],
|
|
44
|
+
historyIndex: 0,
|
|
45
|
+
id: `inline-panel-app:${appId}`,
|
|
46
|
+
kind: RIGHT_PANEL_PANEL_APP_TAB_KIND,
|
|
47
|
+
navVersion: 0,
|
|
48
|
+
resourceUri: createPanelAppResourceUri(appId),
|
|
49
|
+
title,
|
|
50
|
+
};
|
|
51
|
+
}
|
package/src/features/chat/{utils → features/message/utils}/chat-message-inline-content.utils.ts
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
splitTextByInlineTokens,
|
|
3
3
|
type ChatInlineTokenSource,
|
|
4
|
-
} from "@/features/chat/utils/chat-inline-token.utils";
|
|
4
|
+
} from "@/features/chat/features/input/utils/chat-inline-token.utils";
|
|
5
5
|
import type {
|
|
6
6
|
ChatInlineContentSegmentViewModel,
|
|
7
7
|
ChatMessagePartViewModel,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
stringifyUnknown,
|
|
3
3
|
summarizeToolArgs,
|
|
4
|
-
} from "@/features/chat/utils/chat-message-core.utils";
|
|
5
|
-
import { type ChatInlineTokenSource } from "@/features/chat/utils/chat-inline-token.utils";
|
|
4
|
+
} from "@/features/chat/features/message/utils/chat-message-core.utils";
|
|
5
|
+
import { type ChatInlineTokenSource } from "@/features/chat/features/input/utils/chat-inline-token.utils";
|
|
6
6
|
import {
|
|
7
7
|
buildRenderableText,
|
|
8
8
|
buildTextPart,
|
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
} from "./chat-message-tool-card.utils";
|
|
19
19
|
import { resolveToolInvocationAgentId } from "./chat-message-tool-agent-id.utils";
|
|
20
20
|
import { buildFileOperationCardData } from "./file-operation/card.utils";
|
|
21
|
+
import { buildShowContentToolCard } from "./chat-message-show-content-tool-card.utils";
|
|
21
22
|
import { buildSessionRequestToolCard } from "./chat-message-session-request-tool-card.utils";
|
|
22
23
|
import type {
|
|
23
24
|
ChatMessagePartViewModel,
|
|
@@ -116,6 +117,18 @@ function buildToolInvocationPart(
|
|
|
116
117
|
};
|
|
117
118
|
}
|
|
118
119
|
|
|
120
|
+
const showContentToolCard = buildShowContentToolCard({
|
|
121
|
+
invocation,
|
|
122
|
+
actionLabel: texts.showContentActionLabel ?? "Show content",
|
|
123
|
+
statusLabel: texts.toolStatusCompletedLabel,
|
|
124
|
+
});
|
|
125
|
+
if (showContentToolCard) {
|
|
126
|
+
return {
|
|
127
|
+
type: "tool-card",
|
|
128
|
+
card: buildToolCard(showContentToolCard, texts),
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
|
|
119
132
|
const statusView = resolveToolCardStatus({
|
|
120
133
|
status: invocation.status,
|
|
121
134
|
error: invocation.error,
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
stringifyUnknown,
|
|
3
3
|
summarizeToolArgs,
|
|
4
4
|
type ToolCard,
|
|
5
|
-
} from "@/features/chat/utils/chat-message-core.utils";
|
|
5
|
+
} from "@/features/chat/features/message/utils/chat-message-core.utils";
|
|
6
6
|
import { resolveToolInvocationAgentId } from "./chat-message-tool-agent-id.utils";
|
|
7
7
|
import type { ChatToolPartViewModel } from "@nextclaw/agent-chat-ui";
|
|
8
8
|
|