Skip to content

Feat/export resource button#553

Merged
dfwgj merged 3 commits intomainfrom
feat/export-resource-button
Feb 27, 2026
Merged

Feat/export resource button#553
dfwgj merged 3 commits intomainfrom
feat/export-resource-button

Conversation

@dfwgj
Copy link
Collaborator

@dfwgj dfwgj commented Feb 27, 2026

--- Title:

feat(desktop): 角色/工具导出按钮 & macOS Dock 图标修复

Body:

改动

1. 角色/工具详情面板添加导出按钮

  • RoleDetailPanel 和 ToolDetailPanel 右上角新增导出按钮(非 system 资源可见)
  • 点击调用 resources:download IPC,成功/失败通过 toast 提示
  • 正确检查后端返回的 result.success,失败时显示具体错误信息
  • 添加 i18n 键:resources.actions.export / exportSuccess / exportFailed

2. 修复 v2 角色导出

  • 后端 resources:download handler 新增 version 参数
  • v2 角色正确定位 ~/.rolex/roles/<id>/ 目录(v1 仍走 ~/.promptx/resource/role/<id>/
  • v2 角色导出的 ZIP 以 roleId 为顶层目录,确保导入时还原正确 ID(不再变成临时目录名)

3. macOS 子进程 Dock 图标修复

  • macOS 上 AgentX 对话时,spawn 的子进程(Claude Code、MCP servers)会在 Dock 显示多个 "exec" 图标
  • 启动时检测 Electron Helper 二进制路径(其 Info.plist 含 LSUIElement=true
  • buildOptions.spawnClaudeCodeProcessAgentXService MCP server 配置在 macOS 上优先使用 Helper 二进制
  • 所有 spawn 调用添加 windowsHide: true(Windows 适用)

涉及文件

文件 改动
RoleDetailPanel.tsx 导出按钮 + Download 图标 + toast
ToolDetailPanel.tsx 导出按钮 + Download 图标 + toast
ResourceListWindow.ts download handler 支持 version 参数 + v2 路径 + ZIP 顶层目录
en.json / zh-CN.json 新增 export 相关 i18n 键
index.ts macOS Helper 二进制检测
AgentXService.ts MCP server command 使用 Helper
buildOptions.ts spawnClaudeCodeProcess 使用 Helper + windowsHide
PromptXActivationAdapter.ts exec 添加 windowsHide

dfwgj and others added 3 commits February 27, 2026 11:32
…port

Add export buttons to RoleDetailPanel and ToolDetailPanel for non-system
resources. Fix resources:download handler to resolve v2 role paths from
~/.rolex/roles/<id>/ and wrap v2 ZIP contents in a roleId-prefixed
directory so import correctly restores the original ID.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…n flicker

On macOS, spawning process.execPath (the main Electron binary) as child
processes causes each subprocess to briefly show a Dock icon. Use the
Electron Helper binary instead, which has LSUIElement=true in its
Info.plist and is invisible to the Dock. Also add windowsHide:true to
all spawn calls for Windows.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dfwgj dfwgj merged commit 3599084 into main Feb 27, 2026
@dfwgj dfwgj deleted the feat/export-resource-button branch February 27, 2026 04:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant