Skip to content
Merged

Dev #1640

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
eea95c1
feat:webui支持更加优化的模型配置,优化多处UI体验,支持设置视觉和cache价格,修复多重表达不生效的问题,修复表情包路径错误
SengokuCola May 4, 2026
94a0cb3
fix:数字配置读取有问题的问题
SengokuCola May 4, 2026
bff0413
fix: 修复表情包替换时缺失description参数导致KeyError
Blueteemo May 4, 2026
4641fa1
fix:修复qq号为int的问题,修复部分多行配置问题,修复多语言prompt问题
SengokuCola May 4, 2026
caec568
feat:优化插件显示
SengokuCola May 4, 2026
e2ff2c8
fix:重复保存导致的加载慢问题
SengokuCola May 4, 2026
d90230c
Merge pull request #1635 from Blueteemo/fix/issue-1633-emoji-replace-…
SengokuCola May 4, 2026
a4afa58
fix:模型加载慢,错误热重载
SengokuCola May 4, 2026
4f8fc51
Merge branch 'dev' of https://github.com/Mai-with-u/MaiBot into dev
SengokuCola May 4, 2026
9e944f7
fix: accept blank tool call arguments
Maple127667 May 4, 2026
0d43d3e
feat:webui默认infoLog,移除display_message字段
SengokuCola May 5, 2026
41a2941
Merge pull request #1637 from Maple127667/codex/fix-empty-tool-arguments
SengokuCola May 5, 2026
a5e4ac8
pref:优化webui界面,增加prompt模板元信息
SengokuCola May 5, 2026
4242873
Merge branch 'dev' of https://github.com/Mai-with-u/MaiBot into dev
SengokuCola May 5, 2026
16de259
perf:优化webui配置展示,优化log显示,修复表达审核
SengokuCola May 5, 2026
ab21f97
更新Webui依赖
SengokuCola May 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ temp/
tmp/
mai_knowledge/
depends-data/
!depends-data/
!depends-data/char_frequency.json
9 changes: 7 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@

# 运行/调试/构建/测试/依赖
优先使用uv
依赖项以 pyproject.toml 为准

依赖项以 pyproject.toml 为准,要同步更新requirements.txt

# 语言规范
项目的首选语言为简体中文,无论是注释语言,日志展示语言,还是 WebUI 展示语言都首要以简体中文为首要实现目标
Expand All @@ -45,10 +44,16 @@
# 关于 A_memorix 修改
如果修改涉及 `src/A_memorix`,请先阅读 `src/A_memorix/MODIFICATION_POLICY.md`。

# prompt模板、
涉及对prompt模板的修改,要同步修改英文和日文的文件,对齐到中文

默认原则:
1. `src/A_memorix` 的实现层改动应优先遵守 `src/A_memorix/MODIFICATION_POLICY.md` 中的归属约束。
2. 不要提交无边界的 `ruff`、格式化、导入整理或大面积实现整理。
3. 本地实验目录或依赖其运行的测试,除非明确说明并确认,否则不要进入共享历史。

# maibot插件开发文档
https://github.com/Mai-with-u/maibot-plugin-sdk/blob/main/docs/guide.md

# 如何提交maibot插件
https://github.com/Mai-with-u/plugin-repo/blob/main/CONTRIBUTING.md
4 changes: 2 additions & 2 deletions dashboard/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dashboard/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "maibot-dashboard",
"private": true,
"version": "1.0.4",
"version": "1.0.5",
"type": "module",
"main": "./out/main/index.js",
"scripts": {
Expand Down
124 changes: 46 additions & 78 deletions dashboard/src/components/dynamic-form/DynamicConfigForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ function DynamicConfigSection({
basePath,
hooks,
level,
mergedChildren = [],
nestedSchema,
onChange,
sectionDescription,
Expand All @@ -87,11 +86,6 @@ function DynamicConfigSection({
basePath: string
hooks: FieldHookRegistry
level: number
mergedChildren?: Array<{
key: string
schema: ConfigSchema
values: Record<string, unknown>
}>
nestedSchema: ConfigSchema
onChange: (field: string, value: unknown) => void
sectionDescription?: string
Expand All @@ -100,9 +94,7 @@ function DynamicConfigSection({
values: Record<string, unknown>
}) {
const [advancedVisible, setAdvancedVisible] = React.useState(false)
const hasAdvanced =
hasTopLevelAdvancedFields(nestedSchema) ||
mergedChildren.some((child) => hasTopLevelAdvancedFields(child.schema))
const hasAdvanced = hasTopLevelAdvancedFields(nestedSchema)

return (
<Card>
Expand Down Expand Up @@ -135,37 +127,6 @@ function DynamicConfigSection({
level={level}
advancedVisible={hasAdvanced ? advancedVisible : undefined}
/>
{mergedChildren.map((child) => {
const childTitle = resolveSectionTitle(child.schema)
const childDescription = resolveSectionDescription(child.schema, childTitle)
const parentPath = basePath.includes('.')
? basePath.replace(/\.[^.]+$/, '')
: ''
const childPath = buildFieldPath(parentPath, child.key)

return (
<div key={child.key} className="mt-5 border-t border-border/50 pt-4">
<div className="mb-3 space-y-1">
<div className="flex items-center gap-2">
<SectionIcon iconName={child.schema.uiIcon} />
<h3 className="text-sm font-medium">{childTitle}</h3>
</div>
{childDescription && (
<p className="text-xs text-muted-foreground">{childDescription}</p>
)}
</div>
<DynamicConfigForm
schema={child.schema}
values={child.values}
onChange={(field, value) => onChange(`${child.key}.${field}`, value)}
basePath={childPath}
hooks={hooks}
level={level}
advancedVisible={hasAdvanced ? advancedVisible : undefined}
/>
</div>
)
})}
</CardContent>
</Card>
)
Expand Down Expand Up @@ -197,17 +158,6 @@ export const DynamicConfigForm: React.FC<DynamicConfigFormProps> = ({
() => new Map(schema.fields.map((field) => [field.name, field])),
[schema.fields],
)
const mergedChildKeys = React.useMemo(() => {
const keys = new Set<string>()
for (const nestedSchema of Object.values(schema.nested ?? {})) {
for (const childKey of nestedSchema.uiMergeChildren ?? []) {
if (schema.nested?.[childKey]) {
keys.add(childKey)
}
}
}
return keys
}, [schema.nested])

const renderField = (field: FieldSchema) => {
const fieldPath = buildFieldPath(basePath, field.name)
Expand All @@ -225,6 +175,7 @@ export const DynamicConfigForm: React.FC<DynamicConfigFormProps> = ({
value={values[field.name]}
onChange={(v) => onChange(field.name, v)}
schema={field}
parentValues={values}
/>
)
}
Expand All @@ -235,6 +186,7 @@ export const DynamicConfigForm: React.FC<DynamicConfigFormProps> = ({
value={values[field.name]}
onChange={(v) => onChange(field.name, v)}
schema={field}
parentValues={values}
>
<DynamicField
schema={field}
Expand Down Expand Up @@ -265,12 +217,50 @@ export const DynamicConfigForm: React.FC<DynamicConfigFormProps> = ({
? [...normalFields, ...advancedFields]
: normalFields

const groupFieldsByRow = (fields: FieldSchema[]) => {
const rows: FieldSchema[][] = []
let currentRow: FieldSchema[] = []
let currentRowKey: string | undefined

for (const field of fields) {
const rowKey = field['x-row']
if (rowKey && rowKey === currentRowKey) {
currentRow.push(field)
continue
}

if (currentRow.length > 0) {
rows.push(currentRow)
}

currentRow = [field]
currentRowKey = rowKey
}

if (currentRow.length > 0) {
rows.push(currentRow)
}

return rows
}

const renderFieldList = (fields: FieldSchema[]) => (
<>
{fields.map((field, index) => (
<React.Fragment key={field.name}>
{groupFieldsByRow(fields).map((row, index) => (
<React.Fragment key={row.map((field) => field.name).join('|')}>
{index > 0 && <Separator className="my-2 bg-border/50" />}
<div className="py-1">{renderField(field)}</div>
{row.length > 1 ? (
<div
className="grid gap-4 py-1 md:grid-cols-[repeat(var(--field-row-count),minmax(0,1fr))]"
style={{ '--field-row-count': row.length } as React.CSSProperties}
>
{row.map((field) => (
<div key={field.name}>{renderField(field)}</div>
))}
</div>
) : (
<div className="py-1">{renderField(row[0])}</div>
)}
</React.Fragment>
))}
</>
Expand All @@ -294,7 +284,6 @@ export const DynamicConfigForm: React.FC<DynamicConfigFormProps> = ({

{schema.nested &&
Object.entries(schema.nested)
.filter(([key]) => !mergedChildKeys.has(key))
.map(([key, nestedSchema]) => {
const nestedField = fieldMap.get(key)
const nestedFieldPath = buildFieldPath(basePath, key)
Expand All @@ -313,6 +302,7 @@ export const DynamicConfigForm: React.FC<DynamicConfigFormProps> = ({
onChange={(v) => onChange(key, v)}
schema={nestedField ?? nestedSchema}
nestedSchema={nestedSchema}
parentValues={values}
/>
</div>
)
Expand All @@ -326,6 +316,7 @@ export const DynamicConfigForm: React.FC<DynamicConfigFormProps> = ({
onChange={(v) => onChange(key, v)}
schema={nestedField ?? nestedSchema}
nestedSchema={nestedSchema}
parentValues={values}
>
<DynamicConfigForm
schema={nestedSchema}
Expand All @@ -342,34 +333,11 @@ export const DynamicConfigForm: React.FC<DynamicConfigFormProps> = ({

const sectionTitle = resolveSectionTitle(nestedSchema)
const sectionDescription = resolveSectionDescription(nestedSchema, sectionTitle)
const mergedChildren = (nestedSchema.uiMergeChildren ?? [])
.map((childKey) => {
const childSchema = schema.nested?.[childKey]
if (!childSchema) {
return null
}

return {
key: childKey,
schema: childSchema,
values: (values[childKey] as Record<string, unknown>) || {},
}
})
.filter(
(
child,
): child is {
key: string
schema: ConfigSchema
values: Record<string, unknown>
} => Boolean(child),
)

if (level === 0) {
return (
<DynamicConfigSection
key={key}
mergedChildren={mergedChildren}
nestedSchema={nestedSchema}
values={(values[key] as Record<string, unknown>) || {}}
onChange={onChange}
Expand Down
Loading
Loading