@steerable/agent-shell-web 0.14.5 → 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/chat/LocalChatPanel.tsx +26 -1
- 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 +106 -6
- package/src/lib/chat-draft-store.ts +43 -0
- package/src/packs/registry.ts +2 -0
- package/src/pages/AgentPage.tsx +11 -1
- package/src/pages/SettingsPage.tsx +327 -489
- package/src/styles/index.css +6 -0
|
@@ -1,140 +1,98 @@
|
|
|
1
|
-
import { LuGitFork } from 'react-icons/lu';
|
|
2
1
|
import {
|
|
3
2
|
ORCHESTRATION_MAX_DEPTH_RANGE,
|
|
4
3
|
ORCHESTRATION_MAX_PARALLEL_RANGE,
|
|
5
4
|
useOrchestrationLimits,
|
|
6
5
|
} from '@/lib/orchestration-settings';
|
|
7
6
|
import { t } from '@/i18n';
|
|
7
|
+
import { SettingRow, SettingSection, SettingSwitch } from './primitives';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
* OrchestrationSettingsPanel —
|
|
11
|
-
*
|
|
12
|
-
* 以对象形式下发给后续回合。
|
|
13
|
-
*
|
|
14
|
-
* 深度是权限(子代理能不能再派孙代理),所以它必须能在界面上改;写死 1/4
|
|
15
|
-
* 会让「设置里有这个开关」变成一句空话。
|
|
10
|
+
* OrchestrationSettingsPanel — 多智能体协同编排设置面板(Codex 式细分割线行)。
|
|
11
|
+
* 默认开启。开关、深度与并发实时持久化,并随 `metadata.orchestration` 下发给后续回合。
|
|
16
12
|
*/
|
|
17
13
|
export function OrchestrationSettingsPanel() {
|
|
18
14
|
const [setting, update] = useOrchestrationLimits();
|
|
19
15
|
const enabled = setting.enabled;
|
|
20
16
|
|
|
21
17
|
return (
|
|
22
|
-
<div
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
<
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
18
|
+
<div data-testid="orchestration-settings-panel">
|
|
19
|
+
<SettingSection title={t('Orchestration')}>
|
|
20
|
+
<SettingRow
|
|
21
|
+
title={t('Multi-agent orchestration (Fork-Join)')}
|
|
22
|
+
description={t(
|
|
23
|
+
'Let the main agent spawn subtasks (agent_spawn) to reason in parallel, and show a flow chart and live progress board above the input box.',
|
|
24
|
+
)}
|
|
25
|
+
control={
|
|
26
|
+
<SettingSwitch
|
|
27
|
+
checked={enabled}
|
|
28
|
+
onChange={(next) => update({ enabled: next })}
|
|
29
|
+
label={t('Multi-agent orchestration toggle')}
|
|
30
|
+
testId="orchestration-toggle"
|
|
31
|
+
/>
|
|
32
|
+
}
|
|
33
|
+
/>
|
|
38
34
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
35
|
+
<SettingRow
|
|
36
|
+
title={t('Max depth')}
|
|
37
|
+
description={
|
|
38
|
+
<>
|
|
39
|
+
<span>
|
|
40
|
+
{t('{min}–{max}; above 1 lets sub-agents spawn their own.', {
|
|
41
|
+
min: ORCHESTRATION_MAX_DEPTH_RANGE.min,
|
|
42
|
+
max: ORCHESTRATION_MAX_DEPTH_RANGE.max,
|
|
43
|
+
})}
|
|
44
|
+
</span>
|
|
45
|
+
{enabled && setting.maxDepth > 1 ? (
|
|
46
|
+
<span className="mt-0.5 block text-[11px] text-amber-700 dark:text-amber-300">
|
|
47
|
+
{t(
|
|
48
|
+
'Allowing children to spawn further sub-agents raises token use and unpredictability with every extra layer.',
|
|
49
|
+
)}
|
|
50
|
+
</span>
|
|
51
|
+
) : null}
|
|
52
|
+
</>
|
|
53
|
+
}
|
|
54
|
+
control={
|
|
55
|
+
<select
|
|
56
|
+
value={setting.maxDepth}
|
|
57
|
+
disabled={!enabled}
|
|
58
|
+
aria-label={t('Max depth')}
|
|
59
|
+
onChange={(event) => update({ maxDepth: Number(event.target.value) })}
|
|
60
|
+
className="h-7 min-w-[4.5rem] rounded-md border border-agent-border bg-agent-canvas px-2 text-xs text-agent-foreground disabled:cursor-not-allowed disabled:opacity-50"
|
|
61
|
+
data-testid="orchestration-max-depth"
|
|
62
|
+
>
|
|
63
|
+
{rangeOptions(ORCHESTRATION_MAX_DEPTH_RANGE).map((n) => (
|
|
64
|
+
<option key={n} value={n}>
|
|
65
|
+
{n}
|
|
66
|
+
</option>
|
|
67
|
+
))}
|
|
68
|
+
</select>
|
|
69
|
+
}
|
|
70
|
+
/>
|
|
75
71
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
</span>
|
|
101
|
-
</label>
|
|
102
|
-
<label className={enabled ? 'space-y-1' : 'space-y-1 opacity-50'}>
|
|
103
|
-
<span className="block text-[10px] font-medium text-agent-muted-foreground">
|
|
104
|
-
{t('Max parallel')}
|
|
105
|
-
</span>
|
|
106
|
-
<select
|
|
107
|
-
value={setting.maxParallel}
|
|
108
|
-
disabled={!enabled}
|
|
109
|
-
onChange={(event) => update({ maxParallel: Number(event.target.value) })}
|
|
110
|
-
className="h-7 w-full rounded-agent-md border border-agent-border bg-agent-canvas px-2 text-xs text-agent-foreground disabled:cursor-not-allowed"
|
|
111
|
-
data-testid="orchestration-max-parallel"
|
|
112
|
-
>
|
|
113
|
-
{rangeOptions(ORCHESTRATION_MAX_PARALLEL_RANGE).map((n) => (
|
|
114
|
-
<option key={n} value={n}>
|
|
115
|
-
{n}
|
|
116
|
-
</option>
|
|
117
|
-
))}
|
|
118
|
-
</select>
|
|
119
|
-
<span className="block text-[10px] leading-snug text-agent-muted-foreground">
|
|
120
|
-
{t('{min}–{max}; how many sub-agents run at once.', {
|
|
121
|
-
min: ORCHESTRATION_MAX_PARALLEL_RANGE.min,
|
|
122
|
-
max: ORCHESTRATION_MAX_PARALLEL_RANGE.max,
|
|
123
|
-
})}
|
|
124
|
-
</span>
|
|
125
|
-
</label>
|
|
126
|
-
</div>
|
|
127
|
-
{enabled && setting.maxDepth > 1 ? (
|
|
128
|
-
// 深度 >1 是权限扩张,不是普通偏好:说清代价。
|
|
129
|
-
<p className="text-[10px] leading-relaxed text-agent-muted-foreground">
|
|
130
|
-
{t(
|
|
131
|
-
'Allowing children to spawn further sub-agents raises token use and unpredictability with every extra layer.',
|
|
132
|
-
)}
|
|
133
|
-
</p>
|
|
134
|
-
) : null}
|
|
135
|
-
<p className="text-[10px] text-agent-muted-foreground">
|
|
136
|
-
{t('Taking effect next turn')}
|
|
137
|
-
</p>
|
|
72
|
+
<SettingRow
|
|
73
|
+
title={t('Max parallel')}
|
|
74
|
+
description={t('{min}–{max}; how many sub-agents run at once.', {
|
|
75
|
+
min: ORCHESTRATION_MAX_PARALLEL_RANGE.min,
|
|
76
|
+
max: ORCHESTRATION_MAX_PARALLEL_RANGE.max,
|
|
77
|
+
})}
|
|
78
|
+
control={
|
|
79
|
+
<select
|
|
80
|
+
value={setting.maxParallel}
|
|
81
|
+
disabled={!enabled}
|
|
82
|
+
aria-label={t('Max parallel')}
|
|
83
|
+
onChange={(event) => update({ maxParallel: Number(event.target.value) })}
|
|
84
|
+
className="h-7 min-w-[4.5rem] rounded-md border border-agent-border bg-agent-canvas px-2 text-xs text-agent-foreground disabled:cursor-not-allowed disabled:opacity-50"
|
|
85
|
+
data-testid="orchestration-max-parallel"
|
|
86
|
+
>
|
|
87
|
+
{rangeOptions(ORCHESTRATION_MAX_PARALLEL_RANGE).map((n) => (
|
|
88
|
+
<option key={n} value={n}>
|
|
89
|
+
{n}
|
|
90
|
+
</option>
|
|
91
|
+
))}
|
|
92
|
+
</select>
|
|
93
|
+
}
|
|
94
|
+
/>
|
|
95
|
+
</SettingSection>
|
|
138
96
|
</div>
|
|
139
97
|
);
|
|
140
98
|
}
|
|
@@ -288,55 +288,68 @@ export function PortableSettingsPanel() {
|
|
|
288
288
|
};
|
|
289
289
|
|
|
290
290
|
return (
|
|
291
|
-
<div
|
|
292
|
-
className="
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
className="
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
291
|
+
<div className="space-y-4" data-testid="portable-settings-panel">
|
|
292
|
+
<div className="divide-y divide-agent-border/60 border-t border-b border-agent-border/60">
|
|
293
|
+
<div className="flex flex-wrap items-center justify-between gap-4 py-3.5">
|
|
294
|
+
<div className="min-w-0 flex-1 space-y-0.5">
|
|
295
|
+
<div className="text-xs font-medium text-agent-foreground">{t('Configuration')}</div>
|
|
296
|
+
<p className="text-xs leading-relaxed text-agent-muted-foreground">
|
|
297
|
+
{t('Export or import interface, model, agent, and MCP settings. API keys are omitted by default.')}
|
|
298
|
+
</p>
|
|
299
|
+
</div>
|
|
300
|
+
<div className="flex shrink-0 items-center gap-1.5">
|
|
301
|
+
<button
|
|
302
|
+
type="button"
|
|
303
|
+
onClick={startExport}
|
|
304
|
+
className="inline-flex h-7 items-center gap-1 rounded-full border border-agent-border bg-agent-canvas px-3 text-xs font-medium text-agent-foreground transition-colors hover:bg-agent-muted/60"
|
|
305
|
+
data-testid="portable-export-config"
|
|
306
|
+
>
|
|
307
|
+
<LuDownload className="h-3.5 w-3.5" />
|
|
308
|
+
{t('Export config')}
|
|
309
|
+
</button>
|
|
310
|
+
<button
|
|
311
|
+
type="button"
|
|
312
|
+
onClick={() => void startImport('config')}
|
|
313
|
+
disabled={busy}
|
|
314
|
+
className="inline-flex h-7 items-center gap-1 rounded-full border border-agent-border bg-agent-canvas px-3 text-xs font-medium text-agent-foreground transition-colors hover:bg-agent-muted/60 disabled:opacity-60"
|
|
315
|
+
data-testid="portable-import-config"
|
|
316
|
+
>
|
|
317
|
+
<LuUpload className="h-3.5 w-3.5" />
|
|
318
|
+
{t('Import config')}
|
|
319
|
+
</button>
|
|
320
|
+
</div>
|
|
321
|
+
</div>
|
|
322
|
+
|
|
323
|
+
<div className="flex flex-wrap items-center justify-between gap-4 py-3.5">
|
|
324
|
+
<div className="min-w-0 flex-1 space-y-0.5">
|
|
325
|
+
<div className="text-xs font-medium text-agent-foreground">{t('Chat history')}</div>
|
|
326
|
+
<p className="text-xs leading-relaxed text-agent-muted-foreground">
|
|
327
|
+
{t('Export selected conversations with project metadata, or import them as new chats without overwriting existing history.')}
|
|
328
|
+
</p>
|
|
329
|
+
</div>
|
|
330
|
+
<div className="flex shrink-0 items-center gap-1.5">
|
|
331
|
+
<button
|
|
332
|
+
type="button"
|
|
333
|
+
onClick={() => void startExportChats()}
|
|
334
|
+
disabled={busy}
|
|
335
|
+
className="inline-flex h-7 items-center gap-1 rounded-full border border-agent-border bg-agent-canvas px-3 text-xs font-medium text-agent-foreground transition-colors hover:bg-agent-muted/60 disabled:opacity-60"
|
|
336
|
+
data-testid="portable-export-chats"
|
|
337
|
+
>
|
|
338
|
+
<LuDownload className="h-3.5 w-3.5" />
|
|
339
|
+
{t('Export chats')}
|
|
340
|
+
</button>
|
|
341
|
+
<button
|
|
342
|
+
type="button"
|
|
343
|
+
onClick={() => void startImport('chat')}
|
|
344
|
+
disabled={busy}
|
|
345
|
+
className="inline-flex h-7 items-center gap-1 rounded-full border border-agent-border bg-agent-canvas px-3 text-xs font-medium text-agent-foreground transition-colors hover:bg-agent-muted/60 disabled:opacity-60"
|
|
346
|
+
data-testid="portable-import-chats"
|
|
347
|
+
>
|
|
348
|
+
<LuUpload className="h-3.5 w-3.5" />
|
|
349
|
+
{t('Import chats')}
|
|
350
|
+
</button>
|
|
351
|
+
</div>
|
|
352
|
+
</div>
|
|
340
353
|
</div>
|
|
341
354
|
|
|
342
355
|
{mode === 'export' && (
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react';
|
|
2
|
-
import { LuCodeXml } from 'react-icons/lu';
|
|
3
2
|
import { t } from '@/i18n';
|
|
4
3
|
import {
|
|
5
4
|
getHostBridge,
|
|
@@ -86,11 +85,10 @@ export function PythonRunnerSettingsPanel() {
|
|
|
86
85
|
|
|
87
86
|
return (
|
|
88
87
|
<section className="space-y-2" data-testid="settings-section-python-runner">
|
|
89
|
-
<h2 className="
|
|
90
|
-
<LuCodeXml className="h-3.5 w-3.5 text-agent-muted-foreground" />
|
|
88
|
+
<h2 className="text-xs font-semibold text-agent-foreground">
|
|
91
89
|
{t('Python code runner')}
|
|
92
90
|
</h2>
|
|
93
|
-
<div className="space-y-3
|
|
91
|
+
<div className="space-y-3 border-t border-b border-agent-border/60 py-3.5 text-xs">
|
|
94
92
|
<p className="leading-relaxed text-agent-muted-foreground">
|
|
95
93
|
{t(
|
|
96
94
|
'run_code uses a separate Python interpreter. Downloading and configuring it does not block chat. Changes take effect after you restart the app.',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useCallback, useEffect, useState } from 'react';
|
|
2
|
-
import { LuLoaderCircle
|
|
2
|
+
import { LuLoaderCircle } from 'react-icons/lu';
|
|
3
3
|
import { t } from '@/i18n';
|
|
4
4
|
import { hasHostBridge } from '@/lib/host-bridge';
|
|
5
5
|
import {
|
|
@@ -7,22 +7,17 @@ import {
|
|
|
7
7
|
type EgressPosture,
|
|
8
8
|
type SidecarSandboxPosture,
|
|
9
9
|
} from '@/lib/local-api';
|
|
10
|
+
import { SettingRow, SettingStatusBadge } from './primitives';
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* SecuritySettingsPanel — W4-3 layer-1(sidecar 进程沙箱)态势的持久披露。
|
|
13
14
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* (GET /api/v2/sidecar/sandbox-posture)。手动关闭(sandbox:false /
|
|
17
|
-
* STEERABLE_SIDECAR_SANDBOX=0)中性展示;收容失败告知「无法收容、已拒绝启动」。
|
|
18
|
-
* layer-3(每次命令的沙箱)披露在工具卡片,不在此重复。
|
|
19
|
-
*
|
|
20
|
-
* 数据自管理:挂载拉一次,走 local-backend REST,无专用 IPC channel。
|
|
15
|
+
* 采用 Codex 式细分割线行与直观状态徽标,同时完整保留诚实告知语义:
|
|
16
|
+
* 收容失败明确披露「无法收容、已拒绝启动」,部分强制明确标注「partial」。
|
|
21
17
|
*/
|
|
22
18
|
|
|
23
19
|
type PostureReason = SidecarSandboxPosture['reason'];
|
|
24
20
|
|
|
25
|
-
/** 收容失败、已拒绝启动(告警行首句)。 */
|
|
26
21
|
const REFUSED_REASON_TEXT: Partial<Record<PostureReason, string>> = {
|
|
27
22
|
platform_unsupported: 'No process sandbox backend is available on this platform',
|
|
28
23
|
seatbelt_missing: '/usr/bin/sandbox-exec not found',
|
|
@@ -31,7 +26,6 @@ const REFUSED_REASON_TEXT: Partial<Record<PostureReason, string>> = {
|
|
|
31
26
|
helper_missing: 'win-spawn-helper.exe not found',
|
|
32
27
|
};
|
|
33
28
|
|
|
34
|
-
/** 手动关闭原因的中文说明(中性行,不告警)。 */
|
|
35
29
|
const OPT_OUT_REASON_TEXT: Partial<Record<PostureReason, string>> = {
|
|
36
30
|
disabled_by_option: 'Turned off with sandbox: false',
|
|
37
31
|
disabled_by_env: 'Turned off with STEERABLE_SIDECAR_SANDBOX=0',
|
|
@@ -75,30 +69,41 @@ function activeBody(backend: SidecarSandboxPosture['backend']): string {
|
|
|
75
69
|
}
|
|
76
70
|
}
|
|
77
71
|
|
|
78
|
-
/** 出网管控态势行(W-egress-posture):退回分支此前只有主进程日志可见。 */
|
|
79
72
|
function EgressPostureRow({ egress }: { egress: EgressPosture }) {
|
|
80
73
|
if (egress.mode === 'per-host-proxy') {
|
|
81
74
|
return (
|
|
82
|
-
<
|
|
83
|
-
{t(
|
|
75
|
+
<SettingRow
|
|
76
|
+
title={t('Outbound network control')}
|
|
77
|
+
badge={<SettingStatusBadge tone="success">{t('Active')}</SettingStatusBadge>}
|
|
78
|
+
description={t(
|
|
84
79
|
'Egress control: the per-host allowlist proxy is active. Requests outside the allowlist ask you to allow them one by one (valid for this session only).',
|
|
85
80
|
)}
|
|
86
|
-
|
|
81
|
+
/>
|
|
87
82
|
);
|
|
88
83
|
}
|
|
89
84
|
if (egress.mode === 'disabled') {
|
|
90
85
|
return (
|
|
91
|
-
<
|
|
92
|
-
{t('
|
|
93
|
-
|
|
86
|
+
<SettingRow
|
|
87
|
+
title={t('Outbound network control')}
|
|
88
|
+
badge={<SettingStatusBadge tone="neutral">{t('Off')}</SettingStatusBadge>}
|
|
89
|
+
description={t('Egress control: off{reason}.', {
|
|
90
|
+
reason: egress.reason ? ` — ${egress.reason}` : '',
|
|
91
|
+
})}
|
|
92
|
+
/>
|
|
94
93
|
);
|
|
95
94
|
}
|
|
96
95
|
return (
|
|
97
|
-
<
|
|
98
|
-
{t('
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
96
|
+
<SettingRow
|
|
97
|
+
title={t('Outbound network control')}
|
|
98
|
+
badge={<SettingStatusBadge tone="warning">{t('Fallback')}</SettingStatusBadge>}
|
|
99
|
+
description={
|
|
100
|
+
<span className="text-amber-600 dark:text-amber-400">
|
|
101
|
+
{t('Egress control: fell back to port level (coarser control){reason}.', {
|
|
102
|
+
reason: egress.reason ? ` — ${egress.reason}` : '',
|
|
103
|
+
})}
|
|
104
|
+
</span>
|
|
105
|
+
}
|
|
106
|
+
/>
|
|
102
107
|
);
|
|
103
108
|
}
|
|
104
109
|
|
|
@@ -118,7 +123,6 @@ export function SecuritySettingsPanel() {
|
|
|
118
123
|
setEgress(res.egress ?? null);
|
|
119
124
|
if (!res.posture) setUnavailable(t('Could not read sandbox status'));
|
|
120
125
|
} catch {
|
|
121
|
-
// 503 = sidecar 未就绪且没有收容失败记录。
|
|
122
126
|
setPosture(null);
|
|
123
127
|
setEgress(null);
|
|
124
128
|
setUnavailable(t('Sidecar not ready — could not read sandbox status'));
|
|
@@ -134,57 +138,74 @@ export function SecuritySettingsPanel() {
|
|
|
134
138
|
const refusedReason = posture ? REFUSED_REASON_TEXT[posture.reason] : undefined;
|
|
135
139
|
const optOutReason = posture ? OPT_OUT_REASON_TEXT[posture.reason] : undefined;
|
|
136
140
|
|
|
141
|
+
if (!hasHostBridge()) {
|
|
142
|
+
return (
|
|
143
|
+
<p className="py-2 text-xs text-agent-muted-foreground">
|
|
144
|
+
{t('Open this in the desktop app')}
|
|
145
|
+
</p>
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
if (loading) {
|
|
150
|
+
return (
|
|
151
|
+
<div className="flex items-center gap-2 py-2 text-xs text-agent-muted-foreground">
|
|
152
|
+
<LuLoaderCircle className="h-3.5 w-3.5 animate-spin" />
|
|
153
|
+
{t('Loading sandbox status...')}
|
|
154
|
+
</div>
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
if (unavailable) {
|
|
159
|
+
return <p className="py-2 text-xs text-agent-muted-foreground">{unavailable}</p>;
|
|
160
|
+
}
|
|
161
|
+
|
|
137
162
|
return (
|
|
138
|
-
<div className="
|
|
139
|
-
|
|
140
|
-
<
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
{t(
|
|
162
|
-
'The sidecar process that holds the provider API keys did not start, so it is not running without isolation either.',
|
|
163
|
-
)}{' '}
|
|
164
|
-
{t('The only way to run it unsandboxed is to set STEERABLE_SIDECAR_SANDBOX=0 explicitly.')}
|
|
165
|
-
</p>
|
|
166
|
-
<p>
|
|
167
|
-
{t(
|
|
168
|
-
'For isolation, install the containment backend for your platform (macOS Seatbelt, Linux bwrap/Landlock, Windows win-spawn-helper), or run this app in a container.',
|
|
169
|
-
)}
|
|
170
|
-
</p>
|
|
163
|
+
<div className="divide-y divide-agent-border/60 border-t border-b border-agent-border/60">
|
|
164
|
+
{posture && refusedReason ? (
|
|
165
|
+
<div className="py-3.5">
|
|
166
|
+
<div className="space-y-1.5 rounded-agent-md border border-agent-destructive/20 bg-agent-destructive/10 p-3 text-xs text-agent-destructive">
|
|
167
|
+
<p className="font-medium">
|
|
168
|
+
{t('Cannot contain the process, so startup was refused — {reason}.', {
|
|
169
|
+
reason: t(refusedReason),
|
|
170
|
+
})}
|
|
171
|
+
</p>
|
|
172
|
+
<p>
|
|
173
|
+
{t(
|
|
174
|
+
'The sidecar process that holds the provider API keys did not start, so it is not running without isolation either.',
|
|
175
|
+
)}{' '}
|
|
176
|
+
{t(
|
|
177
|
+
'The only way to run it unsandboxed is to set STEERABLE_SIDECAR_SANDBOX=0 explicitly.',
|
|
178
|
+
)}
|
|
179
|
+
</p>
|
|
180
|
+
<p>
|
|
181
|
+
{t(
|
|
182
|
+
'For isolation, install the containment backend for your platform (macOS Seatbelt, Linux bwrap/Landlock, Windows win-spawn-helper), or run this app in a container.',
|
|
183
|
+
)}
|
|
184
|
+
</p>
|
|
185
|
+
</div>
|
|
171
186
|
</div>
|
|
172
187
|
) : posture && optOutReason ? (
|
|
173
|
-
<
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
</
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
</p>
|
|
182
|
-
</div>
|
|
188
|
+
<SettingRow
|
|
189
|
+
align="start"
|
|
190
|
+
title={t('Turned off manually — {reason}.', { reason: t(optOutReason) })}
|
|
191
|
+
badge={<SettingStatusBadge tone="neutral">{t('Off')}</SettingStatusBadge>}
|
|
192
|
+
description={t(
|
|
193
|
+
'The sidecar process (which holds the provider API keys) runs without OS isolation. To restore it, remove the setting and restart the app.',
|
|
194
|
+
)}
|
|
195
|
+
/>
|
|
183
196
|
) : posture ? (
|
|
184
|
-
<
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
197
|
+
<SettingRow
|
|
198
|
+
align="start"
|
|
199
|
+
title={activeHeadline(posture.backend)}
|
|
200
|
+
badge={
|
|
201
|
+
posture.backend === 'none' ? (
|
|
202
|
+
<SettingStatusBadge tone="neutral">{t('Off')}</SettingStatusBadge>
|
|
203
|
+
) : (
|
|
204
|
+
<SettingStatusBadge tone="success">{t('Active')}</SettingStatusBadge>
|
|
205
|
+
)
|
|
206
|
+
}
|
|
207
|
+
description={activeBody(posture.backend)}
|
|
208
|
+
/>
|
|
188
209
|
) : null}
|
|
189
210
|
|
|
190
211
|
{egress && <EgressPostureRow egress={egress} />}
|