2.9 KiB
Desktop Agent Workbench Integration Design
Scope
This deliverable adds the desktop Chat empty-state creator composer and local interactions for Agent Workbench, and connects Agent mode to the existing desktop Agent command path. It intentionally avoids new Rust commands, database tables, billing, and remote media generation until the page contract is stable.
Frontend Boundaries
components/chat/AgentWorkbenchComposer.tsxowns the creator composer, local attachment state, mode state, model selection, Agent handoff, and placeholder result/status for media modes.components/chat/ChatView.tsxrenders the composer in the Chat empty state and keeps the normal Chat input for existing conversations.stores/providerStore.tsremains the source of provider/model data. The page readsprovidersand callsfetchProviders; it does not duplicate provider fetching logic.stores/conversationStore.tsremains the source for conversation creation and Agent streaming. The Workbench reusescreateConversation,updateConversation, andsendAgentMessage.stores/skillStore.tsremains the source for skill installation/listing. The Workbench reusesloadSkills,installSkill, andtoggleSkillfor third-party skills.lib/browserMock.tsmirrors skill install/list/toggle enough for browser preview.- The first composer UI can use Chinese literal copy to match current product direction; it does not add a standalone nav label.
Data Flow
Provider store -> enabled providers -> enabled chat models -> AgentWorkbenchPage model options -> selected provider/model or custom model fallback.
File input -> browser File objects -> base64 AttachmentInput payload -> local attachment chips -> existing Agent attachment persistence during agent_query.
Mode selector -> local creationMode -> mode label/model controls/result copy.
Agent submit -> create conversation -> set mode: "agent" -> upsert Agent session via agent_update_session -> sendAgentMessage -> Chat page streaming display.
Non-Agent submit -> local result/status card. No external side effects yet.
Skills menu -> detect jianying-editor -> if missing install luoluoluo22/jianying-editor-skill via existing install_skill command -> if disabled enable it -> insert 请使用 jianying-editor Skill 自动创建剪映草稿: into the prompt -> Agent submit loads enabled skills in the backend and can invoke the skill tool.
Compatibility
Existing pages and settings should be unaffected. Adding a PageKey requires exhaustive switch and sidebar updates in the same change.
Follow-up Hooks
Future work can replace the non-Agent local submit handler with:
- BoosAPI
/api/agent/modelsfor remote model catalog. - BoosAPI
/api/jimeng/*for image/video generation. - Tauri file staging command for persistent uploads.
- A dedicated JianYing setup/status panel for Python dependency checks, JianYing draft path detection, and platform/version warnings.