@steerable/agent-shell-web 0.14.5 → 0.14.7
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/package.json +4 -4
- package/src/components/AgentSidebar.tsx +6 -2
- package/src/components/ChatHeader.tsx +17 -2
- package/src/components/chat/AssistantMessage.tsx +60 -1
- package/src/components/chat/ChatInput.tsx +16 -4
- package/src/components/chat/LocalChatPanel.tsx +32 -1
- package/src/components/chat/MemorySaveNoticeBar.tsx +24 -3
- package/src/components/chat/MessageList.tsx +6 -0
- package/src/components/settings/AgentsSettingsPanel.tsx +3 -3
- package/src/components/settings/AppUpdateSettingsPanel.tsx +67 -43
- package/src/components/settings/AppearanceSettingsPanel.tsx +101 -134
- package/src/components/settings/CliInstallSettingsPanel.tsx +25 -23
- package/src/components/settings/DiagnoseSettingsPanel.tsx +3 -3
- package/src/components/settings/InsightsSettingsPanel.tsx +5 -7
- package/src/components/settings/LlmSettingsPanel.tsx +22 -2
- package/src/components/settings/McpSettingsPanel.tsx +4 -5
- package/src/components/settings/MemorySettingsPanel.tsx +302 -169
- package/src/components/settings/OrchestrationSettingsPanel.tsx +79 -121
- package/src/components/settings/PortableSettingsPanel.tsx +62 -49
- package/src/components/settings/PythonRunnerSettingsPanel.tsx +2 -4
- package/src/components/settings/SecuritySettingsPanel.tsx +91 -70
- package/src/components/settings/SettingsSidebar.tsx +238 -0
- package/src/components/settings/SkillsSettingsPanel.tsx +3 -4
- package/src/components/settings/TelemetrySettingsPanel.tsx +2 -7
- package/src/components/settings/UsagePanel.tsx +27 -35
- package/src/components/settings/WebSearchSettingsPanel.tsx +89 -88
- package/src/components/settings/primitives.tsx +302 -0
- package/src/components/settings/settings-registry.ts +371 -0
- package/src/layouts/AgentLayout.tsx +106 -6
- package/src/lib/chat-draft-store.ts +43 -0
- package/src/lib/chat-mode-store.ts +27 -0
- package/src/lib/chat-title.ts +13 -0
- package/src/lib/local-api.ts +35 -0
- package/src/packs/registry.ts +2 -0
- package/src/pages/AgentPage.tsx +333 -3
- package/src/pages/SettingsPage.tsx +337 -487
- package/src/styles/index.css +6 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steerable/agent-shell-web",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Steerable framework — product-neutral renderer SPA source for @steerable/agent-shell (React + Vite). Consumed by product web entry points via the `@/` alias (anchored at this package's src/) and the createProductViteConfig factory. Published as a source package (src/), plus the compiled vite.base config factory (vite.base.js + .d.ts) for Node-side config loading.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"react-router-dom": "^6.30.0",
|
|
46
46
|
"rehype-raw": "^7.0.0",
|
|
47
47
|
"remark-gfm": "^4.0.1",
|
|
48
|
-
"@steerable/agent-protocol": "0.14.
|
|
49
|
-
"@steerable/agent-ui": "0.14.
|
|
48
|
+
"@steerable/agent-protocol": "0.14.7",
|
|
49
|
+
"@steerable/agent-ui": "0.14.7"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@tailwindcss/vite": "^4.3.0",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"typescript": "^5.8.3",
|
|
60
60
|
"vite": "^5.4.21",
|
|
61
61
|
"vitest": "^3.2.4",
|
|
62
|
-
"@steerable/pack-sdk": "0.14.
|
|
62
|
+
"@steerable/pack-sdk": "0.14.7"
|
|
63
63
|
},
|
|
64
64
|
"scripts": {
|
|
65
65
|
"gen": "echo agent-shell-web",
|
|
@@ -95,7 +95,7 @@ import {
|
|
|
95
95
|
LuX,
|
|
96
96
|
} from "react-icons/lu";
|
|
97
97
|
import { RiPushpin2Fill, RiPushpin2Line } from "react-icons/ri";
|
|
98
|
-
import { parseChatTitle } from "@/lib/chat-title";
|
|
98
|
+
import { parseChatTitle, resolveChatDisplayTitle } from "@/lib/chat-title";
|
|
99
99
|
import { chatRowKeys } from "@/lib/chat-row-keys";
|
|
100
100
|
import { getDateGroupLabel, getDateGroupPriority } from "@/lib/date-groups";
|
|
101
101
|
import { getHostBridge, hasHostBridge } from "@/lib/host-bridge";
|
|
@@ -938,7 +938,11 @@ export function AgentSidebar({
|
|
|
938
938
|
const { displayTitle, isAutomation } = parseChatTitle(chat.title);
|
|
939
939
|
return {
|
|
940
940
|
id: chat.id,
|
|
941
|
-
title:
|
|
941
|
+
title: resolveChatDisplayTitle(
|
|
942
|
+
displayTitle,
|
|
943
|
+
t("New conversation"),
|
|
944
|
+
chat.titleSource,
|
|
945
|
+
),
|
|
942
946
|
isAutomation,
|
|
943
947
|
isPinned: chat.isPinned,
|
|
944
948
|
sortDate: new Date(
|
|
@@ -51,6 +51,7 @@ import {
|
|
|
51
51
|
import { hostToolChrome } from '@/lib/host-tools';
|
|
52
52
|
import { PanelToggleButton } from '@/layouts/PanelToggleButton';
|
|
53
53
|
import { t } from '@/i18n';
|
|
54
|
+
import { parseChatTitle, resolveChatDisplayTitle } from '@/lib/chat-title';
|
|
54
55
|
import { forkSourceTime } from './chat/timestamp';
|
|
55
56
|
import {
|
|
56
57
|
getTurnFileCategory,
|
|
@@ -392,9 +393,23 @@ export function ChatHeader({
|
|
|
392
393
|
<div className="flex min-w-0 flex-1 flex-wrap items-center gap-x-2 gap-y-0.5">
|
|
393
394
|
<span
|
|
394
395
|
className="break-words text-xs font-medium text-agent-foreground"
|
|
395
|
-
title={
|
|
396
|
+
title={
|
|
397
|
+
chat
|
|
398
|
+
? resolveChatDisplayTitle(
|
|
399
|
+
parseChatTitle(chat.title).displayTitle,
|
|
400
|
+
t('New conversation'),
|
|
401
|
+
chat.titleSource,
|
|
402
|
+
)
|
|
403
|
+
: undefined
|
|
404
|
+
}
|
|
396
405
|
>
|
|
397
|
-
{chat
|
|
406
|
+
{chat
|
|
407
|
+
? resolveChatDisplayTitle(
|
|
408
|
+
parseChatTitle(chat.title).displayTitle,
|
|
409
|
+
t('New conversation'),
|
|
410
|
+
chat.titleSource,
|
|
411
|
+
)
|
|
412
|
+
: t('No chat selected')}
|
|
398
413
|
</span>
|
|
399
414
|
{forkedFrom ? (
|
|
400
415
|
<span
|
|
@@ -12,10 +12,11 @@ import {
|
|
|
12
12
|
LuTriangleAlert,
|
|
13
13
|
} from 'react-icons/lu';
|
|
14
14
|
import type { ChatMessage } from '@steerable/agent-protocol';
|
|
15
|
-
import type { LocalChat, LocalChatAgent } from '@/lib/local-api';
|
|
15
|
+
import type { LocalChat, LocalChatAgent, SavedMemoryNotice } from '@/lib/local-api';
|
|
16
16
|
import { t } from '@/i18n';
|
|
17
17
|
import { CurrentMessageIdContext } from '@/lib/chat-mode-store';
|
|
18
18
|
import { Markdown } from './Markdown';
|
|
19
|
+
import { MemorySaveNoticeBar } from './MemorySaveNoticeBar';
|
|
19
20
|
import { ExecutedActionsCard, type ExecutedAction } from './ExecutedActionsCard';
|
|
20
21
|
import type { ChildInfo } from './OrchestrationChildrenCard';
|
|
21
22
|
import {
|
|
@@ -181,6 +182,11 @@ interface AssistantMessageProps {
|
|
|
181
182
|
* from inline Markdown so suggestions are not shown twice.
|
|
182
183
|
*/
|
|
183
184
|
hideInlineNextSteps?: boolean;
|
|
185
|
+
/** Open the Memory settings tab pre-focused on a saved memory's scope/workspace. */
|
|
186
|
+
onOpenMemorySettings?: (target: {
|
|
187
|
+
scope: 'user' | 'workspace' | 'tenant';
|
|
188
|
+
scopeId: string;
|
|
189
|
+
}) => void;
|
|
184
190
|
}
|
|
185
191
|
|
|
186
192
|
function agentInitial(name: string): string {
|
|
@@ -356,6 +362,36 @@ function readPersistedAgentId(message: ChatMessage): string | undefined {
|
|
|
356
362
|
}
|
|
357
363
|
}
|
|
358
364
|
|
|
365
|
+
export function readSavedMemories(message: ChatMessage): SavedMemoryNotice[] {
|
|
366
|
+
const raw = (message as { messageMetadata?: unknown }).messageMetadata;
|
|
367
|
+
if (typeof raw !== 'string' || !raw) return [];
|
|
368
|
+
try {
|
|
369
|
+
const parsed = JSON.parse(raw) as { savedMemories?: unknown };
|
|
370
|
+
if (!Array.isArray(parsed.savedMemories)) return [];
|
|
371
|
+
const out: SavedMemoryNotice[] = [];
|
|
372
|
+
for (const item of parsed.savedMemories) {
|
|
373
|
+
if (!item || typeof item !== 'object') continue;
|
|
374
|
+
const rec = item as Record<string, unknown>;
|
|
375
|
+
if (typeof rec.refinementId !== 'string' || !rec.refinementId) continue;
|
|
376
|
+
const scope =
|
|
377
|
+
rec.scope === 'workspace' || rec.scope === 'tenant' ? rec.scope : 'user';
|
|
378
|
+
const scopeId = typeof rec.scopeId === 'string' ? rec.scopeId : 'default';
|
|
379
|
+
out.push({
|
|
380
|
+
refinementId: rec.refinementId,
|
|
381
|
+
scope,
|
|
382
|
+
scopeId,
|
|
383
|
+
...(typeof rec.summary === 'string' && rec.summary
|
|
384
|
+
? { summary: rec.summary }
|
|
385
|
+
: {}),
|
|
386
|
+
...(rec.withdrawn === true ? { withdrawn: true } : {}),
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
return out;
|
|
390
|
+
} catch {
|
|
391
|
+
return [];
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
|
|
359
395
|
function TurnErrorBubble({
|
|
360
396
|
failure,
|
|
361
397
|
completedSteps,
|
|
@@ -499,8 +535,10 @@ export function AssistantMessage({
|
|
|
499
535
|
onContinueChild,
|
|
500
536
|
onStopChild,
|
|
501
537
|
hideInlineNextSteps = false,
|
|
538
|
+
onOpenMemorySettings,
|
|
502
539
|
}: AssistantMessageProps) {
|
|
503
540
|
const content = message.content || '';
|
|
541
|
+
const savedMemories = readSavedMemories(message);
|
|
504
542
|
const failure = readTurnFailure(message, content);
|
|
505
543
|
const stopped = !failure && readTurnStatus(message) === 'cancelled';
|
|
506
544
|
const stoppedDuringRetry = stopped && readStoppedDuringRetry(message);
|
|
@@ -756,6 +794,27 @@ export function AssistantMessage({
|
|
|
756
794
|
<TurnFilesCard files={turnFiles} executedActions={executedActions} chatId={chatId} />
|
|
757
795
|
</div>
|
|
758
796
|
)}
|
|
797
|
+
{!isStreaming && savedMemories.length > 0 && (
|
|
798
|
+
<div className="mt-2 space-y-1" data-testid="assistant-saved-memories">
|
|
799
|
+
{savedMemories.map((mem) => (
|
|
800
|
+
<MemorySaveNoticeBar
|
|
801
|
+
key={mem.refinementId}
|
|
802
|
+
refinementId={mem.refinementId}
|
|
803
|
+
scope={mem.scope}
|
|
804
|
+
summary={mem.summary}
|
|
805
|
+
chatId={chatId ?? undefined}
|
|
806
|
+
messageId={message.id}
|
|
807
|
+
workspaceId={mem.scope === 'workspace' ? mem.scopeId : undefined}
|
|
808
|
+
initialWithdrawn={mem.withdrawn}
|
|
809
|
+
onEdit={
|
|
810
|
+
onOpenMemorySettings
|
|
811
|
+
? () => onOpenMemorySettings({ scope: mem.scope, scopeId: mem.scopeId })
|
|
812
|
+
: undefined
|
|
813
|
+
}
|
|
814
|
+
/>
|
|
815
|
+
))}
|
|
816
|
+
</div>
|
|
817
|
+
)}
|
|
759
818
|
<div className="mt-2 flex items-center gap-2 text-[11px] text-agent-muted-foreground/80">
|
|
760
819
|
<span>
|
|
761
820
|
{message.createdAt
|
|
@@ -1216,16 +1216,28 @@ export const ChatInput = forwardRef<ChatInputHandle, ChatInputProps>(
|
|
|
1216
1216
|
const builtinCommandSkills: SkillItem[] = [
|
|
1217
1217
|
{
|
|
1218
1218
|
name: 'compact',
|
|
1219
|
-
displayName: 'Compact context',
|
|
1219
|
+
displayName: t('Compact context'),
|
|
1220
1220
|
description: t('Summarize earlier messages to free up context window space'),
|
|
1221
1221
|
isBuiltin: true,
|
|
1222
1222
|
},
|
|
1223
|
+
{
|
|
1224
|
+
name: 'memory',
|
|
1225
|
+
displayName: t('Memory settings'),
|
|
1226
|
+
description: t('View or edit personal preferences and project memory'),
|
|
1227
|
+
isBuiltin: true,
|
|
1228
|
+
},
|
|
1229
|
+
{
|
|
1230
|
+
name: 'refine',
|
|
1231
|
+
displayName: t('Remember rule'),
|
|
1232
|
+
description: t('Save a durable preference or project convention directly to memory'),
|
|
1233
|
+
isBuiltin: true,
|
|
1234
|
+
},
|
|
1223
1235
|
];
|
|
1224
1236
|
const allSkills = [
|
|
1225
|
-
...builtinCommandSkills
|
|
1226
|
-
|
|
1237
|
+
...builtinCommandSkills,
|
|
1238
|
+
...skills.filter(
|
|
1239
|
+
(s) => !builtinCommandSkills.some((b) => b.name === s.name.toLowerCase()),
|
|
1227
1240
|
),
|
|
1228
|
-
...skills,
|
|
1229
1241
|
];
|
|
1230
1242
|
const skillMatches: SlashSuggestion[] = allSkills
|
|
1231
1243
|
.filter(
|
|
@@ -34,6 +34,7 @@ import {
|
|
|
34
34
|
type AttachmentFile,
|
|
35
35
|
} from '@/lib/attachments';
|
|
36
36
|
import { parseModeSlashCommand } from '@/lib/chat-mode-store';
|
|
37
|
+
import { clearChatDraft, getChatDraft, setChatDraft } from '@/lib/chat-draft-store';
|
|
37
38
|
|
|
38
39
|
/**
|
|
39
40
|
* LocalChatPanel — the product chat shell.
|
|
@@ -183,6 +184,12 @@ export interface LocalChatPanelProps {
|
|
|
183
184
|
*/
|
|
184
185
|
suggestedReplies?: string[];
|
|
185
186
|
onSelectSuggestion?: (text: string) => void;
|
|
187
|
+
/** 切去设置页或切换会话时在内存中保留未发送草稿文本。 */
|
|
188
|
+
preserveDraft?: boolean;
|
|
189
|
+
onOpenMemorySettings?: (target: {
|
|
190
|
+
scope: 'user' | 'workspace' | 'tenant';
|
|
191
|
+
scopeId: string;
|
|
192
|
+
}) => void;
|
|
186
193
|
}
|
|
187
194
|
|
|
188
195
|
export function LocalChatPanel({
|
|
@@ -246,8 +253,28 @@ export function LocalChatPanel({
|
|
|
246
253
|
onShare,
|
|
247
254
|
suggestedReplies,
|
|
248
255
|
onSelectSuggestion,
|
|
256
|
+
preserveDraft = false,
|
|
257
|
+
onOpenMemorySettings,
|
|
249
258
|
}: LocalChatPanelProps) {
|
|
250
|
-
const [inputValue,
|
|
259
|
+
const [inputValue, setInputValueState] = useState(() =>
|
|
260
|
+
preserveDraft ? getChatDraft(chatId) : '',
|
|
261
|
+
);
|
|
262
|
+
const setInputValue = useCallback(
|
|
263
|
+
(next: string | ((prev: string) => string)) => {
|
|
264
|
+
setInputValueState((prev) => {
|
|
265
|
+
const resolved = typeof next === 'function' ? next(prev) : next;
|
|
266
|
+
if (preserveDraft) {
|
|
267
|
+
setChatDraft(chatId, resolved);
|
|
268
|
+
}
|
|
269
|
+
return resolved;
|
|
270
|
+
});
|
|
271
|
+
},
|
|
272
|
+
[preserveDraft, chatId],
|
|
273
|
+
);
|
|
274
|
+
useEffect(() => {
|
|
275
|
+
if (!preserveDraft) return;
|
|
276
|
+
setInputValueState(getChatDraft(chatId));
|
|
277
|
+
}, [preserveDraft, chatId]);
|
|
251
278
|
const [files, setFiles] = useState<AttachmentFile[]>([]);
|
|
252
279
|
const [attachmentError, setAttachmentError] = useState<string | null>(null);
|
|
253
280
|
const [mentionReferences, setMentionReferences] = useState<MentionReference[]>([]);
|
|
@@ -339,6 +366,9 @@ export function LocalChatPanel({
|
|
|
339
366
|
const submittedMentions = mentionReferences;
|
|
340
367
|
// 失败项留在输入框里,用户可以直接重试 / 移除;成功项随消息发出后清掉。
|
|
341
368
|
const failedFiles = failures.map((f) => f.file);
|
|
369
|
+
if (preserveDraft) {
|
|
370
|
+
clearChatDraft(chatId);
|
|
371
|
+
}
|
|
342
372
|
setInputValue('');
|
|
343
373
|
setFiles(failedFiles);
|
|
344
374
|
setMentionReferences([]);
|
|
@@ -561,6 +591,7 @@ export function LocalChatPanel({
|
|
|
561
591
|
onShare={onShare}
|
|
562
592
|
suggestedReplies={suggestedReplies}
|
|
563
593
|
onSelectSuggestion={onSelectSuggestion}
|
|
594
|
+
onOpenMemorySettings={onOpenMemorySettings}
|
|
564
595
|
/>
|
|
565
596
|
<div className="mx-auto w-full max-w-3xl">
|
|
566
597
|
{inputBanner}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
2
|
import { t } from '@/i18n';
|
|
3
3
|
import { getHostBridge, hasHostBridge } from '@/lib/host-bridge';
|
|
4
4
|
|
|
5
5
|
export interface MemorySaveNoticeBarProps {
|
|
6
6
|
refinementId: string;
|
|
7
7
|
scope?: 'user' | 'workspace' | 'tenant';
|
|
8
|
+
summary?: string;
|
|
8
9
|
chatId?: string;
|
|
10
|
+
messageId?: string;
|
|
9
11
|
workspaceId?: string;
|
|
12
|
+
initialWithdrawn?: boolean;
|
|
10
13
|
onEdit?: () => void;
|
|
11
14
|
onWithdrawn?: (refinementId: string) => void;
|
|
12
15
|
}
|
|
@@ -14,17 +17,27 @@ export interface MemorySaveNoticeBarProps {
|
|
|
14
17
|
export function MemorySaveNoticeBar({
|
|
15
18
|
refinementId,
|
|
16
19
|
scope = 'workspace',
|
|
20
|
+
summary,
|
|
17
21
|
chatId,
|
|
22
|
+
messageId,
|
|
18
23
|
workspaceId,
|
|
24
|
+
initialWithdrawn = false,
|
|
19
25
|
onEdit,
|
|
20
26
|
onWithdrawn,
|
|
21
27
|
}: MemorySaveNoticeBarProps) {
|
|
22
|
-
const [withdrawn, setWithdrawn] = useState(
|
|
28
|
+
const [withdrawn, setWithdrawn] = useState(initialWithdrawn);
|
|
29
|
+
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
if (initialWithdrawn) {
|
|
32
|
+
setWithdrawn(true);
|
|
33
|
+
}
|
|
34
|
+
}, [initialWithdrawn]);
|
|
23
35
|
|
|
24
36
|
const handleWithdraw = async () => {
|
|
25
37
|
const path = `/api/v2/memory/refinements/${encodeURIComponent(refinementId)}/withdraw`;
|
|
26
38
|
const body = {
|
|
27
39
|
...(chatId ? { chatId } : {}),
|
|
40
|
+
...(messageId ? { messageId } : {}),
|
|
28
41
|
...(workspaceId ? { workspaceId } : {}),
|
|
29
42
|
};
|
|
30
43
|
if (hasHostBridge()) {
|
|
@@ -61,7 +74,15 @@ export function MemorySaveNoticeBar({
|
|
|
61
74
|
data-testid="memory-save-notice-bar"
|
|
62
75
|
className="mt-1.5 flex flex-wrap items-center gap-2 text-[11px] text-agent-muted-foreground"
|
|
63
76
|
>
|
|
64
|
-
<span>{label}</span>
|
|
77
|
+
<span>{summary ? `${label}:` : label}</span>
|
|
78
|
+
{summary ? (
|
|
79
|
+
<span
|
|
80
|
+
data-testid="memory-notice-summary"
|
|
81
|
+
className="max-w-[32rem] truncate text-agent-foreground/85"
|
|
82
|
+
>
|
|
83
|
+
{summary}
|
|
84
|
+
</span>
|
|
85
|
+
) : null}
|
|
65
86
|
<span>·</span>
|
|
66
87
|
{onEdit ? (
|
|
67
88
|
<button
|
|
@@ -211,6 +211,10 @@ interface MessageListProps {
|
|
|
211
211
|
*/
|
|
212
212
|
suggestedReplies?: string[];
|
|
213
213
|
onSelectSuggestion?: (text: string) => void;
|
|
214
|
+
onOpenMemorySettings?: (target: {
|
|
215
|
+
scope: 'user' | 'workspace' | 'tenant';
|
|
216
|
+
scopeId: string;
|
|
217
|
+
}) => void;
|
|
214
218
|
}
|
|
215
219
|
|
|
216
220
|
const COMPACTED_SUMMARY_PREFIX = '[context compacted: earlier conversation summarized]';
|
|
@@ -284,6 +288,7 @@ export function MessageList({
|
|
|
284
288
|
onShare,
|
|
285
289
|
suggestedReplies,
|
|
286
290
|
onSelectSuggestion,
|
|
291
|
+
onOpenMemorySettings,
|
|
287
292
|
}: MessageListProps) {
|
|
288
293
|
const containerRef = useRef<HTMLDivElement>(null);
|
|
289
294
|
const [isAtBottom, setIsAtBottom] = useState(true);
|
|
@@ -740,6 +745,7 @@ export function MessageList({
|
|
|
740
745
|
(message.id === lastAssistantId &&
|
|
741
746
|
Boolean(suggestedReplies && suggestedReplies.length > 0 && onSelectSuggestion))
|
|
742
747
|
}
|
|
748
|
+
onOpenMemorySettings={onOpenMemorySettings}
|
|
743
749
|
/>
|
|
744
750
|
{!isStreaming &&
|
|
745
751
|
message.id === lastAssistantId &&
|
|
@@ -214,15 +214,15 @@ export function AgentsSettingsPanel({
|
|
|
214
214
|
};
|
|
215
215
|
|
|
216
216
|
return (
|
|
217
|
-
<div className="space-y-
|
|
218
|
-
<p className="text-
|
|
217
|
+
<div className="space-y-4">
|
|
218
|
+
<p className="text-xs leading-relaxed text-agent-muted-foreground">
|
|
219
219
|
{t(
|
|
220
220
|
'Custom agents appear in the expert picker above the input box. The role prompt opens the conversation as its persona, and the checked skills and tool permissions apply on every turn. Built-in agents can have their text and capabilities edited, but cannot be deleted.',
|
|
221
221
|
)}
|
|
222
222
|
</p>
|
|
223
223
|
|
|
224
224
|
{formOpen ? (
|
|
225
|
-
<div className="space-y-
|
|
225
|
+
<div className="space-y-3 rounded-agent-md border border-agent-border bg-agent-canvas p-4">
|
|
226
226
|
<h4 className="text-xs font-semibold text-agent-foreground">
|
|
227
227
|
{editingId ? t('Edit agent') : t('New agent')}
|
|
228
228
|
</h4>
|
|
@@ -1,60 +1,70 @@
|
|
|
1
1
|
import { LuInfo } from 'react-icons/lu';
|
|
2
|
+
import { BRAND_NAME } from '@/brand';
|
|
2
3
|
import { useAppRelease } from '@/components/SidebarRelease';
|
|
3
4
|
import { t } from '@/i18n';
|
|
5
|
+
import { SettingRow, SettingSection } from './primitives';
|
|
4
6
|
|
|
5
7
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
+
* 版本与更新面板:
|
|
9
|
+
* - 独立挂载(未传 showFallbackBrand)且无桌面版本信息时保持返回 null,兼容存量单测;
|
|
10
|
+
* - 在「关于」子页(showFallbackBrand=true)常驻展示应用名称与当前版本号,不额外渲染冗余二级标题。
|
|
8
11
|
*/
|
|
9
|
-
export function AppUpdateSettingsPanel(
|
|
12
|
+
export function AppUpdateSettingsPanel({
|
|
13
|
+
showFallbackBrand = false,
|
|
14
|
+
}: {
|
|
15
|
+
showFallbackBrand?: boolean;
|
|
16
|
+
} = {}) {
|
|
10
17
|
const release = useAppRelease();
|
|
11
|
-
if (!release.version) return null;
|
|
18
|
+
if (!release.version && !showFallbackBrand) return null;
|
|
19
|
+
|
|
12
20
|
const detail =
|
|
13
21
|
release.actionTitle && release.actionTitle !== release.actionLabel
|
|
14
22
|
? release.actionTitle
|
|
15
23
|
: null;
|
|
16
24
|
|
|
17
|
-
|
|
18
|
-
<
|
|
19
|
-
<
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
25
|
+
const body = (
|
|
26
|
+
<div className="space-y-4">
|
|
27
|
+
<SettingSection>
|
|
28
|
+
<SettingRow
|
|
29
|
+
title={release.version ? t('Current version') : BRAND_NAME}
|
|
30
|
+
description={
|
|
31
|
+
<>
|
|
32
|
+
{release.version ? (
|
|
33
|
+
<span className="tabular-nums" data-testid="settings-app-version">
|
|
34
|
+
v{release.version}
|
|
35
|
+
</span>
|
|
36
|
+
) : (
|
|
37
|
+
<span data-testid="settings-app-version">{t('Web client')}</span>
|
|
38
|
+
)}
|
|
39
|
+
{detail ? <span className="mt-1 block">{detail}</span> : null}
|
|
40
|
+
</>
|
|
41
|
+
}
|
|
42
|
+
control={
|
|
43
|
+
release.actionLabel ? (
|
|
44
|
+
<button
|
|
45
|
+
type="button"
|
|
46
|
+
className={[
|
|
47
|
+
'flex h-7 shrink-0 items-center rounded-full px-3 text-xs transition-colors',
|
|
48
|
+
release.emphasize
|
|
49
|
+
? 'bg-agent-foreground font-medium text-agent-canvas hover:opacity-90'
|
|
50
|
+
: 'border border-agent-border text-agent-foreground hover:bg-agent-foreground/5',
|
|
51
|
+
release.clickable ? '' : 'cursor-default opacity-60',
|
|
52
|
+
].join(' ')}
|
|
53
|
+
data-testid="settings-app-update"
|
|
54
|
+
title={release.actionTitle}
|
|
55
|
+
disabled={!release.clickable}
|
|
56
|
+
onClick={release.run}
|
|
57
|
+
>
|
|
58
|
+
{release.actionLabel}
|
|
59
|
+
</button>
|
|
60
|
+
) : null
|
|
61
|
+
}
|
|
62
|
+
/>
|
|
63
|
+
</SettingSection>
|
|
64
|
+
|
|
55
65
|
{release.releaseNotes ? (
|
|
56
66
|
<div
|
|
57
|
-
className="rounded-
|
|
67
|
+
className="rounded-lg border border-agent-border/70 bg-agent-muted/20 p-3.5 text-xs"
|
|
58
68
|
data-testid="settings-app-release-notes"
|
|
59
69
|
>
|
|
60
70
|
<p className="font-medium text-agent-foreground">
|
|
@@ -67,6 +77,20 @@ export function AppUpdateSettingsPanel() {
|
|
|
67
77
|
</div>
|
|
68
78
|
</div>
|
|
69
79
|
) : null}
|
|
80
|
+
</div>
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
if (showFallbackBrand) {
|
|
84
|
+
return body;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return (
|
|
88
|
+
<section className="space-y-2" data-testid="settings-section-update">
|
|
89
|
+
<h2 className="flex items-center gap-1.5 text-xs font-semibold text-agent-foreground">
|
|
90
|
+
<LuInfo className="h-3.5 w-3.5 text-agent-muted-foreground" />
|
|
91
|
+
{t('About')}
|
|
92
|
+
</h2>
|
|
93
|
+
{body}
|
|
70
94
|
</section>
|
|
71
95
|
);
|
|
72
96
|
}
|