@nextclaw/ui 0.14.4 → 0.15.1
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 +73 -0
- package/dist/assets/api-b1R9VdeH.js +13 -0
- package/dist/assets/appearance-settings-page-D2O9pch9.js +1 -0
- package/dist/assets/book-open-B77lQ2Tg.js +1 -0
- package/dist/assets/channels-list-page-DcsIQc6A.js +8 -0
- package/dist/assets/chat-page-CZ7WxPir.js +1 -0
- package/dist/assets/{config-split-page-CRhlZ_pH.js → config-split-page-BWQ6_Raq.js} +1 -1
- package/dist/assets/confirm-dialog-C-NXSioX.js +5 -0
- package/dist/assets/desktop-update-config-usHpXugP.js +1 -0
- package/dist/assets/{dist-CikkhOlq.js → dist-YtoqU-AT.js} +1 -1
- package/dist/assets/{dist-PVA_xL1D.js → dist-jdGmbb6w.js} +1 -1
- package/dist/assets/doc-browser-B_Tf9n70.js +1 -0
- package/dist/assets/doc-browser-BdZPFOVa.js +1 -0
- package/dist/assets/{doc-browser-context-MTw4EvKd.js → doc-browser-context-DwokemUn.js} +1 -1
- package/dist/assets/es2015-bNpL2LKy.js +41 -0
- package/dist/assets/{external-link-DVJIQf_G.js → external-link-BM6fk8q-.js} +1 -1
- package/dist/assets/host-capabilities-9bB_998Z.js +1 -0
- package/dist/assets/i18n-provider-CntWolRA.js +1 -0
- package/dist/assets/index-BIcEw90u.js +104 -0
- package/dist/assets/index-BiNSTKTU.css +1 -0
- package/dist/assets/loader-circle-MBgNSVIH.js +1 -0
- package/dist/assets/mcp-marketplace-page-CLmUstLN.js +9 -0
- package/dist/assets/mcp-marketplace-page-rZkmWPMy.js +1 -0
- package/dist/assets/model-config-page-Di0ySJD2.js +1 -0
- package/dist/assets/plus-vDqW5Kxp.js +1 -0
- package/dist/assets/provider-scoped-model-input-Cm_a4GHf.js +1 -0
- package/dist/assets/providers-config-page-BAf2W0MV.js +1 -0
- package/dist/assets/{react-VNqT5Zp7.js → react-BN8uzPnp.js} +1 -1
- package/dist/assets/refresh-cw-BpVcFPmJ.js +1 -0
- package/dist/assets/remote-CLQ0IBM8.js +1 -0
- package/dist/assets/rotate-cw-CvNBv7_w.js +1 -0
- package/dist/assets/runtime-config-page-CflvvoDc.js +1 -0
- package/dist/assets/{save-BOJ477H-.js → save-BpFW5fpk.js} +1 -1
- package/dist/assets/{search-BEti5beA.js → search-D0uO7enf.js} +1 -1
- package/dist/assets/search-config-page-D0klFUXd.js +1 -0
- package/dist/assets/{secrets-config-page--IzrIOid.js → secrets-config-page-dVZ631Wp.js} +2 -2
- package/dist/assets/security-config-C5gnlkuj.js +1 -0
- package/dist/assets/select-Bh-CrA4p.js +1 -0
- package/dist/assets/setting-row-BJfCHRcb.js +1 -0
- package/dist/assets/settings-2-Blzi1vr6.js +1 -0
- package/dist/assets/side-dock-ZdaSrQVB.js +3 -0
- package/dist/assets/skeleton-BLlEzebZ.js +1 -0
- package/dist/assets/switch-CFLJFNSd.js +1 -0
- package/dist/assets/tag-chip-CzGihiQx.js +1 -0
- package/dist/assets/tooltip-CdcrBjrC.js +1 -0
- package/dist/assets/use-config-CVPgsBmU.js +1 -0
- package/dist/assets/use-confirm-dialog-CSeBk9SF.js +1 -0
- package/dist/assets/x-BF2KQ--V.js +1 -0
- package/dist/index.html +53 -17
- package/index.html +25 -2
- package/package.json +9 -9
- package/src/app/components/layout/__tests__/app-layout.test.tsx +27 -0
- package/src/app/components/layout/__tests__/settings-entry-page.test.tsx +9 -1
- package/src/app/components/layout/__tests__/sidebar.layout.test.tsx +6 -3
- package/src/app/components/layout/app-layout.tsx +10 -3
- package/src/app/components/layout/sidebar-items.tsx +8 -8
- package/src/app/components/layout/sidebar-rail.styles.ts +4 -2
- package/src/app/components/layout/sidebar.tsx +21 -28
- package/src/app/configs/app-navigation.config.ts +11 -5
- package/src/app/index.tsx +8 -0
- package/src/app/managers/__tests__/viewport-layout.manager.test.ts +59 -0
- package/src/app/managers/viewport-layout.manager.ts +39 -0
- package/src/app/presenters/app.presenter.ts +25 -2
- package/src/app/styles/design-system.css +91 -4
- package/src/features/agents/components/__tests__/agents-page.test.tsx +135 -2
- package/src/features/agents/components/agent-advanced-config-fields.tsx +70 -0
- package/src/features/agents/components/agent-details-dialog.tsx +398 -0
- package/src/features/agents/components/agent-dialogs.tsx +20 -47
- package/src/features/agents/components/agents-page.tsx +76 -10
- package/src/features/agents/types/agent-form.types.ts +21 -0
- package/src/features/agents/utils/agent-form.utils.ts +39 -0
- package/src/features/chat/components/conversation/__tests__/chat-conversation-content.test.tsx +86 -0
- package/src/features/chat/components/conversation/__tests__/chat-conversation-header-section.test.tsx +132 -1
- package/src/features/chat/components/conversation/chat-conversation-content.tsx +47 -17
- package/src/features/chat/components/conversation/chat-conversation-header-section.tsx +8 -0
- package/src/features/chat/components/conversation/chat-conversation-header.tsx +7 -3
- package/src/features/chat/components/layout/__tests__/chat-sidebar-read-state.test.tsx +7 -0
- package/src/features/chat/components/layout/chat-sidebar-desktop-layout.tsx +9 -5
- package/src/features/chat/components/layout/chat-sidebar-utility-menu.tsx +5 -5
- package/src/features/chat/features/conversation/components/__tests__/session-conversation-area.test.tsx +66 -2
- package/src/features/chat/features/conversation/components/__tests__/session-conversation-input.streaming.test.tsx +170 -1
- package/src/features/chat/features/conversation/components/session-conversation-area.tsx +23 -1
- package/src/features/chat/features/conversation/components/session-conversation-input.tsx +24 -7
- package/src/features/chat/features/conversation/components/session-queued-input-rows.tsx +96 -0
- package/src/features/chat/features/conversation/hooks/__tests__/use-session-conversation-controller.test.tsx +181 -0
- package/src/features/chat/features/conversation/hooks/use-session-conversation-controller.ts +351 -89
- package/src/features/chat/features/input/hooks/__tests__/use-chat-input-surface-state.test.tsx +29 -4
- package/src/features/chat/features/input/hooks/use-chat-input-surface-state.ts +28 -3
- package/src/features/chat/features/input/input-surface-plugins/__tests__/slash-command-plugin.test.ts +108 -8
- package/src/features/chat/features/input/input-surface-plugins/panel-app-reference-plugin.utils.ts +50 -14
- package/src/features/chat/features/input/input-surface-plugins/slash-command-plugin.utils.ts +77 -6
- package/src/features/chat/features/message/components/__tests__/chat-inline-panel-app-card.test.tsx +21 -12
- package/src/features/chat/features/message/components/__tests__/chat-message-list.container.test.tsx +167 -1
- package/src/features/chat/features/message/components/chat-inline-panel-app-card.tsx +19 -11
- package/src/features/chat/features/message/components/chat-message-list.container.tsx +38 -64
- package/src/features/chat/features/message/utils/__tests__/chat-message-process-summary.utils.test.ts +59 -0
- package/src/features/chat/features/message/utils/__tests__/chat-message-show-content-tool-card.utils.test.ts +56 -1
- package/src/features/chat/features/message/utils/chat-inline-panel-app-card.utils.ts +0 -2
- package/src/features/chat/features/message/utils/chat-message-process-summary.utils.ts +80 -0
- package/src/features/chat/features/message/utils/chat-message-show-content-tool-card.utils.ts +12 -3
- package/src/features/chat/features/message/utils/chat-message-texts.utils.ts +60 -0
- package/src/features/chat/features/message/utils/chat-message.utils.ts +3 -0
- package/src/features/chat/features/ncp/hooks/__tests__/use-ncp-agent-runtime.test.tsx +62 -1
- package/src/features/chat/features/ncp/hooks/__tests__/use-ncp-session-list-view.test.tsx +74 -0
- package/src/features/chat/features/ncp/hooks/use-ncp-session-list-view.ts +3 -2
- package/src/features/chat/features/session/components/chat-sidebar-project-groups.tsx +2 -2
- package/src/features/chat/features/session/components/chat-sidebar-session-item.tsx +1 -1
- package/src/features/chat/features/session/components/session-header/__tests__/chat-session-header-actions.test.tsx +3 -1
- package/src/features/chat/features/session/components/session-header/chat-session-metadata-dialog.tsx +1 -1
- package/src/features/chat/features/session/components/session-header/chat-session-title-switcher.tsx +294 -0
- package/src/features/chat/features/session/utils/__tests__/chat-session-display.utils.test.ts +15 -1
- package/src/features/chat/features/session/utils/__tests__/ncp-session-adapter.utils.test.ts +24 -4
- package/src/features/chat/features/session/utils/chat-session-display.utils.ts +3 -0
- package/src/features/chat/features/session/utils/ncp-session-adapter.utils.ts +1 -0
- package/src/features/chat/features/workspace/components/__tests__/chat-session-workspace-file-preview.test.tsx +304 -115
- package/src/features/chat/features/workspace/components/chat-session-workspace-file-breadcrumb-browser.tsx +121 -0
- package/src/features/chat/features/workspace/components/chat-session-workspace-file-breadcrumbs.tsx +75 -20
- package/src/features/chat/features/workspace/components/chat-session-workspace-file-preview.tsx +64 -5
- package/src/features/chat/features/workspace/utils/__tests__/chat-workspace-panel-view-model.utils.test.ts +46 -0
- package/src/features/chat/features/workspace/utils/chat-workspace-file-tab-persistence.utils.ts +83 -0
- package/src/features/chat/managers/__tests__/chat-thread.manager.test.ts +126 -1
- package/src/features/chat/managers/__tests__/chat-ui.manager.test.ts +2 -0
- package/src/features/chat/managers/chat-thread.manager.ts +15 -3
- package/src/features/chat/managers/chat-ui.manager.ts +5 -1
- package/src/features/chat/presenters/chat.presenter.ts +2 -1
- package/src/features/chat/stores/__tests__/chat-thread.store.test.ts +4 -0
- package/src/features/chat/stores/chat-thread.store.ts +6 -64
- package/src/features/chat/types/chat-message.types.ts +4 -0
- package/src/features/marketplace/components/__tests__/marketplace-page-detail.test.tsx +33 -26
- package/src/features/marketplace/components/__tests__/marketplace-page.test.tsx +1 -0
- package/src/features/marketplace/components/curated-shelves/__tests__/marketplace-curated-scene-route.test.tsx +1 -0
- package/src/features/marketplace/components/detail-doc/__tests__/marketplace-detail-doc.test.tsx +115 -0
- package/src/features/marketplace/components/marketplace-detail-doc.tsx +441 -0
- package/src/features/marketplace/components/mcp/__tests__/mcp-marketplace-page.test.tsx +3 -3
- package/src/features/marketplace/components/mcp/mcp-marketplace-doc.ts +0 -60
- package/src/features/marketplace/components/mcp/mcp-marketplace-page.tsx +64 -29
- package/src/features/marketplace/hooks/use-marketplace-item-detail.ts +42 -31
- package/src/features/marketplace/index.ts +3 -0
- package/src/features/marketplace/stores/marketplace-detail-doc.store.ts +38 -0
- package/src/features/panel-apps/components/__tests__/panel-apps-list.test.tsx +32 -2
- package/src/features/pwa/managers/__tests__/pwa-shell-theme.manager.test.ts +11 -0
- package/src/features/pwa/managers/pwa-shell-theme.manager.ts +8 -3
- package/src/features/settings/pages/__tests__/appearance-settings-page.test.tsx +25 -0
- package/src/features/settings/pages/appearance-settings-page.tsx +40 -0
- package/src/features/side-dock/components/__tests__/side-dock.test.tsx +44 -2
- package/src/features/side-dock/components/side-dock.tsx +100 -13
- package/src/features/side-dock/configs/side-dock-built-in-items.config.ts +10 -0
- package/src/features/side-dock/managers/__tests__/side-dock.manager.test.ts +32 -2
- package/src/features/side-dock/managers/side-dock.manager.ts +17 -7
- package/src/features/side-dock/stores/side-dock.store.ts +9 -0
- package/src/features/side-dock/types/side-dock.types.ts +10 -3
- package/src/features/side-dock/utils/side-dock-item.utils.ts +15 -2
- package/src/features/system-status/components/__tests__/desktop-update-config.test.tsx +97 -5
- package/src/features/system-status/components/desktop-update-config.tsx +91 -2
- package/src/features/system-status/utils/update-release-notes.utils.ts +94 -0
- package/src/index.css +501 -27
- package/src/platforms/desktop/components/desktop-window-chrome.tsx +1 -1
- package/src/shared/components/doc-browser/__tests__/doc-browser-context.test.tsx +30 -1
- package/src/shared/components/doc-browser/__tests__/doc-browser.test.tsx +206 -38
- package/src/shared/components/doc-browser/doc-browser-panel-parts.tsx +34 -11
- package/src/shared/components/doc-browser/doc-browser-renderer.types.ts +1 -1
- package/src/shared/components/doc-browser/doc-browser-tab-strip.tsx +23 -5
- package/src/shared/components/doc-browser/doc-browser.tsx +128 -75
- package/src/shared/components/doc-browser/managers/doc-browser.manager.ts +9 -1
- package/src/shared/components/doc-browser/utils/doc-browser-floating-panel.utils.ts +83 -0
- package/src/shared/components/ui/__tests__/dialog.test.tsx +27 -0
- package/src/shared/components/ui/actions/icon-action-button.tsx +14 -2
- package/src/shared/components/ui/dialog.tsx +2 -2
- package/src/shared/components/ui/popover.tsx +1 -1
- package/src/shared/components/ui/select.tsx +1 -1
- package/src/shared/components/ui/switch.tsx +4 -3
- package/src/shared/components/ui/tab-strip/__tests__/compact-tab-strip.test.tsx +54 -0
- package/src/shared/components/ui/tab-strip/compact-tab-strip.tsx +4 -5
- package/src/shared/components/ui/tooltip.tsx +1 -1
- package/src/shared/lib/api/ncp-session.types.ts +1 -1
- package/src/shared/lib/api/types.ts +12 -3
- package/src/shared/lib/api/utils/server-path.utils.ts +27 -1
- package/src/shared/lib/i18n/locales/en-US/agents.json +41 -0
- package/src/shared/lib/i18n/locales/en-US/chat.json +18 -6
- package/src/shared/lib/i18n/locales/en-US/core.json +2 -0
- package/src/shared/lib/i18n/locales/en-US/desktop-update.json +8 -0
- package/src/shared/lib/i18n/locales/en-US/doc-browser.json +11 -0
- package/src/shared/lib/i18n/locales/en-US/marketplace.json +5 -0
- package/src/shared/lib/i18n/locales/zh-CN/agents.json +41 -0
- package/src/shared/lib/i18n/locales/zh-CN/chat.json +18 -6
- package/src/shared/lib/i18n/locales/zh-CN/core.json +2 -0
- package/src/shared/lib/i18n/locales/zh-CN/desktop-update.json +8 -0
- package/src/shared/lib/i18n/locales/zh-CN/doc-browser.json +11 -0
- package/src/shared/lib/i18n/locales/zh-CN/marketplace.json +5 -0
- package/src/shared/lib/session-project/__tests__/workspace-file-breadcrumb.test.ts +14 -0
- package/src/shared/lib/session-project/index.ts +1 -1
- package/src/shared/lib/session-project/{workspace-file-breadcrumb.ts → workspace-file-breadcrumb.utils.ts} +62 -8
- package/src/shared/lib/theme/index.ts +51 -13
- package/dist/assets/api-BP_8IaxB.js +0 -13
- package/dist/assets/channels-list-page-DEh5Jjqx.js +0 -8
- package/dist/assets/chat-page-BRB0N5WW.js +0 -105
- package/dist/assets/confirm-dialog-DsivFJ4r.js +0 -5
- package/dist/assets/desktop-update-config-B0w9p2ep.js +0 -1
- package/dist/assets/doc-browser-BoNJ7-tE.js +0 -1
- package/dist/assets/doc-browser-CdJ_d4ik.js +0 -1
- package/dist/assets/ellipsis-y6vDtq4M.js +0 -1
- package/dist/assets/index-BiE-K8-q.css +0 -1
- package/dist/assets/index-D9BAE_L_.js +0 -105
- package/dist/assets/mcp-marketplace-page-B1SZNY5m.js +0 -40
- package/dist/assets/mcp-marketplace-page-Cq_Tw42T.js +0 -1
- package/dist/assets/model-config-page-DotaTUHb.js +0 -1
- package/dist/assets/plus-BbZqquJe.js +0 -1
- package/dist/assets/provider-scoped-model-input-DsFRuWJH.js +0 -1
- package/dist/assets/providers-config-page-DW4tQSLN.js +0 -1
- package/dist/assets/remote-B8TiUfwW.js +0 -1
- package/dist/assets/rotate-cw-DjHDTkCv.js +0 -1
- package/dist/assets/runtime-config-page-S6ErRHR8.js +0 -1
- package/dist/assets/search-config-page-DGj5am03.js +0 -1
- package/dist/assets/select-hoj8dK4K.js +0 -41
- package/dist/assets/tag-chip-T8-h-die.js +0 -1
- package/dist/assets/use-config-CjRV2hwL.js +0 -1
- package/dist/assets/x-D9PXs_xP.js +0 -1
- package/src/features/marketplace/components/detail-doc/__tests__/marketplace-detail-doc.test.ts +0 -40
- package/src/features/marketplace/components/detail-doc/marketplace-detail-doc-renderer.ts +0 -201
- package/src/features/marketplace/components/marketplace-detail-doc.ts +0 -142
- /package/dist/assets/{config-hints-BkYBc7z0.js → config-hints-fGnUjDe9.js} +0 -0
- /package/dist/assets/{middleware-CkFT3R4v.js → middleware-BILWbJE4.js} +0 -0
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
@layer base {
|
|
8
8
|
:root {
|
|
9
|
+
color-scheme: light;
|
|
10
|
+
|
|
9
11
|
/* ========================================
|
|
10
12
|
BRAND COLORS (Natural Olive)
|
|
11
13
|
======================================== */
|
|
@@ -200,10 +202,11 @@
|
|
|
200
202
|
--z-dropdown: 100;
|
|
201
203
|
--z-sticky: 200;
|
|
202
204
|
--z-fixed: 300;
|
|
203
|
-
--z-
|
|
204
|
-
--z-modal:
|
|
205
|
-
--z-
|
|
206
|
-
--z-
|
|
205
|
+
--z-floating-panel: 9999;
|
|
206
|
+
--z-modal-backdrop: 10000;
|
|
207
|
+
--z-modal: 10050;
|
|
208
|
+
--z-popover: 10100;
|
|
209
|
+
--z-tooltip: 10150;
|
|
207
210
|
}
|
|
208
211
|
}
|
|
209
212
|
|
|
@@ -569,6 +572,90 @@
|
|
|
569
572
|
}
|
|
570
573
|
}
|
|
571
574
|
|
|
575
|
+
|
|
576
|
+
@layer base {
|
|
577
|
+
:root[data-theme="night"] {
|
|
578
|
+
color-scheme: dark;
|
|
579
|
+
|
|
580
|
+
/* ========================================
|
|
581
|
+
BRAND COLORS (Night Moss)
|
|
582
|
+
======================================== */
|
|
583
|
+
--brand-50: 148 36% 91%;
|
|
584
|
+
--brand-100: 148 34% 84%;
|
|
585
|
+
--brand-200: 149 32% 72%;
|
|
586
|
+
--brand-300: 149 33% 60%;
|
|
587
|
+
--brand-400: 150 36% 52%;
|
|
588
|
+
--brand-500: 150 42% 46%;
|
|
589
|
+
--brand-600: 150 46% 38%;
|
|
590
|
+
--brand-700: 151 48% 30%;
|
|
591
|
+
--brand-800: 152 48% 22%;
|
|
592
|
+
--brand-900: 153 46% 15%;
|
|
593
|
+
|
|
594
|
+
/* ========================================
|
|
595
|
+
NEUTRAL COLORS (Deep Workbench)
|
|
596
|
+
======================================== */
|
|
597
|
+
--gray-50: 220 18% 8%;
|
|
598
|
+
--gray-100: 220 16% 11%;
|
|
599
|
+
--gray-200: 219 14% 16%;
|
|
600
|
+
--gray-300: 218 12% 24%;
|
|
601
|
+
--gray-400: 215 10% 46%;
|
|
602
|
+
--gray-500: 213 12% 62%;
|
|
603
|
+
--gray-600: 212 16% 74%;
|
|
604
|
+
--gray-700: 43 22% 82%;
|
|
605
|
+
--gray-800: 44 32% 90%;
|
|
606
|
+
--gray-900: 44 40% 96%;
|
|
607
|
+
|
|
608
|
+
/* Semantic Colors */
|
|
609
|
+
--background: var(--gray-50);
|
|
610
|
+
--background-secondary: var(--gray-100);
|
|
611
|
+
--background-tertiary: var(--gray-200);
|
|
612
|
+
--foreground: var(--gray-800);
|
|
613
|
+
--foreground-secondary: var(--gray-700);
|
|
614
|
+
--foreground-tertiary: var(--gray-500);
|
|
615
|
+
--foreground-muted: var(--gray-400);
|
|
616
|
+
--primary: var(--brand-400);
|
|
617
|
+
--primary-hover: var(--brand-300);
|
|
618
|
+
--primary-active: var(--brand-200);
|
|
619
|
+
--primary-foreground: 220 18% 8%;
|
|
620
|
+
--secondary: var(--gray-100);
|
|
621
|
+
--secondary-hover: var(--gray-200);
|
|
622
|
+
--secondary-foreground: var(--gray-800);
|
|
623
|
+
--accent: 151 32% 18%;
|
|
624
|
+
--accent-foreground: 148 34% 84%;
|
|
625
|
+
--muted: var(--gray-100);
|
|
626
|
+
--muted-foreground: var(--gray-500);
|
|
627
|
+
--destructive: 0 70% 52%;
|
|
628
|
+
--destructive-foreground: 0 0% 100%;
|
|
629
|
+
--success: 150 46% 44%;
|
|
630
|
+
--success-foreground: 220 18% 8%;
|
|
631
|
+
--warning: 42 82% 58%;
|
|
632
|
+
--warning-foreground: 220 18% 8%;
|
|
633
|
+
--card: 220 16% 10%;
|
|
634
|
+
--card-foreground: var(--gray-800);
|
|
635
|
+
--card-border: 218 13% 20%;
|
|
636
|
+
--popover: 220 16% 10%;
|
|
637
|
+
--popover-foreground: var(--gray-800);
|
|
638
|
+
--border: 218 13% 20%;
|
|
639
|
+
--border-hover: 218 12% 30%;
|
|
640
|
+
--border-active: var(--brand-400);
|
|
641
|
+
--input: 220 16% 12%;
|
|
642
|
+
--input-border: 218 13% 24%;
|
|
643
|
+
--input-focus: var(--brand-400);
|
|
644
|
+
--ring: var(--brand-400);
|
|
645
|
+
--ring-offset: var(--gray-50);
|
|
646
|
+
|
|
647
|
+
/* Shadows (deep neutral tint) */
|
|
648
|
+
--shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.28);
|
|
649
|
+
--shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.34), 0 1px 2px -1px rgb(0 0 0 / 0.3);
|
|
650
|
+
--shadow-md: 0 8px 18px -10px rgb(0 0 0 / 0.42), 0 4px 8px -6px rgb(0 0 0 / 0.34);
|
|
651
|
+
--shadow-lg: 0 16px 28px -16px rgb(0 0 0 / 0.48), 0 8px 14px -10px rgb(0 0 0 / 0.38);
|
|
652
|
+
--shadow-xl: 0 24px 40px -20px rgb(0 0 0 / 0.56), 0 10px 18px -12px rgb(0 0 0 / 0.42);
|
|
653
|
+
--shadow-2xl: 0 32px 60px -24px rgb(0 0 0 / 0.65);
|
|
654
|
+
--shadow-card: 0 0 0 1px hsl(var(--border) / 0.82), 0 18px 48px -34px rgb(0 0 0 / 0.72);
|
|
655
|
+
--shadow-card-hover: 0 0 0 1px hsl(var(--border-hover) / 0.88), 0 24px 60px -36px rgb(0 0 0 / 0.82);
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
|
|
572
659
|
@layer base {
|
|
573
660
|
:root[data-theme="probe"] {
|
|
574
661
|
/* ========================================
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { render, screen } from "@testing-library/react";
|
|
1
|
+
import { fireEvent, render, screen } from "@testing-library/react";
|
|
2
2
|
import userEvent from "@testing-library/user-event";
|
|
3
3
|
import { MemoryRouter } from "react-router-dom";
|
|
4
4
|
import type * as ReactRouterDom from "react-router-dom";
|
|
@@ -50,6 +50,13 @@ const mocks = vi.hoisted(() => ({
|
|
|
50
50
|
builtIn: false,
|
|
51
51
|
model: "openai/gpt-5.2",
|
|
52
52
|
runtime: "codex",
|
|
53
|
+
runtimeConfig: {
|
|
54
|
+
profile: "workspace-write",
|
|
55
|
+
},
|
|
56
|
+
thinkingDefault: "high",
|
|
57
|
+
contextTokens: 128000,
|
|
58
|
+
reservedContextTokens: 4096,
|
|
59
|
+
maxToolIterations: 64,
|
|
53
60
|
workspace: "~/.nextclaw/workspace/agents/researcher",
|
|
54
61
|
avatarUrl: null,
|
|
55
62
|
},
|
|
@@ -63,6 +70,13 @@ const mocks = vi.hoisted(() => ({
|
|
|
63
70
|
defaults: {
|
|
64
71
|
model: "openai/gpt-5.1",
|
|
65
72
|
workspace: "~/.nextclaw/workspace",
|
|
73
|
+
engine: "native",
|
|
74
|
+
engineConfig: {},
|
|
75
|
+
thinkingDefault: "off",
|
|
76
|
+
models: {},
|
|
77
|
+
contextTokens: 200000,
|
|
78
|
+
reservedContextTokens: 10000,
|
|
79
|
+
maxToolIterations: 1000,
|
|
66
80
|
},
|
|
67
81
|
},
|
|
68
82
|
providers: {
|
|
@@ -252,6 +266,7 @@ describe("AgentsPage", () => {
|
|
|
252
266
|
expect(screen.getByText("~/.nextclaw/workspace")).toBeTruthy();
|
|
253
267
|
expect(screen.getAllByRole("button", { name: "开始对话" })).toHaveLength(2);
|
|
254
268
|
expect(screen.getAllByRole("button", { name: "更多操作" })).toHaveLength(2);
|
|
269
|
+
expect(screen.queryByRole("button", { name: "查看详情" })).toBeNull();
|
|
255
270
|
expect(screen.queryByRole("button", { name: "编辑" })).toBeNull();
|
|
256
271
|
expect(screen.getByText("负责调研、信息筛选与结论提炼。")).toBeTruthy();
|
|
257
272
|
expect(
|
|
@@ -269,7 +284,8 @@ describe("AgentsPage", () => {
|
|
|
269
284
|
expect(screen.queryByText("创建新的 Agent 身份")).toBeNull();
|
|
270
285
|
|
|
271
286
|
await user.click(screen.getAllByRole("button", { name: "更多操作" })[1]);
|
|
272
|
-
|
|
287
|
+
const detailsEditButtons = screen.getAllByRole("button", { name: "编辑" });
|
|
288
|
+
await user.click(detailsEditButtons[detailsEditButtons.length - 1]);
|
|
273
289
|
|
|
274
290
|
expect(screen.getByText("编辑 Agent 身份")).toBeTruthy();
|
|
275
291
|
expect(screen.getByText("主目录保持不变")).toBeTruthy();
|
|
@@ -280,6 +296,122 @@ describe("AgentsPage", () => {
|
|
|
280
296
|
expect(screen.getByDisplayValue("gpt-5.2")).toBeTruthy();
|
|
281
297
|
});
|
|
282
298
|
|
|
299
|
+
it("separates read-only details from editing and keeps advanced config collapsed until requested", async () => {
|
|
300
|
+
const user = userEvent.setup();
|
|
301
|
+
|
|
302
|
+
renderAgentsPage();
|
|
303
|
+
|
|
304
|
+
await user.click(screen.getAllByRole("button", { name: "更多操作" })[1]);
|
|
305
|
+
await user.click(screen.getByRole("button", { name: "查看详情" }));
|
|
306
|
+
|
|
307
|
+
expect(screen.getByText("身份")).toBeTruthy();
|
|
308
|
+
expect(screen.getByText("上下文窗口大小")).toBeTruthy();
|
|
309
|
+
expect(screen.getByText("128,000")).toBeTruthy();
|
|
310
|
+
expect(screen.queryByRole("button", { name: "保存编辑" })).toBeNull();
|
|
311
|
+
const detailsDialog = screen.getByText("身份").closest("[role='dialog']");
|
|
312
|
+
expect(detailsDialog?.className).toContain("sm:max-w-2xl");
|
|
313
|
+
const detailLists = Array.from(detailsDialog?.querySelectorAll("dl") ?? []);
|
|
314
|
+
expect(detailLists.length).toBeGreaterThan(0);
|
|
315
|
+
expect(
|
|
316
|
+
detailLists.every(
|
|
317
|
+
(list) =>
|
|
318
|
+
!list.className.includes("divide-y") &&
|
|
319
|
+
!list.className.includes("border-t"),
|
|
320
|
+
),
|
|
321
|
+
).toBe(true);
|
|
322
|
+
expect(
|
|
323
|
+
Array.from(detailsDialog?.querySelectorAll("section") ?? []).every(
|
|
324
|
+
(section) =>
|
|
325
|
+
section.className.includes("space-y-2") &&
|
|
326
|
+
section.className.includes("border-t") &&
|
|
327
|
+
!section.className.includes("sm:grid-cols"),
|
|
328
|
+
),
|
|
329
|
+
).toBe(true);
|
|
330
|
+
expect(
|
|
331
|
+
detailLists.every((list) => list.className.includes("pl-5")),
|
|
332
|
+
).toBe(true);
|
|
333
|
+
expect(
|
|
334
|
+
Array.from(detailsDialog?.querySelectorAll("dt") ?? []).every(
|
|
335
|
+
(term) => {
|
|
336
|
+
const item = term.parentElement;
|
|
337
|
+
return Boolean(
|
|
338
|
+
item?.className.includes("grid-cols-[10rem_minmax(0,1fr)]") &&
|
|
339
|
+
!item.className.includes("space-y"),
|
|
340
|
+
);
|
|
341
|
+
},
|
|
342
|
+
),
|
|
343
|
+
).toBe(true);
|
|
344
|
+
expect(
|
|
345
|
+
Array.from(detailsDialog?.querySelectorAll("dt span") ?? []).every(
|
|
346
|
+
(label) => !label.className.includes("truncate"),
|
|
347
|
+
),
|
|
348
|
+
).toBe(true);
|
|
349
|
+
expect(
|
|
350
|
+
Array.from(detailsDialog?.querySelectorAll("dt") ?? []).every(
|
|
351
|
+
(term) =>
|
|
352
|
+
!term.textContent?.includes("继承默认") &&
|
|
353
|
+
!term.textContent?.includes("Agent 覆盖"),
|
|
354
|
+
),
|
|
355
|
+
).toBe(true);
|
|
356
|
+
expect(
|
|
357
|
+
Array.from(detailsDialog?.querySelectorAll("dd") ?? []).some((value) =>
|
|
358
|
+
value.textContent?.includes("128,000(Agent 覆盖)"),
|
|
359
|
+
),
|
|
360
|
+
).toBe(true);
|
|
361
|
+
expect(
|
|
362
|
+
Array.from(detailsDialog?.querySelectorAll("dd") ?? []).some((value) =>
|
|
363
|
+
value.textContent?.includes("未设置(继承默认)"),
|
|
364
|
+
),
|
|
365
|
+
).toBe(true);
|
|
366
|
+
expect(
|
|
367
|
+
Array.from(detailsDialog?.querySelectorAll("dt span, dd") ?? []).every(
|
|
368
|
+
(node) => node.className.includes("text-xs"),
|
|
369
|
+
),
|
|
370
|
+
).toBe(true);
|
|
371
|
+
expect(detailsDialog?.querySelector(".rounded-xl.bg-white.p-3")).toBeNull();
|
|
372
|
+
|
|
373
|
+
await user.click(screen.getByRole("button", { name: "编辑" }));
|
|
374
|
+
|
|
375
|
+
expect(screen.getByText("编辑 Agent 身份")).toBeTruthy();
|
|
376
|
+
const advancedDetails = screen.getByText("高级配置").closest("details");
|
|
377
|
+
expect(advancedDetails?.hasAttribute("open")).toBe(false);
|
|
378
|
+
|
|
379
|
+
await user.click(screen.getByText("高级配置"));
|
|
380
|
+
expect(advancedDetails?.hasAttribute("open")).toBe(true);
|
|
381
|
+
expect(screen.queryByLabelText("预留上下文大小")).toBeNull();
|
|
382
|
+
expect(screen.queryByLabelText("最大工具迭代次数")).toBeNull();
|
|
383
|
+
expect(screen.queryByLabelText("默认思考强度")).toBeNull();
|
|
384
|
+
expect(screen.queryByLabelText("Runtime 配置 JSON")).toBeNull();
|
|
385
|
+
expect(screen.queryByLabelText("模型覆盖 JSON")).toBeNull();
|
|
386
|
+
|
|
387
|
+
fireEvent.change(screen.getByLabelText("上下文窗口大小"), {
|
|
388
|
+
target: { value: "64000" },
|
|
389
|
+
});
|
|
390
|
+
await user.click(screen.getByRole("button", { name: "保存编辑" }));
|
|
391
|
+
|
|
392
|
+
expect(mocks.updateAgent).toHaveBeenCalledWith({
|
|
393
|
+
agentId: "researcher",
|
|
394
|
+
data: expect.objectContaining({
|
|
395
|
+
contextTokens: 64000,
|
|
396
|
+
}),
|
|
397
|
+
});
|
|
398
|
+
expect(mocks.updateAgent.mock.calls[0][0].data).not.toHaveProperty(
|
|
399
|
+
"reservedContextTokens",
|
|
400
|
+
);
|
|
401
|
+
expect(mocks.updateAgent.mock.calls[0][0].data).not.toHaveProperty(
|
|
402
|
+
"maxToolIterations",
|
|
403
|
+
);
|
|
404
|
+
expect(mocks.updateAgent.mock.calls[0][0].data).not.toHaveProperty(
|
|
405
|
+
"thinkingDefault",
|
|
406
|
+
);
|
|
407
|
+
expect(mocks.updateAgent.mock.calls[0][0].data).not.toHaveProperty(
|
|
408
|
+
"runtimeConfig",
|
|
409
|
+
);
|
|
410
|
+
expect(mocks.updateAgent.mock.calls[0][0].data).not.toHaveProperty(
|
|
411
|
+
"models",
|
|
412
|
+
);
|
|
413
|
+
});
|
|
414
|
+
|
|
283
415
|
it("uses a runtime dropdown instead of manual text input when editing an agent", async () => {
|
|
284
416
|
const user = userEvent.setup();
|
|
285
417
|
|
|
@@ -307,6 +439,7 @@ describe("AgentsPage", () => {
|
|
|
307
439
|
avatar: "",
|
|
308
440
|
model: "openai/gpt-5.2",
|
|
309
441
|
runtime: "codex",
|
|
442
|
+
contextTokens: 128000,
|
|
310
443
|
},
|
|
311
444
|
});
|
|
312
445
|
});
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { AgentEditFormState } from "@/features/agents/types/agent-form.types";
|
|
2
|
+
import { Input } from "@/shared/components/ui/input";
|
|
3
|
+
import { t } from "@/shared/lib/i18n";
|
|
4
|
+
import { ChevronDown, Settings2 } from "lucide-react";
|
|
5
|
+
|
|
6
|
+
type AgentAdvancedConfigFieldsProps = {
|
|
7
|
+
form: AgentEditFormState;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
onChange: (patch: Partial<AgentEditFormState>) => void;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export function AgentAdvancedConfigFields({
|
|
13
|
+
form,
|
|
14
|
+
disabled = false,
|
|
15
|
+
onChange,
|
|
16
|
+
}: AgentAdvancedConfigFieldsProps) {
|
|
17
|
+
return (
|
|
18
|
+
<details className="group rounded-2xl border border-gray-200 bg-white">
|
|
19
|
+
<summary className="flex cursor-pointer list-none items-center justify-between gap-3 px-4 py-3 text-sm font-semibold text-gray-800 [&::-webkit-details-marker]:hidden">
|
|
20
|
+
<span className="flex min-w-0 items-center gap-2">
|
|
21
|
+
<Settings2 className="h-4 w-4 shrink-0 text-gray-400" />
|
|
22
|
+
<span className="truncate">{t("agentsAdvancedConfigToggle")}</span>
|
|
23
|
+
</span>
|
|
24
|
+
<ChevronDown className="h-4 w-4 shrink-0 text-gray-400 transition-transform group-open:rotate-180" />
|
|
25
|
+
</summary>
|
|
26
|
+
<div className="space-y-4 border-t border-gray-100 px-4 py-4">
|
|
27
|
+
<p className="text-xs leading-5 text-gray-500">
|
|
28
|
+
{t("agentsAdvancedConfigDescription")}
|
|
29
|
+
</p>
|
|
30
|
+
<div className="grid gap-4 md:grid-cols-2">
|
|
31
|
+
<AgentNumberField
|
|
32
|
+
label={t("agentsAdvancedContextTokensLabel")}
|
|
33
|
+
value={form.contextTokens}
|
|
34
|
+
min={1000}
|
|
35
|
+
step={1000}
|
|
36
|
+
disabled={disabled}
|
|
37
|
+
onChange={(contextTokens) => onChange({ contextTokens })}
|
|
38
|
+
/>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
</details>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function AgentNumberField(props: {
|
|
46
|
+
label: string;
|
|
47
|
+
value: string;
|
|
48
|
+
min: number;
|
|
49
|
+
step: number;
|
|
50
|
+
disabled: boolean;
|
|
51
|
+
onChange: (value: string) => void;
|
|
52
|
+
}) {
|
|
53
|
+
const { label, value, min, step, disabled, onChange } = props;
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<label className="space-y-2 text-sm font-medium text-gray-700">
|
|
57
|
+
<span>{label}</span>
|
|
58
|
+
<Input
|
|
59
|
+
type="number"
|
|
60
|
+
min={min}
|
|
61
|
+
step={step}
|
|
62
|
+
value={value}
|
|
63
|
+
disabled={disabled}
|
|
64
|
+
placeholder={t("agentsAdvancedInheritPlaceholder")}
|
|
65
|
+
aria-label={label}
|
|
66
|
+
onChange={(event) => onChange(event.target.value)}
|
|
67
|
+
/>
|
|
68
|
+
</label>
|
|
69
|
+
);
|
|
70
|
+
}
|