fix(frontend): use custom names for model channels
This commit is contained in:
parent
19142ba837
commit
f7cdf588ae
|
|
@ -0,0 +1,20 @@
|
|||
export function modelChannelName(id, channel) {
|
||||
return channel?.name?.trim() || id;
|
||||
}
|
||||
|
||||
export function modelChannelOptions(channels) {
|
||||
const options = channels.map(([value, channel]) => ({ value, name: modelChannelName(value, channel) }));
|
||||
const counts = new Map();
|
||||
for (const { name } of options) {
|
||||
counts.set(name, (counts.get(name) || 0) + 1);
|
||||
}
|
||||
return options.map(({ value, name }) => ({
|
||||
value,
|
||||
name,
|
||||
label: counts.get(name) > 1 ? `${name} · ID ${value}` : name
|
||||
}));
|
||||
}
|
||||
|
||||
export function selectedModelChannelName(option) {
|
||||
return option.name || option.label;
|
||||
}
|
||||
|
|
@ -4,6 +4,7 @@ import { useResource } from '../../components/hooks';
|
|||
import { ErrorBanner, toastError } from '../../components/ui';
|
||||
import { api } from '../../lib/http';
|
||||
import { useT } from '../../lib/i18n';
|
||||
import { modelChannelName, modelChannelOptions, selectedModelChannelName } from '../../lib/model-channel';
|
||||
import { REASONING_EFFORTS, REASONING_MODES } from './useModelPreferences';
|
||||
|
||||
const { Text } = Typography;
|
||||
|
|
@ -49,15 +50,12 @@ export default function ChatSettings({
|
|||
: approvalActive
|
||||
? t('chat.hitlUseHumanFirstMessage', null, '首条消息改用人工审批')
|
||||
: t('chat.hitlEnableFirstMessage', null, '为首条消息开启人工审批');
|
||||
const defaultChannel = model.config.data?.default_channel;
|
||||
const defaultModel = model.channels.find(([id]) => id === defaultChannel)?.[1]?.model;
|
||||
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: defaultModel ? `${defaultLabel} · ${defaultModel}` : defaultLabel },
|
||||
...model.channels.map(([id, config]) => ({
|
||||
value: id,
|
||||
label: [config?.name || id, config?.model].filter(Boolean).join(' · ')
|
||||
}))
|
||||
{ value: '', label: defaultName ? `${defaultLabel} · ${defaultName}` : defaultLabel },
|
||||
...modelChannelOptions(model.channels)
|
||||
];
|
||||
const reasoningLabels = {
|
||||
default: t('chat.reasoningModeDefault', null, '跟随系统'),
|
||||
|
|
@ -105,6 +103,7 @@ export default function ChatSettings({
|
|||
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)}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import { useCallback, useEffect, useState } from 'react';
|
|||
import { Banner, Button, Form, Modal, Spin } from '@douyinfe/semi-ui';
|
||||
import { api } from '../../lib/http';
|
||||
import { useT } from '../../lib/i18n';
|
||||
import { modelChannelOptions, selectedModelChannelName } from '../../lib/model-channel';
|
||||
import { ErrorBanner, toastError, toastSuccess } from '../../components/ui';
|
||||
|
||||
const HITL_OPTIONS = [
|
||||
|
|
@ -57,10 +58,7 @@ export default function CreateAssessmentModal({ visible, onCancel, onCreated })
|
|||
}
|
||||
};
|
||||
|
||||
const models = (options?.models || []).map(item => ({
|
||||
value: item.id,
|
||||
label: [item.name || item.id, item.model].filter(Boolean).join(' · ')
|
||||
}));
|
||||
const models = modelChannelOptions((options?.models || []).map(item => [item.id, item]));
|
||||
const roles = (options?.roles || []).map(role => ({ value: role, label: role }));
|
||||
const projects = (options?.projects || []).map(project => ({ value: project.id, label: project.name || project.id }));
|
||||
|
||||
|
|
@ -121,6 +119,7 @@ export default function CreateAssessmentModal({ visible, onCancel, onCreated })
|
|||
field="model"
|
||||
label={t('deepAssessments.model', null, '模型渠道')}
|
||||
optionList={[{ value: '', label: '系统默认' }, ...models]}
|
||||
renderSelectedItem={selectedModelChannelName}
|
||||
style={{ width: '100%' }}
|
||||
/>
|
||||
<Form.Select
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import { IconRefresh, IconTick } from '@douyinfe/semi-icons';
|
|||
import { api, errorMessage } from '../../../lib/http';
|
||||
import { useAuth } from '../../../lib/auth';
|
||||
import { useT } from '../../../lib/i18n';
|
||||
import { modelChannelName } from '../../../lib/model-channel';
|
||||
import { useResource } from '../../../components/hooks';
|
||||
import {
|
||||
CopyButton, ErrorBanner, JsonViewer, KeyValueList, SectionCard, confirmAction, toastError, toastSuccess, toastWarning
|
||||
|
|
@ -78,14 +79,16 @@ export default function BasicSection() {
|
|||
const summary = useMemo(() => {
|
||||
const data = config.data;
|
||||
if (!data) return [];
|
||||
const channels = data.ai?.channels ? Object.keys(data.ai.channels) : [];
|
||||
const channels = data.ai?.channels || {};
|
||||
const channelNames = Object.entries(channels).map(([id, channel]) => modelChannelName(id, channel));
|
||||
const defaultId = data.ai?.default_channel;
|
||||
const tools = Array.isArray(data.tools) ? data.tools : [];
|
||||
const enabledTools = tools.filter(tool => tool.enabled).length;
|
||||
return [
|
||||
{ label: t('settings.defaultChannel', null, '默认 AI 通道'), value: data.ai?.default_channel || '—' },
|
||||
{ label: t('settings.defaultChannel', null, '默认 AI 通道'), value: defaultId ? modelChannelName(defaultId, channels[defaultId]) : '—' },
|
||||
{
|
||||
label: t('settingsBasic.aiChannelSavedList', null, '已保存通道'),
|
||||
value: `${formatNumber(channels.length)}${channels.length ? `(${channels.slice(0, 4).join('、')})` : ''}`
|
||||
value: `${formatNumber(channelNames.length)}${channelNames.length ? `(${channelNames.slice(0, 4).join('、')})` : ''}`
|
||||
},
|
||||
{
|
||||
label: t('settings.toolsEnabled', null, '已启用工具'),
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import { useId, useState } from 'react';
|
|||
import { Banner, Button, Input, Select, Space, Tag, Typography } from '@douyinfe/semi-ui';
|
||||
import { api } from '../../../lib/http';
|
||||
import { useT } from '../../../lib/i18n';
|
||||
import { modelChannelOptions, selectedModelChannelName } from '../../../lib/model-channel';
|
||||
import { ErrorBanner, KeyValueList, SectionCard, toastSuccess } from '../../../components/ui';
|
||||
import { Hint } from './common';
|
||||
|
||||
|
|
@ -194,15 +195,9 @@ export default function ProbePanel({ config, canWrite, reloadConfig }) {
|
|||
const [saveError, setSaveError] = useState(null);
|
||||
const [applyPending, setApplyPending] = useState(false);
|
||||
const locked = !canWrite || saving;
|
||||
const channelNames = channelIds.map(id => channels[id].name?.trim() || id);
|
||||
const channelOptions = legacy
|
||||
? [{ value: MAIN_CHANNEL, label: t('settingsProbe.mainChannel', null, '主模型通道') }]
|
||||
: channelIds.map((id, index) => {
|
||||
const name = channelNames[index];
|
||||
const displayName = channelNames.indexOf(name) !== channelNames.lastIndexOf(name) ? `${name} · ${id}` : name;
|
||||
const suffix = id === defaultId ? t('settingsProbe.defaultChannelSuffix', null, '(默认)') : '';
|
||||
return { value: id, label: displayName + suffix };
|
||||
});
|
||||
: modelChannelOptions(Object.entries(channels));
|
||||
const providerOptions = PROVIDERS.map(({ value, key, fallback }) => ({ value, label: t(key, null, fallback) }));
|
||||
if (!providerOptions.some(option => option.value === form.provider)) {
|
||||
providerOptions.push({ value: form.provider, label: form.provider });
|
||||
|
|
@ -390,17 +385,23 @@ export default function ProbePanel({ config, canWrite, reloadConfig }) {
|
|||
)}
|
||||
>
|
||||
<div className="settings-probe-form">
|
||||
<label className="settings-field">
|
||||
<Text id={channelLabelId} type="tertiary" size="small">{t('settings.checkChannel', null, '通道')}</Text>
|
||||
<div className="settings-field">
|
||||
<Space spacing={6}>
|
||||
<Text id={channelLabelId} type="tertiary" size="small">{t('settings.checkChannel', null, '通道')}</Text>
|
||||
{!legacy && channelId === defaultId && (
|
||||
<Tag color="blue" size="small">{t('settingsBasic.aiChannelDefaultBadge', null, '默认')}</Tag>
|
||||
)}
|
||||
</Space>
|
||||
<Select
|
||||
value={channelId}
|
||||
onChange={selectChannel}
|
||||
optionList={channelOptions}
|
||||
renderSelectedItem={selectedModelChannelName}
|
||||
aria-labelledby={channelLabelId}
|
||||
disabled={saving || !!busy}
|
||||
style={{ width: '100%' }}
|
||||
/>
|
||||
</label>
|
||||
</div>
|
||||
<label className="settings-field">
|
||||
<Text type="tertiary" size="small">{t('settingsBasic.apiProvider', null, 'API 提供商')}</Text>
|
||||
<Select
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ function modelConfig() {
|
|||
default_channel: 'primary',
|
||||
channels: {
|
||||
primary: { provider: 'openai', model: 'primary-model', base_url: 'https://primary.example.test', api_key: '********' },
|
||||
'qwen-max': { name: 'deepseek', provider: 'openai_compatible', model: 'deepseek-flash', base_url: 'https://secondary.example.test', api_key: '********' }
|
||||
'qwen-max': { provider: 'openai_compatible', model: 'deepseek-flash', base_url: 'https://secondary.example.test', api_key: '********' }
|
||||
}
|
||||
},
|
||||
tools: []
|
||||
|
|
@ -33,11 +33,13 @@ test.describe('model channel editing', () => {
|
|||
const channel = panel.getByRole('combobox', { name: '通道', exact: true });
|
||||
const save = panel.getByRole('button', { name: '保存通道', exact: true });
|
||||
await expect(model).toHaveValue('primary-model');
|
||||
await expect(channel).toHaveText('primary');
|
||||
await expect(save).toBeDisabled();
|
||||
await channel.click();
|
||||
await page.getByRole('option', { name: /\bdeepseek$/ }).click();
|
||||
await expect(channel).toHaveText('deepseek');
|
||||
await page.getByRole('option', { name: /\bqwen-max$/ }).click();
|
||||
await expect(channel).toHaveText('qwen-max');
|
||||
await expect(model).toHaveValue('deepseek-flash');
|
||||
await panel.getByLabel('通道名称', { exact: true }).fill('deepseek');
|
||||
await model.fill('manual-model');
|
||||
await panel.getByLabel('模型上下文窗口(Token)', { exact: true }).fill('65536');
|
||||
|
||||
|
|
@ -50,19 +52,24 @@ test.describe('model channel editing', () => {
|
|||
|
||||
await save.click();
|
||||
await expect(model).toHaveValue('manual-model');
|
||||
await expect(channel).toHaveText('deepseek');
|
||||
await expect(save).toBeDisabled();
|
||||
expect(mockApi.calls('PUT', '/api/config')[0].body).toEqual({
|
||||
ai_channel: { channel_id: 'qwen-max', make_default: false, model: 'manual-model', context_window: 65536 }
|
||||
ai_channel: { channel_id: 'qwen-max', make_default: false, name: 'deepseek', model: 'manual-model', context_window: 65536 }
|
||||
});
|
||||
expect(config.ai.default_channel).toBe('primary');
|
||||
expect(config.ai.channels.primary.model).toBe('primary-model');
|
||||
|
||||
await panel.getByRole('button', { name: '设为默认', exact: true }).click();
|
||||
await expect(channel).toHaveText('deepseek(默认)');
|
||||
await expect(panel.getByText('默认', { exact: true })).toBeVisible();
|
||||
await expect(channel).toHaveText('deepseek');
|
||||
expect(mockApi.calls('POST', '/api/config/apply')).toHaveLength(2);
|
||||
await page.reload();
|
||||
await expect(model).toHaveValue('manual-model');
|
||||
await expect(channel).toHaveText('deepseek');
|
||||
await expect(panel.getByLabel('模型上下文窗口(Token)', { exact: true })).toHaveValue('65536');
|
||||
await page.getByRole('tab', { name: '基本设置' }).click();
|
||||
await expect(page.getByRole('cell', { name: /默认 AI 通道.*deepseek/ })).toBeVisible();
|
||||
});
|
||||
|
||||
test('save errors retain the draft and apply errors allow retrying the saved change', async ({ page, mockApi }) => {
|
||||
|
|
@ -107,3 +114,18 @@ test('model configuration remains readable with view permission', async ({ page,
|
|||
await expect(panel.getByRole('button', { name: '保存通道' })).toHaveCount(0);
|
||||
expect(mockApi.writes()).toEqual([]);
|
||||
});
|
||||
|
||||
test('model channels with the same name can be selected by their IDs in the menu', async ({ page, mockApi }) => {
|
||||
const config = modelConfig();
|
||||
config.ai.channels.primary.name = 'deepseek';
|
||||
config.ai.channels['qwen-max'].name = 'deepseek';
|
||||
mockApi.respond('GET', '/api/config', { json: config });
|
||||
await page.goto('/static/app/#/settings?section=models');
|
||||
const panel = (await ready(page)).locator('.settings-channel-panel');
|
||||
const channel = panel.getByRole('combobox', { name: '通道', exact: true });
|
||||
await channel.click();
|
||||
await expect(page.getByRole('option', { selected: true })).toHaveText('deepseek · ID primary');
|
||||
await page.getByRole('option', { name: /deepseek · ID qwen-max$/ }).click();
|
||||
await expect(channel).toHaveText('deepseek');
|
||||
await expect(panel.locator('.settings-probe-form').getByLabel('模型', { exact: true })).toHaveValue('deepseek-flash');
|
||||
});
|
||||
|
|
|
|||
|
|
@ -62,11 +62,11 @@ test.describe('chat composer settings', () => {
|
|||
const channel = settings.getByRole('combobox', { name: label('chat.aiChannelLabel') });
|
||||
const mode = settings.getByRole('combobox', { name: label('chat.reasoningModeLabel') });
|
||||
const effort = settings.getByRole('combobox', { name: label('chat.reasoningEffortLabel') });
|
||||
await expect(channel).toContainText('示例通道 B · fixture-b');
|
||||
await expect(channel).toHaveText('示例通道 B');
|
||||
await expect(effort).toContainText('low');
|
||||
await channel.click();
|
||||
await expect(page.getByRole('option', { name: `${label('chat.aiChannelDefault')} · fixture-a` })).toBeVisible();
|
||||
await page.getByRole('option', { name: '示例通道 A · fixture-a' }).click();
|
||||
await expect(page.getByRole('option', { name: `${label('chat.aiChannelDefault')} · 示例通道 A` })).toBeVisible();
|
||||
await page.getByRole('listbox').getByText('示例通道 A', { exact: true }).click();
|
||||
await mode.click();
|
||||
await page.getByRole('listbox').getByText(label('chat.reasoningModeOff'), { exact: true }).click();
|
||||
await expect(effort).toBeDisabled();
|
||||
|
|
@ -79,7 +79,7 @@ test.describe('chat composer settings', () => {
|
|||
await page.reload();
|
||||
await ready(page);
|
||||
await openSettings.click();
|
||||
await expect(channel).toContainText('示例通道 A · fixture-a');
|
||||
await expect(channel).toHaveText('示例通道 A');
|
||||
await expect(effort).toContainText('medium');
|
||||
await settings.getByRole('button', { name: label('chat.hitlEnableFirstMessage') }).click();
|
||||
await expect(settings.getByText(label('chat.hitlFirstMessageEnabled'))).toBeVisible();
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{S as t,t as n}from"./react-QV7DAAIx.js";import{C as r,I as i,P as a,U as o,V as s,i as c,it as l,j as u,ot as d,rt as f,xt as p,yt as m}from"./semi-DNxeCrHm.js";import{F as h,I as g,P as _,a as v,b as y,c as b,d as x,f as S,l as C,m as w,p as T,s as E,u as D,x as O,y as k}from"./index-Bp0yS_jU.js";var A=e(t(),1),j=e(n(),1),{Text:M}=o;function N(){let e=_(),{hasPermission:t}=h(),n=t(`agents:write`),o=t(`agents:delete`),[N,P]=(0,A.useState)(``),[F,I]=(0,A.useState)(null),[L,R]=(0,A.useState)(null),[z,B]=(0,A.useState)(!1),V=v(()=>g.get(`/multi-agent/markdown-agents`),[]),H=(Array.isArray(V.data?.agents)?V.data.agents:[]).filter(e=>{if(!N)return!0;let t=N.toLowerCase();return[e.name,e.id,e.filename,e.description].some(e=>String(e||``).toLowerCase().includes(t))}),U=async e=>{try{I(await g.get(`/multi-agent/markdown-agents/${encodeURIComponent(e.filename)}`))}catch(e){y(e,`读取智能体失败`)}},W=async()=>{let e=await L.form.validate();B(!0);try{await g.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)}),O(`智能体已保存`),R(null),V.reload()}catch(e){y(e,`保存智能体失败`)}finally{B(!1)}},G=e=>k({title:`删除智能体「${e.name||e.filename}」?`,onOk:async()=>{await g.del(`/multi-agent/markdown-agents/${encodeURIComponent(e.filename)}`),O(`已删除`),V.reload()}});return(0,j.jsxs)(`div`,{children:[(0,j.jsx)(T,{title:e(`agents.title`,null,`智能体管理`),description:V.data?.dir?`目录:${V.data.dir}`:`以 Markdown 文件定义的子智能体与编排器。`,extra:(0,j.jsxs)(a,{children:[(0,j.jsx)(i,{icon:(0,j.jsx)(l,{}),onClick:()=>V.reload(),loading:V.loading,children:`刷新`}),n&&(0,j.jsx)(i,{theme:`solid`,type:`primary`,icon:(0,j.jsx)(d,{}),onClick:()=>R({record:null,form:{}}),children:`新建智能体`})]})}),V.data?.error&&(0,j.jsx)(C,{error:V.data.error}),(0,j.jsxs)(w,{title:`智能体(${H.length})`,children:[(0,j.jsx)(C,{error:V.error,onRetry:()=>V.reload()}),(0,j.jsx)(E,{columns:[{title:`智能体`,dataIndex:`name`,render:(e,t)=>(0,j.jsxs)(a,{vertical:!0,spacing:0,align:`start`,children:[(0,j.jsxs)(a,{children:[(0,j.jsx)(M,{strong:!0,children:e||t.id}),t.is_orchestrator&&(0,j.jsx)(u,{size:`small`,color:`purple`,children:`编排器`})]}),(0,j.jsx)(M,{type:`tertiary`,children:t.filename})]})},{title:`类型`,dataIndex:`kind`,width:110,render:e=>(0,j.jsx)(u,{size:`small`,children:e||`sub`})},{title:`描述`,dataIndex:`description`,render:e=>(0,j.jsx)(M,{type:`tertiary`,ellipsis:{showTooltip:!0},style:{maxWidth:460},children:e||`—`})},{title:`操作`,width:180,render:(e,t)=>(0,j.jsxs)(a,{children:[(0,j.jsx)(i,{size:`small`,theme:`borderless`,onClick:()=>U(t),children:`详情`}),n&&(0,j.jsx)(i,{size:`small`,theme:`borderless`,icon:(0,j.jsx)(m,{}),onClick:()=>R({record:t,form:{}})}),o&&(0,j.jsx)(i,{size:`small`,theme:`borderless`,type:`danger`,icon:(0,j.jsx)(p,{}),onClick:()=>G(t)})]})}],dataSource:H,rowKey:`filename`,loading:V.loading,pagination:{pageSize:20},toolbar:(0,j.jsx)(s,{prefix:(0,j.jsx)(f,{}),value:N,onChange:P,placeholder:`搜索名称或文件名`,style:{width:280}})})]}),(0,j.jsx)(r,{title:L?.record?`编辑智能体`:`新建智能体`,visible:!!L,onCancel:()=>R(null),onOk:W,confirmLoading:z,width:760,children:(0,j.jsxs)(c,{getFormApi:e=>R(t=>t&&{...t,form:e}),initValues:L?.record?{filename:L.record.filename,name:L.record.name,description:L.record.description,kind:L.record.kind||`sub`}:{kind:`sub`},children:[(0,j.jsx)(c.Input,{field:`filename`,label:`文件名(留空自动生成)`,placeholder:`例如 recon.md`}),(0,j.jsx)(c.Input,{field:`name`,label:`名称`,rules:[{required:!0,message:`请输入名称`}]}),(0,j.jsx)(c.Input,{field:`description`,label:`描述`}),(0,j.jsx)(c.Select,{field:`kind`,label:`类型`,optionList:[{value:`sub`,label:`子智能体`},{value:`orchestrator`,label:`编排器`},{value:`plan_execute`,label:`计划执行`}]}),(0,j.jsx)(c.Input,{field:`tools`,label:`工具(逗号分隔)`,placeholder:`toolName, mcp::tool`}),(0,j.jsx)(c.TextArea,{field:`instruction`,label:`指令(Markdown)`,autosize:{minRows:8,maxRows:20}})]})},L?.record?.filename||`new-agent`),(0,j.jsx)(b,{title:F?.name||`智能体详情`,visible:!!F,onCancel:()=>I(null),width:720,children:F&&(0,j.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:12},children:[(0,j.jsx)(x,{items:[{label:`文件名`,value:F.filename},{label:`ID`,value:F.id},{label:`类型`,value:F.kind},{label:`绑定角色`,value:F.bind_role||`—`},{label:`最大迭代`,value:F.max_iterations??`—`},{label:`工具`,value:Array.isArray(F.tools)&&F.tools.length?F.tools.join(`、`):`—`}]}),(0,j.jsx)(S,{content:F.instruction||F.raw||``}),(0,j.jsx)(D,{value:F.raw||F,title:`原始 Markdown`,collapsed:!0})]})})]})}export{N as default};
|
||||
import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{S as t,t as n}from"./react-QV7DAAIx.js";import{C as r,I as i,P as a,U as o,V as s,i as c,it as l,j as u,ot as d,rt as f,xt as p,yt as m}from"./semi-DNxeCrHm.js";import{F as h,I as g,P as _,a as v,b as y,c as b,d as x,f as S,l as C,m as w,p as T,s as E,u as D,x as O,y as k}from"./index-BauQ8w_n.js";var A=e(t(),1),j=e(n(),1),{Text:M}=o;function N(){let e=_(),{hasPermission:t}=h(),n=t(`agents:write`),o=t(`agents:delete`),[N,P]=(0,A.useState)(``),[F,I]=(0,A.useState)(null),[L,R]=(0,A.useState)(null),[z,B]=(0,A.useState)(!1),V=v(()=>g.get(`/multi-agent/markdown-agents`),[]),H=(Array.isArray(V.data?.agents)?V.data.agents:[]).filter(e=>{if(!N)return!0;let t=N.toLowerCase();return[e.name,e.id,e.filename,e.description].some(e=>String(e||``).toLowerCase().includes(t))}),U=async e=>{try{I(await g.get(`/multi-agent/markdown-agents/${encodeURIComponent(e.filename)}`))}catch(e){y(e,`读取智能体失败`)}},W=async()=>{let e=await L.form.validate();B(!0);try{await g.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)}),O(`智能体已保存`),R(null),V.reload()}catch(e){y(e,`保存智能体失败`)}finally{B(!1)}},G=e=>k({title:`删除智能体「${e.name||e.filename}」?`,onOk:async()=>{await g.del(`/multi-agent/markdown-agents/${encodeURIComponent(e.filename)}`),O(`已删除`),V.reload()}});return(0,j.jsxs)(`div`,{children:[(0,j.jsx)(T,{title:e(`agents.title`,null,`智能体管理`),description:V.data?.dir?`目录:${V.data.dir}`:`以 Markdown 文件定义的子智能体与编排器。`,extra:(0,j.jsxs)(a,{children:[(0,j.jsx)(i,{icon:(0,j.jsx)(l,{}),onClick:()=>V.reload(),loading:V.loading,children:`刷新`}),n&&(0,j.jsx)(i,{theme:`solid`,type:`primary`,icon:(0,j.jsx)(d,{}),onClick:()=>R({record:null,form:{}}),children:`新建智能体`})]})}),V.data?.error&&(0,j.jsx)(C,{error:V.data.error}),(0,j.jsxs)(w,{title:`智能体(${H.length})`,children:[(0,j.jsx)(C,{error:V.error,onRetry:()=>V.reload()}),(0,j.jsx)(E,{columns:[{title:`智能体`,dataIndex:`name`,render:(e,t)=>(0,j.jsxs)(a,{vertical:!0,spacing:0,align:`start`,children:[(0,j.jsxs)(a,{children:[(0,j.jsx)(M,{strong:!0,children:e||t.id}),t.is_orchestrator&&(0,j.jsx)(u,{size:`small`,color:`purple`,children:`编排器`})]}),(0,j.jsx)(M,{type:`tertiary`,children:t.filename})]})},{title:`类型`,dataIndex:`kind`,width:110,render:e=>(0,j.jsx)(u,{size:`small`,children:e||`sub`})},{title:`描述`,dataIndex:`description`,render:e=>(0,j.jsx)(M,{type:`tertiary`,ellipsis:{showTooltip:!0},style:{maxWidth:460},children:e||`—`})},{title:`操作`,width:180,render:(e,t)=>(0,j.jsxs)(a,{children:[(0,j.jsx)(i,{size:`small`,theme:`borderless`,onClick:()=>U(t),children:`详情`}),n&&(0,j.jsx)(i,{size:`small`,theme:`borderless`,icon:(0,j.jsx)(m,{}),onClick:()=>R({record:t,form:{}})}),o&&(0,j.jsx)(i,{size:`small`,theme:`borderless`,type:`danger`,icon:(0,j.jsx)(p,{}),onClick:()=>G(t)})]})}],dataSource:H,rowKey:`filename`,loading:V.loading,pagination:{pageSize:20},toolbar:(0,j.jsx)(s,{prefix:(0,j.jsx)(f,{}),value:N,onChange:P,placeholder:`搜索名称或文件名`,style:{width:280}})})]}),(0,j.jsx)(r,{title:L?.record?`编辑智能体`:`新建智能体`,visible:!!L,onCancel:()=>R(null),onOk:W,confirmLoading:z,width:760,children:(0,j.jsxs)(c,{getFormApi:e=>R(t=>t&&{...t,form:e}),initValues:L?.record?{filename:L.record.filename,name:L.record.name,description:L.record.description,kind:L.record.kind||`sub`}:{kind:`sub`},children:[(0,j.jsx)(c.Input,{field:`filename`,label:`文件名(留空自动生成)`,placeholder:`例如 recon.md`}),(0,j.jsx)(c.Input,{field:`name`,label:`名称`,rules:[{required:!0,message:`请输入名称`}]}),(0,j.jsx)(c.Input,{field:`description`,label:`描述`}),(0,j.jsx)(c.Select,{field:`kind`,label:`类型`,optionList:[{value:`sub`,label:`子智能体`},{value:`orchestrator`,label:`编排器`},{value:`plan_execute`,label:`计划执行`}]}),(0,j.jsx)(c.Input,{field:`tools`,label:`工具(逗号分隔)`,placeholder:`toolName, mcp::tool`}),(0,j.jsx)(c.TextArea,{field:`instruction`,label:`指令(Markdown)`,autosize:{minRows:8,maxRows:20}})]})},L?.record?.filename||`new-agent`),(0,j.jsx)(b,{title:F?.name||`智能体详情`,visible:!!F,onCancel:()=>I(null),width:720,children:F&&(0,j.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:12},children:[(0,j.jsx)(x,{items:[{label:`文件名`,value:F.filename},{label:`ID`,value:F.id},{label:`类型`,value:F.kind},{label:`绑定角色`,value:F.bind_role||`—`},{label:`最大迭代`,value:F.max_iterations??`—`},{label:`工具`,value:Array.isArray(F.tools)&&F.tools.length?F.tools.join(`、`):`—`}]}),(0,j.jsx)(S,{content:F.instruction||F.raw||``}),(0,j.jsx)(D,{value:F.raw||F,title:`原始 Markdown`,collapsed:!0})]})})]})}export{N 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
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
|
|
@ -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-Bp0yS_jU.js";import"./c2-shared-Ij_8wvn-.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-DNxeCrHm.js";import{E as i,P as a,k as o}from"./index-BauQ8w_n.js";import"./c2-shared-ySfm4uFc.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};
|
||||
|
|
@ -1 +1 @@
|
|||
import{I as e,L as t}from"./index-Bp0yS_jU.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-BauQ8w_n.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};
|
||||
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
|
|
@ -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-Bp0yS_jU.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,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-BauQ8w_n.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};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1 @@
|
|||
function e(e,t){return t?.name?.trim()||e}function t(t){let n=t.map(([t,n])=>({value:t,name:e(t,n)})),r=new Map;for(let{name:e}of n)r.set(e,(r.get(e)||0)+1);return n.map(({value:e,name:t})=>({value:e,name:t,label:r.get(t)>1?`${t} · ID ${e}`:t}))}function n(e){return e.name||e.label}export{t as n,n as r,e as t};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
|||
import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{S as t,t as n}from"./react-QV7DAAIx.js";import{C as r,I as i,P as a,U as o,V as s,i as c,it as l,j as u,ot as d,rt as f,xt as p,yt as m}from"./semi-DNxeCrHm.js";import{F as h,I as g,P as _,a as v,b as y,l as b,m as x,p as S,s as C,x as w,y as T}from"./index-Bp0yS_jU.js";var E=e(t(),1),D=e(n(),1),{Text:O}=o;function k(){let e=_(),{hasPermission:t}=h(),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=v(()=>g.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 g.post(`/roles`,t),await g.del(`/roles/${encodeURIComponent(n)}`)):n?await g.put(`/roles/${encodeURIComponent(n)}`,t):await g.post(`/roles`,t),w(`角色已保存`),M(null),F.reload()}catch(e){y(e,`保存角色失败`)}finally{P(!1)}},R=e=>T({title:`删除角色「${e.name}」?`,content:`已绑定该角色的对话将失去对应提示词与工具配置。`,onOk:async()=>{await g.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)(a,{children:[(0,D.jsx)(i,{icon:(0,D.jsx)(l,{}),onClick:()=>F.reload(),loading:F.loading,children:`刷新`}),n&&(0,D.jsx)(i,{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)(a,{vertical:!0,spacing:0,align:`start`,children:[(0,D.jsxs)(a,{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)(a,{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)(a,{children:[n&&(0,D.jsx)(i,{size:`small`,theme:`borderless`,icon:(0,D.jsx)(m,{}),onClick:()=>M({role:t,form:{}}),children:`编辑`}),o&&(0,D.jsx)(i,{size:`small`,theme:`borderless`,type:`danger`,icon:(0,D.jsx)(p,{}),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)(r,{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};
|
||||
import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{S as t,t as n}from"./react-QV7DAAIx.js";import{C as r,I as i,P as a,U as o,V as s,i as c,it as l,j as u,ot as d,rt as f,xt as p,yt as m}from"./semi-DNxeCrHm.js";import{F as h,I as g,P as _,a as v,b as y,l as b,m as x,p as S,s as C,x as w,y as T}from"./index-BauQ8w_n.js";var E=e(t(),1),D=e(n(),1),{Text:O}=o;function k(){let e=_(),{hasPermission:t}=h(),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=v(()=>g.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 g.post(`/roles`,t),await g.del(`/roles/${encodeURIComponent(n)}`)):n?await g.put(`/roles/${encodeURIComponent(n)}`,t):await g.post(`/roles`,t),w(`角色已保存`),M(null),F.reload()}catch(e){y(e,`保存角色失败`)}finally{P(!1)}},R=e=>T({title:`删除角色「${e.name}」?`,content:`已绑定该角色的对话将失去对应提示词与工具配置。`,onOk:async()=>{await g.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)(a,{children:[(0,D.jsx)(i,{icon:(0,D.jsx)(l,{}),onClick:()=>F.reload(),loading:F.loading,children:`刷新`}),n&&(0,D.jsx)(i,{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)(a,{vertical:!0,spacing:0,align:`start`,children:[(0,D.jsxs)(a,{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)(a,{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)(a,{children:[n&&(0,D.jsx)(i,{size:`small`,theme:`borderless`,icon:(0,D.jsx)(m,{}),onClick:()=>M({role:t,form:{}}),children:`编辑`}),o&&(0,D.jsx)(i,{size:`small`,theme:`borderless`,type:`danger`,icon:(0,D.jsx)(p,{}),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)(r,{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
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -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-Bp0yS_jU.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,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-BauQ8w_n.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};
|
||||
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
|
|
@ -18,7 +18,7 @@
|
|||
} catch (error) { /* first paint fallback */ }
|
||||
})();
|
||||
</script>
|
||||
<script type="module" crossorigin src="/static/app/assets/index-Bp0yS_jU.js"></script>
|
||||
<script type="module" crossorigin src="/static/app/assets/index-BauQ8w_n.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">
|
||||
|
|
|
|||
|
|
@ -3137,7 +3137,6 @@
|
|||
"effectiveBudget": "Effective context token budget",
|
||||
"warnings": "Context notices",
|
||||
"unknownWarning": "Unrecognized context notice ({{code}})",
|
||||
"defaultChannelSuffix": " (default)",
|
||||
"compatible": "OpenAI-compatible API",
|
||||
"mainChannel": "Primary model channel",
|
||||
"visionHint": "Current vision model: {{model}}. An empty API key uses the primary model configuration.",
|
||||
|
|
|
|||
|
|
@ -3125,7 +3125,6 @@
|
|||
"effectiveBudget": "实际可用上下文令牌数",
|
||||
"warnings": "上下文提示",
|
||||
"unknownWarning": "收到未识别的上下文提示({{code}})",
|
||||
"defaultChannelSuffix": "(默认)",
|
||||
"compatible": "兼容 OpenAI 的接口",
|
||||
"mainChannel": "主模型通道",
|
||||
"visionHint": "当前视觉模型 {{model}},未填写密钥时使用主模型配置。",
|
||||
|
|
|
|||
Loading…
Reference in New Issue