From da5aaba0f7aa62a0dfd7ac93709e864300ed0e04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=80=AA=E7=A8=8B=E4=BC=9F?= Date: Mon, 8 Jun 2026 13:53:26 +0800 Subject: [PATCH] feat(agents): open AGENTS.md editor in a modal, as a settings row, with section reordering Move the AGENTS.md section editing into a click-to-open modal so the Basic tab no longer expands the full document inline. Present the entry as a settings-style row (title + description on the left, a "manage" button on the right) instead of stacked label/hint/button. Add optional move-up/move-down controls to MemorySection (off by default, so MemoryBrowser is unaffected) and wire reordering in AgentGuideEditor: adjacent sections swap and the whole file is re-saved, with a synthetic preamble pinned to the top. --- mateclaw-ui/src/i18n/locales/en-US.ts | 3 + mateclaw-ui/src/i18n/locales/zh-CN.ts | 3 + mateclaw-ui/src/views/Agents.vue | 15 +- .../Agents/components/AgentGuideEditor.vue | 144 ++++++++++++++---- .../views/Memory/components/MemorySection.vue | 9 ++ 5 files changed, 139 insertions(+), 35 deletions(-) diff --git a/mateclaw-ui/src/i18n/locales/en-US.ts b/mateclaw-ui/src/i18n/locales/en-US.ts index 4850d7f6..01fe9161 100644 --- a/mateclaw-ui/src/i18n/locales/en-US.ts +++ b/mateclaw-ui/src/i18n/locales/en-US.ts @@ -1238,6 +1238,7 @@ export default { }, guide: { summary: 'Behavior Guide (AGENTS.md)', + open: 'Manage Behavior Guide', desc: "This is the employee's behavior handbook (AGENTS.md): when to write memories, what goes in each file, and which memory tools are available. The Role/Goal/Backstory above are the employee's factory identity; evolving memories like PROFILE/MEMORY live in the Memory menu.", empty: 'This employee has no behavior guide (AGENTS.md) yet.', create: 'Create Behavior Guide', @@ -3780,6 +3781,8 @@ export default { editPlaceholder: 'Edit memory content...', confirmed: 'Confirmed', saved: 'Saved', + moveUp: 'Move up', + moveDown: 'Move down', }, facts: { searchPlaceholder: 'Search facts…', diff --git a/mateclaw-ui/src/i18n/locales/zh-CN.ts b/mateclaw-ui/src/i18n/locales/zh-CN.ts index 7a440674..9494f840 100644 --- a/mateclaw-ui/src/i18n/locales/zh-CN.ts +++ b/mateclaw-ui/src/i18n/locales/zh-CN.ts @@ -1130,6 +1130,7 @@ export default { }, guide: { summary: '行为指南(AGENTS.md)', + open: '管理行为指南', desc: '这里是该员工的行为手册(AGENTS.md):规定何时写记忆、各文件放什么、可用的记忆工具。上方的岗位/目标/背景是员工的出厂身份;PROFILE/MEMORY 等可演化的记忆在「记忆」菜单管理。', empty: '该员工还没有行为指南(AGENTS.md)。', create: '创建行为指南', @@ -3872,6 +3873,8 @@ export default { editPlaceholder: '修改记忆内容...', confirmed: '已确认', saved: '已保存', + moveUp: '上移', + moveDown: '下移', }, facts: { searchPlaceholder: '搜索事实…', diff --git a/mateclaw-ui/src/views/Agents.vue b/mateclaw-ui/src/views/Agents.vue index a75d7125..f1fe4a51 100644 --- a/mateclaw-ui/src/views/Agents.vue +++ b/mateclaw-ui/src/views/Agents.vue @@ -347,8 +347,10 @@

{{ t('agents.fields.extraInstructionsHint') }}

- -

{{ t('agents.guide.desc') }}

+
+ {{ t('agents.guide.summary') }} +

{{ t('agents.guide.desc') }}

+
@@ -1965,7 +1967,14 @@ html.dark .seg-count.warn { .advanced-prompt[open] > .advanced-prompt__summary { padding: 0 0 8px; border-bottom: 1px solid var(--mc-border-light); margin-bottom: 8px; } .advanced-prompt[open] > .advanced-prompt__summary::before { transform: rotate(90deg); } .advanced-prompt .form-textarea { width: 100%; box-sizing: border-box; } -.advanced-guide { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--mc-border-light); } +.advanced-guide { + margin-top: 16px; display: flex; align-items: center; gap: 14px; + padding: 12px 14px; border-radius: 10px; background: var(--mc-bg-sunken); + border: 1px solid var(--mc-border-light); +} +.advanced-guide__info { flex: 1; min-width: 0; } +.advanced-guide__title { display: block; font-size: 13px; font-weight: 600; color: var(--mc-text-primary); } +.advanced-guide__desc { margin: 4px 0 0; font-size: 12px; line-height: 1.5; color: var(--mc-text-tertiary); } .modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--mc-border-light); } @media (max-width: 900px) { diff --git a/mateclaw-ui/src/views/Agents/components/AgentGuideEditor.vue b/mateclaw-ui/src/views/Agents/components/AgentGuideEditor.vue index 92dec50f..59bab9e5 100644 --- a/mateclaw-ui/src/views/Agents/components/AgentGuideEditor.vue +++ b/mateclaw-ui/src/views/Agents/components/AgentGuideEditor.vue @@ -1,41 +1,60 @@