@lynn123411/dsh-kimi-cu 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DETAILS.md +38 -10
- package/README.md +7 -5
- package/lib/client.js +226 -44
- package/lib/client.js.map +3 -3
- package/lib/index.js +432 -86
- package/lib/index.js.map +3 -3
- package/package.json +13 -15
- package/scripts/smoke-host.mjs +5 -0
- package/scripts/test-card.mjs +141 -9
- package/scripts/test-exclusivity.mjs +158 -0
- package/scripts/test-update.mjs +317 -0
- package/skills/macos/kimi-cu/SKILL.md +8 -21
package/DETAILS.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
| 行 id | 挂的包 | 作用 |
|
|
10
10
|
| --- | --- | --- |
|
|
11
|
-
| `dsh-kimi-cu` | 本包 | 宿主半边(`kimi_cu_status` 工具 + `/api/dsh-kimi-cu/status`
|
|
11
|
+
| `dsh-kimi-cu` | 本包 | 宿主半边(`kimi_cu_status` 工具 + `/api/dsh-kimi-cu/status` 与 `/api/dsh-kimi-cu/update` 两条路由 + MCP 注册)与浏览器半边(插件页状态卡) |
|
|
12
12
|
| `skill-kimi-cu-macos` | `@deepseek-ai/dsh-skill-filesystem` | 只扫本包 `skills/macos` |
|
|
13
13
|
| `skill-kimi-cu-windows` | `@deepseek-ai/dsh-skill-filesystem` | 只扫本包 `skills/windows` |
|
|
14
14
|
|
|
@@ -20,6 +20,14 @@
|
|
|
20
20
|
|
|
21
21
|
管理器还统一提供连接状态、重启与探测,KimiCU 的连接因此出现在与其他 MCP 服务器同一张表里。管理器缺失时 `ctx.inject(['mcpManager'])` 整块不激活,插件其余部分照常加载,只是没有 `mcp__kimi-cu__*` 工具。
|
|
22
22
|
|
|
23
|
+
## 为什么要占桌面操作的独占槽位
|
|
24
|
+
|
|
25
|
+
宿主把「控制桌面」当成独占能力:`@deepseek-ai/dsh-computer-use` 只放行一个提供方,第二个 `computerUse.register()` 直接抛错并报出已占位的名字。官方 CUA 与 Cua Driver 都经这个登记占位。
|
|
26
|
+
|
|
27
|
+
KimiCU 同样是桌面操作后端,但它的工具走 MCP,宿主看不见它在控制桌面。所以本插件也占位(名字 `kimi-cu`),并且**占到了才注册 MCP 连接**:槽位已被别的后端占着时不抢、也不交出工具,只写一条 warning。两套后端同时控制同一台机器,比少一套工具更危险。
|
|
28
|
+
|
|
29
|
+
两个可选服务谁先到不确定,所以注册动作收在 `syncMcp()` 里:条件齐了才动手,条件变了再算一次。组合里没有 `computerUse` 服务时行为不变,照常注册。槽位后来空出来要重启 DSH 才会补位——宿主的登记没有变更事件可订阅。
|
|
30
|
+
|
|
23
31
|
## 为什么 MCP 要按平台分
|
|
24
32
|
|
|
25
33
|
KimiCU 在 macOS 与 Windows 是两条产品线:macOS 只有 app 包,命令是 app 内的二进制,参数 `mcp -s user`;Windows 只有独立 runtime,默认装在 `%LOCALAPPDATA%\Kimi Computer Use`(0.3.8 起;旧目录 `%LOCALAPPDATA%\KimiCU` 由安装器建 junction 兼容),参数只有 `mcp`。平台判断在 `resolve.ts`:不受支持的平台给出 `mcp: null`,宿主半边就不注册,模型看到的仍是 `mcp__kimi-cu__*`。
|
|
@@ -38,18 +46,34 @@ Windows 走的是旧 13 工具 MCP,不是上游主推的 code-mode 插件:co
|
|
|
38
46
|
- `doctor.ts`:跑 `kimi-cu doctor` 并解析。macOS 解析 `✅`/`❌` 行;Windows 解析 `version=` 与 `mcp=true`。
|
|
39
47
|
- `status.ts`:把上面两样合成 `KimiCuStatus`,缓存 10 秒、并发单飞、`refresh` 绕过缓存;所有失败落进状态字段,不抛。探测整体失败时返回 `notes: ['detection-failed']` 的状态,路由与工具拿到的是状态而不是异常。
|
|
40
48
|
|
|
41
|
-
Windows 的路径公式只在 `resolve.ts` 的 `windowsMcpCommand` 里有一份;`test-status` 与 `check-bundle` 会逐 env 断言。覆盖值存在时只用覆盖值,不回退到默认/旧目录;旧目录安装会同时标 `legacy-install` 与 `mcp-command-missing
|
|
49
|
+
Windows 的路径公式只在 `resolve.ts` 的 `windowsMcpCommand` 里有一份;`test-status` 与 `check-bundle` 会逐 env 断言。覆盖值存在时只用覆盖值,不回退到默认/旧目录;旧目录安装会同时标 `legacy-install` 与 `mcp-command-missing`,卡片按「本机检查未通过」处理,不会在连接指向的文件不存在时报「本机检查通过」。
|
|
42
50
|
|
|
43
|
-
浏览器半边在 `src/client/`:注册 `plugins.bundle.config`(key 是包名),卡片按「未安装 /
|
|
51
|
+
浏览器半边在 `src/client/`:注册 `plugins.bundle.config`(key 是包名),卡片按「未安装 / 本机检查未通过 / 本机检查通过 / 不支持」四种状态渲染,给官方命令、复制、重新检测与文档链接。卡片只给安装命令,不执行安装脚本;已安装时版本行右侧多一个更新按钮,它只触发 KimiCU 自己的 `upgrade`。
|
|
44
52
|
|
|
45
53
|
`kimi_cu_status` 工具返回同一份 JSON;MCP 工具缺失或连接失败时,技能要求模型先查它,再把安装/修复步骤转告用户。
|
|
46
54
|
|
|
47
|
-
##
|
|
55
|
+
## 为什么安装不执行、更新却执行
|
|
56
|
+
|
|
57
|
+
- 安装器需要交互式权限授予:macOS 的辅助功能与屏幕录制只能在系统设置里由用户确认,后台执行拿不到。所以安装只给官方命令与复制,由用户在终端里执行。
|
|
58
|
+
- 更新走 KimiCU 自带的 `upgrade`:它自己下载、校验 SHA-256 与 Apple 公证或 Authenticode、替换安装、重启服务并自检,失败回滚;不需要交互式密码,也不要求退出 app。
|
|
59
|
+
- 因此更新可以由卡片触发,安装仍只给命令。装好后按提示开关插件。
|
|
48
60
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
61
|
+
## 更新链路
|
|
62
|
+
|
|
63
|
+
宿主半边在 `src/server/`:
|
|
64
|
+
|
|
65
|
+
- `update.ts`:清单解析、按数字段比版本、`==>` 行映射阶段、失败分类,以及带单飞锁的更新器。
|
|
66
|
+
- `update-runtime.ts`:读清单(5 秒超时)与跑 `upgrade` 子进程并逐行回调。
|
|
67
|
+
- `update-router.ts`:`GET /api/dsh-kimi-cu/update` 返回检查结果,`POST` 返回 NDJSON 事件流。
|
|
68
|
+
|
|
69
|
+
macOS 与 Windows 各有一份更新清单,版本号互不可比:macOS 读 `kimi-computer-use/latest/version.json`,Windows 读 `kimi-computer-use-windows/latest/version.json`。页面打开时静默读一次清单(与本地检测解耦),只用来决定按钮文案;点按钮时服务端重新比对,已是最新就直接返回,否则执行。
|
|
70
|
+
|
|
71
|
+
- **命令**:macOS 跑 `kimi-cu upgrade`(不带版本号,让 KimiCU 自己判断);Windows 的 `upgrade` 必须带目标版本,所以传清单里的版本号。
|
|
72
|
+
- **清单读不到**:macOS 照常跑,交给 KimiCU 判断;Windows 报网络错误,不执行。
|
|
73
|
+
- **阶段**:`==>` 开头的行映射成「正在下载/校验/替换/重连」,认不出的行保持上一个阶段。
|
|
74
|
+
- **失败分类**:只看错误行(跳过 `==>` 与 `✓` 进度行),分网络、校验失败、权限不足、已有升级在跑、超时五类,另有 unknown 兜底。
|
|
75
|
+
- **单飞锁与超时**:同一时刻只允许一次更新;5 分钟超时只放弃等待,不 kill 子进程,锁留到它真的退出。
|
|
76
|
+
- **重连**:升级后读到新版本号才调 `mcpManager.restart('kimi-cu')`;重启失败时卡片提示重启 DSH。
|
|
53
77
|
|
|
54
78
|
## 连不上时看什么
|
|
55
79
|
|
|
@@ -75,14 +99,16 @@ bundle patch 里的 `!!js` 表达式以**声明这份 patch 的那棵树**的 `b
|
|
|
75
99
|
|
|
76
100
|
## 随包技能从哪来
|
|
77
101
|
|
|
78
|
-
`skills/macos/kimi-cu/SKILL.md`
|
|
102
|
+
`skills/macos/kimi-cu/SKILL.md` 按 KimiCU MCP 的 18 个直接工具写,另加 DSH 适配(工具前缀、窗口级工具、`activate_window` / `debug_tap` 的边界、`kimi_cu_status`)。`skills/windows/kimi-cu/SKILL.md` 按 Windows runtime 的旧 13 工具 MCP 与官方 `INSTALL.md` 写。
|
|
103
|
+
|
|
104
|
+
上游随 Kimi Code 插件发的那份 `skills/kimi-cu/SKILL.md` 已经改成 CodeAct 优先(`cua.listApps`、`js` / `js_reset`、浏览器标签页),而 DSH 注册的 MCP 只暴露 18 个直接工具,没有 `js` 与浏览器工具。所以同步时只能取它的工具语义与边界,不能整篇照搬;参数以当前工具 schema 为准。
|
|
79
105
|
|
|
80
106
|
## 验证
|
|
81
107
|
|
|
82
108
|
包目录里跑 `pnpm check`,它由这几段组成:
|
|
83
109
|
|
|
84
110
|
1. `pnpm typecheck`。
|
|
85
|
-
2. `pnpm test`:构建 + `smoke-host`(真 cordis + 真 ToolRuntime)+ `smoke-client`(假 Web shell)+ `test-status`(纯逻辑)+ `test-card`(jsdom 渲染)。
|
|
111
|
+
2. `pnpm test`:构建 + `smoke-host`(真 cordis + 真 ToolRuntime)+ `smoke-client`(假 Web shell)+ `test-status`(纯逻辑)+ `test-update`(更新链路纯逻辑与更新器行为)+ `test-card`(jsdom 渲染)。
|
|
86
112
|
3. `assert:lib-untracked`。
|
|
87
113
|
4. `check-bundle.mjs`:清单面、文本面与契约面(内核真 `Config` schema、两平台分支、技能目录)。
|
|
88
114
|
5. `tools/probes/preset-skills.mjs --skills skills/macos` 与 `--skills skills/windows`。
|
|
@@ -93,4 +119,6 @@ bundle patch 里的 `!!js` 表达式以**声明这份 patch 的那棵树**的 `b
|
|
|
93
119
|
|
|
94
120
|
- 2026-11-08,内核 0.2.2-rc.1,macOS:`pnpm check` 全通过(typecheck、4 个测试脚本、check-bundle 16 条、两个技能根的 probe);`kimi-cu doctor` 五项全绿,`kimi_cu_status` 返回 0.6.8 与已就绪。
|
|
95
121
|
- 2026-11-08,内核 0.2.2-rc.1,macOS:`node tools/host-smoke.mjs` 装载通过,插件页能取到本包的 `client.js`。
|
|
122
|
+
- 2026-11-13,内核 0.2.2-rc.3,macOS:`pnpm check` 全通过(typecheck、6 个测试脚本、check-bundle 13 条、两个技能根的 probe)。
|
|
123
|
+
- 2026-11-13,真机更新链路:清单检查得出 0.7.5 已是最新,`run()` 直接返回 upToDate;`upgrade --force-reinstall` 6.7 秒退出 0,走完下载、签名与公证校验、替换与重启服务,`==>` 行依次映射到 checking、downloading、verifying,签名通过后映射到 installing;装完仍是 0.7.5,`doctor` 五项全绿,服务仍 enabled,`mcp__kimi-cu__*` 连接未中断。
|
|
96
124
|
- Windows 真机验收待补:卡片未安装 → 运行官方命令 → 重新检测 → 开关插件 → `mcp__kimi-cu__*` 工具出现 → `list_apps` 可用。
|
package/README.md
CHANGED
|
@@ -1,25 +1,27 @@
|
|
|
1
1
|
# @lynn123411/dsh-kimi-cu
|
|
2
2
|
|
|
3
|
-
把本机装的 KimiCU(macOS / Windows)接进 DSH:它的 MCP 服务变成模型可以直接调用的 `mcp__kimi-cu__*` 工具,随包带一份操作桌面的 `kimi-cu` 技能;插件页还会检测 KimiCU
|
|
3
|
+
把本机装的 KimiCU(macOS / Windows)接进 DSH:它的 MCP 服务变成模型可以直接调用的 `mcp__kimi-cu__*` 工具,随包带一份操作桌面的 `kimi-cu` 技能;插件页还会检测 KimiCU 是否装好、给出对应平台的官方安装命令,并在装好之后把 KimiCU 更新到最新。
|
|
4
4
|
|
|
5
5
|
## 功能
|
|
6
6
|
|
|
7
7
|
- **读写本机 app 界面**:模型能看到并操作已打开的应用窗口——观察、点击、输入、滚动、拖拽,以及列出应用和窗口。macOS 走后台静默操作;Windows 走前台真实输入,会短暂占用鼠标键盘。
|
|
8
|
-
- **安装检测与引导**:插件页详情页的状态卡显示「未安装 /
|
|
8
|
+
- **安装检测与引导**:插件页详情页的状态卡显示「未安装 / 已安装但本机检查未通过 / 本机检查通过」,给出当前平台的官方安装命令、复制按钮与重新检测;模型也可以用 `kimi_cu_status` 工具查同样的状态。
|
|
9
|
+
- **一键更新**:卡片读 KimiCU 官方的更新清单,有新版时按钮显示「更新到 x.y.z」;点一下由 KimiCU 自己的 `upgrade` 通道下载、校验签名并替换安装,过程中显示阶段文字,完成后就地更新版本号并重连 MCP。
|
|
9
10
|
- **随包带操作技能**:`kimi-cu` 技能说明怎么绑定目标窗口、什么时候重新观察、坐标与 index 怎么用、投递成功与真的生效怎么区分;macOS 与 Windows 各一份。
|
|
10
11
|
|
|
11
12
|
## 特性
|
|
12
13
|
|
|
13
14
|
- **装配按平台分流**:patch 里三条根层行——本包自己的宿主/浏览器半边、macOS 技能行、Windows 技能行;平台守卫保证同一时刻只有一条技能行启用。MCP 连接不占 patch 行,由宿主半边按探测结果注册。
|
|
14
15
|
- **Windows 走旧 13 工具 MCP**:`kimi-cu.exe mcp`,不需要 Node;工具面与 macOS 同族,但没有 `paste`、`drag_paths`、`js`、`list_windows`、`get_window`,多一个 `turn_ended`。
|
|
15
|
-
- **检测只看本机事实**:二进制是否存在、版本号、`doctor` 结果;缓存 10 秒,并发调用共用一次探测,`refresh`
|
|
16
|
-
-
|
|
16
|
+
- **检测只看本机事实**:二进制是否存在、版本号、`doctor` 结果;缓存 10 秒,并发调用共用一次探测,`refresh` 绕过缓存。`doctor` 只检查调用者上下文,所以「本机检查通过」不表示后台 Service 已就绪——服务权限要看 `xpc-ping`(见随包 macOS 技能)。
|
|
17
|
+
- **安装只给命令,更新交给 KimiCU 自己**:安装脚本不在插件里跑,卡片只给官方命令与复制;更新走 `kimi-cu upgrade`,下载、SHA-256 与签名校验、替换与回滚都由 KimiCU 完成,插件只负责触发、显示阶段与失败分类。装好后在插件页把本插件关一次再开一次(或重启 DSH)让 MCP 连接重建。
|
|
18
|
+
- **桌面操作是独占能力**:宿主只允许一个桌面操作后端,官方 CUA 与 Cua Driver 都经 `computerUse.register()` 占位。本插件同样占位(名字 `kimi-cu`),占到了才交出 `mcp__kimi-cu__*`;槽位已被别的后端占着时**不抢也不交出工具**,只写一条 warning——两套后端同时控制同一台机器比少一套工具更危险。组合里没有这个服务时行为不变。槽位后来空出来要重启 DSH 才会补位。
|
|
17
19
|
- **连不上有据可查**:MCP 连接由宿主的 `mcpManager` 管,连接状态、重启与探测都在它那一处;二进制缺失时插件启动会写一条带安装命令的 warning,`kimi_cu_status` 也照常回答。
|
|
18
20
|
- **长任务按 5 分钟计**:注册给管理器的条目把单次工具调用上限设成 5 分钟。
|
|
19
21
|
- **一条连接服务所有 session**:宿主只起一个 KimiCU MCP 连接;两个 session 同时操作同一个应用时要错开。
|
|
20
22
|
- **技能行另立门户**:`providerName: kimi-cu` + `includeDefaultRoots: false`,只扫本包对应平台的 `skills/`;项目与用户技能目录仍归内核那条默认行。
|
|
21
23
|
- **技能目录按包名解析**:bundle patch 的 `!!js` 以 profile 目录为 `baseUrl`,所以技能路径用 `createRequire(baseUrl).resolve(...)` 算成绝对路径。
|
|
22
|
-
- **自检盯着内核契约**:`pnpm check` 用内核自带 include 的 YAML 方言读 patch,拿内核 `skill-filesystem` 的真 `Config` schema 校验两条技能行,再照 Loader 的方式求值技能目录表达式;MCP
|
|
24
|
+
- **自检盯着内核契约**:`pnpm check` 用内核自带 include 的 YAML 方言读 patch,拿内核 `skill-filesystem` 的真 `Config` schema 校验两条技能行,再照 Loader 的方式求值技能目录表达式;MCP 注册那条链断言命令取自探测器、管理器走可选注入;更新链路由 `test-update` 盯住清单解析、版本比较、阶段映射、失败分类、单飞锁与超时;随包技能的真发现与真装载交给 `tools/probes/preset-skills.mjs`。装配、验证与实测记录见 [DETAILS.md](./DETAILS.md)。
|
|
23
25
|
|
|
24
26
|
## 安装
|
|
25
27
|
|
package/lib/client.js
CHANGED
|
@@ -48,6 +48,49 @@ async function fetchStatus(refresh = false) {
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
+
// src/shared/update.ts
|
|
52
|
+
var UPDATE_ROUTE_PATH = "/api/dsh-kimi-cu/update";
|
|
53
|
+
|
|
54
|
+
// src/client/update-remote.ts
|
|
55
|
+
async function fetchUpdateCheck() {
|
|
56
|
+
try {
|
|
57
|
+
const response = await fetch(UPDATE_ROUTE_PATH, { cache: "no-store" });
|
|
58
|
+
if (!response.ok) return { kind: "error", message: "HTTP " + String(response.status) };
|
|
59
|
+
const body = await response.json();
|
|
60
|
+
if (typeof body.error === "string") return { kind: "error", message: body.error };
|
|
61
|
+
return { kind: "ok", check: body };
|
|
62
|
+
} catch (error) {
|
|
63
|
+
return { kind: "error", message: error instanceof Error ? error.message : String(error) };
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
async function startUpdate(onEvent) {
|
|
67
|
+
try {
|
|
68
|
+
const response = await fetch(UPDATE_ROUTE_PATH, { method: "POST", cache: "no-store" });
|
|
69
|
+
if (!response.ok) return { ok: false, message: "HTTP " + String(response.status) };
|
|
70
|
+
if (response.body === null) return { ok: false, message: "empty response" };
|
|
71
|
+
const reader = response.body.getReader();
|
|
72
|
+
const decoder = new TextDecoder();
|
|
73
|
+
let pending = "";
|
|
74
|
+
for (; ; ) {
|
|
75
|
+
const { done, value } = await reader.read();
|
|
76
|
+
if (done) break;
|
|
77
|
+
pending += decoder.decode(value, { stream: true });
|
|
78
|
+
const lines = pending.split("\n");
|
|
79
|
+
pending = lines.pop() ?? "";
|
|
80
|
+
for (const line of lines) {
|
|
81
|
+
if (line.trim() === "") continue;
|
|
82
|
+
try {
|
|
83
|
+
onEvent(JSON.parse(line));
|
|
84
|
+
} catch {
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return { ok: true };
|
|
89
|
+
} catch (error) {
|
|
90
|
+
return { ok: false, message: error instanceof Error ? error.message : String(error) };
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
51
94
|
// src/client/ConfigCard.tsx
|
|
52
95
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
53
96
|
var NOTE_KEYS = {
|
|
@@ -68,6 +111,9 @@ function checkLabel(tr, check) {
|
|
|
68
111
|
const key = CHECK_KEYS[check.id];
|
|
69
112
|
return key === void 0 ? check.label : tr(key);
|
|
70
113
|
}
|
|
114
|
+
function toUpdateState(result) {
|
|
115
|
+
return result.kind === "ok" ? { kind: "ready", check: result.check } : { kind: "unavailable", message: result.message };
|
|
116
|
+
}
|
|
71
117
|
function docsUrl(install) {
|
|
72
118
|
const language = typeof navigator === "undefined" ? "en" : navigator.language.toLowerCase();
|
|
73
119
|
return language.startsWith("zh") ? install.docsUrl : install.docsUrlEn;
|
|
@@ -78,11 +124,21 @@ function ConfigCard(props) {
|
|
|
78
124
|
const [state, setState] = (0, import_react.useState)({ kind: "loading" });
|
|
79
125
|
const [copied, setCopied] = (0, import_react.useState)(false);
|
|
80
126
|
const [copyFailed, setCopyFailed] = (0, import_react.useState)(false);
|
|
127
|
+
const [update, setUpdate] = (0, import_react.useState)({ kind: "checking" });
|
|
128
|
+
const [run, setRun] = (0, import_react.useState)({ kind: "idle" });
|
|
129
|
+
const loadUpdate = () => {
|
|
130
|
+
setUpdate({ kind: "checking" });
|
|
131
|
+
void fetchUpdateCheck().then((result) => setUpdate(toUpdateState(result)));
|
|
132
|
+
};
|
|
81
133
|
(0, import_react.useEffect)(() => {
|
|
82
134
|
let alive = true;
|
|
83
135
|
void fetchStatus(false).then((result) => {
|
|
84
136
|
if (alive) setState(result);
|
|
85
137
|
});
|
|
138
|
+
void fetchUpdateCheck().then((result) => {
|
|
139
|
+
if (!alive) return;
|
|
140
|
+
setUpdate(toUpdateState(result));
|
|
141
|
+
});
|
|
86
142
|
return () => {
|
|
87
143
|
alive = false;
|
|
88
144
|
};
|
|
@@ -91,6 +147,8 @@ function ConfigCard(props) {
|
|
|
91
147
|
setState({ kind: "loading" });
|
|
92
148
|
setCopied(false);
|
|
93
149
|
setCopyFailed(false);
|
|
150
|
+
setRun({ kind: "idle" });
|
|
151
|
+
loadUpdate();
|
|
94
152
|
void fetchStatus(true).then((result) => setState(result));
|
|
95
153
|
};
|
|
96
154
|
const copy = (command) => {
|
|
@@ -105,18 +163,37 @@ function ConfigCard(props) {
|
|
|
105
163
|
() => setCopyFailed(true)
|
|
106
164
|
);
|
|
107
165
|
};
|
|
166
|
+
const updateNow = () => {
|
|
167
|
+
setRun({ kind: "running", stage: "checking" });
|
|
168
|
+
void startUpdate((event) => {
|
|
169
|
+
if (event.type === "stage") {
|
|
170
|
+
setRun({ kind: "running", stage: event.stage });
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
if (event.type === "error") {
|
|
174
|
+
setRun({ kind: "failed", failure: event.kind, raw: event.raw });
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
setRun({ kind: "done", upToDate: event.upToDate, version: event.version, reconnect: event.reconnect });
|
|
178
|
+
void fetchStatus(true).then((result) => setState(result));
|
|
179
|
+
loadUpdate();
|
|
180
|
+
}).then((outcome) => {
|
|
181
|
+
if (!outcome.ok) setRun({ kind: "failed", failure: "unknown", raw: outcome.message ?? "" });
|
|
182
|
+
});
|
|
183
|
+
};
|
|
108
184
|
if (state.kind === "loading") {
|
|
109
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-card", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-
|
|
185
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-card", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-hint", children: t("status.loading") }) });
|
|
110
186
|
}
|
|
111
187
|
if (state.kind === "error") {
|
|
112
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.
|
|
113
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-
|
|
114
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-
|
|
115
|
-
|
|
188
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-card", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-kimi-cu-row", children: [
|
|
189
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-label", children: t("status.state") }),
|
|
190
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-value", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-hint dsh-kimi-cu-error", children: t("status.error") }) }),
|
|
191
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-control", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.Button, { variant: "outline", size: "sm", onClick: recheck, children: t("status.retry") }) })
|
|
192
|
+
] }) });
|
|
116
193
|
}
|
|
117
194
|
const status = state.status;
|
|
118
195
|
if (!status.supported) {
|
|
119
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-card", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-
|
|
196
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-card", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-hint", children: t("status.unsupported") }) });
|
|
120
197
|
}
|
|
121
198
|
const install = status.install;
|
|
122
199
|
const docs = install === null ? null : docsUrl(install);
|
|
@@ -126,47 +203,96 @@ function ConfigCard(props) {
|
|
|
126
203
|
const notReady = doctorFailed || status.installed && commandMissing;
|
|
127
204
|
const showInstall = !status.installed || legacy || commandMissing;
|
|
128
205
|
const badge = !status.installed ? t("status.missing.title") : notReady ? t("status.notReady.title") : t("status.ready.title");
|
|
206
|
+
const updateHint = (() => {
|
|
207
|
+
if (run.kind === "running") return tr("update.stage." + run.stage);
|
|
208
|
+
if (run.kind === "failed") return tr("update.failed." + run.failure);
|
|
209
|
+
if (run.kind === "done") {
|
|
210
|
+
if (run.upToDate || run.version === null) return t("update.hint.latest");
|
|
211
|
+
return t("update.done") + " " + run.version;
|
|
212
|
+
}
|
|
213
|
+
if (update.kind === "checking") return t("update.hint.checking");
|
|
214
|
+
if (update.kind === "unavailable") return t("update.hint.unavailable");
|
|
215
|
+
return update.check.hasUpdate ? t("update.hint.available") : t("update.hint.latest");
|
|
216
|
+
})();
|
|
217
|
+
const updateLabel = (() => {
|
|
218
|
+
if (run.kind === "running") return t("update.running");
|
|
219
|
+
if (run.kind === "failed") return t("status.retry");
|
|
220
|
+
if (run.kind === "done") return t("update.latest");
|
|
221
|
+
if (update.kind === "ready") {
|
|
222
|
+
return update.check.hasUpdate ? t("update.to") + " " + (update.check.latest ?? "") : t("update.latest");
|
|
223
|
+
}
|
|
224
|
+
if (update.kind === "unavailable") return t("update.action");
|
|
225
|
+
return t("update.check");
|
|
226
|
+
})();
|
|
227
|
+
const updateDisabled = run.kind === "running" || run.kind === "done" || update.kind === "checking" || update.kind === "ready" && !update.check.hasUpdate;
|
|
228
|
+
const updateAction = update.kind === "ready" && !update.check.hasUpdate ? loadUpdate : updateNow;
|
|
129
229
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-kimi-cu-card", children: [
|
|
130
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-kimi-cu-
|
|
131
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
132
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
230
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-kimi-cu-row", children: [
|
|
231
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-label", children: t("status.state") }),
|
|
232
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-kimi-cu-value", children: [
|
|
233
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.Tag, { tone: !status.installed || notReady ? "danger" : "info", children: badge }),
|
|
234
|
+
status.installed ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-hint", children: t("status.missing.hint") }),
|
|
235
|
+
status.installed && !notReady && !legacy ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-hint", children: t("status.ready.hint") }) : null,
|
|
236
|
+
status.notes.map((note) => NOTE_KEYS[note] === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-hint", children: tr(NOTE_KEYS[note]) }, note))
|
|
237
|
+
] }),
|
|
238
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-control", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.Button, { variant: "ghost", size: "sm", disabled: run.kind === "running", onClick: recheck, children: t("status.recheck") }) })
|
|
133
239
|
] }),
|
|
134
|
-
status.installed ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
135
|
-
|
|
136
|
-
t("status.version"),
|
|
137
|
-
": ",
|
|
138
|
-
|
|
240
|
+
status.installed ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
241
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-kimi-cu-row", children: [
|
|
242
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-label", children: t("status.version") }),
|
|
243
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-value", children: status.version ?? "\u2014" })
|
|
244
|
+
] }),
|
|
245
|
+
status.path === null ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-kimi-cu-row", children: [
|
|
246
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-label", children: t("status.path") }),
|
|
247
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-value dsh-kimi-cu-path", children: status.path })
|
|
248
|
+
] }),
|
|
249
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-kimi-cu-row", children: [
|
|
250
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-label", children: t("update.label") }),
|
|
251
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-kimi-cu-value", children: [
|
|
252
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: run.kind === "failed" ? "dsh-kimi-cu-hint dsh-kimi-cu-error" : "dsh-kimi-cu-hint", children: updateHint }),
|
|
253
|
+
run.kind === "done" && run.reconnect === "failed" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-hint", children: t("update.reconnectFailed") }) : null
|
|
254
|
+
] }),
|
|
255
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-control", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.Button, { variant: "outline", size: "sm", disabled: updateDisabled, onClick: updateAction, children: updateLabel }) })
|
|
139
256
|
] }),
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
": ",
|
|
143
|
-
|
|
257
|
+
run.kind === "failed" ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-kimi-cu-row", children: [
|
|
258
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-label" }),
|
|
259
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-span", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("details", { className: "dsh-kimi-cu-raw", children: [
|
|
260
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("summary", { children: t("update.raw") }),
|
|
261
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("pre", { className: "dsh-kimi-cu-command", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("code", { children: run.raw }) })
|
|
262
|
+
] }) })
|
|
263
|
+
] }) : null
|
|
264
|
+
] }) : null,
|
|
265
|
+
notReady ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-kimi-cu-row", children: [
|
|
266
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-label", children: t("status.checks") }),
|
|
267
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-kimi-cu-span", children: [
|
|
268
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-hint", children: t("status.notReady.hint") }),
|
|
269
|
+
status.doctor.checks.length === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ul", { className: "dsh-kimi-cu-checks", children: status.doctor.checks.map((check) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("li", { className: check.ok ? "dsh-kimi-cu-check-ok" : "dsh-kimi-cu-check-bad", children: [
|
|
270
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: check.ok ? "\u2705" : "\u274C" }),
|
|
271
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: checkLabel(tr, check) })
|
|
272
|
+
] }, check.id)) }),
|
|
273
|
+
doctorFailed ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-hint", children: status.platform === "darwin" ? t("fix.macos") : t("fix.windows") }) : null
|
|
144
274
|
] })
|
|
145
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-note", children: t("status.missing.hint") }),
|
|
146
|
-
status.notes.map((note) => NOTE_KEYS[note] === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-note", children: tr(NOTE_KEYS[note]) }, note)),
|
|
147
|
-
notReady ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-kimi-cu-section", children: [
|
|
148
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-note", children: t("status.notReady.hint") }),
|
|
149
|
-
status.doctor.checks.length === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ul", { className: "dsh-kimi-cu-checks", children: status.doctor.checks.map((check) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("li", { className: check.ok ? "dsh-kimi-cu-check-ok" : "dsh-kimi-cu-check-bad", children: [
|
|
150
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: check.ok ? "\u2705" : "\u274C" }),
|
|
151
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: checkLabel(tr, check) })
|
|
152
|
-
] }, check.id)) }),
|
|
153
|
-
doctorFailed ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-note", children: status.platform === "darwin" ? t("fix.macos") : t("fix.windows") }) : null
|
|
154
275
|
] }) : null,
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
158
|
-
|
|
159
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
276
|
+
showInstall && install !== null ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-kimi-cu-row", children: [
|
|
277
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-label", children: t("status.install") }),
|
|
278
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-kimi-cu-span", children: [
|
|
279
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("pre", { className: "dsh-kimi-cu-command", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("code", { children: install.command }) }),
|
|
280
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-kimi-cu-actions", children: [
|
|
281
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.Button, { variant: "outline", size: "sm", onClick: () => copy(install.command), children: copied ? t("status.copied") : t("status.copy") }),
|
|
282
|
+
docs === null ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("a", { className: "dsh-kimi-cu-link", href: docs, target: "_blank", rel: "noreferrer", children: t("status.docs") })
|
|
283
|
+
] }),
|
|
284
|
+
copyFailed ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-hint", children: t("status.copyFailed") }) : null,
|
|
285
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("ol", { className: "dsh-kimi-cu-steps", children: install.steps.map((step) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { children: tr("step." + step) }, step)) })
|
|
286
|
+
] })
|
|
287
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-kimi-cu-row", children: [
|
|
288
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-label", children: t("status.docs.label") }),
|
|
289
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-span", children: docs === null ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("a", { className: "dsh-kimi-cu-link", href: docs, target: "_blank", rel: "noreferrer", children: t("status.docs") }) })
|
|
290
|
+
] })
|
|
165
291
|
] });
|
|
166
292
|
}
|
|
167
293
|
|
|
168
294
|
// src/client/ConfigCard.css
|
|
169
|
-
var ConfigCard_default = "/* \u63D2\u4EF6\u9875\u4E0A\u7684 KimiCU \u72B6\u6001\u5361\u3002 */\n\n.dsh-kimi-cu-card {\n display: flex;\n flex-direction: column;\n gap: 12px;\n}\n\n.dsh-kimi-cu-
|
|
295
|
+
var ConfigCard_default = "/* \u63D2\u4EF6\u9875\u4E0A\u7684 KimiCU \u72B6\u6001\u5361\uFF1A\u6BCF\u884C\u90FD\u662F\u300C\u6807\u7B7E | \u5185\u5BB9 | \u52A8\u4F5C\u300D\u4E09\u5217\uFF0C\u52A8\u4F5C\u6C38\u8FDC\u5728\u6700\u53F3\u5217\u3002 */\n\n.dsh-kimi-cu-card {\n display: flex;\n flex-direction: column;\n gap: 12px;\n}\n\n.dsh-kimi-cu-row {\n display: grid;\n grid-template-columns: 56px minmax(0, 1fr) auto;\n align-items: start;\n column-gap: 12px;\n}\n\n.dsh-kimi-cu-label {\n color: var(--dsw-alias-label-secondary);\n font-size: 12px;\n line-height: 20px;\n}\n\n.dsh-kimi-cu-value {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: 4px;\n min-width: 0;\n color: var(--dsw-alias-label-primary);\n font-size: 13px;\n line-height: 20px;\n}\n\n.dsh-kimi-cu-span {\n grid-column: 2 / -1;\n display: flex;\n flex-direction: column;\n gap: 8px;\n min-width: 0;\n}\n\n.dsh-kimi-cu-control {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n.dsh-kimi-cu-hint {\n color: var(--dsw-alias-label-secondary);\n font-size: 12px;\n line-height: 18px;\n}\n\n.dsh-kimi-cu-error {\n color: var(--dsw-alias-state-error-primary);\n}\n\n.dsh-kimi-cu-path {\n color: var(--dsw-alias-label-secondary);\n font-size: 12px;\n line-height: 18px;\n word-break: break-all;\n}\n\n.dsh-kimi-cu-command {\n margin: 0;\n padding: 10px 12px;\n border-radius: var(--dsw-radius-sm);\n background: var(--dsw-alias-bg-layer-2);\n color: var(--dsw-alias-label-primary);\n font-size: 12px;\n line-height: 18px;\n white-space: pre-wrap;\n word-break: break-all;\n}\n\n.dsh-kimi-cu-actions {\n display: flex;\n align-items: center;\n gap: 12px;\n}\n\n.dsh-kimi-cu-link {\n color: var(--dsw-alias-label-primary);\n font-size: 12px;\n line-height: 18px;\n text-decoration: underline;\n}\n\n.dsh-kimi-cu-checks {\n list-style: none;\n margin: 0;\n padding: 0;\n display: flex;\n flex-direction: column;\n gap: 4px;\n font-size: 12px;\n line-height: 18px;\n}\n\n.dsh-kimi-cu-checks li {\n display: flex;\n gap: 6px;\n}\n\n.dsh-kimi-cu-check-ok {\n color: var(--dsw-alias-label-secondary);\n}\n\n.dsh-kimi-cu-check-bad {\n color: var(--dsw-alias-state-error-primary);\n}\n\n.dsh-kimi-cu-steps {\n margin: 0;\n padding-left: 18px;\n color: var(--dsw-alias-label-secondary);\n font-size: 12px;\n line-height: 18px;\n}\n\n.dsh-kimi-cu-raw summary {\n color: var(--dsw-alias-label-secondary);\n font-size: 12px;\n line-height: 18px;\n cursor: pointer;\n}\n\n.dsh-kimi-cu-raw pre {\n margin-top: 8px;\n}\n";
|
|
170
296
|
|
|
171
297
|
// src/client/locales.ts
|
|
172
298
|
var NS = "kimiCu";
|
|
@@ -178,9 +304,9 @@ var en = {
|
|
|
178
304
|
"status.unsupported": "This plugin supports macOS and Windows only; no KimiCU connection starts on this platform.",
|
|
179
305
|
"status.missing.title": "KimiCU is not installed",
|
|
180
306
|
"status.missing.hint": "Install the official runtime, then check again.",
|
|
181
|
-
"status.notReady.title": "KimiCU is installed but
|
|
307
|
+
"status.notReady.title": "KimiCU is installed but local checks failed",
|
|
182
308
|
"status.notReady.hint": "Fix the failed checks below, then check again.",
|
|
183
|
-
"status.ready.title": "
|
|
309
|
+
"status.ready.title": "Local checks passed",
|
|
184
310
|
"status.ready.hint": "If the model cannot see the mcp__kimi-cu__* tools, turn this plugin off and on again on the Plugins page, or restart DSH.",
|
|
185
311
|
"status.copy": "Copy command",
|
|
186
312
|
"status.copied": "Copied",
|
|
@@ -188,6 +314,10 @@ var en = {
|
|
|
188
314
|
"status.docs": "Official docs",
|
|
189
315
|
"status.version": "Version",
|
|
190
316
|
"status.path": "Path",
|
|
317
|
+
"status.state": "Status",
|
|
318
|
+
"status.checks": "Checks",
|
|
319
|
+
"status.install": "Install",
|
|
320
|
+
"status.docs.label": "Docs",
|
|
191
321
|
"step.install": "Install the official KimiCU runtime.",
|
|
192
322
|
"step.grant-permissions": "In System Settings, grant Accessibility and Screen Recording to KimiCU.",
|
|
193
323
|
"step.reload-plugin": "Turn this plugin off and on again on the Plugins page, or restart DSH.",
|
|
@@ -205,7 +335,31 @@ var en = {
|
|
|
205
335
|
"fix.macos": "Open System Settings \u2192 Privacy & Security and enable Accessibility and Screen Recording for KimiCU.",
|
|
206
336
|
"fix.windows": "KimiCU needs the same privilege level as the target app; use its control panel to enable administrator mode when needed.",
|
|
207
337
|
"doctor.failed": "doctor reported a failure",
|
|
208
|
-
"doctor.notRun": "doctor was not run"
|
|
338
|
+
"doctor.notRun": "doctor was not run",
|
|
339
|
+
"update.check": "Check for updates",
|
|
340
|
+
"update.action": "Update",
|
|
341
|
+
"update.to": "Update to",
|
|
342
|
+
"update.latest": "Up to date",
|
|
343
|
+
"update.running": "Updating\u2026",
|
|
344
|
+
"update.done": "Updated to",
|
|
345
|
+
"update.raw": "Show raw output",
|
|
346
|
+
"update.label": "Update",
|
|
347
|
+
"update.hint.available": "A newer version is available.",
|
|
348
|
+
"update.hint.latest": "Already the newest version.",
|
|
349
|
+
"update.hint.unavailable": "Couldn't read the update manifest.",
|
|
350
|
+
"update.hint.checking": "Checking for updates\u2026",
|
|
351
|
+
"update.reconnectFailed": "The new version is installed; restart DSH to load it.",
|
|
352
|
+
"update.stage.checking": "Checking for updates\u2026",
|
|
353
|
+
"update.stage.downloading": "Downloading\u2026",
|
|
354
|
+
"update.stage.verifying": "Verifying the download\u2026",
|
|
355
|
+
"update.stage.installing": "Installing\u2026",
|
|
356
|
+
"update.stage.restarting": "Reconnecting the MCP server\u2026",
|
|
357
|
+
"update.failed.network": "Couldn't reach the KimiCU update server; check the network and retry.",
|
|
358
|
+
"update.failed.verify": "The downloaded package failed verification; nothing was changed.",
|
|
359
|
+
"update.failed.permission": "Couldn't replace the KimiCU install; run the installer from a terminal with administrator rights.",
|
|
360
|
+
"update.failed.busy": "Another update is already running; wait for it to finish.",
|
|
361
|
+
"update.failed.timeout": "The update did not finish within 5 minutes; it may still be running. Check again later.",
|
|
362
|
+
"update.failed.unknown": "The update failed."
|
|
209
363
|
};
|
|
210
364
|
var zh = {
|
|
211
365
|
"status.loading": "\u6B63\u5728\u68C0\u6D4B KimiCU\u2026",
|
|
@@ -215,9 +369,9 @@ var zh = {
|
|
|
215
369
|
"status.unsupported": "\u672C\u63D2\u4EF6\u53EA\u652F\u6301 macOS \u4E0E Windows\uFF1B\u5F53\u524D\u5E73\u53F0\u4E0D\u4F1A\u542F\u52A8 KimiCU \u8FDE\u63A5\u3002",
|
|
216
370
|
"status.missing.title": "\u672A\u68C0\u6D4B\u5230 KimiCU",
|
|
217
371
|
"status.missing.hint": "\u5148\u5B89\u88C5\u5B98\u65B9\u8FD0\u884C\u65F6\uFF0C\u518D\u56DE\u6765\u91CD\u65B0\u68C0\u6D4B\u3002",
|
|
218
|
-
"status.notReady.title": "\u5DF2\u5B89\u88C5 KimiCU\uFF0C\u4F46\
|
|
372
|
+
"status.notReady.title": "\u5DF2\u5B89\u88C5 KimiCU\uFF0C\u4F46\u672C\u673A\u68C0\u67E5\u672A\u901A\u8FC7",
|
|
219
373
|
"status.notReady.hint": "\u6309\u4E0B\u9762\u5931\u8D25\u7684\u68C0\u67E5\u9879\u4FEE\u590D\uFF0C\u518D\u91CD\u65B0\u68C0\u6D4B\u3002",
|
|
220
|
-
"status.ready.title": "
|
|
374
|
+
"status.ready.title": "\u672C\u673A\u68C0\u67E5\u901A\u8FC7",
|
|
221
375
|
"status.ready.hint": "\u5982\u679C\u6A21\u578B\u770B\u4E0D\u5230 mcp__kimi-cu__* \u5DE5\u5177\uFF0C\u8BF7\u5728\u63D2\u4EF6\u9875\u628A\u672C\u63D2\u4EF6\u5173\u4E00\u6B21\u518D\u5F00\u4E00\u6B21\uFF0C\u6216\u91CD\u542F DSH\u3002",
|
|
222
376
|
"status.copy": "\u590D\u5236\u547D\u4EE4",
|
|
223
377
|
"status.copied": "\u5DF2\u590D\u5236",
|
|
@@ -225,6 +379,10 @@ var zh = {
|
|
|
225
379
|
"status.docs": "\u5B98\u65B9\u6587\u6863",
|
|
226
380
|
"status.version": "\u7248\u672C",
|
|
227
381
|
"status.path": "\u8DEF\u5F84",
|
|
382
|
+
"status.state": "\u72B6\u6001",
|
|
383
|
+
"status.checks": "\u672C\u673A\u68C0\u67E5",
|
|
384
|
+
"status.install": "\u5B89\u88C5",
|
|
385
|
+
"status.docs.label": "\u6587\u6863",
|
|
228
386
|
"step.install": "\u5B89\u88C5\u5B98\u65B9 KimiCU \u8FD0\u884C\u65F6\u3002",
|
|
229
387
|
"step.grant-permissions": "\u5728\u7CFB\u7EDF\u8BBE\u7F6E\u91CC\u4E3A KimiCU \u5F00\u542F\u8F85\u52A9\u529F\u80FD\u4E0E\u5C4F\u5E55\u5F55\u5236\u3002",
|
|
230
388
|
"step.reload-plugin": "\u5728\u63D2\u4EF6\u9875\u628A\u672C\u63D2\u4EF6\u5173\u4E00\u6B21\u518D\u5F00\u4E00\u6B21\uFF0C\u6216\u91CD\u542F DSH\u3002",
|
|
@@ -242,7 +400,31 @@ var zh = {
|
|
|
242
400
|
"fix.macos": "\u6253\u5F00\u7CFB\u7EDF\u8BBE\u7F6E \u2192 \u9690\u79C1\u4E0E\u5B89\u5168\u6027\uFF0C\u4E3A KimiCU \u5F00\u542F\u8F85\u52A9\u529F\u80FD\u4E0E\u5C4F\u5E55\u5F55\u5236\u3002",
|
|
243
401
|
"fix.windows": "KimiCU \u9700\u8981\u4E0E\u76EE\u6807\u5E94\u7528\u540C\u7EA7\u7684\u6743\u9650\uFF1B\u9700\u8981\u65F6\u5728\u5B83\u7684\u63A7\u5236\u9762\u677F\u91CC\u5F00\u542F\u7BA1\u7406\u5458\u6A21\u5F0F\u3002",
|
|
244
402
|
"doctor.failed": "doctor \u62A5\u544A\u4E86\u5931\u8D25",
|
|
245
|
-
"doctor.notRun": "doctor \u6CA1\u6709\u8DD1\u8D77\u6765"
|
|
403
|
+
"doctor.notRun": "doctor \u6CA1\u6709\u8DD1\u8D77\u6765",
|
|
404
|
+
"update.check": "\u68C0\u67E5\u66F4\u65B0",
|
|
405
|
+
"update.action": "\u66F4\u65B0",
|
|
406
|
+
"update.to": "\u66F4\u65B0\u5230",
|
|
407
|
+
"update.latest": "\u5DF2\u662F\u6700\u65B0",
|
|
408
|
+
"update.running": "\u66F4\u65B0\u4E2D\u2026",
|
|
409
|
+
"update.done": "\u5DF2\u66F4\u65B0\u5230",
|
|
410
|
+
"update.raw": "\u67E5\u770B\u539F\u59CB\u8F93\u51FA",
|
|
411
|
+
"update.label": "\u66F4\u65B0",
|
|
412
|
+
"update.hint.available": "\u6709\u65B0\u7248\u672C\u53EF\u7528\u3002",
|
|
413
|
+
"update.hint.latest": "\u5DF2\u662F\u6700\u65B0\u7248\u672C\u3002",
|
|
414
|
+
"update.hint.unavailable": "\u8BFB\u4E0D\u5230\u66F4\u65B0\u6E05\u5355\u3002",
|
|
415
|
+
"update.hint.checking": "\u6B63\u5728\u68C0\u67E5\u66F4\u65B0\u2026",
|
|
416
|
+
"update.reconnectFailed": "\u65B0\u7248\u672C\u5DF2\u88C5\u597D\uFF1B\u91CD\u542F DSH \u540E\u751F\u6548\u3002",
|
|
417
|
+
"update.stage.checking": "\u6B63\u5728\u68C0\u67E5\u66F4\u65B0",
|
|
418
|
+
"update.stage.downloading": "\u6B63\u5728\u4E0B\u8F7D",
|
|
419
|
+
"update.stage.verifying": "\u6B63\u5728\u6821\u9A8C\u4E0B\u8F7D\u5305",
|
|
420
|
+
"update.stage.installing": "\u6B63\u5728\u66FF\u6362\u5B89\u88C5",
|
|
421
|
+
"update.stage.restarting": "\u6B63\u5728\u91CD\u8FDE MCP \u670D\u52A1",
|
|
422
|
+
"update.failed.network": "\u8FDE\u4E0D\u4E0A KimiCU \u7684\u66F4\u65B0\u670D\u52A1\u5668\uFF0C\u8BF7\u68C0\u67E5\u7F51\u7EDC\u540E\u91CD\u8BD5\u3002",
|
|
423
|
+
"update.failed.verify": "\u4E0B\u8F7D\u7684\u5B89\u88C5\u5305\u6821\u9A8C\u6CA1\u901A\u8FC7\uFF0C\u5DF2\u4E2D\u6B62\uFF0C\u6CA1\u6709\u6539\u52A8\u73B0\u6709\u5B89\u88C5\u3002",
|
|
424
|
+
"update.failed.permission": "\u6CA1\u6709\u6743\u9650\u66FF\u6362 KimiCU \u7684\u5B89\u88C5\uFF0C\u8BF7\u5728\u7EC8\u7AEF\u91CC\u7528\u7BA1\u7406\u5458\u6743\u9650\u8FD0\u884C\u5B89\u88C5\u811A\u672C\u3002",
|
|
425
|
+
"update.failed.busy": "\u5DF2\u7ECF\u6709\u4E00\u4E2A\u66F4\u65B0\u5728\u8FDB\u884C\uFF0C\u8BF7\u7B49\u5B83\u7ED3\u675F\u518D\u8BD5\u3002",
|
|
426
|
+
"update.failed.timeout": "\u66F4\u65B0\u8D85\u8FC7 5 \u5206\u949F\u8FD8\u6CA1\u7ED3\u675F\uFF0C\u5B83\u53EF\u80FD\u4ECD\u5728\u540E\u53F0\u8FDB\u884C\uFF1B\u7A0D\u540E\u70B9\u300C\u91CD\u65B0\u68C0\u6D4B\u300D\u770B\u7ED3\u679C\u3002",
|
|
427
|
+
"update.failed.unknown": "\u66F4\u65B0\u5931\u8D25\u3002"
|
|
246
428
|
};
|
|
247
429
|
|
|
248
430
|
// src/client/index.ts
|