feat(chat): streamline composer controls and batch selection

Keep project selection available for saved conversations, expose model and collaboration settings beside the composer, and add current-page selection to reduce repetitive conversation management.
This commit is contained in:
Sycun 2026-11-19 14:52:27 +08:00
parent aa1d569dd0
commit 1acb1597ea
58 changed files with 990 additions and 296 deletions

View File

@ -82,9 +82,61 @@ function SettingSelect({ label, ...props }) {
);
}
export function ModelSettings({ model, busy, canReadConfig }) {
const t = useT();
const defaultId = model.config.data?.default_channel;
const defaultName = defaultId ? modelChannelName(defaultId, model.config.data?.channels?.[defaultId]) : '';
const defaultLabel = t('chat.aiChannelDefault', null, '跟随默认通道');
const channelOptions = [
{ value: '', label: defaultName ? `${defaultLabel} · ${defaultName}` : defaultLabel },
...modelChannelOptions(model.channels)
];
const reasoningLabels = {
default: t('chat.reasoningModeDefault', null, '跟随系统'),
off: t('chat.reasoningModeOff', null, '关闭'),
on: t('chat.reasoningModeOn', null, '开启'),
auto: t('chat.reasoningModeAuto', null, '自动')
};
return (
<>
{canReadConfig && (
<>
<SettingSelect
label={t('chat.aiChannelLabel', null, 'AI 通道')}
value={model.channel}
optionList={channelOptions}
renderSelectedItem={selectedModelChannelName}
onSelect={model.setChannel}
loading={model.config.loading}
disabled={busy || model.config.loading || Boolean(model.config.error)}
/>
<ErrorBanner error={model.config.error} onRetry={() => model.config.reload()} />
</>
)}
<SettingSelect
label={t('chat.reasoningModeLabel', null, '模型推理')}
value={model.mode}
optionList={REASONING_MODES.map(value => ({ value, label: reasoningLabels[value] }))}
onSelect={model.setMode}
disabled={busy}
/>
<SettingSelect
label={t('chat.reasoningEffortLabel', null, '推理强度')}
value={model.mode === 'off' ? '' : model.effort}
optionList={[
{ value: '', label: t('chat.reasoningEffortUnset', null, '不指定') },
...REASONING_EFFORTS.map(value => ({ value, label: value }))
]}
onSelect={model.setEffort}
disabled={busy || model.mode === 'off'}
/>
</>
);
}
export default function ChatSettings({
onClose, narrow, busy, canReadConfig, canReadHitl, canEnableHitl,
model, conversationId, draftHitl, onDraftHitlChange
model, conversationId, draftHitl, onDraftHitlChange, section = 'all'
}) {
const t = useT();
const [saving, setSaving] = useState(false);
@ -109,19 +161,6 @@ export default function ChatSettings({
setToolsDirty(false);
}, [approvals.data, conversationId]);
const defaultId = model.config.data?.default_channel;
const defaultName = defaultId ? modelChannelName(defaultId, model.config.data?.channels?.[defaultId]) : '';
const defaultLabel = t('chat.aiChannelDefault', null, '跟随默认通道');
const channelOptions = [
{ value: '', label: defaultName ? `${defaultLabel} · ${defaultName}` : defaultLabel },
...modelChannelOptions(model.channels)
];
const reasoningLabels = {
default: t('chat.reasoningModeDefault', null, '跟随系统'),
off: t('chat.reasoningModeOff', null, '关闭'),
on: t('chat.reasoningModeOn', null, '开启'),
auto: t('chat.reasoningModeAuto', null, '自动')
};
const modeLabels = {
off: t('chat.hitlModeOff', null, '关闭'),
approval: t('chat.hitlModeApproval', null, '审批模式'),
@ -188,7 +227,7 @@ export default function ChatSettings({
return (
<SideSheet
visible
title={t('chat.sessionSettingsTitle', null, '会话设置')}
title={section === 'hitl' ? t('chat.hitlTitle', null, '人机协同') : t('chat.sessionSettingsTitle', null, '会话设置')}
width={narrow ? '100%' : 420}
closable={!saving}
maskClosable={!saving}
@ -196,40 +235,10 @@ export default function ChatSettings({
onCancel={onClose}
>
<div className="chat-settings-fields">
{canReadConfig && (
<>
<SettingSelect
label={t('chat.aiChannelLabel', null, 'AI 通道')}
value={model.channel}
optionList={channelOptions}
renderSelectedItem={selectedModelChannelName}
onSelect={model.setChannel}
loading={model.config.loading}
disabled={busy || model.config.loading || Boolean(model.config.error)}
/>
<ErrorBanner error={model.config.error} onRetry={() => model.config.reload()} />
</>
)}
<SettingSelect
label={t('chat.reasoningModeLabel', null, '模型推理')}
value={model.mode}
optionList={REASONING_MODES.map(value => ({ value, label: reasoningLabels[value] }))}
onSelect={model.setMode}
disabled={busy}
/>
<SettingSelect
label={t('chat.reasoningEffortLabel', null, '推理强度')}
value={model.mode === 'off' ? '' : model.effort}
optionList={[
{ value: '', label: t('chat.reasoningEffortUnset', null, '不指定') },
...REASONING_EFFORTS.map(value => ({ value, label: value }))
]}
onSelect={model.setEffort}
disabled={busy || model.mode === 'off'}
/>
{section !== 'hitl' && <ModelSettings model={model} busy={busy} canReadConfig={canReadConfig} />}
{canReadHitl && (
<section className="chat-setting-field chat-setting-hitl">
<Text strong>{t('chat.hitlTitle', null, '人机协同')}</Text>
{section !== 'hitl' && <Text strong>{t('chat.hitlTitle', null, '人机协同')}</Text>}
<Text type="tertiary" size="small">
{t('chat.sessionSettingsHint', null, '人机协同设置只影响后续消息。')}
</Text>

View File

@ -1,8 +1,9 @@
/** 发送区:文本、附件、代理模式、项目选择、发送/停止。 */
import { useRef } from 'react';
import { Banner, Button, Select, Space, Tag, TextArea, Tooltip, Typography } from '@douyinfe/semi-ui';
import { IconPaperclip, IconSend, IconStop } from '@douyinfe/semi-icons';
import { useId, useRef } from 'react';
import { Banner, Button, Popover, Select, Tag, TextArea, Tooltip, Typography } from '@douyinfe/semi-ui';
import { IconArrowUp, IconChevronDown, IconDesktop, IconFolder, IconPaperclip, IconPlus, IconShield, IconStop } from '@douyinfe/semi-icons';
import { useT } from '../../lib/i18n';
import { modelChannelName } from '../../lib/model-channel';
import { ModelSettings } from './ChatSettings';
const { Text } = Typography;
@ -25,7 +26,10 @@ export default function Composer({
onProjectChange,
onCreateProject,
projects,
showProjectSelect,
projectDisabled,
model,
canReadConfig,
onOpenHitl,
attachments,
onPickFiles,
onRemoveAttachment,
@ -33,6 +37,8 @@ export default function Composer({
}) {
const t = useT();
const fileRef = useRef(null);
const modeLabelId = useId();
const projectLabelId = useId();
const list = Array.isArray(attachments) ? attachments : [];
const modeOptions = [
{ value: 'single', label: t('chat.agentModePiSingle', null, '单代理') },
@ -44,17 +50,28 @@ export default function Composer({
{ value: '', label: t('chat.noProject', null, '不绑定项目') },
...(Array.isArray(projects) ? projects : []).map(project => ({ value: project.id, label: project.name || project.id }))
];
if (projectId && !projectOptions.some(option => option.value === projectId)) {
projectOptions.push({ value: projectId, label: projectId });
}
if (onCreateProject) {
projectOptions.push({ value: CREATE_PROJECT, label: `+ ${t('projects.newProject', null, '新建项目')}` });
}
const uploadingCount = Number(uploading) || list.filter(item => item.uploading).length;
const blocked = !canWrite || !canExecute;
const busy = sending || checkingRun;
const channelId = model.channel || model.config.data?.default_channel;
const channelName = channelId
? modelChannelName(channelId, model.config.data?.channels?.[channelId])
: t('chat.aiChannelDefaultShort', null, '默认通道');
const reasoningSummary = model.mode === 'off'
? t('chat.reasoningModeOff', null, '关闭')
: model.effort || t('chat.reasoningSummaryFollow', null, '系统');
const handleKeyDown = event => {
if (event.key !== 'Enter' || event.shiftKey) return;
if (event.nativeEvent?.isComposing) return;
event.preventDefault();
if (sending || checkingRun || blocked || uploadingCount > 0) return;
if (busy || blocked || uploadingCount > 0) return;
onSend();
};
@ -71,107 +88,151 @@ export default function Composer({
: t('chat.noExecutePermission', null, '当前账号没有智能体执行权限(agent:execute),发送已禁用。')}
/>
)}
{list.length > 0 && (
<div className="chat-file-list">
{list.map(file => (
<Tag
key={file.id}
className={`chat-file-chip ${file.error ? 'is-error' : ''} ${file.uploading ? 'is-uploading' : ''}`}
size="large"
color={file.error ? 'red' : (file.uploading ? 'amber' : 'blue')}
closable
onClose={() => onRemoveAttachment(file.id)}
>
<IconPaperclip size="small" />
<span className="chat-file-name" title={file.fileName}>{file.fileName}</span>
<span className="chat-file-state">
{file.uploading ? '上传中…' : (file.error ? '上传失败' : '已上传')}
</span>
</Tag>
))}
<div className="chat-composer-shell">
<div className="chat-composer-context">
<span id={modeLabelId} hidden>{t('chat.agentModeSelectAria', null, '选择对话执行模式')}</span>
<Select
value={mode}
optionList={modeOptions}
onChange={onModeChange}
prefix={<IconDesktop />}
className="chat-context-select chat-composer-mode"
aria-labelledby={modeLabelId}
disabled={busy || blocked}
/>
<span id={projectLabelId} hidden>{t('chat.filterByProject', null, '选择项目')}</span>
<Select
value={projectId}
optionList={projectOptions}
onChange={value => {
if (value === CREATE_PROJECT) onCreateProject?.();
else onProjectChange(value);
}}
prefix={<IconFolder />}
className="chat-context-select chat-composer-project"
aria-labelledby={projectLabelId}
disabled={busy || projectDisabled || !canWrite}
/>
</div>
)}
<div className="chat-composer-box">
<input
ref={fileRef}
type="file"
multiple
hidden
onChange={event => {
if (event.target.files?.length) onPickFiles(Array.from(event.target.files));
event.target.value = '';
}}
/>
<TextArea
className="chat-textarea"
borderless
value={value}
onChange={onChange}
onKeyDown={handleKeyDown}
disabled={blocked}
autosize={{ minRows: 2, maxRows: 8 }}
aria-label={t('chat.composerLabel', null, '对话内容')}
placeholder={t('chat.composerPlaceholder', null, '描述目标、授权范围与需求,或附上相关材料…')}
/>
<div className="chat-composer-toolbar">
<Space spacing={8} wrap className="chat-composer-controls">
<Tooltip content={t('chat.selectFile', null, '选择附件')}>
<div className="chat-composer-box">
<input
ref={fileRef}
type="file"
multiple
hidden
onChange={event => {
if (event.target.files?.length) onPickFiles(Array.from(event.target.files));
event.target.value = '';
}}
/>
{list.length > 0 && (
<div className="chat-file-list">
{list.map(file => (
<Tag
key={file.id}
className={`chat-file-chip ${file.error ? 'is-error' : ''} ${file.uploading ? 'is-uploading' : ''}`}
size="large"
color={file.error ? 'red' : (file.uploading ? 'amber' : 'blue')}
closable
onClose={() => onRemoveAttachment(file.id)}
>
<IconPaperclip size="small" />
<span className="chat-file-name" title={file.fileName}>{file.fileName}</span>
<span className="chat-file-state">
{file.uploading ? '上传中…' : (file.error ? '上传失败' : '已上传')}
</span>
</Tag>
))}
</div>
)}
<TextArea
className="chat-textarea"
borderless
value={value}
onChange={onChange}
onKeyDown={handleKeyDown}
disabled={blocked}
autosize={{ minRows: 2, maxRows: 8 }}
aria-label={t('chat.composerLabel', null, '对话内容')}
placeholder={t('chat.composerPlaceholder', null, '描述目标、授权范围与需求,或附上相关材料…')}
/>
<div className="chat-composer-toolbar">
<div className="chat-composer-controls">
<Tooltip content={t('chat.selectFile', null, '选择附件')}>
<Button
icon={<IconPlus />}
theme="borderless"
type="tertiary"
aria-label={t('chat.attachmentsLabel', null, '附件')}
disabled={blocked}
onClick={() => fileRef.current?.click()}
/>
</Tooltip>
<Button
icon={<IconPaperclip />}
icon={<IconShield />}
theme="borderless"
disabled={blocked}
onClick={() => fileRef.current?.click()}
type="tertiary"
className="chat-composer-hitl"
aria-label={t('chat.hitlTitle', null, '人机协同')}
disabled={!onOpenHitl}
onClick={onOpenHitl}
>
{t('chat.attachmentsLabel', null, '附件')}
{t('chat.hitlTitle', null, '人机协同')}
</Button>
</Tooltip>
<Select
value={mode}
optionList={modeOptions}
onChange={onModeChange}
className="chat-composer-select"
aria-label={t('chat.agentModeSelectAria', null, '选择对话执行模式')}
disabled={sending}
/>
{showProjectSelect && (
<Select
value={projectId}
optionList={projectOptions}
onChange={value => {
if (value === CREATE_PROJECT) {
onCreateProject?.();
} else {
onProjectChange(value);
}
}}
className="chat-composer-select"
aria-label={t('chat.filterByProject', null, '选择项目')}
placeholder={t('chat.filterByProject', null, '选择项目')}
disabled={sending}
/>
)}
</Space>
<Space spacing={8} wrap className="chat-composer-submit">
<Text type="tertiary" size="small" className="chat-composer-hint">
{uploadingCount > 0
? t('chat.waitingAttachmentsUpload', null, '附件上传中…')
: t('chat.sendHint', null, 'Enter 发送 · Shift+Enter 换行')}
</div>
<div className="chat-composer-submit">
<Popover
trigger="click"
position="topRight"
className="chat-model-popover"
condition={!busy}
content={(
<div className="chat-settings-fields chat-model-settings">
<ModelSettings model={model} busy={busy || blocked} canReadConfig={canReadConfig} />
</div>
)}
>
<Button
theme="borderless"
type="tertiary"
className="chat-composer-model"
aria-label={t('chat.modelSettingsAria', null, '选择 AI 通道、模型与推理设置')}
title={`${channelName} · ${reasoningSummary}`}
disabled={busy}
>
<span className="chat-composer-model-name">{channelName}</span>
<span className="chat-composer-effort">{reasoningSummary}</span>
<IconChevronDown size="small" />
</Button>
</Popover>
{sending ? (
<Button
type="danger"
className="chat-composer-send"
icon={<IconStop />}
aria-label={t('chat.stop', null, '停止')}
onClick={onStop}
disabled={!canStop}
/>
) : (
<Tooltip content={t('chat.sendHint', null, 'Enter 发送 · Shift+Enter 换行')}>
<Button
theme="solid"
className="chat-composer-send"
icon={<IconArrowUp />}
aria-label={t('chat.send', null, '发送')}
disabled={blocked || checkingRun || uploadingCount > 0}
onClick={onSend}
/>
</Tooltip>
)}
</div>
</div>
{uploadingCount > 0 && (
<Text type="tertiary" size="small" role="status">
{t('chat.waitingAttachmentsUpload', null, '附件上传中…')}
</Text>
{sending ? (
<Button type="danger" icon={<IconStop />} onClick={onStop} disabled={!canStop}>
{t('chat.stop', null, '停止')}
</Button>
) : (
<Button
theme="solid"
icon={<IconSend />}
disabled={blocked || checkingRun || uploadingCount > 0}
onClick={onSend}
>
{t('chat.send', null, '发送')}
</Button>
)}
</Space>
)}
</div>
</div>
</div>

View File

@ -105,6 +105,8 @@ export default function ConversationList({
const [editingTitle, setEditingTitle] = useState('');
const [batchMode, setBatchMode] = useState(false);
const [selectedIds, setSelectedIds] = useState([]);
const allSelected = list.length > 0 && list.every(item => selectedIds.includes(item.id));
const partiallySelected = !allSelected && list.some(item => selectedIds.includes(item.id));
useEffect(() => {
setSelectedIds([]);
@ -182,6 +184,15 @@ export default function ConversationList({
</div>
{batchMode && (
<div className="chat-batch-bar">
<Checkbox
className="chat-batch-select-all"
checked={allSelected}
indeterminate={partiallySelected}
disabled={loading || !list.length}
onChange={event => setSelectedIds(event.target.checked ? list.map(item => item.id) : [])}
>
{t('chat.selectPage', null, '全选本页')}
</Checkbox>
<Text size="small">{t('chat.selectedCount', null, '已选')} {selectedIds.length}</Text>
<Button
size="small"

View File

@ -69,11 +69,12 @@ export default function Page() {
const [projectFilter, setProjectFilter] = useState('');
const [page, setPage] = useState(1);
const [newProjectId, setNewProjectId] = useState('');
const [projectSaving, setProjectSaving] = useState(false);
const [projectFormOpen, setProjectFormOpen] = useState(false);
const [storedMode, setStoredMode] = useLocalStorage(MODE_STORAGE_KEY, 'single');
const mode = AGENT_MODES.includes(storedMode) ? storedMode : 'single';
const model = useModelPreferences(canReadConfig);
const [settingsOpen, setSettingsOpen] = useState(false);
const [settingsOpen, setSettingsOpen] = useState('');
const [draftHitl, setDraftHitl] = useState(null);
const [detail, setDetail] = useState(EMPTY_DETAIL);
@ -132,7 +133,7 @@ export default function Page() {
...previous,
projects: [project, ...(previous?.projects || [])]
}));
setNewProjectId(project.id);
void changeProject(project.id);
};
const listItems = Array.isArray(conversations.data?.conversations) ? conversations.data.conversations : [];
@ -276,6 +277,29 @@ export default function Page() {
reloadConversations.current?.({ silent: true });
}, []);
const changeProject = async value => {
if (!canWrite || sending || backgroundRunning || checkingRun || projectSaving) return;
const projectId = value || '';
const id = conversationRef.current;
if (!id) {
setNewProjectId(projectId);
return;
}
if (detail.conversation?.id !== id || detail.loading || detail.error) return;
setProjectSaving(true);
try {
await api.put(`/conversations/${encodeURIComponent(id)}/project`, { projectId });
setDetail(previous => previous.conversation?.id === id
? { ...previous, conversation: { ...previous.conversation, projectId } }
: previous);
reloadList();
} catch (error) {
toastError(error, t('chat.projectChangeFailed', null, '更新对话所属项目失败'));
} finally {
setProjectSaving(false);
}
};
const clearSelection = useCallback(() => setDetail(EMPTY_DETAIL), []);
const {
@ -380,7 +404,7 @@ export default function Page() {
}, [conversationId, updateComposer]);
const submit = useCallback(() => {
if (!canWrite || !canExecute || sending || backgroundRunning || checkingRun || model.waitingForChannel) return;
if (!canWrite || !canExecute || sending || backgroundRunning || checkingRun || projectSaving || model.waitingForChannel) return;
const text = draft.trim();
if (!text && !attachments.length) {
toastWarning(t('chat.emptyMessage', null, '请输入内容或添加附件'));
@ -417,7 +441,7 @@ export default function Page() {
...model.request,
hitl: !conversationId && canDecideHitl ? draftHitl || undefined : undefined
});
}, [attachments, backgroundRunning, canWrite, canExecute, canDecideHitl, checkingRun, conversationId, draft, draftHitl, mode, model, newProjectId, resetRun, run, sending, t, updateComposer]);
}, [attachments, backgroundRunning, canWrite, canExecute, canDecideHitl, checkingRun, conversationId, draft, draftHitl, mode, model, newProjectId, projectSaving, resetRun, run, sending, t, updateComposer]);
const conversation = detail.conversation;
@ -462,7 +486,7 @@ export default function Page() {
onToggleSidebar={() => setSidebarOpen(true)}
onOpenUsage={() => setUsageOpen(true)}
onOpenSettings={canReadConfig || canReadHitl || (canWrite && canExecute)
? () => setSettingsOpen(true) : undefined}
? () => setSettingsOpen('all') : undefined}
onOpenPlan={() => {
refreshPlan();
setPlanOpen(true);
@ -534,17 +558,20 @@ export default function Page() {
onStop={stop}
canStop={canStop}
sending={sending || backgroundRunning}
checkingRun={checkingRun || model.waitingForChannel}
checkingRun={checkingRun || projectSaving || model.waitingForChannel}
canWrite={canWrite}
canExecute={canExecute}
mode={mode}
onModeChange={value => setStoredMode(AGENT_MODES.includes(value) ? value : 'single')}
projectId={newProjectId}
onProjectChange={value => setNewProjectId(value || '')}
onCreateProject={canCreateProject && !projectsResource.loading
projectId={conversationId ? conversation?.projectId || '' : newProjectId}
onProjectChange={changeProject}
onCreateProject={canCreateProject && canWrite && !projectsResource.loading
? () => setProjectFormOpen(true) : undefined}
projects={projects}
showProjectSelect={!conversationId}
projectDisabled={projectsResource.loading || Boolean(conversationId && (detail.loading || !conversation || detail.error))}
model={model}
canReadConfig={canReadConfig}
onOpenHitl={canReadHitl ? () => setSettingsOpen('hitl') : undefined}
attachments={attachments}
onPickFiles={uploadFiles}
onRemoveAttachment={removeAttachment}
@ -562,7 +589,8 @@ export default function Page() {
{settingsOpen && (
<ChatSettings
key={conversationId}
onClose={() => setSettingsOpen(false)}
section={settingsOpen}
onClose={() => setSettingsOpen('')}
narrow={narrow}
busy={sending || backgroundRunning || checkingRun || !(canWrite && canExecute)}
canReadConfig={canReadConfig}

View File

@ -69,6 +69,7 @@
margin-bottom: 8px;
background: var(--semi-color-fill-0);
}
.chat-batch-select-all { flex-basis: 100%; }
.chat-conv-item {
display: flex;
@ -289,10 +290,31 @@
gap: 12px;
}
.chat-composer > * { flex-shrink: 0; width: 100%; max-width: var(--chat-content-width); margin-inline: auto; }
.chat-composer-context {
display: flex;
align-items: center;
gap: 4px;
min-width: 0;
margin-inline: 14px;
padding: 6px 6px 16px;
border-radius: 18px 18px 0 0;
background: var(--semi-color-fill-0);
}
.chat-context-select.semi-select {
min-width: 0;
max-width: 100%;
background: transparent;
border-color: transparent;
}
.chat-context-select.semi-select:hover { background: var(--semi-color-fill-1); }
.chat-composer-mode { flex: 0 1 164px; width: 164px; }
.chat-composer-project { flex: 0 1 260px; width: 260px; }
.chat-composer-box {
position: relative;
margin-top: -10px;
padding: 14px 16px 10px;
border: 1px solid var(--semi-color-border);
border-radius: 16px;
border-radius: 20px;
background: var(--semi-color-bg-1);
box-shadow: var(--semi-shadow-elevated);
transition: border-color .15s ease, box-shadow .15s ease;
@ -302,7 +324,7 @@
box-shadow: 0 0 0 2px var(--semi-color-primary-light-default);
}
.chat-composer-banner { margin-bottom: 2px; }
.chat-file-list { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.chat-file-list { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; margin-bottom: 12px; }
.chat-file-chip { max-width: 100%; }
.chat-file-chip .semi-tag-content { display: flex; align-items: center; gap: 6px; min-width: 0; }
.chat-file-name { min-width: 0; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@ -313,16 +335,21 @@
.chat-composer-box .semi-input-textarea { overflow-wrap: anywhere; }
.chat-composer-box .semi-input-textarea:focus-visible { outline: none; }
.chat-composer-box .semi-input-textarea-counter { display: none; }
.chat-composer-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.chat-composer-controls { flex: 1 1 360px; min-width: 0; }
.chat-composer-controls > * { min-width: 0; max-width: 100%; }
.chat-composer-select { flex: 1 1 148px; width: 148px; min-width: 0; }
.chat-composer-submit { min-width: 0; max-width: 100%; margin-inline-start: auto; justify-content: flex-end; }
.chat-composer-submit > * { min-width: 0; max-width: 100%; }
.chat-composer-hint { font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }
.chat-composer-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.chat-composer-controls { display: flex; align-items: center; gap: 2px; flex: 0 0 auto; }
.chat-composer-controls .semi-button { padding-inline: 8px; }
.chat-composer-submit { display: flex; align-items: center; gap: 8px; min-width: 0; margin-inline-start: auto; }
.chat-composer-model.semi-button { min-width: 0; max-width: 360px; padding-inline: 8px; }
.chat-composer-model .semi-button-content { display: flex; align-items: center; gap: 6px; min-width: 0; }
.chat-composer-model-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-composer-effort { flex: 0 0 auto; font-size: 12px; color: var(--semi-color-text-2); }
.chat-composer-send.semi-button { flex: 0 0 32px; width: 32px; height: 32px; padding: 0; border-radius: 50%; }
.chat-model-settings { width: 320px; max-width: calc(100vw - 32px); padding: 16px; }
.chat-model-settings .semi-select { width: 100%; min-width: 0; }
.chat-settings-fields { display: grid; gap: 16px; }
.chat-setting-field { display: grid; gap: 8px; min-width: 0; }
.chat-setting-hitl { padding-top: 16px; border-top: 1px solid var(--semi-color-border); }
.chat-setting-hitl:first-child { padding-top: 0; border-top: 0; }
.chat-setting-reviewer { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
.chat-setting-reviewer .semi-radio-addon-buttonRadio { flex: 1; text-align: center; }
@ -406,12 +433,18 @@
.chat-turn-body .cs-markdown,
.chat-stream-text { font-size: 14px; }
.chat-composer { padding-block: 8px 12px; }
.chat-composer-box { padding: 12px 12px 8px; border-radius: 14px; }
.chat-composer-context { margin-inline: 8px; padding-inline: 2px; }
.chat-composer-mode { flex: 1 1 120px; width: 120px; }
.chat-composer-project { flex: 1 1 140px; width: 140px; }
.chat-composer-box { padding: 12px 12px 8px; border-radius: 18px; }
.chat-composer-box .semi-input-textarea { font-size: 16px; }
.chat-composer-controls,
.chat-composer-submit { width: 100%; }
.chat-composer-submit { justify-content: space-between; }
.chat-composer-hint { flex: 1 1 120px; }
.chat-composer-toolbar { gap: 4px; }
.chat-composer-controls .semi-button { padding-inline: 4px; }
.chat-composer-hitl { font-size: 12px; }
.chat-composer-submit { gap: 4px; }
.chat-composer-model.semi-button { padding-inline: 4px; }
.chat-composer-model-name { font-size: 12px; }
.chat-composer-model .semi-button-content { gap: 4px; }
}
@media (max-width: 900px) {

View File

@ -1,4 +1,4 @@
import { test, expect, visit, ready, label, UI_PERMISSIONS, CONVERSATION, ASSESSMENT, STAMP } from './fixtures.mjs';
import { test, expect, visit, ready, label, UI_PERMISSIONS, PROJECT, CONVERSATION, ASSESSMENT, STAMP } from './fixtures.mjs';
test('token usage: summary values render with daily rows and update to zero after filtering', async ({ page, mockApi }, testInfo) => {
const summary = {
@ -82,6 +82,136 @@ test('refreshing a conversation detects an active backend run and disables dupli
expect(mockApi.writes()).toEqual([]);
});
function mockEmptyConversation(mockApi, projectId = '') {
const conversation = { ...CONVERSATION, projectId, messages: [] };
mockApi.respond('GET', '/api/agent-loop/tasks', { json: { tasks: [] } });
mockApi.respond('GET', `/api/conversations/${conversation.id}`, () => ({ json: conversation }));
mockApi.respond('GET', '/api/conversations', () => ({ json: { conversations: [conversation], total: 1 } }));
return conversation;
}
test.describe('chat composer projects', () => {
test('binds and unbinds an existing empty conversation without losing its draft or sending during save', async ({ page, mockApi }) => {
const conversation = mockEmptyConversation(mockApi);
const path = `/api/conversations/${conversation.id}/project`;
const noProject = label('chat.noProject', '不绑定项目');
const draft = 'FAKE:切换项目时保留这份会话草稿。';
let releaseSave;
const pendingSave = new Promise(resolve => { releaseSave = resolve; });
mockApi.respond('PUT', path, async request => {
await pendingSave;
conversation.projectId = request.body.projectId;
return { json: { success: true, projectId: conversation.projectId } };
});
try {
const main = await visit(page, `chat?conversation=${conversation.id}`);
const context = main.locator('.chat-composer-context');
const project = context.getByRole('combobox').filter({ hasText: new RegExp(`${noProject}|${PROJECT.name}`) });
const input = main.getByRole('textbox', { name: label('chat.composerLabel', '对话内容') });
const send = main.getByRole('button', { name: /发送$/ });
// The header may display the project name or its existing abbreviated ID.
const headerProject = main.locator('.chat-header-tags .semi-tag').filter({ hasText: new RegExp(`${PROJECT.name}|${PROJECT.id.slice(0, 8)}`) });
await expect(context.getByRole('combobox')).toHaveCount(2);
await expect(project).toHaveText(noProject);
await expect(headerProject).toHaveCount(0);
await input.fill(draft);
await expect(send).toBeEnabled();
await expect.poll(() => mockApi.calls('GET', '/api/conversations').some(call => call.fulfilled)).toBe(true);
const initialListReads = mockApi.calls('GET', '/api/conversations').length;
await project.click();
await page.getByRole('listbox').getByText(PROJECT.name, { exact: true }).click();
await expect.poll(() => mockApi.calls('PUT', path).length).toBe(1);
expect(mockApi.calls('PUT', path)[0].body).toEqual({ projectId: PROJECT.id });
await expect(project).toBeDisabled();
await expect(send).toBeDisabled();
await input.press('Enter');
await expect(input).toHaveValue(draft);
expect(mockApi.writes().map(call => call.path)).toEqual([path]);
releaseSave();
await expect(project).toBeEnabled();
await expect(project).toHaveText(PROJECT.name);
await expect(headerProject).toBeVisible();
await expect(main.getByRole('heading', { name: conversation.title, exact: true })).toBeVisible();
await expect.poll(() => mockApi.calls('GET', '/api/conversations').length).toBeGreaterThan(initialListReads);
await expect(input).toHaveValue(draft);
const boundListReads = mockApi.calls('GET', '/api/conversations').length;
await project.click();
await page.getByRole('listbox').getByText(noProject, { exact: true }).click();
await expect(project).toBeEnabled();
await expect(project).toHaveText(noProject);
await expect(headerProject).toHaveCount(0);
await expect(send).toBeEnabled();
await expect(input).toHaveValue(draft);
await expect.poll(() => mockApi.calls('GET', '/api/conversations').length).toBeGreaterThan(boundListReads);
expect(mockApi.writes().map(({ method, path, body }) => ({ method, path, body }))).toEqual([
{ method: 'PUT', path, body: { projectId: PROJECT.id } },
{ method: 'PUT', path, body: { projectId: '' } }
]);
} finally {
releaseSave();
}
});
test('keeps the server project and draft when an existing empty conversation cannot be unbound', async ({ page, mockApi }) => {
const conversation = mockEmptyConversation(mockApi, PROJECT.id);
const path = `/api/conversations/${conversation.id}/project`;
const draft = 'FAKE:保存失败也不能丢失这份草稿。';
mockApi.fail('PUT', path, 'fixture 项目保存失败');
const main = await visit(page, `chat?conversation=${conversation.id}`);
const context = main.locator('.chat-composer-context');
const project = context.getByRole('combobox').filter({ hasText: PROJECT.name });
const input = main.getByRole('textbox', { name: label('chat.composerLabel', '对话内容') });
const headerProject = main.locator('.chat-header-tags .semi-tag').filter({ hasText: new RegExp(`${PROJECT.name}|${PROJECT.id.slice(0, 8)}`) });
await expect(project).toHaveText(PROJECT.name);
await expect(headerProject).toBeVisible();
await input.fill(draft);
await project.click();
await page.getByRole('listbox').getByText(label('chat.noProject', '不绑定项目'), { exact: true }).click();
await expect(page.getByText('fixture 项目保存失败', { exact: false })).toBeVisible();
await expect(project).toBeEnabled();
await expect(project).toHaveText(PROJECT.name);
await expect(headerProject).toBeVisible();
await expect(input).toHaveValue(draft);
await expect(main.getByRole('button', { name: /发送$/ })).toBeEnabled();
expect(mockApi.writes().map(({ method, path, body }) => ({ method, path, body }))).toEqual([
{ method: 'PUT', path, body: { projectId: '' } }
]);
expect(conversation.projectId).toBe(PROJECT.id);
});
test('selects a new conversation project locally and includes it only in the first send', async ({ page, mockApi }) => {
mockApi.respond('GET', '/api/agent-loop/tasks', { json: { tasks: [] } });
const message = 'FAKE:整理这个示例项目的工作记录。';
const id = mockApi.enableChatStream(message);
const main = await visit(page, 'chat');
const context = main.locator('.chat-composer-context');
const input = main.getByRole('textbox', { name: label('chat.composerLabel', '对话内容') });
await expect(context.getByRole('combobox')).toHaveCount(2);
await input.fill(message);
await context.getByRole('combobox').filter({ hasText: label('chat.agentModePiSingle') }).click();
for (const key of ['chat.agentModePiSingle', 'chat.agentModeDeep', 'chat.agentModePlanExecuteLabel', 'chat.agentModeSupervisorLabel']) {
await expect(page.getByRole('listbox').getByText(label(key), { exact: true })).toBeVisible();
}
await page.getByRole('listbox').getByText(label('chat.agentModePiSingle'), { exact: true }).click();
await context.getByRole('combobox').filter({ hasText: label('chat.noProject', '不绑定项目') }).click();
await page.getByRole('listbox').getByText(PROJECT.name, { exact: true }).click();
await expect(context.getByRole('combobox').filter({ hasText: PROJECT.name })).toBeVisible();
await expect(input).toHaveValue(message);
await expect(page).toHaveURL(/#\/chat$/);
expect(mockApi.writes()).toEqual([]);
await input.press('Enter');
await expect(page).toHaveURL(new RegExp(`#/chat\\?conversation=${id}$`));
expect(mockApi.writes().map(({ method, path, body }) => ({ method, path, body }))).toEqual([{
method: 'POST', path: '/api/agent/stream',
body: { message, conversationId: '', projectId: PROJECT.id }
}]);
});
});
test.describe('chat session settings', () => {
test.use({ appPermissions: [...UI_PERMISSIONS, 'hitl:write'] });
@ -289,6 +419,213 @@ test.describe('chat session settings', () => {
await expect.poll(() => mockApi.calls('GET', path).length).toBeGreaterThanOrEqual(2);
expect(mockApi.calls('PUT', '/api/hitl/config')).toHaveLength(1);
});
for (const reasoningMode of ['off', 'on']) {
test(`composer model popover persists preferences and sends reasoning ${reasoningMode}`, async ({ page, mockApi }) => {
mockApi.respond('GET', '/api/agent-loop/tasks', { json: { tasks: [] } });
mockApi.respond('GET', '/api/config', { json: { ai: {
default_channel: 'demo-primary',
channels: {
'demo-primary': { name: '示例通道 A', model: 'fixture-a' },
'demo-backup': { name: '示例通道 B', model: 'fixture-b' }
}
} } });
const message = `FAKE:使用推理 ${reasoningMode} 整理示例文本。`;
const id = mockApi.enableChatStream(message);
const main = await visit(page, 'chat');
const openModel = main.getByRole('button', { name: label('chat.modelSettingsAria'), exact: true });
await expect(openModel).toHaveClass(/chat-composer-model/);
await openModel.click();
const popover = page.locator('.chat-model-popover');
const channel = popover.getByRole('combobox', { name: label('chat.aiChannelLabel'), exact: true });
const mode = popover.getByRole('combobox', { name: label('chat.reasoningModeLabel'), exact: true });
const effort = popover.getByRole('combobox', { name: label('chat.reasoningEffortLabel'), exact: true });
await expect(popover).toBeVisible();
await expect(popover.getByRole('combobox')).toHaveCount(3);
await expect(popover.getByRole('combobox', { name: label('chat.hitlModeLabel'), exact: true })).toHaveCount(0);
await channel.click();
await page.getByRole('listbox').getByText('示例通道 B', { exact: true }).click();
await mode.click();
await page.getByRole('listbox').getByText(label('chat.reasoningModeOn'), { exact: true }).click();
await effort.click();
await page.getByRole('listbox').getByText('high', { exact: true }).click();
await mode.click();
await page.getByRole('listbox').getByText(label('chat.reasoningModeOff'), { exact: true }).click();
await expect(effort).toBeDisabled();
if (reasoningMode === 'on') {
await mode.click();
await page.getByRole('listbox').getByText(label('chat.reasoningModeOn'), { exact: true }).click();
await expect(effort).toBeEnabled();
await expect(effort).toHaveText('high');
}
await expect.poll(() => page.evaluate(() => ({
channel: localStorage.getItem('cyberstrike-chat-ai-channel'),
mode: localStorage.getItem('cyberstrike-chat-reasoning-mode'),
effort: localStorage.getItem('cyberstrike-chat-reasoning-effort')
}))).toEqual({ channel: 'demo-backup', mode: reasoningMode, effort: 'high' });
await main.locator('.chat-header-title').click();
await expect(popover).not.toBeVisible();
expect(mockApi.writes()).toEqual([]);
await page.reload();
await ready(page);
await openModel.click();
await expect(channel).toHaveText('示例通道 B');
await expect(mode).toHaveText(label(reasoningMode === 'off' ? 'chat.reasoningModeOff' : 'chat.reasoningModeOn'));
if (reasoningMode === 'off') await expect(effort).toBeDisabled();
else await expect(effort).toHaveText('high');
await main.locator('.chat-header-title').click();
const input = main.getByRole('textbox', { name: label('chat.composerLabel', '对话内容') });
await input.fill(message);
await input.press('Enter');
await expect(page).toHaveURL(new RegExp(`#/chat\\?conversation=${id}$`));
expect(mockApi.writes().map(({ method, path, body }) => ({ method, path, body }))).toEqual([{
method: 'POST', path: '/api/agent/stream',
body: {
message, conversationId: '', aiChannelId: 'demo-backup',
reasoning: reasoningMode === 'off' ? { mode: 'off' } : { mode: 'on', effort: 'high' }
}
}]);
});
}
test('composer HITL entry edits a local draft in a HITL-only sheet and includes it in the first send', async ({ page, mockApi }) => {
mockApi.respond('GET', '/api/agent-loop/tasks', { json: { tasks: [] } });
mockApi.respond('GET', '/api/hitl/default-config', { json: {
defaultMode: 'off', defaultReviewer: 'human', defaultTimeoutSeconds: 120, conversationHumanApproval: true
} });
const message = 'FAKE:保留草稿并使用人机协同整理示例文本。';
const id = mockApi.enableChatStream(message);
const hitl = {
enabled: true, mode: 'approval', reviewer: 'audit_agent',
sensitiveTools: ['fixture-read', 'fixture-write'], timeoutSeconds: 60
};
mockApi.respond('GET', `/api/hitl/config/${id}`, { json: { hitl } });
const main = await visit(page, 'chat');
const input = main.getByRole('textbox', { name: label('chat.composerLabel', '对话内容') });
const controls = main.locator('.chat-composer-controls');
const openHitl = controls.getByRole('button', { name: label('chat.hitlTitle'), exact: true });
await expect(controls.getByRole('button', { name: label('chat.attachmentsLabel', '附件'), exact: true })).toBeEnabled();
await input.fill(message);
await openHitl.click();
const settings = page.getByRole('dialog').filter({ hasText: label('chat.hitlTitle') });
await expect(settings).toHaveClass(/semi-sidesheet-inner/);
for (const key of ['chat.aiChannelLabel', 'chat.reasoningModeLabel', 'chat.reasoningEffortLabel']) {
await expect(settings.getByRole('combobox', { name: label(key), exact: true })).toHaveCount(0);
}
const mode = settings.getByRole('combobox', { name: label('chat.hitlModeLabel'), exact: true });
const timeout = settings.getByRole('combobox', { name: label('chat.hitlTimeoutLabel'), exact: true });
const tools = settings.getByRole('textbox', { name: label('chat.hitlWhitelistTools'), exact: true });
await expect(mode).toHaveText(label('chat.hitlModeOff'));
await mode.click();
await page.getByRole('listbox').getByText(label('chat.hitlModeApproval'), { exact: true }).click();
await settings.getByText(label('chat.hitlReviewerAgent'), { exact: true }).click();
await timeout.click();
await page.getByRole('listbox').getByText(label('chat.hitlTimeoutOneMinute'), { exact: true }).click();
await tools.fill('fixture-read, fixture-write');
await tools.press('Tab');
expect(mockApi.writes()).toEqual([]);
await settings.locator('button.semi-sidesheet-close').click();
await expect(input).toHaveValue(message);
await openHitl.click();
await expect(mode).toHaveText(label('chat.hitlModeApproval'));
await expect(settings.getByRole('radio', { name: label('chat.hitlReviewerAgent'), exact: true })).toBeChecked();
await expect(timeout).toHaveText(label('chat.hitlTimeoutOneMinute'));
await expect(tools).toHaveValue('fixture-read, fixture-write');
expect(mockApi.writes()).toEqual([]);
await settings.locator('button.semi-sidesheet-close').click();
await input.press('Enter');
await expect(page).toHaveURL(new RegExp(`#/chat\\?conversation=${id}$`));
expect(mockApi.writes().map(({ method, path, body }) => ({ method, path, body }))).toEqual([{
method: 'POST', path: '/api/agent/stream', body: { message, conversationId: '', hitl }
}]);
});
test('composer HITL entry saves an existing conversation and shares the full header settings', async ({ page, mockApi }) => {
const conversation = mockEmptyConversation(mockApi, PROJECT.id);
let hitl = {
enabled: true, mode: 'approval', reviewer: 'human',
sensitiveTools: ['fixture-existing-tool'], timeoutSeconds: 90
};
mockApi.respond('GET', `/api/hitl/config/${conversation.id}`, () => ({ json: {
hitl, defaultTimeoutSeconds: 90, hitlGlobalToolWhitelist: []
} }));
mockApi.respond('PUT', '/api/hitl/config', request => {
const { conversationId, ...config } = request.body;
hitl = config;
return { json: { ok: true } };
});
const main = await visit(page, `chat?conversation=${conversation.id}`);
const input = main.getByRole('textbox', { name: label('chat.composerLabel', '对话内容') });
const draft = 'FAKE:保存人机协同设置时保留会话草稿。';
await input.fill(draft);
const openHitl = main.locator('.chat-composer-controls').getByRole('button', { name: label('chat.hitlTitle'), exact: true });
await openHitl.click();
const settings = page.getByRole('dialog').filter({ hasText: label('chat.hitlTitle') });
const mode = settings.getByRole('combobox', { name: label('chat.hitlModeLabel'), exact: true });
await expect(mode).toHaveText(label('chat.hitlModeApproval'));
expect(mockApi.writes()).toEqual([]);
await mode.click();
await page.getByRole('listbox').getByText(label('chat.hitlModeReviewEdit'), { exact: true }).click();
await expect.poll(() => mockApi.calls('PUT', '/api/hitl/config').map(call => call.body)).toEqual([{
conversationId: conversation.id, enabled: true, mode: 'review_edit', reviewer: 'human',
sensitiveTools: ['fixture-existing-tool'], timeoutSeconds: 90
}]);
await expect(settings.getByRole('status')).toHaveText(label('chat.hitlApplyOkSync'));
await settings.locator('button.semi-sidesheet-close').click();
await main.locator('.chat-header').getByRole('button', { name: label('chat.sessionSettingsTitle'), exact: true }).click();
const fullSettings = page.getByRole('dialog').filter({ hasText: label('chat.sessionSettingsTitle') });
for (const key of ['chat.aiChannelLabel', 'chat.reasoningModeLabel', 'chat.reasoningEffortLabel']) {
await expect(fullSettings.getByRole('combobox', { name: label(key), exact: true })).toBeVisible();
}
await expect(fullSettings.getByRole('combobox', { name: label('chat.hitlModeLabel'), exact: true })).toHaveText(label('chat.hitlModeReviewEdit'));
await fullSettings.locator('button.semi-sidesheet-close').click();
await openHitl.click();
await expect(mode).toHaveText(label('chat.hitlModeReviewEdit'));
await settings.locator('button.semi-sidesheet-close').click();
await expect(input).toHaveValue(draft);
expect(mockApi.writes()).toHaveLength(1);
});
});
test.describe('chat composer read-only permissions', () => {
test.use({ appPermissions: UI_PERMISSIONS.filter(permission => permission !== 'chat:write') });
test('disables stored project changes and HITL editing without their respective write permissions', async ({ page, mockApi }) => {
const conversation = mockEmptyConversation(mockApi, PROJECT.id);
mockApi.respond('GET', `/api/hitl/config/${conversation.id}`, { json: {
hitl: {
enabled: true, mode: 'approval', reviewer: 'human',
sensitiveTools: ['fixture-existing-tool'], timeoutSeconds: 90
}
} });
const main = await visit(page, `chat?conversation=${conversation.id}`);
const context = main.locator('.chat-composer-context');
await expect(context.getByRole('combobox').filter({ hasText: PROJECT.name })).toBeDisabled();
await expect(main.getByRole('textbox', { name: label('chat.composerLabel', '对话内容') })).toBeDisabled();
await expect(main.getByRole('button', { name: /发送$/ })).toBeDisabled();
const controls = main.locator('.chat-composer-controls');
await expect(controls.getByRole('button', { name: label('chat.attachmentsLabel', '附件'), exact: true })).toBeDisabled();
await controls.getByRole('button', { name: label('chat.hitlTitle'), exact: true }).click();
const settings = page.getByRole('dialog').filter({ hasText: label('chat.hitlTitle') });
const mode = settings.getByRole('combobox', { name: label('chat.hitlModeLabel'), exact: true });
const timeout = settings.getByRole('combobox', { name: label('chat.hitlTimeoutLabel'), exact: true });
const tools = settings.getByRole('textbox', { name: label('chat.hitlWhitelistTools'), exact: true });
await expect(mode).toHaveText(label('chat.hitlModeApproval'));
await expect(mode).toBeDisabled();
await expect(timeout).toHaveText('90s');
await expect(timeout).toBeDisabled();
await expect(tools).toHaveValue('fixture-existing-tool');
await expect(tools).toBeDisabled();
await expect(settings.getByRole('radio', { name: label('chat.hitlReviewerHuman'), exact: true })).toBeChecked();
for (const key of ['chat.hitlReviewerHuman', 'chat.hitlReviewerAgent']) {
await expect(settings.getByRole('radio', { name: label(key), exact: true })).toBeDisabled();
}
await settings.locator('button.semi-sidesheet-close').click();
expect(mockApi.writes()).toEqual([]);
});
});
test.describe('running-status stop permission', () => {

View File

@ -328,11 +328,64 @@ test('chat: empty state, blank Enter and Shift+Enter never send', async ({ page,
expect(mockApi.writes()).toEqual([]);
});
for (const uploadFails of [false, true]) {
test(`chat: attachment plus ${uploadFails ? 'preserves failed uploads until removed' : 'uploads and sends the selected file'}`, async ({ page, mockApi }) => {
const message = 'FAKE:整理附件内容。';
const id = mockApi.enableChatStream(message);
let releaseUpload;
const uploadReady = new Promise(resolve => { releaseUpload = resolve; });
mockApi.respond('POST', '/api/chat-uploads', async () => {
await uploadReady;
return uploadFails
? { status: 503, json: { error: 'fixture 附件上传失败' } }
: { json: { absolutePath: '/tmp/fixture-attachment.txt' } };
});
const main = await visit(page, 'chat');
const composer = main.locator('.chat-composer');
const input = composer.getByRole('textbox', { name: label('chat.composerLabel', '对话内容') });
await input.fill(message);
const chooserPending = page.waitForEvent('filechooser');
await button(composer, label('chat.attachmentsLabel', '附件')).click();
const chooser = await chooserPending;
await chooser.setFiles({ name: 'fixture-attachment.txt', mimeType: 'text/plain', buffer: Buffer.from('FAKE fixture attachment') });
try {
await expect(composer.locator('.chat-file-chip')).toContainText('上传中');
await expect(button(composer, label('chat.send', '发送'))).toBeDisabled();
await input.press('Enter');
expect(mockApi.calls('POST', '/api/agent/stream')).toEqual([]);
} finally {
releaseUpload();
}
if (uploadFails) {
await expect(composer.locator('.chat-file-chip')).toContainText('上传失败');
await input.press('Enter');
await expect(input).toHaveValue(message);
await expect(page.getByText(label('chat.attachmentsUploadIncomplete', '存在上传失败的附件,请移除后再发送'), { exact: true })).toBeVisible();
expect(mockApi.calls('POST', '/api/agent/stream')).toEqual([]);
await composer.locator('.chat-file-chip .semi-tag-close').click();
await expect(composer.locator('.chat-file-chip')).toHaveCount(0);
} else {
await expect(composer.locator('.chat-file-chip')).toContainText('已上传');
}
await input.press('Enter');
await expect(page).toHaveURL(new RegExp(`#/chat\\?conversation=${id}$`));
expect(mockApi.calls('POST', '/api/agent/stream')[0].body).toEqual({
message,
conversationId: '',
...(uploadFails ? {} : { attachments: [{ fileName: 'fixture-attachment.txt', mimeType: 'text/plain', serverPath: '/tmp/fixture-attachment.txt' }] })
});
});
}
for (const width of [1440, 1024, 390]) {
test(`chat: header spacing and session settings stay usable at ${width}px`, async ({ page, mockApi }, testInfo) => {
await page.setViewportSize({ width, height: 900 });
const longTitle = '用于验证对话页标题换行与操作区布局的长会话名称'.repeat(4);
mockApi.respond('GET', `/api/conversations/${CONVERSATION.id}`, { json: { ...CONVERSATION, title: longTitle } });
mockApi.respond('GET', `/api/conversations/${CONVERSATION.id}`, { json: { ...CONVERSATION, title: longTitle, projectId: PROJECT.id } });
mockApi.respond('GET', '/api/config', { json: { ai: {
default_channel: 'fixture-long-model',
channels: { 'fixture-long-model': { name: '用于验证输入区长名称的模型通道'.repeat(3), model: 'fixture-model' } }
} } });
mockApi.respond('GET', '/api/agent-loop/tasks', { json: { tasks: [] } });
mockApi.respond('GET', '/api/hitl/default-config', { json: { defaultMode: 'off' } });
mockApi.respond('GET', `/api/hitl/config/${CONVERSATION.id}`, { json: { enabled: false, mode: 'off' } });
@ -358,7 +411,38 @@ for (const width of [1440, 1024, 390]) {
}
await expect(button(composer, label('chat.send', '发送'))).toBeInViewport({ ratio: 1 });
await assertNoOverflow(page);
const context = composer.locator('.chat-composer-context');
await expect(context.getByRole('combobox')).toHaveCount(2);
const project = context.locator('.chat-composer-project');
await expect(project).toHaveText(stored ? PROJECT.name : label('chat.noProject', '不绑定项目'));
const box = await composer.locator('.chat-composer-box').boundingBox();
for (const control of await context.getByRole('combobox').all()) {
await expect(control).toBeInViewport({ ratio: 1 });
const bounds = await control.boundingBox();
expect(bounds.y + bounds.height).toBeLessThanOrEqual(box.y);
}
const attachment = button(composer, label('chat.attachmentsLabel', '附件'));
const hitl = button(composer, label('chat.hitlTitle'));
const model = button(composer, label('chat.modelSettingsAria'));
const send = button(composer, label('chat.send', '发送'));
const toolbarBoxes = [];
for (const control of [attachment, hitl, model, send]) {
await expect(control).toBeInViewport({ ratio: 1 });
toolbarBoxes.push(await control.boundingBox());
}
for (let index = 1; index < toolbarBoxes.length; index++) {
expect(toolbarBoxes[index].x).toBeGreaterThanOrEqual(toolbarBoxes[index - 1].x + toolbarBoxes[index - 1].width);
}
await screenshot(page, testInfo, `chat-header-${stored ? 'long-title' : 'new'}-${width}`);
await model.click();
const modelPopover = page.locator('.chat-model-popover');
await expect(modelPopover.getByRole('combobox', { name: label('chat.reasoningEffortLabel') })).toBeVisible();
await expect(modelPopover).toBeInViewport({ ratio: 1 });
const popoverBox = await modelPopover.boundingBox();
expect(popoverBox.x).toBeGreaterThanOrEqual(0);
expect(popoverBox.x + popoverBox.width).toBeLessThanOrEqual(width);
await title.click();
await expect(modelPopover).not.toBeVisible();
await input.fill('保留会话草稿');
await settingsButton.click();
@ -424,10 +508,10 @@ test.describe('chat: read-only permissions', () => {
await expect(button(main, label('chat.send', '发送'))).toBeDisabled();
await expect(button(main, label('chat.attachmentsLabel', '附件'))).toBeDisabled();
await expect(main.getByText(label('chat.noWritePermission', '当前账号没有对话写入权限(chat:write),发送已禁用。'), { exact: true })).toBeVisible();
await readsCompleted(mockApi, ['/api/projects']);
await main.locator('.chat-composer').getByRole('combobox').filter({ hasText: label('chat.noProject', '不绑定项目') }).click();
await expect(page.getByRole('option', { name: PROJECT.name })).toBeVisible();
await expect(page.getByRole('option').filter({ hasText: `+ ${label('projects.newProject', '新建项目')}` })).toHaveCount(0);
await readsCompleted(mockApi, ['/api/projects', '/api/conversations']);
await expect(button(main, label('chat.batchManage', '批量管理'))).toHaveCount(0);
await expect(main.locator('.chat-composer-context').getByRole('combobox').filter({ hasText: label('chat.noProject', '不绑定项目') })).toBeDisabled();
await expect(main.locator('.chat-composer-mode')).toBeDisabled();
// Send real keyboard events, without force-enabling a disabled application control.
await main.locator('.chat-header-title').click();
await page.keyboard.press('Enter');
@ -462,6 +546,129 @@ test('chat: select stored conversation and restore it after reload', async ({ pa
expect(mockApi.writes()).toEqual([]);
});
test.describe('chat: batch selection', () => {
test.use({ appPermissions: [...UI_PERMISSIONS, 'chat:delete'] });
const conversations = Array.from({ length: 23 }, (_, index) => ({
...CONVERSATION,
id: `fixture-batch-${index + 1}`,
title: `批量示例 ${String(index + 1).padStart(2, '0')}`,
projectId: index % 2 ? PROJECT.id : ''
}));
test.beforeEach(async ({ mockApi }) => {
let remaining = [...conversations];
mockApi.respond('GET', '/api/conversations', (_, url) => {
const search = url.searchParams.get('search') || '';
const project = url.searchParams.get('project_id') || '';
const filtered = remaining.filter(item => item.title.includes(search) && (!project || item.projectId === project));
const offset = Number(url.searchParams.get('offset') || 0);
const limit = Number(url.searchParams.get('limit') || 20);
return { json: { conversations: filtered.slice(offset, offset + limit), total: filtered.length } };
});
for (const item of conversations) {
mockApi.respond('DELETE', `/api/conversations/${item.id}`, () => {
remaining = remaining.filter(row => row.id !== item.id);
return { json: { success: true } };
});
}
});
for (const width of [1440, 390]) {
test(`select, clear and delete only the current page at ${width}px`, async ({ page, mockApi }, testInfo) => {
await page.setViewportSize({ width, height: 1000 });
const main = await visit(page, 'chat');
if (width < 900) await button(main, label('chat.conversations', '会话')).click();
const sidebar = page.locator('.chat-sidebar-inner:visible');
await expect(sidebar.locator('.chat-conv-item')).toHaveCount(20);
await button(sidebar, label('chat.batchManage', '批量管理')).click();
const bar = sidebar.locator('.chat-batch-bar');
const selectPage = bar.getByRole('checkbox', { name: label('chat.selectPage') });
const rows = sidebar.locator('.chat-conv-check');
const deleteButton = button(bar, label('chat.batchDelete', '批量删除'));
await expect(selectPage).not.toBeChecked();
await expect(deleteButton).toBeDisabled();
await bar.getByText(label('chat.selectPage'), { exact: true }).click();
await expect(sidebar.locator('.chat-conv-check input:checked')).toHaveCount(20);
await expect(bar).toContainText('已选 20');
await bar.getByText(label('chat.selectPage'), { exact: true }).click();
await expect(sidebar.locator('.chat-conv-check input:checked')).toHaveCount(0);
await expect(deleteButton).toBeDisabled();
await rows.first().click();
await expect(bar.locator('.chat-batch-select-all')).toHaveClass(/semi-checkbox-indeterminate/);
await bar.getByText(label('chat.selectPage'), { exact: true }).click();
await rows.last().click();
await expect(bar).toContainText('已选 19');
await expect(bar.locator('.chat-batch-select-all')).toHaveClass(/semi-checkbox-indeterminate/);
await rows.last().click();
await expect(selectPage).toBeChecked();
await expect(bar.locator('.chat-batch-select-all')).not.toHaveClass(/semi-checkbox-indeterminate/);
await selectPage.focus();
await page.keyboard.press('Space');
await expect(sidebar.locator('.chat-conv-check input:checked')).toHaveCount(0);
await bar.getByText(label('chat.selectPage'), { exact: true }).click();
await expect(deleteButton).toBeInViewport({ ratio: 1 });
await expect(selectPage).toBeInViewport({ ratio: 1 });
const sizes = await bar.evaluate(element => ({ width: element.clientWidth, scroll: element.scrollWidth }));
expect(sizes.scroll).toBeLessThanOrEqual(sizes.width);
await screenshot(page, testInfo, `chat-batch-selection-${width}`);
expect(mockApi.writes()).toEqual([]);
await deleteButton.click();
await expect(bar).toHaveCount(0);
await expect(sidebar.locator('.chat-conv-item')).toHaveCount(3);
expect(mockApi.writes().map(call => `${call.method} ${call.path}`).sort()).toEqual(
conversations.slice(0, 20).map(item => `DELETE /api/conversations/${item.id}`).sort()
);
});
}
test('resets selections on pagination, search, project filtering and cancel', async ({ page, mockApi }) => {
await visit(page, 'chat');
const sidebar = page.locator('.chat-sidebar-inner:visible');
const manage = button(sidebar, label('chat.batchManage', '批量管理'));
const bar = sidebar.locator('.chat-batch-bar');
const selectPage = bar.getByRole('checkbox', { name: label('chat.selectPage') });
await manage.click();
await bar.getByText(label('chat.selectPage'), { exact: true }).click();
await sidebar.getByRole('button', { name: 'Next', exact: true }).click();
await expect(bar).toHaveCount(0);
await expect(sidebar.locator('.chat-conv-item')).toHaveCount(3);
await manage.click();
await expect(bar).toContainText('已选 0');
await bar.getByText(label('chat.selectPage'), { exact: true }).click();
await expect(bar).toContainText('已选 3');
await sidebar.getByRole('textbox', { name: label('chat.searchHistory', '搜索历史对话') }).fill('批量示例 2');
await expect(bar).toHaveCount(0);
await expect(sidebar.locator('.chat-conv-item')).toHaveCount(4);
await manage.click();
await expect(bar).toContainText('已选 0');
await bar.getByText(label('chat.selectPage'), { exact: true }).click();
await expect(bar).toContainText('已选 4');
await sidebar.getByRole('combobox').filter({ hasText: label('chat.filterAllProjects', '全部项目') }).click();
await page.getByRole('option').filter({ hasText: PROJECT.name }).click();
await expect(bar).toHaveCount(0);
await expect(sidebar.locator('.chat-conv-item')).toHaveCount(2);
await manage.click();
await expect(bar).toContainText('已选 0');
await bar.getByText(label('chat.selectPage'), { exact: true }).click();
await expect(bar).toContainText('已选 2');
await button(sidebar, label('common.cancel', '取消')).click();
await manage.click();
await expect(selectPage).not.toBeChecked();
await expect(button(bar, label('chat.batchDelete', '批量删除'))).toBeDisabled();
await sidebar.getByRole('textbox', { name: label('chat.searchHistory', '搜索历史对话') }).fill('没有匹配的会话');
await expect(sidebar.locator('.chat-conv-item')).toHaveCount(0);
await expect(manage).toHaveCount(0);
await expect(bar).toHaveCount(0);
expect(mockApi.writes()).toEqual([]);
});
});
test('chat: floating composer stays aligned and shows focus', async ({ page, mockApi }, testInfo) => {
mockApi.respond('GET', '/api/agent-loop/tasks', { json: { tasks: [] } });
await page.goto(`/static/app/#/chat?conversation=${CONVERSATION.id}`);
@ -484,7 +691,7 @@ test('chat: floating composer stays aligned and shows focus', async ({ page, moc
expect(box.width).toBeLessThanOrEqual(footer.width);
await expect(composer).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)');
await expect(composerBox).toHaveCSS('border-top-width', '1px');
await expect(composerBox).toHaveCSS('border-radius', '16px');
await expect(composerBox).toHaveCSS('border-radius', '20px');
const borderColor = await composerBox.evaluate(node => getComputedStyle(node).borderTopColor);
await input.click();

View File

@ -1 +1 @@
import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{S as t,t as n}from"./react-QV7DAAIx.js";import{I as r,P as i,U as a,V as o,i as s,it as c,j as l,ot as u,rt as d,xt as f,yt as p}from"./semi-DNxeCrHm.js";import{F as m,I as h,P as g,a as _,b as v,c as y,d as b,f as x,l as S,m as C,p as w,s as T,u as E,x as D,y as O}from"./index-BVurtcsj.js";var k=e(t(),1),A=e(n(),1),{Text:j}=a;function M(){let e=g(),{hasPermission:t}=m(),n=t(`agents:write`),a=t(`agents:delete`),[M,N]=(0,k.useState)(``),[P,F]=(0,k.useState)(null),[I,L]=(0,k.useState)(null),[R,z]=(0,k.useState)(!1),B=_(()=>h.get(`/multi-agent/markdown-agents`),[]),V=(Array.isArray(B.data?.agents)?B.data.agents:[]).filter(e=>{if(!M)return!0;let t=M.toLowerCase();return[e.name,e.id,e.filename,e.description].some(e=>String(e||``).toLowerCase().includes(t))}),H=async e=>{try{F(await h.get(`/multi-agent/markdown-agents/${encodeURIComponent(e.filename)}`))}catch(e){v(e,`读取智能体失败`)}},U=async()=>{let e=await I.form.validate();z(!0);try{await h.post(`/multi-agent/markdown-agents`,{filename:e.filename?.trim()||``,name:e.name.trim(),description:e.description?.trim()||``,instruction:e.instruction,kind:e.kind||`sub`,tools:String(e.tools||``).split(`,`).map(e=>e.trim()).filter(Boolean)}),D(`智能体已保存`),L(null),B.reload()}catch(e){v(e,`保存智能体失败`)}finally{z(!1)}},W=e=>O({title:`删除智能体「${e.name||e.filename}」?`,onOk:async()=>{await h.del(`/multi-agent/markdown-agents/${encodeURIComponent(e.filename)}`),D(`已删除`),B.reload()}});return(0,A.jsxs)(`div`,{children:[(0,A.jsx)(w,{title:e(`agents.title`,null,`智能体管理`),description:B.data?.dir?`目录:${B.data.dir}`:`以 Markdown 文件定义的子智能体与编排器。`,extra:(0,A.jsxs)(i,{children:[(0,A.jsx)(r,{icon:(0,A.jsx)(c,{}),onClick:()=>B.reload(),loading:B.loading,children:`刷新`}),n&&(0,A.jsx)(r,{theme:`solid`,type:`primary`,icon:(0,A.jsx)(u,{}),onClick:()=>L({record:null,form:{}}),children:`新建智能体`})]})}),B.data?.error&&(0,A.jsx)(S,{error:B.data.error}),(0,A.jsxs)(C,{title:`智能体(${V.length})`,children:[(0,A.jsx)(S,{error:B.error,onRetry:()=>B.reload()}),(0,A.jsx)(T,{columns:[{title:`智能体`,dataIndex:`name`,render:(e,t)=>(0,A.jsxs)(i,{vertical:!0,spacing:0,align:`start`,children:[(0,A.jsxs)(i,{children:[(0,A.jsx)(j,{strong:!0,children:e||t.id}),t.is_orchestrator&&(0,A.jsx)(l,{size:`small`,color:`purple`,children:`编排器`})]}),(0,A.jsx)(j,{type:`tertiary`,children:t.filename})]})},{title:`类型`,dataIndex:`kind`,width:110,render:e=>(0,A.jsx)(l,{size:`small`,children:e||`sub`})},{title:`描述`,dataIndex:`description`,render:e=>(0,A.jsx)(j,{type:`tertiary`,ellipsis:{showTooltip:!0},style:{maxWidth:460},children:e||`—`})},{title:`操作`,width:180,render:(e,t)=>(0,A.jsxs)(i,{children:[(0,A.jsx)(r,{size:`small`,theme:`borderless`,onClick:()=>H(t),children:`详情`}),n&&(0,A.jsx)(r,{size:`small`,theme:`borderless`,icon:(0,A.jsx)(p,{}),onClick:()=>L({record:t,form:{}})}),a&&(0,A.jsx)(r,{size:`small`,theme:`borderless`,type:`danger`,icon:(0,A.jsx)(f,{}),onClick:()=>W(t)})]})}],dataSource:V,rowKey:`filename`,loading:B.loading,pagination:{pageSize:20},toolbar:(0,A.jsx)(o,{prefix:(0,A.jsx)(d,{}),value:M,onChange:N,placeholder:`搜索名称或文件名`,style:{width:280}})})]}),(0,A.jsx)(y,{title:I?.record?`编辑智能体`:`新建智能体`,visible:!!I,onCancel:()=>L(null),onOk:U,confirmLoading:R,width:760,children:(0,A.jsxs)(s,{getFormApi:e=>L(t=>t&&{...t,form:e}),initValues:I?.record?{filename:I.record.filename,name:I.record.name,description:I.record.description,kind:I.record.kind||`sub`}:{kind:`sub`},children:[(0,A.jsx)(s.Input,{field:`filename`,label:`文件名(留空自动生成)`,placeholder:`例如 recon.md`}),(0,A.jsx)(s.Input,{field:`name`,label:`名称`,rules:[{required:!0,message:`请输入名称`}]}),(0,A.jsx)(s.Input,{field:`description`,label:`描述`}),(0,A.jsx)(s.Select,{field:`kind`,label:`类型`,optionList:[{value:`sub`,label:`子智能体`},{value:`orchestrator`,label:`编排器`},{value:`plan_execute`,label:`计划执行`}]}),(0,A.jsx)(s.Input,{field:`tools`,label:`工具(逗号分隔)`,placeholder:`toolName, mcp::tool`}),(0,A.jsx)(s.TextArea,{field:`instruction`,label:`指令(Markdown)`,autosize:{minRows:8,maxRows:20}})]})},I?.record?.filename||`new-agent`),(0,A.jsx)(y,{title:P?.name||`智能体详情`,visible:!!P,onCancel:()=>F(null),width:720,children:P&&(0,A.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:12},children:[(0,A.jsx)(b,{items:[{label:`文件名`,value:P.filename},{label:`ID`,value:P.id},{label:`类型`,value:P.kind},{label:`绑定角色`,value:P.bind_role||`—`},{label:`最大迭代`,value:P.max_iterations??`—`},{label:`工具`,value:Array.isArray(P.tools)&&P.tools.length?P.tools.join(`、`):`—`}]}),(0,A.jsx)(x,{content:P.instruction||P.raw||``}),(0,A.jsx)(E,{value:P.raw||P,title:`原始 Markdown`,collapsed:!0})]})})]})}export{M as default};
import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{S as t,t as n}from"./react-QV7DAAIx.js";import{I as r,P as i,St as a,U as o,V as s,i as c,it as l,j as u,ot as d,rt as f,yt as p}from"./semi-BX8ib3Fq.js";import{F as m,I as h,P as g,a as _,b as v,c as y,d as b,f as x,l as S,m as C,p as w,s as T,u as E,x as D,y as O}from"./index-CiI19B2v.js";var k=e(t(),1),A=e(n(),1),{Text:j}=o;function M(){let e=g(),{hasPermission:t}=m(),n=t(`agents:write`),o=t(`agents:delete`),[M,N]=(0,k.useState)(``),[P,F]=(0,k.useState)(null),[I,L]=(0,k.useState)(null),[R,z]=(0,k.useState)(!1),B=_(()=>h.get(`/multi-agent/markdown-agents`),[]),V=(Array.isArray(B.data?.agents)?B.data.agents:[]).filter(e=>{if(!M)return!0;let t=M.toLowerCase();return[e.name,e.id,e.filename,e.description].some(e=>String(e||``).toLowerCase().includes(t))}),H=async e=>{try{F(await h.get(`/multi-agent/markdown-agents/${encodeURIComponent(e.filename)}`))}catch(e){v(e,`读取智能体失败`)}},U=async()=>{let e=await I.form.validate();z(!0);try{await h.post(`/multi-agent/markdown-agents`,{filename:e.filename?.trim()||``,name:e.name.trim(),description:e.description?.trim()||``,instruction:e.instruction,kind:e.kind||`sub`,tools:String(e.tools||``).split(`,`).map(e=>e.trim()).filter(Boolean)}),D(`智能体已保存`),L(null),B.reload()}catch(e){v(e,`保存智能体失败`)}finally{z(!1)}},W=e=>O({title:`删除智能体「${e.name||e.filename}」?`,onOk:async()=>{await h.del(`/multi-agent/markdown-agents/${encodeURIComponent(e.filename)}`),D(`已删除`),B.reload()}});return(0,A.jsxs)(`div`,{children:[(0,A.jsx)(w,{title:e(`agents.title`,null,`智能体管理`),description:B.data?.dir?`目录:${B.data.dir}`:`以 Markdown 文件定义的子智能体与编排器。`,extra:(0,A.jsxs)(i,{children:[(0,A.jsx)(r,{icon:(0,A.jsx)(l,{}),onClick:()=>B.reload(),loading:B.loading,children:`刷新`}),n&&(0,A.jsx)(r,{theme:`solid`,type:`primary`,icon:(0,A.jsx)(d,{}),onClick:()=>L({record:null,form:{}}),children:`新建智能体`})]})}),B.data?.error&&(0,A.jsx)(S,{error:B.data.error}),(0,A.jsxs)(C,{title:`智能体(${V.length})`,children:[(0,A.jsx)(S,{error:B.error,onRetry:()=>B.reload()}),(0,A.jsx)(T,{columns:[{title:`智能体`,dataIndex:`name`,render:(e,t)=>(0,A.jsxs)(i,{vertical:!0,spacing:0,align:`start`,children:[(0,A.jsxs)(i,{children:[(0,A.jsx)(j,{strong:!0,children:e||t.id}),t.is_orchestrator&&(0,A.jsx)(u,{size:`small`,color:`purple`,children:`编排器`})]}),(0,A.jsx)(j,{type:`tertiary`,children:t.filename})]})},{title:`类型`,dataIndex:`kind`,width:110,render:e=>(0,A.jsx)(u,{size:`small`,children:e||`sub`})},{title:`描述`,dataIndex:`description`,render:e=>(0,A.jsx)(j,{type:`tertiary`,ellipsis:{showTooltip:!0},style:{maxWidth:460},children:e||`—`})},{title:`操作`,width:180,render:(e,t)=>(0,A.jsxs)(i,{children:[(0,A.jsx)(r,{size:`small`,theme:`borderless`,onClick:()=>H(t),children:`详情`}),n&&(0,A.jsx)(r,{size:`small`,theme:`borderless`,icon:(0,A.jsx)(p,{}),onClick:()=>L({record:t,form:{}})}),o&&(0,A.jsx)(r,{size:`small`,theme:`borderless`,type:`danger`,icon:(0,A.jsx)(a,{}),onClick:()=>W(t)})]})}],dataSource:V,rowKey:`filename`,loading:B.loading,pagination:{pageSize:20},toolbar:(0,A.jsx)(s,{prefix:(0,A.jsx)(f,{}),value:M,onChange:N,placeholder:`搜索名称或文件名`,style:{width:280}})})]}),(0,A.jsx)(y,{title:I?.record?`编辑智能体`:`新建智能体`,visible:!!I,onCancel:()=>L(null),onOk:U,confirmLoading:R,width:760,children:(0,A.jsxs)(c,{getFormApi:e=>L(t=>t&&{...t,form:e}),initValues:I?.record?{filename:I.record.filename,name:I.record.name,description:I.record.description,kind:I.record.kind||`sub`}:{kind:`sub`},children:[(0,A.jsx)(c.Input,{field:`filename`,label:`文件名(留空自动生成)`,placeholder:`例如 recon.md`}),(0,A.jsx)(c.Input,{field:`name`,label:`名称`,rules:[{required:!0,message:`请输入名称`}]}),(0,A.jsx)(c.Input,{field:`description`,label:`描述`}),(0,A.jsx)(c.Select,{field:`kind`,label:`类型`,optionList:[{value:`sub`,label:`子智能体`},{value:`orchestrator`,label:`编排器`},{value:`plan_execute`,label:`计划执行`}]}),(0,A.jsx)(c.Input,{field:`tools`,label:`工具(逗号分隔)`,placeholder:`toolName, mcp::tool`}),(0,A.jsx)(c.TextArea,{field:`instruction`,label:`指令(Markdown)`,autosize:{minRows:8,maxRows:20}})]})},I?.record?.filename||`new-agent`),(0,A.jsx)(y,{title:P?.name||`智能体详情`,visible:!!P,onCancel:()=>F(null),width:720,children:P&&(0,A.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:12},children:[(0,A.jsx)(b,{items:[{label:`文件名`,value:P.filename},{label:`ID`,value:P.id},{label:`类型`,value:P.kind},{label:`绑定角色`,value:P.bind_role||`—`},{label:`最大迭代`,value:P.max_iterations??`—`},{label:`工具`,value:Array.isArray(P.tools)&&P.tools.length?P.tools.join(`、`):`—`}]}),(0,A.jsx)(x,{content:P.instruction||P.raw||``}),(0,A.jsx)(E,{value:P.raw||P,title:`原始 Markdown`,collapsed:!0})]})})]})}export{M as default};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
import{I as e,L as t}from"./index-BVurtcsj.js";var n=encodeURIComponent,r=t=>e.get(`/c2/listeners`,t),i=t=>e.post(`/c2/listeners`,t),a=(t,r)=>e.put(`/c2/listeners/${n(t)}`,r),o=t=>e.del(`/c2/listeners/${n(t)}`),s=t=>e.post(`/c2/listeners/${n(t)}/start`,{}),c=t=>e.post(`/c2/listeners/${n(t)}/stop`,{}),l=t=>e.get(`/c2/sessions`,t),u=t=>e.get(`/c2/sessions/${n(t)}`),d=t=>e.del(`/c2/sessions/${n(t)}`),f=t=>e.del(`/c2/sessions`,{body:{ids:t}}),p=(t,{sleepSeconds:r,jitterPercent:i})=>e.put(`/c2/sessions/${n(t)}/sleep`,{sleep_seconds:r,jitter_percent:i}),m=(t,r)=>e.put(`/c2/sessions/${n(t)}/note`,{note:r}),h=t=>e.get(`/c2/tasks`,t),g=t=>e.get(`/c2/tasks/${n(t)}`),_=t=>e.post(`/c2/tasks`,t),v=(t,r)=>e.post(`/c2/sessions/${n(t)}/tasks`,r),y=t=>e.post(`/c2/tasks/${n(t)}/cancel`,{}),b=(t,r=30)=>e.get(`/c2/tasks/${n(t)}/wait`,{timeout:r},{timeout:(r+10)*1e3}),x=t=>e.del(`/c2/tasks`,{body:{ids:t}}),S=(e,r)=>t(`/c2/tasks/${n(e)}/result-file`,{filename:r}),C=t=>e.post(`/c2/payloads/oneliner`,t),w=t=>e.post(`/c2/payloads/build`,t),T=(e,r)=>t(`/c2/payloads/${n(e)}/download`,{filename:r}),E=t=>e.get(`/c2/events`,t),D=t=>e.del(`/c2/events`,{body:{ids:t}}),O=()=>e.get(`/c2/profiles`),k=t=>e.post(`/c2/profiles`,t),A=(t,r)=>e.put(`/c2/profiles/${n(t)}`,r),j=t=>e.del(`/c2/profiles/${n(t)}`);async function M(){try{let t=await e.get(`/projects`,{limit:200});return Array.isArray(t?.projects)?t.projects:[]}catch{return[]}}export{b as A,h as C,c as D,s as E,a as O,l as S,p as T,g as _,k as a,O as b,D as c,d,f,u as g,S as h,i,A as k,o as l,T as m,w as n,v as o,x as p,y as r,_ as s,C as t,j as u,E as v,m as w,M as x,r as y};
import{I as e,L as t}from"./index-CiI19B2v.js";var n=encodeURIComponent,r=t=>e.get(`/c2/listeners`,t),i=t=>e.post(`/c2/listeners`,t),a=(t,r)=>e.put(`/c2/listeners/${n(t)}`,r),o=t=>e.del(`/c2/listeners/${n(t)}`),s=t=>e.post(`/c2/listeners/${n(t)}/start`,{}),c=t=>e.post(`/c2/listeners/${n(t)}/stop`,{}),l=t=>e.get(`/c2/sessions`,t),u=t=>e.get(`/c2/sessions/${n(t)}`),d=t=>e.del(`/c2/sessions/${n(t)}`),f=t=>e.del(`/c2/sessions`,{body:{ids:t}}),p=(t,{sleepSeconds:r,jitterPercent:i})=>e.put(`/c2/sessions/${n(t)}/sleep`,{sleep_seconds:r,jitter_percent:i}),m=(t,r)=>e.put(`/c2/sessions/${n(t)}/note`,{note:r}),h=t=>e.get(`/c2/tasks`,t),g=t=>e.get(`/c2/tasks/${n(t)}`),_=t=>e.post(`/c2/tasks`,t),v=(t,r)=>e.post(`/c2/sessions/${n(t)}/tasks`,r),y=t=>e.post(`/c2/tasks/${n(t)}/cancel`,{}),b=(t,r=30)=>e.get(`/c2/tasks/${n(t)}/wait`,{timeout:r},{timeout:(r+10)*1e3}),x=t=>e.del(`/c2/tasks`,{body:{ids:t}}),S=(e,r)=>t(`/c2/tasks/${n(e)}/result-file`,{filename:r}),C=t=>e.post(`/c2/payloads/oneliner`,t),w=t=>e.post(`/c2/payloads/build`,t),T=(e,r)=>t(`/c2/payloads/${n(e)}/download`,{filename:r}),E=t=>e.get(`/c2/events`,t),D=t=>e.del(`/c2/events`,{body:{ids:t}}),O=()=>e.get(`/c2/profiles`),k=t=>e.post(`/c2/profiles`,t),A=(t,r)=>e.put(`/c2/profiles/${n(t)}`,r),j=t=>e.del(`/c2/profiles/${n(t)}`);async function M(){try{let t=await e.get(`/projects`,{limit:200});return Array.isArray(t?.projects)?t.projects:[]}catch{return[]}}export{b as A,h as C,c as D,s as E,a as O,l as S,p as T,g as _,k as a,O as b,D as c,d,f,u as g,S as h,i,A as k,o as l,T as m,w as n,v as o,x as p,y as r,_ as s,C as t,j as u,E as v,m as w,M as x,r as y};

View File

@ -1 +1 @@
import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{I as t,P as n,U as r}from"./semi-DNxeCrHm.js";import{E as i,P as a,k as o}from"./index-BVurtcsj.js";import"./c2-shared-K-WbB5Dl.js";import{t as s}from"./react-QV7DAAIx.js";var c=e(s(),1),{Text:l}=r,u=[{value:`http_beacon`,label:`HTTP Beacon`},{value:`https_beacon`,label:`HTTPS Beacon`},{value:`tcp_reverse`,label:`TCP 反向`},{value:`websocket`,label:`WebSocket`}],d={running:`运行中`,stopped:`已停止`,error:`异常`},f={tcp_reverse:[{value:`bash`,label:`Bash (/dev/tcp)`},{value:`nc`,label:`Netcat (-e)`},{value:`nc_mkfifo`,label:`Netcat (mkfifo)`},{value:`python`,label:`Python`},{value:`perl`,label:`Perl`},{value:`powershell`,label:`PowerShell`}],http_beacon:[{value:`curl_beacon`,label:`Curl Beacon (HTTP)`}],https_beacon:[{value:`curl_beacon`,label:`Curl Beacon (HTTP)`}],websocket:[{value:`curl_beacon`,label:`Curl Beacon (HTTP)`}]},p=[{value:`shell`,label:`shell`},{value:`exec`,label:`exec`},{value:`ls`,label:`ls`},{value:`pwd`,label:`pwd`},{value:`cd`,label:`cd`},{value:`ps`,label:`ps`},{value:`kill_proc`,label:`kill_proc`},{value:`download`,label:`download`},{value:`upload`,label:`upload`},{value:`screenshot`,label:`screenshot`},{value:`sleep`,label:`sleep`},{value:`exit`,label:`exit`},{value:`self_delete`,label:`self_delete`},{value:`port_fwd`,label:`port_fwd`},{value:`socks_start`,label:`socks_start`},{value:`socks_stop`,label:`socks_stop`},{value:`load_assembly`,label:`load_assembly`},{value:`persist`,label:`persist`}],m=[{value:`queued`,label:`队列中`},{value:`sent`,label:`已发送`},{value:`running`,label:`执行中`},{value:`success`,label:`成功`},{value:`failed`,label:`失败`},{value:`cancelled`,label:`已取消`}],h=[{value:`info`,label:`信息`},{value:`warn`,label:`警告`},{value:`critical`,label:`严重`}],g=[{value:`listener`,label:`监听器`},{value:`session`,label:`会话`},{value:`task`,label:`任务`},{value:`payload`,label:`Payload`},{value:`opsec`,label:`OPSEC`}],_=[{value:`active`,label:`活跃`},{value:`sleeping`,label:`休眠`},{value:`dead`,label:`离线`},{value:`killed`,label:`已终止`}],v=[{value:`15m`,label:`最近15分钟`,ms:9e5},{value:`1h`,label:`最近1小时`,ms:36e5},{value:`24h`,label:`最近24小时`,ms:864e5},{value:`7d`,label:`最近7天`,ms:6048e5},{value:`all`,label:`全部`,ms:0}];function y(e){let t=v.find(t=>t.value===e);return!t||!t.ms?``:new Date(Date.now()-t.ms).toISOString()}function b({value:e,onChange:r,ns:i=`tasks`}){let o=a();return(0,c.jsxs)(n,{spacing:6,wrap:!0,className:`c2-time-presets`,children:[(0,c.jsx)(l,{type:`tertiary`,size:`small`,children:o(`c2.tasks.timePresets`,null,`快捷`)}),v.map(n=>(0,c.jsx)(t,{size:`small`,theme:n.value===e?`solid`:`borderless`,type:n.value===e?`primary`:`tertiary`,onClick:()=>r(n.value),children:o(`c2.${i}.preset${n.value===`all`?`All`:n.value}`,null,n.label)},n.value))]})}function x(e){let t=Number(e);return!Number.isFinite(t)||t<=0?`—`:t<1e3?`${Math.round(t)}ms`:t<6e4?`${(t/1e3).toFixed(1)}秒`:`${Math.round(t/6e4)}分钟`}function S({value:e}){let t=a();return e?(0,c.jsx)(`span`,{className:`c2-time-text`,title:i(e),children:o(e,t)}):(0,c.jsx)(l,{type:`tertiary`,children:`—`})}var C={running:`green`,stopped:`grey`,error:`red`},w={queued:`amber`,sent:`blue`,running:`blue`,success:`green`,failed:`red`,cancelled:`grey`},T={active:`green`,sleeping:`amber`,dead:`grey`,killed:`red`},E={info:`blue`,warn:`amber`,critical:`red`};export{d as a,T as c,m as d,p as f,y as g,x as h,C as i,_ as l,S as m,E as n,u as o,b as p,h as r,f as s,g as t,w as u};
import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{I as t,P as n,U as r}from"./semi-BX8ib3Fq.js";import{E as i,P as a,k as o}from"./index-CiI19B2v.js";import"./c2-shared-CU1DgJgC.js";import{t as s}from"./react-QV7DAAIx.js";var c=e(s(),1),{Text:l}=r,u=[{value:`http_beacon`,label:`HTTP Beacon`},{value:`https_beacon`,label:`HTTPS Beacon`},{value:`tcp_reverse`,label:`TCP 反向`},{value:`websocket`,label:`WebSocket`}],d={running:`运行中`,stopped:`已停止`,error:`异常`},f={tcp_reverse:[{value:`bash`,label:`Bash (/dev/tcp)`},{value:`nc`,label:`Netcat (-e)`},{value:`nc_mkfifo`,label:`Netcat (mkfifo)`},{value:`python`,label:`Python`},{value:`perl`,label:`Perl`},{value:`powershell`,label:`PowerShell`}],http_beacon:[{value:`curl_beacon`,label:`Curl Beacon (HTTP)`}],https_beacon:[{value:`curl_beacon`,label:`Curl Beacon (HTTP)`}],websocket:[{value:`curl_beacon`,label:`Curl Beacon (HTTP)`}]},p=[{value:`shell`,label:`shell`},{value:`exec`,label:`exec`},{value:`ls`,label:`ls`},{value:`pwd`,label:`pwd`},{value:`cd`,label:`cd`},{value:`ps`,label:`ps`},{value:`kill_proc`,label:`kill_proc`},{value:`download`,label:`download`},{value:`upload`,label:`upload`},{value:`screenshot`,label:`screenshot`},{value:`sleep`,label:`sleep`},{value:`exit`,label:`exit`},{value:`self_delete`,label:`self_delete`},{value:`port_fwd`,label:`port_fwd`},{value:`socks_start`,label:`socks_start`},{value:`socks_stop`,label:`socks_stop`},{value:`load_assembly`,label:`load_assembly`},{value:`persist`,label:`persist`}],m=[{value:`queued`,label:`队列中`},{value:`sent`,label:`已发送`},{value:`running`,label:`执行中`},{value:`success`,label:`成功`},{value:`failed`,label:`失败`},{value:`cancelled`,label:`已取消`}],h=[{value:`info`,label:`信息`},{value:`warn`,label:`警告`},{value:`critical`,label:`严重`}],g=[{value:`listener`,label:`监听器`},{value:`session`,label:`会话`},{value:`task`,label:`任务`},{value:`payload`,label:`Payload`},{value:`opsec`,label:`OPSEC`}],_=[{value:`active`,label:`活跃`},{value:`sleeping`,label:`休眠`},{value:`dead`,label:`离线`},{value:`killed`,label:`已终止`}],v=[{value:`15m`,label:`最近15分钟`,ms:9e5},{value:`1h`,label:`最近1小时`,ms:36e5},{value:`24h`,label:`最近24小时`,ms:864e5},{value:`7d`,label:`最近7天`,ms:6048e5},{value:`all`,label:`全部`,ms:0}];function y(e){let t=v.find(t=>t.value===e);return!t||!t.ms?``:new Date(Date.now()-t.ms).toISOString()}function b({value:e,onChange:r,ns:i=`tasks`}){let o=a();return(0,c.jsxs)(n,{spacing:6,wrap:!0,className:`c2-time-presets`,children:[(0,c.jsx)(l,{type:`tertiary`,size:`small`,children:o(`c2.tasks.timePresets`,null,`快捷`)}),v.map(n=>(0,c.jsx)(t,{size:`small`,theme:n.value===e?`solid`:`borderless`,type:n.value===e?`primary`:`tertiary`,onClick:()=>r(n.value),children:o(`c2.${i}.preset${n.value===`all`?`All`:n.value}`,null,n.label)},n.value))]})}function x(e){let t=Number(e);return!Number.isFinite(t)||t<=0?`—`:t<1e3?`${Math.round(t)}ms`:t<6e4?`${(t/1e3).toFixed(1)}秒`:`${Math.round(t/6e4)}分钟`}function S({value:e}){let t=a();return e?(0,c.jsx)(`span`,{className:`c2-time-text`,title:i(e),children:o(e,t)}):(0,c.jsx)(l,{type:`tertiary`,children:`—`})}var C={running:`green`,stopped:`grey`,error:`red`},w={queued:`amber`,sent:`blue`,running:`blue`,success:`green`,failed:`red`,cancelled:`grey`},T={active:`green`,sleeping:`amber`,dead:`grey`,killed:`red`},E={info:`blue`,warn:`amber`,critical:`red`};export{d as a,T as c,m as d,p as f,y as g,x as h,C as i,_ as l,S as m,E as n,u as o,b as p,h as r,f as s,g as t,w as u};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{S as t,t as n}from"./react-QV7DAAIx.js";import{I as r,P as i,U as a,V as o,it as s,j as c,rt as l,xt as u}from"./semi-DNxeCrHm.js";import{E as d,F as f,I as p,P as m,a as h,c as g,d as _,l as v,m as y,p as b,s as x,u as S,x as C,y as w}from"./index-BVurtcsj.js";var T=e(t(),1),E=e(n(),1),{Text:D}=a;function O(){let e=m(),{hasPermission:t}=f(),n=t(`knowledge:delete`),[a,O]=(0,T.useState)(``),[k,A]=(0,T.useState)(50),[j,M]=(0,T.useState)(null),N=h(()=>p.get(`/knowledge/retrieval-logs`,{conversationId:a||void 0,limit:k}),[a,k]),P=Array.isArray(N.data?.logs)?N.data.logs:[],F=e=>w({title:`删除该检索日志?`,content:e.query||e.id,onOk:async()=>{await p.del(`/knowledge/retrieval-logs/${encodeURIComponent(e.id)}`),C(`已删除`),N.reload()}});return(0,E.jsxs)(`div`,{children:[(0,E.jsx)(b,{title:e(`knowledge.retrievalLogsTitle`,null,`检索历史`),description:`记录智能体每次知识库检索的语句、命中项与会话,用于回溯回答依据。`,extra:(0,E.jsx)(r,{icon:(0,E.jsx)(s,{}),onClick:()=>N.reload(),loading:N.loading,children:`刷新`})}),(0,E.jsxs)(y,{title:`检索记录(${P.length})`,children:[(0,E.jsx)(v,{error:N.error,onRetry:()=>N.reload()}),(0,E.jsx)(x,{columns:[{title:`检索语句`,dataIndex:`query`,render:(e,t)=>(0,E.jsx)(`button`,{type:`button`,className:`link-button`,onClick:()=>M(t),style:{background:`none`,border:`none`,padding:0,cursor:`pointer`,textAlign:`left`,color:`var(--semi-color-primary)`},children:e||`—`})},{title:`风险类型`,dataIndex:`riskType`,width:140,render:e=>e?(0,E.jsx)(c,{size:`small`,children:e}):`—`},{title:`命中知识项`,dataIndex:`retrievedItems`,width:120,render:e=>(0,E.jsxs)(D,{type:`tertiary`,children:[Array.isArray(e)?e.length:0,` 条`]})},{title:`会话`,dataIndex:`conversationId`,width:200,render:e=>(0,E.jsx)(D,{type:`tertiary`,ellipsis:{showTooltip:!0},children:e||`—`})},{title:`时间`,dataIndex:`createdAt`,width:180,render:e=>d(e)},{title:`操作`,width:110,render:(e,t)=>(0,E.jsxs)(i,{children:[(0,E.jsx)(r,{size:`small`,theme:`borderless`,onClick:()=>M(t),children:`详情`}),n&&(0,E.jsx)(r,{size:`small`,theme:`borderless`,type:`danger`,icon:(0,E.jsx)(u,{}),onClick:()=>F(t)})]})}],dataSource:P,rowKey:`id`,loading:N.loading,pagination:!1,toolbar:(0,E.jsxs)(i,{children:[(0,E.jsx)(o,{prefix:(0,E.jsx)(l,{}),placeholder:`按会话 ID 过滤`,value:a,onChange:O,style:{width:260}}),(0,E.jsx)(o,{placeholder:`条数`,value:String(k),onChange:e=>A(Math.min(Math.max(Number(e)||50,1),500)),style:{width:100},suffix:(0,E.jsx)(D,{type:`tertiary`,children:`条`})})]})})]}),(0,E.jsx)(g,{title:`检索日志详情`,visible:!!j,onCancel:()=>M(null),width:560,children:j&&(0,E.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:12},children:[(0,E.jsx)(_,{items:[{label:`日志 ID`,value:j.id},{label:`检索语句`,value:j.query},{label:`风险类型`,value:j.riskType||`—`},{label:`会话 ID`,value:j.conversationId||`—`},{label:`消息 ID`,value:j.messageId||`—`},{label:`时间`,value:d(j.createdAt)}]}),(0,E.jsx)(S,{value:j.retrievedItems||[],title:`命中知识项`})]})})]})}export{O as default};
import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{S as t,t as n}from"./react-QV7DAAIx.js";import{I as r,P as i,St as a,U as o,V as s,it as c,j as l,rt as u}from"./semi-BX8ib3Fq.js";import{E as d,F as f,I as p,P as m,a as h,c as g,d as _,l as v,m as y,p as b,s as x,u as S,x as C,y as w}from"./index-CiI19B2v.js";var T=e(t(),1),E=e(n(),1),{Text:D}=o;function O(){let e=m(),{hasPermission:t}=f(),n=t(`knowledge:delete`),[o,O]=(0,T.useState)(``),[k,A]=(0,T.useState)(50),[j,M]=(0,T.useState)(null),N=h(()=>p.get(`/knowledge/retrieval-logs`,{conversationId:o||void 0,limit:k}),[o,k]),P=Array.isArray(N.data?.logs)?N.data.logs:[],F=e=>w({title:`删除该检索日志?`,content:e.query||e.id,onOk:async()=>{await p.del(`/knowledge/retrieval-logs/${encodeURIComponent(e.id)}`),C(`已删除`),N.reload()}});return(0,E.jsxs)(`div`,{children:[(0,E.jsx)(b,{title:e(`knowledge.retrievalLogsTitle`,null,`检索历史`),description:`记录智能体每次知识库检索的语句、命中项与会话,用于回溯回答依据。`,extra:(0,E.jsx)(r,{icon:(0,E.jsx)(c,{}),onClick:()=>N.reload(),loading:N.loading,children:`刷新`})}),(0,E.jsxs)(y,{title:`检索记录(${P.length})`,children:[(0,E.jsx)(v,{error:N.error,onRetry:()=>N.reload()}),(0,E.jsx)(x,{columns:[{title:`检索语句`,dataIndex:`query`,render:(e,t)=>(0,E.jsx)(`button`,{type:`button`,className:`link-button`,onClick:()=>M(t),style:{background:`none`,border:`none`,padding:0,cursor:`pointer`,textAlign:`left`,color:`var(--semi-color-primary)`},children:e||`—`})},{title:`风险类型`,dataIndex:`riskType`,width:140,render:e=>e?(0,E.jsx)(l,{size:`small`,children:e}):`—`},{title:`命中知识项`,dataIndex:`retrievedItems`,width:120,render:e=>(0,E.jsxs)(D,{type:`tertiary`,children:[Array.isArray(e)?e.length:0,` 条`]})},{title:`会话`,dataIndex:`conversationId`,width:200,render:e=>(0,E.jsx)(D,{type:`tertiary`,ellipsis:{showTooltip:!0},children:e||`—`})},{title:`时间`,dataIndex:`createdAt`,width:180,render:e=>d(e)},{title:`操作`,width:110,render:(e,t)=>(0,E.jsxs)(i,{children:[(0,E.jsx)(r,{size:`small`,theme:`borderless`,onClick:()=>M(t),children:`详情`}),n&&(0,E.jsx)(r,{size:`small`,theme:`borderless`,type:`danger`,icon:(0,E.jsx)(a,{}),onClick:()=>F(t)})]})}],dataSource:P,rowKey:`id`,loading:N.loading,pagination:!1,toolbar:(0,E.jsxs)(i,{children:[(0,E.jsx)(s,{prefix:(0,E.jsx)(u,{}),placeholder:`按会话 ID 过滤`,value:o,onChange:O,style:{width:260}}),(0,E.jsx)(s,{placeholder:`条数`,value:String(k),onChange:e=>A(Math.min(Math.max(Number(e)||50,1),500)),style:{width:100},suffix:(0,E.jsx)(D,{type:`tertiary`,children:`条`})})]})})]}),(0,E.jsx)(g,{title:`检索日志详情`,visible:!!j,onCancel:()=>M(null),width:560,children:j&&(0,E.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:12},children:[(0,E.jsx)(_,{items:[{label:`日志 ID`,value:j.id},{label:`检索语句`,value:j.query},{label:`风险类型`,value:j.riskType||`—`},{label:`会话 ID`,value:j.conversationId||`—`},{label:`消息 ID`,value:j.messageId||`—`},{label:`时间`,value:d(j.createdAt)}]}),(0,E.jsx)(S,{value:j.retrievedItems||[],title:`命中知识项`})]})})]})}export{O as default};

View File

@ -1 +1 @@
import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{S as t,t as n}from"./react-QV7DAAIx.js";import{U as r,i}from"./semi-DNxeCrHm.js";import{I as a,P as o,c as s,l as c,x as l}from"./index-BVurtcsj.js";var u=e(t(),1),d=e(n(),1),{Text:f}=r,p=120,m=4e3;function h({visible:e,project:t,onCancel:n,onSaved:r}){let h=o(),g=(0,u.useId)(),[_,v]=(0,u.useState)(!1),[y,b]=(0,u.useState)(null),x=!!t?.id;return(0,u.useEffect)(()=>{b(null)},[e,t?.id]),(0,d.jsxs)(s,{visible:e,width:560,maskClosable:!1,onCancel:n,title:x?h(`projects.modalEditTitle`,null,`编辑项目`):h(`projects.modalNewTitle`,null,`新建项目`),formId:g,okText:x?h(`projects.saveChanges`,null,`保存修改`):h(`projects.createProject`,null,`创建项目`),confirmLoading:_,children:[(0,d.jsx)(f,{type:`tertiary`,size:`small`,children:x?h(`projects.modalEditSubtitle`,null,`修改项目名称与描述`):h(`projects.modalNewSubtitle`,null,`创建后可绑定对话,跨会话共享事实黑板`)}),(0,d.jsxs)(i,{id:g,onSubmit:async e=>{v(!0),b(null);try{let n={name:e.name.trim(),description:(e.description||``).slice(0,m)},i=x?await a.put(`/projects/${t.id}`,n):await a.post(`/projects`,n);l(x?h(`projects.saved`,null,`已保存`):h(`projects.createProject`,null,`创建项目`)),r?.(i)}catch(e){b(e)}finally{v(!1)}},initValues:{name:t?.name||``,description:t?.description||``},children:[(0,d.jsx)(i.Input,{field:`name`,maxLength:p,label:h(`projects.projectName`,null,`项目名称`),placeholder:h(`projects.projectNamePlaceholder`,null,`例如:某客户 Web 渗透`),rules:[{required:!0,whitespace:!0,message:h(`projects.enterProjectName`,null,`请输入项目名称`)}]}),(0,d.jsx)(i.TextArea,{field:`description`,rows:4,maxCount:m,label:h(`projects.projectDescription`,null,`项目描述`),placeholder:h(`projects.projectDescriptionPlaceholder`,null,`客户/任务备注、协作说明…`),extraText:h(`projects.descriptionLengthHint`,null,`仅供团队成员查阅,Agent 不会读取;需让 Agent 知晓的内容请写入事实黑板`)}),(0,d.jsx)(c,{error:y})]},`${e}-${t?.id||`new`}`)]})}export{h as t};
import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{S as t,t as n}from"./react-QV7DAAIx.js";import{U as r,i}from"./semi-BX8ib3Fq.js";import{I as a,P as o,c as s,l as c,x as l}from"./index-CiI19B2v.js";var u=e(t(),1),d=e(n(),1),{Text:f}=r,p=120,m=4e3;function h({visible:e,project:t,onCancel:n,onSaved:r}){let h=o(),g=(0,u.useId)(),[_,v]=(0,u.useState)(!1),[y,b]=(0,u.useState)(null),x=!!t?.id;return(0,u.useEffect)(()=>{b(null)},[e,t?.id]),(0,d.jsxs)(s,{visible:e,width:560,maskClosable:!1,onCancel:n,title:x?h(`projects.modalEditTitle`,null,`编辑项目`):h(`projects.modalNewTitle`,null,`新建项目`),formId:g,okText:x?h(`projects.saveChanges`,null,`保存修改`):h(`projects.createProject`,null,`创建项目`),confirmLoading:_,children:[(0,d.jsx)(f,{type:`tertiary`,size:`small`,children:x?h(`projects.modalEditSubtitle`,null,`修改项目名称与描述`):h(`projects.modalNewSubtitle`,null,`创建后可绑定对话,跨会话共享事实黑板`)}),(0,d.jsxs)(i,{id:g,onSubmit:async e=>{v(!0),b(null);try{let n={name:e.name.trim(),description:(e.description||``).slice(0,m)},i=x?await a.put(`/projects/${t.id}`,n):await a.post(`/projects`,n);l(x?h(`projects.saved`,null,`已保存`):h(`projects.createProject`,null,`创建项目`)),r?.(i)}catch(e){b(e)}finally{v(!1)}},initValues:{name:t?.name||``,description:t?.description||``},children:[(0,d.jsx)(i.Input,{field:`name`,maxLength:p,label:h(`projects.projectName`,null,`项目名称`),placeholder:h(`projects.projectNamePlaceholder`,null,`例如:某客户 Web 渗透`),rules:[{required:!0,whitespace:!0,message:h(`projects.enterProjectName`,null,`请输入项目名称`)}]}),(0,d.jsx)(i.TextArea,{field:`description`,rows:4,maxCount:m,label:h(`projects.projectDescription`,null,`项目描述`),placeholder:h(`projects.projectDescriptionPlaceholder`,null,`客户/任务备注、协作说明…`),extraText:h(`projects.descriptionLengthHint`,null,`仅供团队成员查阅,Agent 不会读取;需让 Agent 知晓的内容请写入事实黑板`)}),(0,d.jsx)(c,{error:y})]},`${e}-${t?.id||`new`}`)]})}export{h as t};

View File

@ -1 +1 @@
import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{S as t,t as n}from"./react-QV7DAAIx.js";import{I as r,P as i,U as a,V as o,i as s,it as c,j as l,ot as u,rt as d,xt as f,yt as p}from"./semi-DNxeCrHm.js";import{F as m,I as h,P as g,a as _,b as v,c as y,l as b,m as x,p as S,s as C,x as w,y as T}from"./index-BVurtcsj.js";var E=e(t(),1),D=e(n(),1),{Text:O}=a;function k(){let e=g(),{hasPermission:t}=m(),n=t(`roles:write`),a=t(`roles:delete`),[k,A]=(0,E.useState)(``),[j,M]=(0,E.useState)(null),[N,P]=(0,E.useState)(!1),F=_(()=>h.get(`/roles`),[]),I=(Array.isArray(F.data?.roles)?F.data.roles:[]).filter(e=>{if(!k)return!0;let t=k.toLowerCase();return[e.name,e.description].some(e=>String(e||``).toLowerCase().includes(t))}),L=async()=>{let e=await j.form.validate();P(!0);try{let t={name:e.name.trim(),description:e.description?.trim()||``,user_prompt:e.user_prompt||``,tools:String(e.tools||``).split(`,`).map(e=>e.trim()).filter(Boolean),enabled:e.enabled!==!1},n=j.role?.name;n&&n!==t.name?(await h.post(`/roles`,t),await h.del(`/roles/${encodeURIComponent(n)}`)):n?await h.put(`/roles/${encodeURIComponent(n)}`,t):await h.post(`/roles`,t),w(`角色已保存`),M(null),F.reload()}catch(e){v(e,`保存角色失败`)}finally{P(!1)}},R=e=>T({title:`删除角色「${e.name}」?`,content:`已绑定该角色的对话将失去对应提示词与工具配置。`,onOk:async()=>{await h.del(`/roles/${encodeURIComponent(e.name)}`),w(`已删除`),F.reload()}});return(0,D.jsxs)(`div`,{children:[(0,D.jsx)(S,{title:e(`roles.title`,null,`角色管理`),description:`角色定义对话的系统提示词、可用工具与绑定工作流。`,extra:(0,D.jsxs)(i,{children:[(0,D.jsx)(r,{icon:(0,D.jsx)(c,{}),onClick:()=>F.reload(),loading:F.loading,children:`刷新`}),n&&(0,D.jsx)(r,{theme:`solid`,type:`primary`,icon:(0,D.jsx)(u,{}),onClick:()=>M({role:null,form:{}}),children:`新建角色`})]})}),(0,D.jsxs)(x,{title:`角色(${I.length})`,children:[(0,D.jsx)(b,{error:F.error,onRetry:()=>F.reload()}),(0,D.jsx)(C,{columns:[{title:`角色`,dataIndex:`name`,render:(e,t)=>(0,D.jsxs)(i,{vertical:!0,spacing:0,align:`start`,children:[(0,D.jsxs)(i,{children:[(0,D.jsx)(O,{strong:!0,children:e}),t.enabled===!1&&(0,D.jsx)(l,{size:`small`,color:`grey`,children:`已停用`})]}),(0,D.jsx)(O,{type:`tertiary`,ellipsis:{showTooltip:!0},style:{maxWidth:460},children:t.description||`—`})]})},{title:`工具`,dataIndex:`tools`,width:260,render:e=>Array.isArray(e)&&e.length?(0,D.jsxs)(i,{wrap:!0,spacing:4,children:[e.slice(0,4).map(e=>(0,D.jsx)(l,{size:`small`,children:e},e)),e.length>4&&(0,D.jsxs)(O,{type:`tertiary`,children:[`+`,e.length-4]})]}):(0,D.jsx)(O,{type:`tertiary`,children:`未绑定`})},{title:`工作流`,dataIndex:`workflow_id`,width:160,render:e=>e||`—`},{title:`操作`,width:150,render:(e,t)=>(0,D.jsxs)(i,{children:[n&&(0,D.jsx)(r,{size:`small`,theme:`borderless`,icon:(0,D.jsx)(p,{}),onClick:()=>M({role:t,form:{}}),children:`编辑`}),a&&(0,D.jsx)(r,{size:`small`,theme:`borderless`,type:`danger`,icon:(0,D.jsx)(f,{}),onClick:()=>R(t)})]})}],dataSource:I,rowKey:`name`,loading:F.loading,pagination:{pageSize:20},toolbar:(0,D.jsx)(o,{prefix:(0,D.jsx)(d,{}),value:k,onChange:A,placeholder:`搜索角色名称`,style:{width:260}})})]}),(0,D.jsx)(y,{title:j?.role?`编辑角色`:`新建角色`,visible:!!j,onCancel:()=>M(null),onOk:L,confirmLoading:N,width:760,children:(0,D.jsxs)(s,{getFormApi:e=>M(t=>t&&{...t,form:e}),initValues:j?.role?{name:j.role.name,description:j.role.description,user_prompt:j.role.user_prompt,tools:Array.isArray(j.role.tools)?j.role.tools.join(`, `):``,enabled:j.role.enabled!==!1}:{enabled:!0},children:[(0,D.jsx)(s.Input,{field:`name`,label:`角色名称`,rules:[{required:!0,message:`请输入角色名称`}]}),(0,D.jsx)(s.Input,{field:`description`,label:`描述`}),(0,D.jsx)(s.Input,{field:`tools`,label:`工具(逗号分隔)`,placeholder:`toolName, mcp::toolName`}),(0,D.jsx)(s.TextArea,{field:`user_prompt`,label:`用户提示词(追加到用户消息前)`,autosize:{minRows:6,maxRows:18}}),(0,D.jsx)(s.Slot,{label:`启用`,children:(0,D.jsx)(s.Switch,{field:`enabled`})})]})},j?.role?.name||`new-role`)]})}export{k as default};
import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{S as t,t as n}from"./react-QV7DAAIx.js";import{I as r,P as i,St as a,U as o,V as s,i as c,it as l,j as u,ot as d,rt as f,yt as p}from"./semi-BX8ib3Fq.js";import{F as m,I as h,P as g,a as _,b as v,c as y,l as b,m as x,p as S,s as C,x as w,y as T}from"./index-CiI19B2v.js";var E=e(t(),1),D=e(n(),1),{Text:O}=o;function k(){let e=g(),{hasPermission:t}=m(),n=t(`roles:write`),o=t(`roles:delete`),[k,A]=(0,E.useState)(``),[j,M]=(0,E.useState)(null),[N,P]=(0,E.useState)(!1),F=_(()=>h.get(`/roles`),[]),I=(Array.isArray(F.data?.roles)?F.data.roles:[]).filter(e=>{if(!k)return!0;let t=k.toLowerCase();return[e.name,e.description].some(e=>String(e||``).toLowerCase().includes(t))}),L=async()=>{let e=await j.form.validate();P(!0);try{let t={name:e.name.trim(),description:e.description?.trim()||``,user_prompt:e.user_prompt||``,tools:String(e.tools||``).split(`,`).map(e=>e.trim()).filter(Boolean),enabled:e.enabled!==!1},n=j.role?.name;n&&n!==t.name?(await h.post(`/roles`,t),await h.del(`/roles/${encodeURIComponent(n)}`)):n?await h.put(`/roles/${encodeURIComponent(n)}`,t):await h.post(`/roles`,t),w(`角色已保存`),M(null),F.reload()}catch(e){v(e,`保存角色失败`)}finally{P(!1)}},R=e=>T({title:`删除角色「${e.name}」?`,content:`已绑定该角色的对话将失去对应提示词与工具配置。`,onOk:async()=>{await h.del(`/roles/${encodeURIComponent(e.name)}`),w(`已删除`),F.reload()}});return(0,D.jsxs)(`div`,{children:[(0,D.jsx)(S,{title:e(`roles.title`,null,`角色管理`),description:`角色定义对话的系统提示词、可用工具与绑定工作流。`,extra:(0,D.jsxs)(i,{children:[(0,D.jsx)(r,{icon:(0,D.jsx)(l,{}),onClick:()=>F.reload(),loading:F.loading,children:`刷新`}),n&&(0,D.jsx)(r,{theme:`solid`,type:`primary`,icon:(0,D.jsx)(d,{}),onClick:()=>M({role:null,form:{}}),children:`新建角色`})]})}),(0,D.jsxs)(x,{title:`角色(${I.length})`,children:[(0,D.jsx)(b,{error:F.error,onRetry:()=>F.reload()}),(0,D.jsx)(C,{columns:[{title:`角色`,dataIndex:`name`,render:(e,t)=>(0,D.jsxs)(i,{vertical:!0,spacing:0,align:`start`,children:[(0,D.jsxs)(i,{children:[(0,D.jsx)(O,{strong:!0,children:e}),t.enabled===!1&&(0,D.jsx)(u,{size:`small`,color:`grey`,children:`已停用`})]}),(0,D.jsx)(O,{type:`tertiary`,ellipsis:{showTooltip:!0},style:{maxWidth:460},children:t.description||`—`})]})},{title:`工具`,dataIndex:`tools`,width:260,render:e=>Array.isArray(e)&&e.length?(0,D.jsxs)(i,{wrap:!0,spacing:4,children:[e.slice(0,4).map(e=>(0,D.jsx)(u,{size:`small`,children:e},e)),e.length>4&&(0,D.jsxs)(O,{type:`tertiary`,children:[`+`,e.length-4]})]}):(0,D.jsx)(O,{type:`tertiary`,children:`未绑定`})},{title:`工作流`,dataIndex:`workflow_id`,width:160,render:e=>e||`—`},{title:`操作`,width:150,render:(e,t)=>(0,D.jsxs)(i,{children:[n&&(0,D.jsx)(r,{size:`small`,theme:`borderless`,icon:(0,D.jsx)(p,{}),onClick:()=>M({role:t,form:{}}),children:`编辑`}),o&&(0,D.jsx)(r,{size:`small`,theme:`borderless`,type:`danger`,icon:(0,D.jsx)(a,{}),onClick:()=>R(t)})]})}],dataSource:I,rowKey:`name`,loading:F.loading,pagination:{pageSize:20},toolbar:(0,D.jsx)(s,{prefix:(0,D.jsx)(f,{}),value:k,onChange:A,placeholder:`搜索角色名称`,style:{width:260}})})]}),(0,D.jsx)(y,{title:j?.role?`编辑角色`:`新建角色`,visible:!!j,onCancel:()=>M(null),onOk:L,confirmLoading:N,width:760,children:(0,D.jsxs)(c,{getFormApi:e=>M(t=>t&&{...t,form:e}),initValues:j?.role?{name:j.role.name,description:j.role.description,user_prompt:j.role.user_prompt,tools:Array.isArray(j.role.tools)?j.role.tools.join(`, `):``,enabled:j.role.enabled!==!1}:{enabled:!0},children:[(0,D.jsx)(c.Input,{field:`name`,label:`角色名称`,rules:[{required:!0,message:`请输入角色名称`}]}),(0,D.jsx)(c.Input,{field:`description`,label:`描述`}),(0,D.jsx)(c.Input,{field:`tools`,label:`工具(逗号分隔)`,placeholder:`toolName, mcp::toolName`}),(0,D.jsx)(c.TextArea,{field:`user_prompt`,label:`用户提示词(追加到用户消息前)`,autosize:{minRows:6,maxRows:18}}),(0,D.jsx)(c.Slot,{label:`启用`,children:(0,D.jsx)(c.Switch,{field:`enabled`})})]})},j?.role?.name||`new-role`)]})}export{k as default};

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{I as t,P as n,U as r,it as i,xt as a}from"./semi-DNxeCrHm.js";import{D as o,F as s,I as c,O as l,P as u,_ as d,a as f,l as p,m,p as h,s as g,x as _,y as v}from"./index-BVurtcsj.js";import{t as y}from"./react-QV7DAAIx.js";var b=e(y(),1),{Text:x}=r;function S(){let e=u(),{hasPermission:r}=s(),y=r(`skills:delete`),S=f(()=>c.get(`/skills/stats`),[]),C=Array.isArray(S.data?.stats)?S.data.stats:[],w=Number(S.data?.total_calls||0),T=Number(S.data?.total_success||0),E=w>0?T/w:null,D=()=>v({title:`清空所有技能调用统计?`,content:`只影响统计计数,不删除技能文件。`,onOk:async()=>{await c.del(`/skills/stats`),_(`统计已清空`),S.reload()}}),O=e=>v({title:`清空「${e}」的统计?`,onOk:async()=>{await c.del(`/skills/${encodeURIComponent(e)}/stats`),_(`已清空`),S.reload()}});return(0,b.jsxs)(`div`,{children:[(0,b.jsx)(h,{title:e(`skills.monitorTitle`,null,`技能状态`),description:S.data?.skills_dir?`技能目录:${S.data.skills_dir}`:`统计技能被调用的次数、成功率与最近使用时间。`,extra:(0,b.jsxs)(n,{children:[(0,b.jsx)(t,{icon:(0,b.jsx)(i,{}),onClick:()=>S.reload(),loading:S.loading,children:`刷新`}),y&&(0,b.jsx)(t,{type:`danger`,theme:`light`,onClick:D,children:`清空全部统计`})]})}),(0,b.jsx)(d,{columns:4,metrics:[{id:`skills`,label:`技能总数`,value:o(S.data?.total_skills||0),loading:S.loading},{id:`calls`,label:`调用总数`,value:o(w),loading:S.loading},{id:`success`,label:`成功次数`,value:o(T),loading:S.loading},{id:`rate`,label:`成功率`,value:E===null?`—`:l(E),tone:E!==null&&E<.8?`warning`:`success`,loading:S.loading}]}),(0,b.jsxs)(m,{title:`按技能统计`,children:[(0,b.jsx)(p,{error:S.error,onRetry:()=>S.reload()}),(0,b.jsx)(g,{columns:[{title:`技能`,dataIndex:`skill_name`,render:e=>(0,b.jsx)(x,{strong:!0,children:e})},{title:`调用次数`,dataIndex:`total_calls`,width:120,render:e=>o(e||0)},{title:`成功`,dataIndex:`success_calls`,width:100,render:e=>o(e||0)},{title:`失败`,dataIndex:`failed_calls`,width:100,render:e=>Number(e)>0?(0,b.jsx)(x,{type:`danger`,children:o(e)}):`0`},{title:`最后调用`,dataIndex:`last_call_time`,width:180,render:e=>e||`—`},{title:`操作`,width:110,render:(e,n)=>y&&Number(n.total_calls)>0?(0,b.jsx)(t,{size:`small`,theme:`borderless`,type:`danger`,icon:(0,b.jsx)(a,{}),onClick:()=>O(n.skill_name),children:`清空`}):null}],dataSource:C,rowKey:`skill_name`,loading:S.loading,pagination:{pageSize:20}})]})]})}export{S as default};
import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{I as t,P as n,St as r,U as i,it as a}from"./semi-BX8ib3Fq.js";import{D as o,F as s,I as c,O as l,P as u,_ as d,a as f,l as p,m,p as h,s as g,x as _,y as v}from"./index-CiI19B2v.js";import{t as y}from"./react-QV7DAAIx.js";var b=e(y(),1),{Text:x}=i;function S(){let e=u(),{hasPermission:i}=s(),y=i(`skills:delete`),S=f(()=>c.get(`/skills/stats`),[]),C=Array.isArray(S.data?.stats)?S.data.stats:[],w=Number(S.data?.total_calls||0),T=Number(S.data?.total_success||0),E=w>0?T/w:null,D=()=>v({title:`清空所有技能调用统计?`,content:`只影响统计计数,不删除技能文件。`,onOk:async()=>{await c.del(`/skills/stats`),_(`统计已清空`),S.reload()}}),O=e=>v({title:`清空「${e}」的统计?`,onOk:async()=>{await c.del(`/skills/${encodeURIComponent(e)}/stats`),_(`已清空`),S.reload()}});return(0,b.jsxs)(`div`,{children:[(0,b.jsx)(h,{title:e(`skills.monitorTitle`,null,`技能状态`),description:S.data?.skills_dir?`技能目录:${S.data.skills_dir}`:`统计技能被调用的次数、成功率与最近使用时间。`,extra:(0,b.jsxs)(n,{children:[(0,b.jsx)(t,{icon:(0,b.jsx)(a,{}),onClick:()=>S.reload(),loading:S.loading,children:`刷新`}),y&&(0,b.jsx)(t,{type:`danger`,theme:`light`,onClick:D,children:`清空全部统计`})]})}),(0,b.jsx)(d,{columns:4,metrics:[{id:`skills`,label:`技能总数`,value:o(S.data?.total_skills||0),loading:S.loading},{id:`calls`,label:`调用总数`,value:o(w),loading:S.loading},{id:`success`,label:`成功次数`,value:o(T),loading:S.loading},{id:`rate`,label:`成功率`,value:E===null?`—`:l(E),tone:E!==null&&E<.8?`warning`:`success`,loading:S.loading}]}),(0,b.jsxs)(m,{title:`按技能统计`,children:[(0,b.jsx)(p,{error:S.error,onRetry:()=>S.reload()}),(0,b.jsx)(g,{columns:[{title:`技能`,dataIndex:`skill_name`,render:e=>(0,b.jsx)(x,{strong:!0,children:e})},{title:`调用次数`,dataIndex:`total_calls`,width:120,render:e=>o(e||0)},{title:`成功`,dataIndex:`success_calls`,width:100,render:e=>o(e||0)},{title:`失败`,dataIndex:`failed_calls`,width:100,render:e=>Number(e)>0?(0,b.jsx)(x,{type:`danger`,children:o(e)}):`0`},{title:`最后调用`,dataIndex:`last_call_time`,width:180,render:e=>e||`—`},{title:`操作`,width:110,render:(e,n)=>y&&Number(n.total_calls)>0?(0,b.jsx)(t,{size:`small`,theme:`borderless`,type:`danger`,icon:(0,b.jsx)(r,{}),onClick:()=>O(n.skill_name),children:`清空`}):null}],dataSource:C,rowKey:`skill_name`,loading:S.loading,pagination:{pageSize:20}})]})]})}export{S as default};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -18,10 +18,10 @@
} catch (error) { /* first paint fallback */ }
})();
</script>
<script type="module" crossorigin src="/static/app/assets/index-BVurtcsj.js"></script>
<script type="module" crossorigin src="/static/app/assets/index-CiI19B2v.js"></script>
<link rel="modulepreload" crossorigin href="/static/app/assets/rolldown-runtime-WkwZ5CU-.js">
<link rel="modulepreload" crossorigin href="/static/app/assets/react-QV7DAAIx.js">
<link rel="modulepreload" crossorigin href="/static/app/assets/semi-DNxeCrHm.js">
<link rel="modulepreload" crossorigin href="/static/app/assets/semi-BX8ib3Fq.js">
<link rel="stylesheet" crossorigin href="/static/app/assets/semi-BUXPdXzR.css">
<link rel="stylesheet" crossorigin href="/static/app/assets/index-bMuhvPYI.css">
</head>

View File

@ -798,6 +798,8 @@
"sortByCreatedAt": "وقت الإنشاء",
"sortByUpdatedAt": "وقت التحديث",
"batchManage": "إدارة مجمّعة",
"selectPage": "تحديد الكل في هذه الصفحة",
"projectChangeFailed": "تعذّر تحديث مشروع المحادثة",
"paginationShow": "عرض {{start}}-{{end}} من {{total}}",
"paginationRange": "{{start}}-{{end}}/{{total}}",
"paginationTotal": "{{total}} إجمالاً",

View File

@ -799,6 +799,8 @@
"sortByCreatedAt": "Created time",
"sortByUpdatedAt": "Updated time",
"batchManage": "Batch manage",
"selectPage": "Select all on this page",
"projectChangeFailed": "Failed to update the conversation project",
"paginationShow": "Show {{start}}-{{end}} of {{total}}",
"paginationRange": "{{start}}-{{end}}/{{total}}",
"paginationTotal": "{{total}} total",

View File

@ -811,6 +811,8 @@
"sortByCreatedAt": "Время создания",
"sortByUpdatedAt": "Время изменения",
"batchManage": "Массовые действия",
"selectPage": "Выбрать все на странице",
"projectChangeFailed": "Не удалось изменить проект диалога",
"paginationShow": "Показано {{start}}-{{end}} из {{total}}",
"paginationRange": "{{start}}-{{end}}/{{total}}",
"paginationTotal": "Всего {{total}}",

View File

@ -787,6 +787,8 @@
"sortByCreatedAt": "创建时间",
"sortByUpdatedAt": "更新时间",
"batchManage": "批量管理",
"selectPage": "全选本页",
"projectChangeFailed": "更新对话所属项目失败",
"paginationShow": "显示 {{start}}-{{end}} / 共 {{total}}",
"paginationRange": "{{start}}-{{end}}/{{total}}",
"paginationTotal": "共 {{total}} 条",