@steerable/agent-shell-web 0.14.4 → 0.14.6
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 +189 -46
- package/src/components/ChatHeader.tsx +12 -1
- package/src/components/SidebarAccount.tsx +33 -41
- package/src/components/chat/AssistantMessage.tsx +25 -4
- package/src/components/chat/ChatInput.tsx +169 -111
- package/src/components/chat/ChatProjectBadge.tsx +233 -88
- package/src/components/chat/ContextUsagePill.tsx +20 -5
- package/src/components/chat/ExecPolicyPicker.tsx +72 -67
- package/src/components/chat/LocalChatPanel.tsx +34 -34
- package/src/components/chat/MessageList.tsx +109 -19
- package/src/components/chat/ModelPicker.tsx +2 -2
- package/src/components/chat/SessionTodoList.tsx +63 -72
- package/src/components/chat/TurnFilesCard.tsx +270 -112
- package/src/components/chat/TurnProcessGroup.tsx +3 -0
- package/src/components/chat/TurnProcessTimeline.tsx +13 -0
- package/src/components/chat/UserMessage.tsx +8 -1
- package/src/components/chat/next-steps-tags.ts +13 -0
- package/src/components/chat/process-status.ts +112 -2
- package/src/components/chat/todo-list-model.ts +52 -4
- 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 +210 -159
- 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 +275 -12
- package/src/layouts/PanelToggleButton.tsx +27 -9
- package/src/layouts/conversation-preview.ts +3 -0
- package/src/layouts/request-chat-slot.ts +20 -0
- package/src/layouts/right-panel-tabs.ts +32 -0
- package/src/lib/chat-draft-store.ts +43 -0
- package/src/lib/file-preview-registry.ts +57 -0
- package/src/packs/registry.ts +2 -0
- package/src/pages/AgentPage.tsx +17 -4
- package/src/pages/SettingsPage.tsx +327 -489
- package/src/styles/index.css +6 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
1
|
+
import { useEffect, useId, useMemo, useRef, useState } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
LuCircle,
|
|
4
4
|
LuCircleCheck,
|
|
@@ -6,9 +6,7 @@ import {
|
|
|
6
6
|
LuChevronDown,
|
|
7
7
|
LuListChecks,
|
|
8
8
|
LuLoaderCircle,
|
|
9
|
-
LuX,
|
|
10
9
|
} from 'react-icons/lu';
|
|
11
|
-
import { useExclusiveExpand } from './composer-status-stack';
|
|
12
10
|
import { t } from '@/i18n';
|
|
13
11
|
import {
|
|
14
12
|
summarizeTodos,
|
|
@@ -63,7 +61,7 @@ export function TodoItems({
|
|
|
63
61
|
}) {
|
|
64
62
|
return (
|
|
65
63
|
<ol
|
|
66
|
-
className={`m-0 list-none ${compact ? 'max-h-
|
|
64
|
+
className={`m-0 list-none ${compact ? 'max-h-52 space-y-1.5 overflow-y-auto px-3 py-2' : 'space-y-1 px-2.5 py-1.5'}`}
|
|
67
65
|
>
|
|
68
66
|
{todos.map((todo) => {
|
|
69
67
|
const done = todo.status === 'completed';
|
|
@@ -94,11 +92,28 @@ export function TodoItems({
|
|
|
94
92
|
);
|
|
95
93
|
}
|
|
96
94
|
|
|
97
|
-
export
|
|
95
|
+
export interface TurnTodoStripProps {
|
|
96
|
+
todos: SessionTodo[];
|
|
97
|
+
/** When false, renders standalone rounded corners (e.g. isolated tests). Defaults to true. */
|
|
98
|
+
attachedTop?: boolean;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Compact 28px single-line progress strip attached directly beneath the turn's
|
|
103
|
+
* sticky user prompt card. Always defaults to collapsed so streaming output is
|
|
104
|
+
* never occluded; clicking opens a downward step list dismissed via Escape or
|
|
105
|
+
* outside pointerdown in any status.
|
|
106
|
+
*/
|
|
107
|
+
export function TurnTodoStrip({
|
|
108
|
+
todos,
|
|
109
|
+
attachedTop = true,
|
|
110
|
+
}: TurnTodoStripProps) {
|
|
98
111
|
const containerRef = useRef<HTMLDivElement>(null);
|
|
112
|
+
const panelId = useId();
|
|
113
|
+
const [expanded, setExpanded] = useState(false);
|
|
114
|
+
|
|
99
115
|
const current = useMemo(() => currentTodoStep(todos), [todos]);
|
|
100
116
|
const progressLabel = useMemo(() => todoProgressCopy(todos), [todos]);
|
|
101
|
-
|
|
102
117
|
const hasActive = useMemo(
|
|
103
118
|
() => todos.some((todo) => todo.status === 'in_progress'),
|
|
104
119
|
[todos],
|
|
@@ -108,83 +123,72 @@ export function SessionTodoList({ todos }: { todos: SessionTodo[] }) {
|
|
|
108
123
|
return summary.total > 0 && summary.completed === summary.total;
|
|
109
124
|
}, [todos]);
|
|
110
125
|
|
|
111
|
-
// 执行中默认展开,全部完成默认折叠;允许用户手动点击收起或展开。
|
|
112
|
-
// 与编排胶囊同列时,展开浮层互斥。
|
|
113
|
-
const [userToggled, setUserToggled] = useState<boolean | null>(null);
|
|
114
|
-
const desired = userToggled ?? hasActive;
|
|
115
|
-
const { expanded, requestOpen } = useExclusiveExpand('todos', desired);
|
|
116
|
-
|
|
117
|
-
// 当任务全部执行完毕时,自动收起为紧凑胶囊
|
|
118
|
-
useEffect(() => {
|
|
119
|
-
if (isAllCompleted) {
|
|
120
|
-
setUserToggled(false);
|
|
121
|
-
}
|
|
122
|
-
}, [isAllCompleted]);
|
|
123
|
-
|
|
124
|
-
// 当新出现执行中的任务时,恢复默认展开
|
|
125
126
|
useEffect(() => {
|
|
126
|
-
if (
|
|
127
|
-
setUserToggled(null);
|
|
128
|
-
}
|
|
129
|
-
}, [hasActive]);
|
|
130
|
-
|
|
131
|
-
// 任务全部完成后,如果展开了浮层,点击外部区域时自动收起
|
|
132
|
-
useEffect(() => {
|
|
133
|
-
if (!expanded || !isAllCompleted) return;
|
|
127
|
+
if (!expanded) return;
|
|
134
128
|
const handlePointerDown = (event: PointerEvent) => {
|
|
135
129
|
if (
|
|
136
130
|
containerRef.current &&
|
|
137
131
|
!containerRef.current.contains(event.target as Node)
|
|
138
132
|
) {
|
|
139
|
-
|
|
133
|
+
setExpanded(false);
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
const handleKeyDown = (event: KeyboardEvent) => {
|
|
137
|
+
if (event.key === 'Escape') {
|
|
138
|
+
event.preventDefault();
|
|
139
|
+
event.stopPropagation();
|
|
140
|
+
setExpanded(false);
|
|
140
141
|
}
|
|
141
142
|
};
|
|
142
143
|
document.addEventListener('pointerdown', handlePointerDown);
|
|
143
|
-
|
|
144
|
-
|
|
144
|
+
document.addEventListener('keydown', handleKeyDown);
|
|
145
|
+
return () => {
|
|
146
|
+
document.removeEventListener('pointerdown', handlePointerDown);
|
|
147
|
+
document.removeEventListener('keydown', handleKeyDown);
|
|
148
|
+
};
|
|
149
|
+
}, [expanded]);
|
|
150
|
+
|
|
151
|
+
const shapeClass = attachedTop
|
|
152
|
+
? 'rounded-b-agent-lg border border-t-0 border-agent-border/80'
|
|
153
|
+
: 'rounded-agent-lg border border-agent-border/80';
|
|
154
|
+
|
|
155
|
+
const toneClass = isAllCompleted
|
|
156
|
+
? 'bg-emerald-500/[0.06] text-emerald-700 dark:text-emerald-300 hover:bg-emerald-500/[0.10]'
|
|
157
|
+
: hasActive
|
|
158
|
+
? 'bg-blue-500/[0.06] text-blue-700 dark:text-blue-300 hover:bg-blue-500/[0.11]'
|
|
159
|
+
: 'bg-agent-canvas/90 text-agent-muted-foreground hover:bg-agent-muted/60 hover:text-agent-foreground';
|
|
145
160
|
|
|
146
161
|
return (
|
|
147
162
|
<div
|
|
148
163
|
ref={containerRef}
|
|
149
|
-
className="relative
|
|
164
|
+
className="relative w-full"
|
|
150
165
|
data-testid="session-todo-list"
|
|
151
166
|
>
|
|
152
167
|
<button
|
|
153
168
|
type="button"
|
|
154
|
-
onClick={() =>
|
|
155
|
-
if (expanded) setUserToggled(false);
|
|
156
|
-
else {
|
|
157
|
-
setUserToggled(true);
|
|
158
|
-
requestOpen();
|
|
159
|
-
}
|
|
160
|
-
}}
|
|
161
|
-
className={[
|
|
162
|
-
'flex h-6 max-w-[240px] sm:max-w-[320px] items-center gap-1.5 rounded-full px-2 text-left text-[11px] transition-all duration-200 select-none shadow-2xs',
|
|
163
|
-
isAllCompleted
|
|
164
|
-
? 'border border-emerald-500/25 bg-emerald-500/[0.04] text-emerald-700 dark:text-emerald-300 hover:bg-emerald-500/[0.08]'
|
|
165
|
-
: hasActive
|
|
166
|
-
? 'border border-blue-500/30 bg-blue-500/[0.06] text-blue-700 dark:text-blue-300 hover:bg-blue-500/10'
|
|
167
|
-
: 'border border-agent-border/80 bg-agent-canvas text-agent-muted-foreground hover:bg-agent-foreground/5 hover:text-agent-foreground',
|
|
168
|
-
].join(' ')}
|
|
169
|
+
onClick={() => setExpanded((prev) => !prev)}
|
|
169
170
|
aria-expanded={expanded}
|
|
171
|
+
aria-controls={expanded ? panelId : undefined}
|
|
172
|
+
title={expanded ? t('Hide task steps') : t('Show task steps')}
|
|
173
|
+
className={`flex h-7 w-full cursor-pointer items-center gap-2 px-3 text-left text-[11px] select-none transition-colors ${shapeClass} ${toneClass}`}
|
|
170
174
|
>
|
|
171
175
|
{isAllCompleted ? (
|
|
172
176
|
<LuCircleCheck className="h-3.5 w-3.5 shrink-0 text-emerald-600 dark:text-emerald-400" />
|
|
173
177
|
) : hasActive ? (
|
|
174
178
|
<LuLoaderCircle className="h-3.5 w-3.5 shrink-0 animate-spin text-blue-600 dark:text-blue-400" />
|
|
175
|
-
) : current ? (
|
|
176
|
-
<StatusIcon status={current.status} />
|
|
177
179
|
) : (
|
|
178
|
-
<LuListChecks className="h-3.5 w-3.5 shrink-0 text-agent-foreground" />
|
|
180
|
+
<LuListChecks className="h-3.5 w-3.5 shrink-0 text-agent-muted-foreground" />
|
|
179
181
|
)}
|
|
180
182
|
<span className="min-w-0 flex-1 truncate font-medium">
|
|
181
|
-
{isAllCompleted
|
|
183
|
+
{isAllCompleted
|
|
184
|
+
? t('All tasks completed')
|
|
185
|
+
: (current?.content ?? t('Task list'))}
|
|
182
186
|
</span>
|
|
183
187
|
{progressLabel ? (
|
|
184
188
|
<span
|
|
185
|
-
className={`shrink-0 rounded-full px-1.5 py-0.
|
|
189
|
+
className={`shrink-0 rounded-full px-1.5 py-0.5 font-mono text-[10px] font-medium tabular-nums leading-none ${
|
|
186
190
|
isAllCompleted
|
|
187
|
-
? 'bg-emerald-500/
|
|
191
|
+
? 'bg-emerald-500/12 text-emerald-700 dark:text-emerald-300'
|
|
188
192
|
: hasActive
|
|
189
193
|
? 'bg-blue-500/15 text-blue-700 dark:text-blue-300'
|
|
190
194
|
: 'bg-agent-muted text-agent-muted-foreground'
|
|
@@ -203,25 +207,11 @@ export function SessionTodoList({ todos }: { todos: SessionTodo[] }) {
|
|
|
203
207
|
|
|
204
208
|
{expanded && (
|
|
205
209
|
<div
|
|
206
|
-
|
|
210
|
+
id={panelId}
|
|
211
|
+
role="region"
|
|
212
|
+
aria-label={t('Task list')}
|
|
213
|
+
className="absolute left-0 right-0 top-full z-30 mt-1 overflow-hidden rounded-agent-lg border border-agent-border bg-agent-canvas/98 shadow-lg backdrop-blur-md animate-in fade-in slide-in-from-top-1 duration-150"
|
|
207
214
|
>
|
|
208
|
-
<div className="flex items-center justify-between border-b border-agent-border/60 bg-agent-muted/30 px-2.5 py-1.5">
|
|
209
|
-
<div className="flex items-center gap-1.5 text-[11px] font-medium text-agent-foreground">
|
|
210
|
-
<LuListChecks className="h-3.5 w-3.5 text-agent-foreground" />
|
|
211
|
-
<span>{t('Task list')}</span>
|
|
212
|
-
</div>
|
|
213
|
-
<div className="flex items-center gap-1.5">
|
|
214
|
-
<button
|
|
215
|
-
type="button"
|
|
216
|
-
onClick={() => setUserToggled(false)}
|
|
217
|
-
className="flex h-5 w-5 items-center justify-center rounded text-agent-muted-foreground transition-colors hover:bg-agent-foreground/10 hover:text-agent-foreground"
|
|
218
|
-
title={t('Collapse list')}
|
|
219
|
-
aria-label={t('Collapse list')}
|
|
220
|
-
>
|
|
221
|
-
<LuX className="h-3 w-3" />
|
|
222
|
-
</button>
|
|
223
|
-
</div>
|
|
224
|
-
</div>
|
|
225
215
|
<TodoItems todos={todos} compact />
|
|
226
216
|
</div>
|
|
227
217
|
)}
|
|
@@ -229,5 +219,6 @@ export function SessionTodoList({ todos }: { todos: SessionTodo[] }) {
|
|
|
229
219
|
);
|
|
230
220
|
}
|
|
231
221
|
|
|
232
|
-
export
|
|
222
|
+
export const SessionTodoList = TurnTodoStrip;
|
|
233
223
|
|
|
224
|
+
export default TurnTodoStrip;
|