diff --git a/.project-docs/30-worklog/tasks/20261012-agent-config-simplify-c6829a4e.md b/.project-docs/30-worklog/tasks/20261012-agent-config-simplify-c6829a4e.md new file mode 100644 index 00000000..ec08682e --- /dev/null +++ b/.project-docs/30-worklog/tasks/20261012-agent-config-simplify-c6829a4e.md @@ -0,0 +1,85 @@ +# Task: Simplify Agent settings and open conversations directly + +## Identity + +- Task ID: 20261012-agent-config-simplify-c6829a4e +- Mode: Feature +- Branch: codex/20261012-agent-config-simplify-c6829a4e-agent-config-simplify +- Worktree: /Users/chillishark/Makelore 麦洛/.codex-worktrees/makelore/20261012-agent-config-simplify-c6829a4e +- Base commit: f7b1003c4c0b86a09b47e62e8e20d836fe0dd9d0 +- Owner: codex +- Status: Planning + +## Scope + +- Simplify personal Agent advanced settings: remove Tool/Skill helper descriptions, cloud capability management, budget and execution-limit cards. +- Make the explicit Start Use action activate the saved private Agent when required and open its formal conversation directly. +- Update and verify the latest isolated temporary application using the existing trial profile. + +## Intent And Constraints + +- User-facing discussion stays in Chinese product language. Current explicit request supersedes older helper copy and the second activation confirmation screen. +- Keep model selection required and raw prompt authoritative. Preserve existing budget/runtime configuration and service policies; hide controls without clearing stored values. +- Keep typed Host API, explicit save, dirty/conflict/model/account guards and recovery of uncertain actions. Opening a conversation must not send a message or invoke a model. +- Do not modify another checkout, canonical project memory, installed application, or cloud services. Preserve trial data and do not activate a real cloud Agent during verification. + +## Project Context Loaded + +Task context: +- Task ID: 20261012-agent-config-simplify-c6829a4e +- Mode: Feature +- Branch: codex/20261012-agent-config-simplify-c6829a4e-agent-config-simplify +- Worktree: /Users/chillishark/Makelore 麦洛/.codex-worktrees/makelore/20261012-agent-config-simplify-c6829a4e +- Base commit: f7b1003c4c0b86a09b47e62e8e20d836fe0dd9d0 +- Ownership: bundled start succeeded and status JSON matched identity, branch, base and absolute worktree. +- Other active local tasks: 34 peer owners; all peer task-record Scope / Intent And Constraints / Promotion Candidates read, read-only. +- Overlap: prior completed Agent configuration, design, purpose and trial tasks overlap; the current user's explicit refinement resolves their presentation differences. One old child-language task has undefined scope but no concrete dependency. No blocking conflict. + +Read: +- AGENTS.md; 05-agent-entry/read-before-planning.md, memory-index.md, planning-gate.md; active task record. +- 00-brief/project-positioning.md, success-criteria.md, community-collaboration.md; 30-worklog/current-state.md integrated snapshot/current focus. +- 10-decisions/decision-index.md and ADR-2026-09-11-personal-cloud-agents.md; 20-architecture/system-overview.md; 40-domain/business-rules.md. +- 50-evidence/evidence-index.md; 60-reflection/reflection-index.md; 80-commitments/commitments.md. + +Relevant understanding: +- Project goal: approachable creation and use of personal AI assistants for students and creators. +- Current integrated focus: unified client capabilities and cloud integration; the integrated guided Agent UI predates the user's October simplification. +- Active scope: presentation removals and one-click entry to formal personal conversation, followed by a local trial update. +- Active constraints: Main owns authentication/network/recovery, Yuxi owns configurations/versions/execution, Works owns eligibility and billing. Payment does not grant broader resource access. +- Decisions: model is explicitly selected; private activation remains explicit; saved draft and published version are distinct. Budget/runtime policies remain even with controls hidden. +- Evidence/reflections/commitments: fixture tests do not establish real paid-model acceptance. Existing release/provider commitments remain outside this temporary UI update; no real cloud mutation is needed for verification. +- Likely modules: ConfigurationFields, Page/DraftEditor/useCloudDraft/Publication flow, scoped tests, README, local trial lifecycle artifacts. +- Stale context: older first-use confirmation and helper descriptions are intentionally superseded by this user request. Optional description cloud deployment is a separate existing dependency. + +Gate result: +- Passed. + +## Plan + +1. Remove the requested advanced settings sections while retaining persisted configuration fields. +2. Connect Start Use to existing activation/recovery and formal conversation without the intermediate screen; add focused regression coverage. +3. Run focused checks and production build; stage a uniquely identified temporary application, verify it before replacing the current runtime, and show the updated page. +4. Record actual verification and remaining limits in this task record, commit the result and complete task ownership. + +## Outcome + +- Requested helper copy and capability-manager/budget/runtime cards are removed from the personal configuration page. Knowledge management and model/resource choices remain; saving changes preserves hidden runtime policy fields and does not read/write budgets. +- Start Use now performs the existing explicit private activation and opens formal chat on confirmed success, without an access/confirmation panel. Missing model, dirty configuration, conflicting save and unreadable state remain actionable in configuration; retries retain their original operation identity. +- Implementation and fixture verification complete; real temporary-application replacement and review pending. + +## Verification + +- Typecheck and scoped ESLint passed; git diff --check passed. +- Seven focused unit files: 146 passed; final added activation-status/revised-draft recovery cases verified with all 9 direct-use cases passing separately (148 distinct focused cases total). +- 10 Playwright cases passed: 9 Chrome layout/avatar cases at 375/768/1024/1440 and 1 Electron identity/configuration/private-activation/direct-chat case. +- Independent read-only review found no actionable regression; added the revised-draft/old-activation recovery case from that review. Mobile advanced settings screenshot reviewed after removals. +- Production build:vite passed for Renderer, Main, preload and utility targets. Existing Browserslist age/chunk-size warnings only. +- Native current trial observed on WeChat channel details with disabled Save Target; no current unsaved form was visible. No real cloud publish, save or model message was sent during verification. + +## Follow-ups + +- Replace latest temporary runtime after exact build binding and isolated startup probe; verify real login/page separately from fixture results. + +## Promotion Candidates + +- Target: README-linked Agent UI descriptions and ADR-2026-09-11-personal-cloud-agents/current-state when integrated. Proposal: advanced settings retain model/resource selection without helper, resource-management, budget or runtime cards; explicit Start Use directly activates privately and opens formal chat. Evidence: this user's 2026-10-12 request, 148 distinct scoped unit cases and 10 layout/Electron cases. Impact: fewer configuration distractions and one fewer activation page. Semantic conflict: older first-use confirmation/UI descriptions are superseded by the user's explicit request; backend version, payment, access, budget and runtime policies remain. Human confirmation: already supplied for this implementation; canonical promotion still requires serialized Integration Gate. diff --git a/README.md b/README.md index bdfeef1c..740ed14d 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Makelore 是一个面向软件、视觉创作、智能机器人与个人云智 - `Makelore Code|AI 编程`:管理本地项目、项目智能体、对话、文件上下文、代码变更和运行时。 会话工作台采用浅蓝项目栏、彩色通用手柄图标与卡片选中态;中间对话/作品使用圆角标签,作品预览的后退、前进、刷新与网址输入统一放在标签右侧;只在作品页显示,窄窗口自动换行。右侧智能体咨询使用奶油色标题区。沿用真实项目和会话入口、侧栏伸缩与账户菜单,样式只作用于 Code 会话工作台。可编辑的空对话在输入区上方的可用区域中央显示童趣欢迎语;「去作品广场逛逛」入口紧贴输入框上方,两者一起位于底部。老师介绍以固定宽度浮在右上角,不占用中间布局;欢迎语和底部输入区始终相对项目栏右侧的整个内容区域居中;小窗口的欢迎内容独立滚动;发送首条消息后收起欢迎区。侧栏保留「作品广场」入口,只有点击后才在系统浏览器打开公共广场,不请求、摘取或内嵌展示广场作品。打开广场保留当前项目、对话、草稿和附件,不自动发送消息;老师求助按钮保留临时应用的最新文案「帮我整体看🧠」。 -- `Makelore Agents|AI 智能体`:首页围绕自己的智能体和创建入口,显示童趣问候“Hi,今天想创造还是想聊聊?”,不再显示更多、收到的分享、活动或归档筛选。卡片显示名称、可为空的一句话介绍及状态,支持聊天、调整、继续制作和确认删除;删除沿用云端归档机制,移出列表并停用新调用,历史和费用保留。创建先填写名称并选择平台像素头像或上传头像,下一步进入独立配置。顶部名称有编辑图标,头像可点击修改;未设置头像时使用同一张默认像素头像,从创建到配置、改名、保存和重新打开保持一致。基础页为“介绍与提示词”,一句话介绍可留空,完整提示词保留原始文本;模型作为高级设置第一项必选,未选择时不能开始使用,草稿可分步保存,不自动选模型。介绍与提示词采用浅蓝介绍卡和浅紫提示词卡;高级设置按模型、工具箱(Tool)、做事手册(Skill)、MCP 服务、子智能体、知识库和限制纵向呈现,不再设内部分类切换。工具箱说明为“选它做事时能用的工具。”,做事手册说明为“给它一本手册,照着方法做。”。顶层页签切换保留搜索、资源选择、知识表单、费用及未保存输入。配置页移除聊天、自动任务和使用与接入导航,独立聊天仍从卡片进入,微信账号仍在侧栏渠道管理。草稿明确保存(Ctrl/⌘+S);保存只更新草稿,“应用最新修改”使新配置生效,失败重试保持原操作身份;首次确认开始使用创建仅自己可用的发布版本并打开聊天,配置不自动发送消息。头像上传、Main-owned Host API、访问隔离、费用与不可变版本规则保持;介绍留空需要配套 Yuxi DraftCreate/DraftSave 的空字符串契约。 +- `Makelore Agents|AI 智能体`:首页围绕自己的智能体和创建入口,显示童趣问候“Hi,今天想创造还是想聊聊?”,不再显示更多、收到的分享、活动或归档筛选。卡片显示名称、可为空的一句话介绍及状态,支持聊天、调整、继续制作和确认删除;删除沿用云端归档机制,移出列表并停用新调用,历史和费用保留。创建先填写名称并选择平台像素头像或上传头像,下一步进入独立配置。顶部名称有编辑图标,头像可点击修改;未设置头像时使用同一张默认像素头像,从创建到配置、改名、保存和重新打开保持一致。基础页为“介绍与提示词”,一句话介绍可留空,完整提示词保留原始文本;模型作为高级设置第一项必选,未选择时不能开始使用,草稿可分步保存,不自动选模型。介绍与提示词采用浅蓝介绍卡和浅紫提示词卡;高级设置按模型、工具箱(Tool)、做事手册(Skill)、MCP 服务、子智能体和知识库纵向呈现,不再设内部分类切换;不展示 Tool/Skill 解释、云端能力管理、费用上限或运行限制卡片,保存其他配置时保留既有运行限制,费用规则不变。顶层页签切换保留搜索、资源选择、知识表单及未保存输入。配置页移除聊天、自动任务和使用与接入导航,独立聊天仍从卡片进入,微信账号仍在侧栏渠道管理。草稿明确保存(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/ConfigurationFields.tsx b/src/pages/CloudAgents/ConfigurationFields.tsx index f9b2e5e9..e26bca41 100644 --- a/src/pages/CloudAgents/ConfigurationFields.tsx +++ b/src/pages/CloudAgents/ConfigurationFields.tsx @@ -1,17 +1,15 @@ import { useEffect, useState } from 'react'; -import { BookOpen, Brain, Library, Plug, RefreshCw, SlidersHorizontal, Users, Wrench } from 'lucide-react'; +import { BookOpen, Brain, Library, Plug, RefreshCw, Users, Wrench } from 'lucide-react'; import { cloudAgentsApi } from '@/lib/cloud-agents-api'; import { Button } from '@/components/ui/button'; import { Input } from '@/components/ui/input'; import { CloudKnowledgePanel } from './CloudKnowledge'; -import { CloudResources } from './CloudResources'; -import { CloudBudgetEditor } from './CloudCosts'; import { AgentConfigHeading } from './AgentConfigHeading'; import type { CloudAgentConfiguration, CloudCatalog } from '../../../shared/cloud-agents'; const resourceSections = [ - { key: 'tools', label: '工具箱', title: '工具箱(Tool)', description: '选它做事时能用的工具。', icon: Wrench, tone: 'blue' }, - { key: 'skills', label: '做事手册', title: '做事手册(Skill)', description: '给它一本手册,照着方法做。', icon: BookOpen, tone: 'lilac' }, + { key: 'tools', label: '工具箱', title: '工具箱(Tool)', icon: Wrench, tone: 'blue' }, + { key: 'skills', label: '做事手册', title: '做事手册(Skill)', icon: BookOpen, tone: 'lilac' }, { key: 'mcps', label: 'MCP 服务', title: 'MCP 服务', icon: Plug, tone: 'neutral' }, { key: 'subagents', label: '子智能体', title: '子智能体', icon: Users, tone: 'neutral' }, { key: 'knowledges', label: '知识库', title: '知识库', icon: Library, tone: 'mint' }, @@ -57,7 +55,7 @@ export function ConfigurationFields({ slug, value, disabled, onChange, section = return
{title}
- +
{choosing === key && setSearch(e.target.value)} />} @@ -78,26 +76,6 @@ export function ConfigurationFields({ slug, value, disabled, onChange, section = onCreated={kb => { change('knowledges', [...new Set([...value.knowledges, kb.kb_id])]); setRefresh(v => v + 1); }} />}
; })} -
-

未选择的资源不会开放给此智能体。通过微信或 API 使用时也遵循本配置。

- setRefresh(v => v + 1)} /> -
-
-
- -

以下设置随草稿保存;费用上限独立保存,对后续调用生效。执行步数会统计模型调用、工具、图节点和中间件步骤。

- -
- {([{ key: 'max_execution_steps', label: '最多执行步数', min: 1, max: 300 }, - { key: 'max_output_tokens', label: '单次输出词元上限', min: 1, max: 32768 }, - { key: 'max_run_seconds', label: '单次运行时限(秒)', min: 10, max: 3600 }] as const).map(item => - )} -
-
+

未选择的资源不会开放给此智能体。通过微信或 API 使用时也遵循本配置。

; } diff --git a/src/pages/CloudAgents/DraftEditor.tsx b/src/pages/CloudAgents/DraftEditor.tsx index ca68ad45..93ed47f7 100644 --- a/src/pages/CloudAgents/DraftEditor.tsx +++ b/src/pages/CloudAgents/DraftEditor.tsx @@ -10,7 +10,6 @@ import { EMPTY_CLOUD_CONFIGURATION, type CloudAgentDraft, type CloudRecent } fro import { ConfigurationFields } from './ConfigurationFields'; import { CloudChat } from './CloudChat'; import { CloudChannelConversations } from './CloudChannelConversations'; -import { CloudAccessPanel } from './CloudAccess'; import { CloudPendingContext, useCloudPendingState } from './CloudPending'; import { AgentRequirements } from './AgentRequirements'; import { CloudAvatar, CloudAvatarEditor } from './CloudAvatar'; @@ -18,7 +17,7 @@ import { useCloudPublication } from './useCloudPublication'; import { AgentConfigHeading } from './AgentConfigHeading'; import './agent-config.css'; -type Tab = 'configuration' | 'chat' | 'access'; +type Tab = 'configuration' | 'chat'; const hasDraftChanges = (draft: CloudAgentDraft, saved: CloudAgentDraft) => draft.name !== saved.name || (draft.icon ?? null) !== (saved.icon ?? null) || draft.purpose !== saved.purpose || draft.system_prompt !== saved.system_prompt || JSON.stringify(draft.configuration) !== JSON.stringify(saved.configuration); const errorMessage = (error: unknown) => error instanceof Error ? error.message : '暂时无法完成操作'; @@ -103,6 +102,20 @@ export function DraftEditor({ initial, recent, onBack, onSaved, startingPrompt, } catch { /* Keep the failed save and local input available for retry. */ } } finally { saving.current = false; if (alive.current) setBusy(false); } }; + const startUsing = () => { + if (busy || saving.current) return; + if (remote) { navigate('configuration'); setError('云端已有新修改,请先处理保存冲突。'); return; } + if (!draft.configuration.model) { + navigate('configuration'); + setEditorTab('advanced'); + if (configurationScroll.current) configurationScroll.current.scrollTop = 0; + setError('请先在高级设置中选择模型。'); return; + } + if (dirty) { navigate('configuration'); setError('请先保存草稿,再开始使用。'); return; } + if (!publication.access) { setError('暂时无法确认智能体状态,请刷新后重试。'); return; } + setError(''); + void publication.publish(); + }; useEffect(() => { const shortcut = (event: KeyboardEvent) => { if ((event.ctrlKey || event.metaKey) && event.key.toLowerCase() === 's') { event.preventDefault(); void save(); } @@ -139,14 +152,10 @@ export function DraftEditor({ initial, recent, onBack, onSaved, startingPrompt, {publication.busy && } {publication.busy ? '正在应用…' : publication.pending ? '重试本次应用' : !dirty && publication.appliedRevision === saved.draft_revision ? '已应用' : '应用最新修改'} } - {!saved.published_version && } + {!saved.published_version && } {tab !== 'configuration' &&