diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cc2e29d..fe4c0bd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -82,10 +82,33 @@ jobs: ### Downloads by platform - **Windows**: `.msi` installer - - **macOS**: `.dmg` (unsigned — first launch needs right-click → Open) + `.app` + - **macOS**: `.dmg` + `.app`(未签名,仅 Apple Silicon / M 系列芯片) - **Linux**: `.deb` / `.AppImage` / `.rpm` + ### macOS 安装说明(无开发者账号签名,需一次手动绕过) + + 1. 下载 `KimiSwitch_*.dmg`,双击挂载后把 `Kimi Switch.app` 拖入「应用程序」文件夹 + 2. 下载本 Release 附带的 `install-macos.sh`,在终端运行: + + ```bash + bash install-macos.sh + ``` + + 脚本会自动清除「下载隔离」属性并启动应用,之后可正常使用。 + 3. 手动替代方案:右键 `Kimi Switch.app` → 打开 → 弹窗中点「打开」(或 系统设置 → 隐私与安全性 → 仍要打开) + Full changelog: see commit history. prerelease: ${{ contains(github.ref_name, '-rc') || contains(github.ref_name, '-beta') || contains(github.ref_name, '-alpha') }} overwrite: true args: ${{ matrix.args }} + + upload-macos-script: + name: Attach macOS install script + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Upload install-macos.sh to release + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: gh release upload "${{ github.ref_name }}" scripts/install-macos.sh --clobber diff --git a/README.md b/README.md index 0c5c74b..a1c67e1 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,13 @@ ## 下载 - **Windows**: [GitHub Releases](https://github.com/billowliu2/KimiSwitch/releases/latest) → `.msi` -- **macOS**: [GitHub Releases](https://github.com/billowliu2/KimiSwitch/releases/latest) → `.dmg`(**未签名** —— 首次启动请右键 → 打开绕过 Gatekeeper) +- **macOS**: [GitHub Releases](https://github.com/billowliu2/KimiSwitch/releases/latest) → `.dmg`(**未签名**,仅 Apple Silicon / M 系列芯片)。安装请下载 Release 附带的 `install-macos.sh` 一键处理: + + ```bash + bash install-macos.sh + ``` + + 或手动:把 `Kimi Switch.app` 拖入「应用程序」→ 右键 → 打开 → 点「打开」绕过 Gatekeeper。 - **Linux**: [GitHub Releases](https://github.com/billowliu2/KimiSwitch/releases/latest) → `.deb` / `.AppImage` / `.rpm` 历史版本(v0.5.x 及之前)请前往 [git.codingplan.site 仓库](https://git.codingplan.site/admin/KimiCodeSwitch/releases)。 diff --git a/docs/BUILD.md b/docs/BUILD.md index b3667f8..78f79ae 100644 --- a/docs/BUILD.md +++ b/docs/BUILD.md @@ -26,7 +26,9 @@ npm run tauri build -- --bundles app,dmg Output: `src-tauri/target/release/bundle/{macos,dmg}/`. -Unsigned: first launch requires right-click → Open to bypass Gatekeeper. +Unsigned (no Developer ID account): downloaded copies are blocked by Gatekeeper. +For end users, attach `install-macos.sh` (auto-uploaded to each Release) or instruct: +right-click → Open, or `xattr -cr "/Applications/Kimi Switch.app"`. ### Linux (native) diff --git a/package.json b/package.json index 6cecd77..ba230d8 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "kimiswitch", "private": true, - "version": "0.7.1", + "version": "0.7.2", "type": "module", "scripts": { "dev": "vite", diff --git a/release-notes-v0.7.2.md b/release-notes-v0.7.2.md new file mode 100644 index 0000000..b6fb13a --- /dev/null +++ b/release-notes-v0.7.2.md @@ -0,0 +1,33 @@ +## v0.7.2 + +### 子代理模型指定(实验功能) + +- 新增「子代理模型(次主力模型)」指定:在实验功能设置中为子代理选择次主力模型后,子代理默认绑定该模型,不再继承主模型 +- 实验开关改为滑动开关,修复开启态因样式缺失而不可见的问题 +- 仅保存模型引用,子代理直接继承所选模型的上下文长度与思考模式 + +### 模型数据与发布 + +- models.dev 模型列表与价格数据同步更新 +- 官网企业版视觉升级;出品公司标识统一为 codingplan.site +- macOS 发布优化:Release 附带 `install-macos.sh` 一键安装脚本(见下方说明) + +### Downloads by platform + +- **Windows**: `.msi` installer +- **macOS**: `.dmg` + `.app`(未签名,仅 Apple Silicon / M 系列芯片) +- **Linux**: `.deb` / `.AppImage` / `.rpm` + +### macOS 安装说明(无开发者账号签名,需一次手动绕过) + +> 原因:macOS 包未做 Developer ID 签名与公证(无 Apple 开发者账号),系统会拦截从网络下载的未签名应用(Gatekeeper)。`install-macos.sh` 通过清除「下载隔离」属性绕过该拦截,不影响功能与安全。 + +1. 下载 `Kimi.Switch_0.7.2_aarch64.dmg`,双击挂载后把 `Kimi Switch.app` 拖入「应用程序」文件夹 +2. 下载本 Release 附带的 `install-macos.sh`,在终端运行: + + ```bash + bash install-macos.sh + ``` + + 脚本会自动清除下载隔离属性并启动应用,只需执行一次,之后正常使用。 +3. 手动替代方案:右键 `Kimi Switch.app` → 打开 → 弹窗点「打开」;或 系统设置 → 隐私与安全性 → 仍要打开 diff --git a/scripts/install-macos.sh b/scripts/install-macos.sh new file mode 100644 index 0000000..189687a --- /dev/null +++ b/scripts/install-macos.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# install-macos.sh — Kimi Switch macOS 一键安装辅助脚本 +# +# 背景:macOS 包未做 Developer ID 签名(无开发者账号),从网络下载后会被 +# Gatekeeper 的「下载隔离(quarantine)」属性拦截。本脚本清除该属性后启动应用。 +# +# 用法(把 Kimi Switch.app 拖入「应用程序」文件夹后执行): +# bash install-macos.sh +# +# 若脚本提示找不到应用,请先手动把 Kimi Switch.app 拖到 /Applications 再运行。 + +set -e + +APP_NAME="Kimi Switch" +APP_PATH="/Applications/${APP_NAME}.app" +DOWNLOADED_DMG_NAME="KimiSwitch.dmg" + +if [ ! -d "$APP_PATH" ]; then + echo "❌ 未找到 ${APP_PATH}" + echo "" + echo "请先把「${APP_NAME}.app」拖到「应用程序」文件夹,再重新运行本脚本:" + echo " 1. 双击下载的 ${DOWNLOADED_DMG_NAME}(磁盘映像会自动挂载)" + echo " 2. 把其中的 Kimi Switch.app 拖入「应用程序」文件夹" + echo " 3. 回到终端重新运行:bash install-macos.sh" + exit 1 +fi + +echo "① 清除「下载隔离」属性(Gatekeeper 拦截的来源)..." +xattr -cr "$APP_PATH" 2>/dev/null || true +echo " 完成" + +echo "② 验证代码签名状态:" +if codesign -dv "$APP_PATH" 2>&1 | grep -q "Signature=adhoc"; then + echo " Signature=adhoc(正常,ad-hoc 签名,右键打开即可运行)" +else + echo " (未检测到签名信息,属正常,不影响本脚本的运行方式)" +fi + +echo "③ 正在启动「${APP_NAME}」..." +open "$APP_PATH" +echo "" +echo "✅ 启动完成。" +echo "" +echo "如果仍提示「无法验证开发者」,请按下面任一种方式再试:" +echo " a) 右键 ${APP_NAME}.app → 打开 → 在弹出的提示中点「打开」" +echo " b) 系统设置 → 隐私与安全性 → 滚动到「安全性」→ 点「仍要打开」" +echo "" +echo "首次启动后应用即可正常使用,之后无需重复本操作。" diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 10cd892..6ce3820 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -1958,7 +1958,7 @@ dependencies = [ [[package]] name = "kimiswitch" -version = "0.7.1" +version = "0.7.2" dependencies = [ "anyhow", "chrono", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 7a209f2..0f4cfb4 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "kimiswitch" -version = "0.7.1" +version = "0.7.2" description = "Kimi Switch - model config manager" authors = ["codingplan.site"] edition = "2021" diff --git a/src-tauri/src/commands.rs b/src-tauri/src/commands.rs index d70888b..ae26724 100644 --- a/src-tauri/src/commands.rs +++ b/src-tauri/src/commands.rs @@ -949,6 +949,32 @@ pub fn open_installer(app: tauri::AppHandle, path: String) -> Result<(), String> .open_path(&path, None::<&str>) .map_err(|e| e.to_string()) } + +/// Launch `kimi web` — starts the local Kimi Code Web UI server and opens it +/// in the default browser (the code-app web bundle built into kimi-code 0.33+). +/// The kimi CLI must be on PATH; the spawned process is detached so the server +/// keeps running while Kimi Switch stays open. +#[tauri::command] +pub fn open_kimi_web() -> Result<(), String> { + use std::process::Command; + let mut cmd = Command::new("kimi"); + cmd.arg("web"); + #[cfg(windows)] + { + use std::os::windows::process::CommandExt; + // CREATE_NO_WINDOW: avoid a console window flashing next to the GUI. + cmd.creation_flags(0x08000000); + } + cmd.spawn() + .map(|_| ()) + .map_err(|e| { + if e.kind() == std::io::ErrorKind::NotFound { + "kimi executable not found on PATH — install Kimi Code CLI first".to_string() + } else { + format!("failed to start `kimi web`: {e}") + } + }) +} /// Preference for Linux is AppImage (portable, no install). If the preferred /// extension is not present, returns None so the UI can fall back to /// "open release page" instead of guessing a less-preferred format. diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index ab45d05..a55bfd6 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -109,6 +109,7 @@ pub fn run() { commands::download_update, commands::open_installer, commands::open_external_url, + commands::open_kimi_web, commands::kimi_oauth_start, commands::kimi_oauth_poll, commands::get_experimental_env_status, diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 0a4ef4c..8718d77 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,6 +1,6 @@ { "productName": "Kimi Switch", - "version": "0.7.1", + "version": "0.7.2", "identifier": "com.kimiswitch.app", "build": { "beforeDevCommand": "npm run dev", diff --git a/src/components/AgentSettingsPanel.tsx b/src/components/AgentSettingsPanel.tsx index c93247d..0206abb 100644 --- a/src/components/AgentSettingsPanel.tsx +++ b/src/components/AgentSettingsPanel.tsx @@ -24,7 +24,18 @@ const PERMISSION_LABELS: Record<(typeof PERMISSION_DECISIONS)[number], Translati ask: "permissionAsk", }; -const COMMON_EVENTS = ["PreToolUse", "PostToolUse"] as const; +// kimi-code 0.33+ added TurnStarted / UserPromptQueued / TaskStarted / +// SessionHeartbeat hook events (plus SessionStart / SessionEnd). +const COMMON_EVENTS = [ + "PreToolUse", + "PostToolUse", + "TurnStarted", + "UserPromptQueued", + "TaskStarted", + "SessionHeartbeat", + "SessionStart", + "SessionEnd", +] as const; export function AgentSettingsPanel({ rawOther, onChange }: AgentSettingsPanelProps) { const { t } = useTranslation(); @@ -91,9 +102,18 @@ export function AgentSettingsPanel({ rawOther, onChange }: AgentSettingsPanelPro updateLoopControl({ max_retries_per_step: v })} + label={t("maxAttemptsPerStep")} + value={ + settings.loop_control?.max_attempts_per_step ?? + settings.loop_control?.max_retries_per_step ?? + 3 + } + onChange={(v) => + updateLoopControl({ + max_attempts_per_step: v, + max_retries_per_step: v, + }) + } /> )} + {/* Kimi Code WebUI quick open */} + +

{t("webuiDesc")}

+ +
+ {/* Subagent: secondary model picker + inherited settings */}