diff --git a/.project-docs/30-worklog/tasks/20261012-agent-config-design-74c9a2e1.md b/.project-docs/30-worklog/tasks/20261012-agent-config-design-74c9a2e1.md new file mode 100644 index 00000000..eff1537f --- /dev/null +++ b/.project-docs/30-worklog/tasks/20261012-agent-config-design-74c9a2e1.md @@ -0,0 +1,76 @@ +# Task: Polish Agent introduction and unified advanced settings + +## Identity + +- Task ID: 20261012-agent-config-design-74c9a2e1 +- Mode: Feature +- Branch: codex/20261012-agent-config-design-74c9a2e1-agent-config-design +- Worktree: /Users/chillishark/Makelore 麦洛/.codex-worktrees/makelore/20261012-agent-config-design-74c9a2e1 +- Base commit: a7182ac8fe8d936a6849e641a77b8720e0827286 +- Owner: codex +- Status: In Progress + +## Scope + +- Polish the introduction/prompt configuration page using the existing MakeLore warm, pastel, rounded visual language. +- Replace advanced category switching with one persistent vertically scrolling page; model remains first and required for use. +- Present tools as 工具箱(Tool) / 选它做事时能用的工具。 and skills as 做事手册(Skill) / 给它一本手册,照着方法做。 +- Verify and update the latest temporary application from the new source. + +## Intent And Constraints + +- User explicitly requests this refinement, superseding older advanced category navigation. Preserve identity/avatar editing, optional purpose, raw prompt, selection state, explicit save/apply, independent budget saves and account/request isolation. +- No real cloud mutations or paid prompts during verification, no installed-app changes, main merge/push or peer/canonical document writes. Use the exact latest trial commit as base and keep its profile and direct-network startup. + +## Project Context Loaded + +Task context: +- Task ID/mode/branch/worktree/base match Identity; bundled start exited 0 and status confirmed ownership/reservation in this isolated checkout. +- Read all 33 peer task records' Scope, Intent And Constraints and Promotion Candidates read-only. Agent source/trial/refinement peers are ready; this base includes their latest accepted product behavior. Teacher/consultation/community tasks are separate. The child-language planning record has undefined scope; no identified dependency on this personal-Agent configuration page. Do not modify peer worktrees or primary checkout. + +Read: +- AGENTS.md; .project-docs/05-agent-entry/read-before-planning.md, memory-index.md, planning-gate.md; active task; 00-brief/project-positioning.md and success-criteria.md; relevant current-state.md snapshot and current focus; decision-index.md; personal-cloud-agent ADR; system-overview.md; community-collaboration.md; task-relevant business-rules.md; preceding Agent task records. +- design and maintain-project-docs skills. Required design-system search completed; existing project colors/components take precedence over generic search suggestions. + +Relevant understanding: +- Project goal: accessible creative desktop client; this module centers on building and using one's own Agent. +- Current integrated focus: creative tools and cloud consultation, Main-owned authentication/network, independent cloud execution and service policies. +- Active constraints: single light design; preserve model/resource contracts, manual saves, drafts and cloud identity. Current optional introduction reuses purpose; companion cloud rollout remains teammate-owned. +- Decisions: user's latest instruction replaces historical starter/preview/category-tab descriptions. Basic/advanced top-level switch remains; only categories inside advanced are removed. No billing, permission or architecture changes. +- Evidence/commitments: latest trial a7182ac is verified; tests use isolated fixture transport. Real cloud behavior is not inferred from fixtures. No reusable debugging/reflection change required at planning. +- Likely files: DraftEditor, ConfigurationFields, AgentRequirements, desktop-workspace styles, resource headings and focused UI/Electron tests/README. +- Unknown/stale: canonical UX descriptions predate the accepted October refinements; record promotion only. Cloud optional-purpose deployment is outside this styling task. + +Gate result: Passed. + +## Implementation Plan + +1. Add restrained pastel section cards for introduction/prompt and unify advanced rendering in model-first order with the requested tools/skills language. +2. Preserve mounted form state and existing save/recovery behavior, adapt focused regression and Electron tests, and inspect responsive screenshots. +3. Build, stage the verified temporary app safely, record actual validation and remaining live-login limitations, and hand off a clean committed result. + +## Outcome + +- Implemented two pastel introduction/prompt cards and matching top-level controls, using existing typography, Lucide icons, warm background and rounded forms. +- Advanced settings now show model, Tool/Skill resources, MCP/subagents, knowledge and limits on one persistent vertical page. Resource catalogs, missing IDs, selected Skill preloading, management dialogs, independent budget saves and draft/conflict guards are retained. +- Requested Tool/Skill names and exact short explanations are visible; personal Skill management actions use the same 做事手册 wording. README and focused tests updated. +- Compact screenshot review found the inherited name input collapsing to zero width; increased identity selector specificity and gave it a minimum flex basis so header actions wrap while the name remains visible. +- Latest real trial is still on a7182ac: native AX inspection shows unsaved name 英语陪练aron and 有未保存修改. Asked user to save or authorize discarding before replacement; do not terminate that window while the answer is pending. + +## Verification + +- Renderer typecheck and scoped ESLint passed. +- Six focused unit files: 139 passed; include page switching preserving prompt/model/search/resources/knowledge/limits/budget inputs and no implicit save or model calls. +- Production Renderer/Main/preload/utility build passed; existing Browserslist and chunk-size warnings only. +- Five isolated Electron flows passed: identity/configuration/formal chat, three homepage cases and WeChat channel lifecycle. No real cloud mutation/model calls. Basic/advanced Electron screenshots visually inspected. +- Independent read-only source/state/accessibility review found no concrete defect. +- Nine Chrome fixture cases passed: original five avatar/card cases and four configuration layouts at 375/768/1024/1440. Real element bounds, >=96px name width, accessible focus, all advanced sections, lower-section scrolling and return-to-introduction checked. Desktop and compact screenshots inspected; compact header regression fixed and reverified. +- After the header fix, production build and the Electron configuration case passed again, including its 980px 125%/150% content zoom checks. Total 14 distinct E2E cases passed (five Electron and nine browser fixture cases). + +## Follow-ups + +- Finish responsive screenshots and safely replace the latest temporary app after the user resolves its unsaved changes. Restart requires manual login because unpackaged auth is memory-only. + +## Promotion Candidates + +- Target: personal-cloud-Agent ADR and integrated current state during a later serialized integration. Proposal: introduction/prompt uses two readable pastel cards; advanced configuration is one vertical model-first page, with 工具箱(Tool) and 做事手册(Skill) plus short explanations. Evidence: user request, source, focused unit/Electron checks and screenshot review. Future impact: simpler configuration navigation while preserving manual saves, state and service contracts. Supersedes historical internal advanced category switching; user confirmation already provided, canonical documents remain unchanged here. diff --git a/README.md b/README.md index 1547f36f..bdfeef1c 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Makelore 是一个面向软件、视觉创作、智能机器人与个人云智 - `Makelore Code|AI 编程`:管理本地项目、项目智能体、对话、文件上下文、代码变更和运行时。 会话工作台采用浅蓝项目栏、彩色通用手柄图标与卡片选中态;中间对话/作品使用圆角标签,作品预览的后退、前进、刷新与网址输入统一放在标签右侧;只在作品页显示,窄窗口自动换行。右侧智能体咨询使用奶油色标题区。沿用真实项目和会话入口、侧栏伸缩与账户菜单,样式只作用于 Code 会话工作台。可编辑的空对话在输入区上方的可用区域中央显示童趣欢迎语;「去作品广场逛逛」入口紧贴输入框上方,两者一起位于底部。老师介绍以固定宽度浮在右上角,不占用中间布局;欢迎语和底部输入区始终相对项目栏右侧的整个内容区域居中;小窗口的欢迎内容独立滚动;发送首条消息后收起欢迎区。侧栏保留「作品广场」入口,只有点击后才在系统浏览器打开公共广场,不请求、摘取或内嵌展示广场作品。打开广场保留当前项目、对话、草稿和附件,不自动发送消息;老师求助按钮保留临时应用的最新文案「帮我整体看🧠」。 -- `Makelore Agents|AI 智能体`:首页围绕自己的智能体和创建入口,显示童趣问候“Hi,今天想创造还是想聊聊?”,不再显示更多、收到的分享、活动或归档筛选。卡片显示名称、可为空的一句话介绍及状态,支持聊天、调整、继续制作和确认删除;删除沿用云端归档机制,移出列表并停用新调用,历史和费用保留。创建先填写名称并选择平台像素头像或上传头像,下一步进入独立配置。顶部名称有编辑图标,头像可点击修改;未设置头像时使用同一张默认像素头像,从创建到配置、改名、保存和重新打开保持一致。基础页为“介绍与提示词”,一句话介绍可留空,完整提示词保留原始文本;模型作为高级设置第一项必选,未选择时不能开始使用,草稿可分步保存,不自动选模型。高级设置保留能力、知识和限制,切换保留输入。配置页移除聊天、自动任务和使用与接入导航,独立聊天仍从卡片进入,微信账号仍在侧栏渠道管理。草稿明确保存(Ctrl/⌘+S);保存只更新草稿,“应用最新修改”使新配置生效,失败重试保持原操作身份;首次确认开始使用创建仅自己可用的发布版本并打开聊天,配置不自动发送消息。头像上传、Main-owned Host API、访问隔离、费用与不可变版本规则保持;介绍留空需要配套 Yuxi DraftCreate/DraftSave 的空字符串契约。 +- `Makelore Agents|AI 智能体`:首页围绕自己的智能体和创建入口,显示童趣问候“Hi,今天想创造还是想聊聊?”,不再显示更多、收到的分享、活动或归档筛选。卡片显示名称、可为空的一句话介绍及状态,支持聊天、调整、继续制作和确认删除;删除沿用云端归档机制,移出列表并停用新调用,历史和费用保留。创建先填写名称并选择平台像素头像或上传头像,下一步进入独立配置。顶部名称有编辑图标,头像可点击修改;未设置头像时使用同一张默认像素头像,从创建到配置、改名、保存和重新打开保持一致。基础页为“介绍与提示词”,一句话介绍可留空,完整提示词保留原始文本;模型作为高级设置第一项必选,未选择时不能开始使用,草稿可分步保存,不自动选模型。介绍与提示词采用浅蓝介绍卡和浅紫提示词卡;高级设置按模型、工具箱(Tool)、做事手册(Skill)、MCP 服务、子智能体、知识库和限制纵向呈现,不再设内部分类切换。工具箱说明为“选它做事时能用的工具。”,做事手册说明为“给它一本手册,照着方法做。”。顶层页签切换保留搜索、资源选择、知识表单、费用及未保存输入。配置页移除聊天、自动任务和使用与接入导航,独立聊天仍从卡片进入,微信账号仍在侧栏渠道管理。草稿明确保存(Ctrl/⌘+S);保存只更新草稿,“应用最新修改”使新配置生效,失败重试保持原操作身份;首次确认开始使用创建仅自己可用的发布版本并打开聊天,配置不自动发送消息。头像上传、Main-owned Host API、访问隔离、费用与不可变版本规则保持;介绍留空需要配套 Yuxi DraftCreate/DraftSave 的空字符串契约。 云知识库的 embedding 模型只由平台管理员在 Yuxi 后台维护:在「智能体管理 → 模型供应商」启用供应商,按供应商要求填写有效的服务地址和 API Key,添加并启用 embedding 模型并填写实际向量维度;embedding 向量化费用由平台承担,不计入用户用量、词元点数或智能体费用上限;one-api 不参与 embedding 配置,Works Square 只负责其他应计费模型调用的创建者词元点数账本。客户端区分目录加载中、加载失败与无可用模型,空状态提供管理员配置说明;「刷新知识库与模型」保留未提交名称,未确认的创建请求沿用原操作身份。 diff --git a/src/pages/CloudAgents/AgentConfigHeading.tsx b/src/pages/CloudAgents/AgentConfigHeading.tsx new file mode 100644 index 00000000..947fb3ca --- /dev/null +++ b/src/pages/CloudAgents/AgentConfigHeading.tsx @@ -0,0 +1,13 @@ +import type { LucideIcon } from 'lucide-react'; + +export function AgentConfigHeading({ title, icon: Icon, note, description }: { + title: string; icon: LucideIcon; note?: string; description?: string; +}) { + return
+ +
+

{title}

{note && {note}}
+ {description &&

{description}

} +
+
; +} diff --git a/src/pages/CloudAgents/AgentRequirements.tsx b/src/pages/CloudAgents/AgentRequirements.tsx index fd6888ee..0bf8bd23 100644 --- a/src/pages/CloudAgents/AgentRequirements.tsx +++ b/src/pages/CloudAgents/AgentRequirements.tsx @@ -1,9 +1,15 @@ +import { useId } from 'react'; +import { NotebookPen } from 'lucide-react'; import { Textarea } from '@/components/ui/textarea'; +import { AgentConfigHeading } from './AgentConfigHeading'; export function AgentRequirements({ value, onChange }: { value: string; onChange: (value: string) => void }) { - return