feat: add packaged mcp launcher for macos

This commit is contained in:
ILoveBingLu
2026-04-07 10:52:18 +08:00
parent 6c79328b5e
commit 892bb38105
8 changed files with 119 additions and 8 deletions
+6 -2
View File
@@ -33,6 +33,10 @@ function formatCommandPart(value: string) {
return /[\s"]/.test(value) ? `"${value.replace(/"/g, '\\"')}"` : value
}
function getPackagedLauncherLabel(command: string) {
return command.endsWith('ciphertalk-mcp') ? '`ciphertalk-mcp`' : '`ciphertalk-mcp.cmd`'
}
const textFieldSx = {
'& .MuiInputLabel-root': {
color: 'var(--text-secondary)',
@@ -213,7 +217,7 @@ function McpPage() {
>
`mcpEnabled` warning 宿 MCP
{launchConfig.mode === 'packaged'
? ' 当前展示的是打包版伴随启动器 `ciphertalk-mcp.cmd`。'
? ` 当前展示的是打包版伴随启动器 ${getPackagedLauncherLabel(launchConfig.command)}`
: ' 当前展示的是开发态入口 `npm run mcp`。'}
</Alert>
@@ -320,7 +324,7 @@ function McpPage() {
</Button>
<Typography sx={{ alignSelf: 'center', fontSize: 13, color: 'var(--text-secondary)' }}>
{launchConfig.mode === 'packaged'
? '`cwd` 指向安装目录,宿主通常无需额外包一层 shell。'
? '打包态请直接把 `command` 指向启动器本身;macOS 不要把 `CipherTalk.app` 本体当作 command。'
: '`cwd` 已自动使用当前仓库目录,通常无需修改。'}
</Typography>
</Stack>