@lynn123411/dsh-kimi-cu 0.1.3 → 0.2.1

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 CHANGED
@@ -2,75 +2,95 @@
2
2
 
3
3
  写给维护者。用户面向的说明在 [README.md](./README.md)。
4
4
 
5
- ## 两行落在哪
5
+ ## 三行落在哪
6
6
 
7
- `cordis.patch.yml` 只有一层 `insert`,两行都在根层:
7
+ `cordis.patch.yml` 只有一层 `insert`,三行都在根层:
8
8
 
9
9
  | 行 id | 挂的包 | 作用 |
10
10
  | --- | --- | --- |
11
- | `mcp-kimi-cu` | `@deepseek-ai/dsh-mcp-client` | stdio 连 `/Applications/KimiCU.app/Contents/MacOS/kimi-cu mcp -s user`,工具以 `mcp__kimi-cu__*` 出现在模型面前 |
12
- | `skill-kimi-cu` | `@deepseek-ai/dsh-skill-filesystem` | 第二份技能 provider,只扫本包 `skills/` |
11
+ | `dsh-kimi-cu` | 本包 | 宿主半边(`kimi_cu_status` 工具 + `/api/dsh-kimi-cu/status` 路由 + MCP 注册)与浏览器半边(插件页状态卡) |
12
+ | `skill-kimi-cu-macos` | `@deepseek-ai/dsh-skill-filesystem` | 只扫本包 `skills/macos` |
13
+ | `skill-kimi-cu-windows` | `@deepseek-ai/dsh-skill-filesystem` | 只扫本包 `skills/windows` |
13
14
 
14
15
  根层的意思是「进全局层」:profile 里每个 preset 的 agent 都能看到这批工具与这个技能。`dsh plugin --profile web add` 之后,本包名同时进 profile 的 `dependencies` 与 `dsh.profile.bundles`,`dsh.bundle.patch` 声明的这份 patch 随即并入层栈。
15
16
 
16
- 两行都带 `disabled: !!js process.platform !== 'darwin'`。守卫写在行上而不是包上:别的平台上插件照常可装可列,只是不启动任何一行。
17
+ ## MCP 连接为什么不在 patch 里
17
18
 
18
- ## 为什么 MCP 那行要 `failOnStartupError: true`
19
+ 宿主半边探测到可执行文件之后调用 `mcpManager.register('kimi-cu', …)`,命令与参数取自同一次探测。这样只有一处决定「连什么」:状态卡、`kimi_cu_status` 与真正的连接都读 `resolve.ts` 的同一份结果,不会出现 patch 表达式与检测逻辑各写一遍、改一处忘另一处的漂移。
19
20
 
20
- KimiCU 的二进制在 app 包内,不是 PATH 上的命令。不设 `failOnStartupError` 时,初次连不上只写一行日志,模型看不到任何工具——用户侧的表现是「插件装了但没用」。设成 `true` 让那一行的 fiber 在激活时回滚并报错,故障当场看得见。
21
+ 管理器还统一提供连接状态、重启与探测,KimiCU 的连接因此出现在与其他 MCP 服务器同一张表里。管理器缺失时 `ctx.inject(['mcpManager'])` 整块不激活,插件其余部分照常加载,只是没有 `mcp__kimi-cu__*` 工具。
21
22
 
22
- 代价要讲清楚:激活失败会连带销毁这条连接的重连监督器,所以开机时 KimiCU 没在跑,它不会自己回来——把 KimiCU 打开之后,要在插件页里把这个插件关一次再开一次(或重启),那一行才会重新连。宿主本身照常启动:`mcp-kimi-cu` 不在内核的必需启动行清单里(`agent-loop`、`webserver` 那一组),所以表现是一行启动警告加一行激活错误,不是宿主起不来。
23
+ ## 为什么 MCP 要按平台分
23
24
 
24
- MCP 与技能是两行,MCP 失败不影响技能那一行。
25
+ 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__*`。
25
26
 
26
- 环境变量按内核默认处理:ambient 环境里名字命中 `KEY` / `PASSWORD` / `SECRET` / `TOKEN` 的、以及 `DSH_*` 的会被丢掉,再叠 `config.env`。本插件不写 `env`,KimiCU 也不需要 DSH 注入任何凭据。
27
+ Windows 走的是旧 13 工具 MCP,不是上游主推的 code-mode 插件:code-mode 要求用户先装 Kimi Code 插件包、宿主 PATH 有 Node 24.15+,与本插件「装完即用」的目标冲突;旧 MCP 由 runtime 自带,不需要 Node,工具面与 macOS 同族。
27
28
 
28
- ## 为什么把工具调用上限设成 5 分钟
29
+ ## 为什么技能也按平台分两条
29
30
 
30
- 内核 `mcp-client` 的默认值是 60 秒。KimiCU 的 `js` cell 可以跑循环和批量操作,超过 60 秒会被客户端取消,服务端报 `previous cell was cancelled by the MCP client`。5 分钟覆盖常见的批量;更长的任务拆成多个 cell,不要把超时当进度条。
31
+ 两份技能的工具面与操作语义不同:macOS 是后台静默、AX 树、`paste` / `drag_paths` / `js`;Windows 是前台真实输入、UIA 树、`turn_ended`,没有 `paste` / `drag_paths` / `js`。合成一份会让模型在错误的平台上调用不存在的工具,所以各扫各的目录,技能名都叫 `kimi-cu`。
31
32
 
32
- ## 为什么技能行要另起一条
33
+ ## 检测与引导
33
34
 
34
- 内核的 base bundle 已经挂了一条 `skill-filesystem`(`id: skill-filesystem`),负责项目目录(`<project>/.dsh/skills`、`<project>/.agents/skills`)与用户目录(`~/.dsh/skills`、`~/.agents/skills`)。本插件另起一条同包的行,`providerName: kimi-cu`、`includeDefaultRoots: false`、`customSkillDirs: [<本包>/skills]`:两个 provider 并存,各扫各的根,默认那条一行都不用动。
35
+ 宿主半边在 `src/server/`:
35
36
 
36
- 同名技能在各自 provider 内先到先得,跨 provider 由 `ctx.skills` 按层与 rank 合并。
37
+ - `resolve.ts`:纯函数,解析安装位置、MCP 命令与安装计划;MCP 注册与状态卡都读它这一份(`check-bundle` 会逐平台断言)。
38
+ - `doctor.ts`:跑 `kimi-cu doctor` 并解析。macOS 解析 `✅`/`❌` 行;Windows 解析 `version=` 与 `mcp=true`。
39
+ - `status.ts`:把上面两样合成 `KimiCuStatus`,缓存 10 秒、并发单飞、`refresh` 绕过缓存;所有失败落进状态字段,不抛。探测整体失败时返回 `notes: ['detection-failed']` 的状态,路由与工具拿到的是状态而不是异常。
37
40
 
38
- ## 一条连接服务所有 session
41
+ Windows 的路径公式只在 `resolve.ts` 的 `windowsMcpCommand` 里有一份;`test-status` 与 `check-bundle` 会逐 env 断言。覆盖值存在时只用覆盖值,不回退到默认/旧目录;旧目录安装会同时标 `legacy-install` 与 `mcp-command-missing`,卡片按「未就绪」处理,不会在连接指向的文件不存在时报「已就绪」。
39
42
 
40
- 两行都在根层,宿主只起一个 KimiCU MCP 连接,所有 session 共用。KimiCU 的快照与 index 缓存是连接级的:两个 session 同时操作同一个应用,后一次观察会顶掉前一次的参照。技能要求每次动作前重新观察,正常使用能兜住;并发操作同一个窗口时仍要自己错开。
43
+ 浏览器半边在 `src/client/`:注册 `plugins.bundle.config`(key 是包名),卡片按「未安装 / 未就绪 / 已就绪 / 不支持」四种状态渲染,给官方命令、复制、重新检测与文档链接。卡片只给命令,不执行安装脚本。
41
44
 
42
- ## 技能目录为什么不能写相对路径
45
+ `kimi_cu_status` 工具返回同一份 JSON;MCP 工具缺失或连接失败时,技能要求模型先查它,再把安装/修复步骤转告用户。
43
46
 
44
- bundle patch 里的 `!!js` 表达式以**声明这份 patch 的那棵树**的 `baseUrl` 求值;对 bundle 层来说那是 profile 目录。所以技能目录写成先按包名解析出包目录、再拼 `skills`:
47
+ ## 为什么卡片不自动执行安装
45
48
 
46
- ```yaml
47
- - !!js process.getBuiltinModule('node:path').join(process.getBuiltinModule('node:path').dirname(process.getBuiltinModule('node:module').createRequire(baseUrl).resolve('@lynn123411/dsh-kimi-cu/package.json')), 'skills')
48
- ```
49
+ - 宿主静默执行远程脚本会绕过 DSH 的审批模型:安装器从 CDN 下载并替换运行时,失败时难以回滚。
50
+ - macOS 安装器需要交互式权限授予(辅助功能、屏幕录制),后台执行拿不到用户在系统设置里的确认。
51
+ - Windows 安装器会替换正在使用的运行时;如果宿主正连着它,更新与连接状态都会被打断。
52
+ - 因此卡片只给官方命令与复制,由用户在终端里执行;装好后按提示开关插件。
49
53
 
50
- 表达式里用 `process.getBuiltinModule` 取内置模块:它在 ESM 求值作用域里直接可用,是 Node 22 起的正式入口。兄弟 preset `plugin-upgrade-cordis` 的 patch 用的是同一个形状。
54
+ ## 连不上时看什么
51
55
 
52
- ## 随包技能从哪来
56
+ KimiCU 的二进制不在 PATH 上,所以「装了但没连上」是常见状态。三条信号各管一段:
53
57
 
54
- `skills/kimi-cu/SKILL.md` 以 KimiCU 自带技能为底稿,装 KimiCU 时底稿在 `/Users/tny/.kimi-code/plugins/managed/kimi-cu/skills/kimi-cu/SKILL.md`;包内这份另加 DSH 适配:工具名带 `mcp__kimi-cu__` 前缀、窗口级工具 `get_window_state` / `get_window` / `launch_app` 的用法,以及 `activate_window` / `debug_tap` 的使用边界。上游改了要人工同步一次,同步时保留 DSH 适配段;拷贝进包,技能内容就不受 KimiCU 的安装布局影响。
58
+ - 插件启动时探测一次,缺装就写一条带官方安装命令的 warning;
59
+ - `kimi_cu_status` 工具随时可查,返回安装位置、版本、`doctor` 结果与安装计划;
60
+ - 宿主的 `mcpManager` 记录这条连接的状态,重启与探测都在它那一处。
55
61
 
56
- 技能只有这一份 `SKILL.md`,没有附带脚本或参考文件,所以包内也不需要额外转发资源。
62
+ 注册发生在探测之后,所以装好 KimiCU 之后要在插件页里把本插件关一次再开一次(或重启),注册才会重新跑一次。
57
63
 
58
- ## 验证
64
+ ## 为什么把工具调用上限设成 5 分钟
65
+
66
+ 内核 `mcp-client` 的默认值是 60 秒。KimiCU 的 `js` cell 可以跑循环和批量操作,超过 60 秒会被客户端取消。5 分钟覆盖常见的批量;更长的任务拆成多个 cell。
67
+
68
+ ## 一条连接服务所有 session
59
69
 
60
- 包目录里跑 `pnpm check`,它由两段组成:
70
+ 宿主只起一个 KimiCU MCP 连接,所有 session 共用。KimiCU 的快照与 index 缓存是连接级的:两个 session 同时操作同一个应用,后一次观察会顶掉前一次的参照。技能要求每次动作前重新观察。
71
+
72
+ ## 技能目录为什么不能写相对路径
73
+
74
+ bundle patch 里的 `!!js` 表达式以**声明这份 patch 的那棵树**的 `baseUrl` 求值;对 bundle 层来说那是 profile 目录。所以技能目录写成先按包名解析出包目录、再拼 `skills/<platform>`。
75
+
76
+ ## 随包技能从哪来
77
+
78
+ `skills/macos/kimi-cu/SKILL.md` 以 KimiCU 自带技能为底稿,另加 DSH 适配(工具前缀、窗口级工具、`activate_window` / `debug_tap` 的边界、`kimi_cu_status`)。`skills/windows/kimi-cu/SKILL.md` 按 Windows runtime 的旧 13 工具 MCP 与官方 `INSTALL.md` 写。上游改了要人工同步一次。
79
+
80
+ ## 验证
61
81
 
62
- 1. `node scripts/check-bundle.mjs`——三层断言:
63
- - 清单面:`files`、`exports`、`icon` 点得到,locale 两种语言的标题与说明齐备,`SKILL.md` 的 frontmatter 合规。
64
- - 文本面:patch 只插两行、id 与内核包名对、两行都有 macOS 守卫、MCP 那行指向 app 内二进制、`failOnStartupError: true` 且工具调用上限不低于 2 分钟、技能那行另取 providerName 且关掉默认目录。
65
- - 契约面(本机装了内核才跑,缺内核时明说跳过):用内核自带 `cordis-plugin-include` 的 `entryListSchema` 读这份 patch(与装载时同一份 YAML 方言),把两行 config 交给内核 `dsh-mcp-client` 与 `dsh-skill-filesystem` 的真 `Config` schema,再照 Loader 的方式求值技能目录那条表达式,确认结果就是本包 `skills/`。
66
- 2. `node ../../tools/probes/preset-skills.mjs --skills skills`——用内核真正的 skill provider 做一次发现与装载:候选名对得上、`source` 是 `custom`、零条警告、正文取得回来、`resourceBase` 指回技能目录。没装内核的机器上它明说跳过。
82
+ 包目录里跑 `pnpm check`,它由这几段组成:
67
83
 
68
- 仓库级一次跑齐用 `node tools/check.mjs`(台账 + 每个包的 check + 产物新鲜度)。
84
+ 1. `pnpm typecheck`。
85
+ 2. `pnpm test`:构建 + `smoke-host`(真 cordis + 真 ToolRuntime)+ `smoke-client`(假 Web shell)+ `test-status`(纯逻辑)+ `test-card`(jsdom 渲染)。
86
+ 3. `assert:lib-untracked`。
87
+ 4. `check-bundle.mjs`:清单面、文本面与契约面(内核真 `Config` schema、两平台分支、技能目录)。
88
+ 5. `tools/probes/preset-skills.mjs --skills skills/macos` 与 `--skills skills/windows`。
69
89
 
70
- 机器上没有 KimiCU 时,前两段照跑,「KimiCU 真的连上了吗」不在 `check` 的范围内:那句要起真实例,用 `node tools/host-smoke.mjs` 或启用插件后看 MCP 工具是否出现。
90
+ 仓库级一次跑齐用 `node tools/check.mjs`;真装载用 `node tools/host-smoke.mjs`。
71
91
 
72
92
  ## 实测记录
73
93
 
74
- - 2026-10-25,内核 0.2.1-rc.2,macOS:`pnpm check` 两段全通过(`check-bundle` 11/11,`preset-skills` 报 1 个候选、装载通过);技能候选名与目录名一致。
75
- - 同日装进 web profile 后就地验证:`cordis_inspect_query` 的 `Config.listConfigs` 看到 `include:mcp-kimi-cu` 与 `include:skill-kimi-cu` 两行;工具表里出现 `mcp__kimi-cu__*`,调 `list_apps` 返回 11 个在跑的应用;技能目录里出现 `kimi-cu`;插件页卡片显示本包的标题与说明。
76
- - 2026-11-02,内核 0.2.1-rc.2,KimiCU 0.6.8,macOS:`pnpm check` 两段全通过(`check-bundle` 12/12,`preset-skills` 报 1 个候选、装载通过);按插件的启动参数起 KimiCU MCP,握手成功,`tools/list` 返回全部工具,实调 `list_apps` 返回在跑的应用;把超时断言变异成 60 秒后该条 FAIL。
94
+ - 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
+ - 2026-11-08,内核 0.2.2-rc.1,macOS:`node tools/host-smoke.mjs` 装载通过,插件页能取到本包的 `client.js`。
96
+ - Windows 真机验收待补:卡片未安装 → 运行官方命令 → 重新检测 → 开关插件 → `mcp__kimi-cu__*` 工具出现 → `list_apps` 可用。
package/README.md CHANGED
@@ -1,27 +1,30 @@
1
1
  # @lynn123411/dsh-kimi-cu
2
2
 
3
- 把本机装的 KimiCU 接进 DSH:它的 `mcp -s user` 服务变成模型可以直接调用的 `mcp__kimi-cu__*` 工具,同时随包带一份操作桌面界面用的 `kimi-cu` 技能。插件本体没有一行自有代码——两件事都落在同一条 bundle patch 的两行里,挂的都是内核现成的包。
3
+ 把本机装的 KimiCU(macOS / Windows)接进 DSH:它的 MCP 服务变成模型可以直接调用的 `mcp__kimi-cu__*` 工具,随包带一份操作桌面的 `kimi-cu` 技能;插件页还会检测 KimiCU 是否装好,并给出对应平台的官方安装命令。
4
4
 
5
5
  ## 功能
6
6
 
7
- - **读写本机 app 界面**:模型能看到并操作 macOS 上已打开的应用窗口——观察无障碍树与截图、点击、输入、滚动、拖拽,以及列出应用和窗口。
8
- - **随包带操作技能**:`kimi-cu` 技能说明怎么绑定目标窗口、什么时候重新观察、坐标与 index 怎么用、投递成功与真的生效怎么区分,也写明 DSH 里的工具前缀、窗口级工具与前台操作的边界;模型按技能里的规则调用上面那些工具。
7
+ - **读写本机 app 界面**:模型能看到并操作已打开的应用窗口——观察、点击、输入、滚动、拖拽,以及列出应用和窗口。macOS 走后台静默操作;Windows 走前台真实输入,会短暂占用鼠标键盘。
8
+ - **安装检测与引导**:插件页详情页的状态卡显示「未安装 / 已安装但未就绪 / 已就绪」,给出当前平台的官方安装命令、复制按钮与重新检测;模型也可以用 `kimi_cu_status` 工具查同样的状态。
9
+ - **随包带操作技能**:`kimi-cu` 技能说明怎么绑定目标窗口、什么时候重新观察、坐标与 index 怎么用、投递成功与真的生效怎么区分;macOS 与 Windows 各一份。
9
10
 
10
11
  ## 特性
11
12
 
12
- - **两行都是内核自带的包**:MCP 那行挂 `@deepseek-ai/dsh-mcp-client`,技能那行挂 `@deepseek-ai/dsh-skill-filesystem`。本包只负责声明配置、带技能文件与自检。
13
- - **只在 macOS 上生效**:KimiCU 只有 macOS 版,两行都写着 `disabled: !!js process.platform !== 'darwin'`,别的平台上插件装上也不启动任何一行。
14
- - **连不上就当场报错**:MCP 那行 `failOnStartupError: true`,二进制不在 `/Applications/KimiCU.app/Contents/MacOS/kimi-cu` 或 `mcp` 子命令没有响应时,那一行激活失败并报错,而不是静默少掉一整排工具。代价是这条连接的重连监督器一并销毁:把 KimiCU 打开之后,要在插件页里关一次再开一次(或重启)才会重连。宿主本身照常启动。
15
- - **长任务按 5 分钟计**:MCP 那行把单次工具调用上限设成 5 分钟,`js` 里的循环和批量操作不会在内核默认的 60 秒被客户端取消。
16
- - **工具面不裁剪**:KimiCU 列出的工具全部露出,包括窗口级观察、后台启动与排障入口;调用边界由随包技能写明,`activate_window` 只在用户明确要求切前台时使用,`debug_tap` 只用于排障。
17
- - **一条连接服务所有 session**:两行都在根层,宿主只起一个 KimiCU MCP 连接,快照与 index 缓存是连接级的;两个 session 同时操作同一个应用时要错开,技能要求每次动作前重新观察。
18
- - **技能行另立门户**:`providerName: kimi-cu` + `includeDefaultRoots: false`,只扫本包的 `skills/`;项目与用户技能目录仍归内核那条默认行,两边互不覆盖,同名技能也不会互相顶掉。
19
- - **技能目录按包名解析**:bundle patch 的 `!!js` 以 profile 目录为 `baseUrl`,所以技能路径用 `createRequire(baseUrl).resolve('@lynn123411/dsh-kimi-cu/package.json')` 算成绝对路径,而不是相对路径。
20
- - **装完即生效**:两行都在根层,profile 里每个 preset 的 agent 都看得见这批工具与这个技能;改过 patch 之后要触发一次重新组合才换配置(带 `hmr` 的 Web profile 在插件页开关一次即可)。
21
- - **自检盯着内核契约**:`pnpm check` 用内核自带 include 的 YAML 方言读这份 patch,拿内核两个包的真 `Config` schema 校验两行配置,再照 Loader 的方式求值一遍技能目录那条表达式;随包技能的真发现与真装载交给 `tools/probes/preset-skills.mjs`。装配、验证与实测记录见 [DETAILS.md](./DETAILS.md)。
13
+ - **装配按平台分流**:patch 里三条根层行——本包自己的宿主/浏览器半边、macOS 技能行、Windows 技能行;平台守卫保证同一时刻只有一条技能行启用。MCP 连接不占 patch 行,由宿主半边按探测结果注册。
14
+ - **Windows 走旧 13 工具 MCP**:`kimi-cu.exe mcp`,不需要 Node;工具面与 macOS 同族,但没有 `paste`、`drag_paths`、`js`、`list_windows`、`get_window`,多一个 `turn_ended`。
15
+ - **检测只看本机事实**:二进制是否存在、版本号、`doctor` 结果;缓存 10 秒,并发调用共用一次探测,`refresh` 绕过缓存。
16
+ - **只给命令,不执行安装**:卡片给官方命令与复制,不静默运行远程脚本;装好后在插件页把本插件关一次再开一次(或重启 DSH)让 MCP 连接重建。
17
+ - **连不上有据可查**:MCP 连接由宿主的 `mcpManager` 管,连接状态、重启与探测都在它那一处;二进制缺失时插件启动会写一条带安装命令的 warning,`kimi_cu_status` 也照常回答。
18
+ - **长任务按 5 分钟计**:注册给管理器的条目把单次工具调用上限设成 5 分钟。
19
+ - **一条连接服务所有 session**:宿主只起一个 KimiCU MCP 连接;两个 session 同时操作同一个应用时要错开。
20
+ - **技能行另立门户**:`providerName: kimi-cu` + `includeDefaultRoots: false`,只扫本包对应平台的 `skills/`;项目与用户技能目录仍归内核那条默认行。
21
+ - **技能目录按包名解析**:bundle patch 的 `!!js` 以 profile 目录为 `baseUrl`,所以技能路径用 `createRequire(baseUrl).resolve(...)` 算成绝对路径。
22
+ - **自检盯着内核契约**:`pnpm check` 用内核自带 include 的 YAML 方言读 patch,拿内核 `skill-filesystem` 的真 `Config` schema 校验两条技能行,再照 Loader 的方式求值技能目录表达式;MCP 注册那条链断言命令取自探测器、管理器走可选注入;随包技能的真发现与真装载交给 `tools/probes/preset-skills.mjs`。装配、验证与实测记录见 [DETAILS.md](./DETAILS.md)。
22
23
 
23
24
  ## 安装
24
25
 
25
26
  ```bash
26
27
  dsh plugin --profile web add @lynn123411/dsh-kimi-cu
27
28
  ```
29
+
30
+ 首次使用前需要先安装 KimiCU;装好插件后打开插件页的详情页,状态卡会给出当前平台的官方安装命令。
package/cordis.patch.yml CHANGED
@@ -1,37 +1,39 @@
1
1
  # @lynn123411/dsh-kimi-cu bundle patch
2
2
  # 声明在 package.json 的 dsh.bundle.patch,`dsh plugin --profile web add` 后自动并入 profile 层栈。
3
3
  #
4
- # 两行都是内核自带的包,本插件不带任何自有代码:
5
- # - mcp-kimi-cu:把本机 KimiCU 的 `mcp -s user` 挂成 mcp__kimi-cu__* 工具。
6
- # - skill-kimi-cu:另起一条技能行,只扫本包 `skills/`(随包带的那份 kimi-cu 技能)。
4
+ # 三行都在根层:
5
+ # - dsh-kimi-cu:本包自己。宿主半边(kimi_cu_status 工具 + 状态路由)与浏览器半边
6
+ # (插件页状态卡)都挂在这一行;这一行不设平台守卫,别的平台上照常加载,卡片会说明
7
+ # 当前平台不受支持。
8
+ # - MCP 连接不在这里:宿主半边探测到可执行文件后调用 `mcpManager.register('kimi-cu', …)`,
9
+ # 命令与状态卡、`kimi_cu_status` 说的是同一份路径(见 src/index.ts)。
10
+ # - skill-kimi-cu-macos / skill-kimi-cu-windows:随包技能,各扫自己的目录。
7
11
  #
8
- # 两行都带 macOS 守卫:KimiCU 只有 macOS 版,别的平台上插件装上也不生效,更不会因为
9
- # 找不到 /Applications/KimiCU.app 让宿主启动失败。
12
+ # KimiCU 在 macOS 与 Windows 是两条产品线:macOS 只有 app 包,Windows 只有独立 runtime,
13
+ # 所以路径、参数与技能内容都按平台分开。
10
14
  - insert:
11
- # KimiCU 的二进制在 app 包里,不是 PATH 上的命令。
12
- - id: mcp-kimi-cu
13
- name: '@deepseek-ai/dsh-mcp-client'
14
- disabled: !!js process.platform !== 'darwin'
15
- config:
16
- serverName: kimi-cu
17
- transport: stdio
18
- command: /Applications/KimiCU.app/Contents/MacOS/kimi-cu
19
- args: [mcp, -s, user]
20
- # 连不上时报错并让这一行回滚,而不是静默少掉一整排工具。
21
- failOnStartupError: true
22
- # 内核默认 60 秒就取消一次调用;KimiCU 的 js 里可能跑长循环,
23
- # 留 5 分钟,避免把还在执行的 cell 当成失败。
24
- toolCallTimeoutMs: 300000
15
+ # 本包自己的根层行:宿主半边 + 浏览器半边。
16
+ - id: dsh-kimi-cu
17
+ name: '@lynn123411/dsh-kimi-cu'
25
18
 
26
19
  # 技能 provider 的第二份:providerName 另取一个名字,includeDefaultRoots 关掉默认目录,
27
- # 只扫本包的 skills/。内核那条默认技能行照旧负责项目与用户技能目录。
20
+ # 只扫本包对应的那份技能。内核那条默认技能行照旧负责项目与用户技能目录。
28
21
  #
29
- # 路径必须写成包里解析出来的绝对路径:bundle patch 的 `!!js` 以 PROFILE 目录为 baseUrl。
30
- - id: skill-kimi-cu
22
+ # 路径必须写成包里解析出来的绝对路径:bundle patch 的 !!js 以 PROFILE 目录为 baseUrl。
23
+ - id: skill-kimi-cu-macos
31
24
  name: '@deepseek-ai/dsh-skill-filesystem'
32
25
  disabled: !!js process.platform !== 'darwin'
33
26
  config:
34
27
  providerName: kimi-cu
35
28
  includeDefaultRoots: false
36
29
  customSkillDirs:
37
- - !!js process.getBuiltinModule('node:path').join(process.getBuiltinModule('node:path').dirname(process.getBuiltinModule('node:module').createRequire(baseUrl).resolve('@lynn123411/dsh-kimi-cu/package.json')), 'skills')
30
+ - !!js process.getBuiltinModule('node:path').join(process.getBuiltinModule('node:path').dirname(process.getBuiltinModule('node:module').createRequire(baseUrl).resolve('@lynn123411/dsh-kimi-cu/package.json')), 'skills', 'macos')
31
+
32
+ - id: skill-kimi-cu-windows
33
+ name: '@deepseek-ai/dsh-skill-filesystem'
34
+ disabled: !!js process.platform !== 'win32'
35
+ config:
36
+ providerName: kimi-cu
37
+ includeDefaultRoots: false
38
+ customSkillDirs:
39
+ - !!js process.getBuiltinModule('node:path').join(process.getBuiltinModule('node:path').dirname(process.getBuiltinModule('node:module').createRequire(baseUrl).resolve('@lynn123411/dsh-kimi-cu/package.json')), 'skills', 'windows')
package/lib/client.js ADDED
@@ -0,0 +1,281 @@
1
+ window.__ModuleLoader__.load({ id: "@lynn123411/dsh-kimi-cu", factory: (require) => { var module = { exports: {} }; var exports = module.exports;
2
+ "use strict";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name2 in all)
9
+ __defProp(target, name2, { get: all[name2], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/client/index.ts
22
+ var index_exports = {};
23
+ __export(index_exports, {
24
+ apply: () => apply,
25
+ inject: () => inject,
26
+ name: () => name
27
+ });
28
+ module.exports = __toCommonJS(index_exports);
29
+
30
+ // src/client/ConfigCard.tsx
31
+ var import_react = require("react");
32
+ var import_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
33
+
34
+ // src/shared/status.ts
35
+ var STATUS_ROUTE_PATH = "/api/dsh-kimi-cu/status";
36
+
37
+ // src/client/status-remote.ts
38
+ async function fetchStatus(refresh = false) {
39
+ try {
40
+ const url = refresh ? STATUS_ROUTE_PATH + "?refresh=1" : STATUS_ROUTE_PATH;
41
+ const response = await fetch(url);
42
+ if (!response.ok) return { kind: "error", message: "HTTP " + String(response.status) };
43
+ const body = await response.json();
44
+ if (typeof body.error === "string") return { kind: "error", message: body.error };
45
+ return { kind: "ok", status: body };
46
+ } catch (error) {
47
+ return { kind: "error", message: error instanceof Error ? error.message : String(error) };
48
+ }
49
+ }
50
+
51
+ // src/client/ConfigCard.tsx
52
+ var import_jsx_runtime = require("react/jsx-runtime");
53
+ var NOTE_KEYS = {
54
+ "legacy-install": "note.legacy-install",
55
+ "override-missing": "note.override-missing",
56
+ "mcp-command-missing": "note.mcp-command-missing",
57
+ "detection-failed": "note.detection-failed"
58
+ };
59
+ var CHECK_KEYS = {
60
+ accessibility: "check.accessibility",
61
+ "screen-recording": "check.screen-recording",
62
+ skylight: "check.skylight",
63
+ "bg-input": "check.bg-input",
64
+ "signed-keyboard": "check.signed-keyboard",
65
+ mcp: "check.mcp"
66
+ };
67
+ function checkLabel(tr, check) {
68
+ const key = CHECK_KEYS[check.id];
69
+ return key === void 0 ? check.label : tr(key);
70
+ }
71
+ function docsUrl(install) {
72
+ const language = typeof navigator === "undefined" ? "en" : navigator.language.toLowerCase();
73
+ return language.startsWith("zh") ? install.docsUrl : install.docsUrlEn;
74
+ }
75
+ function ConfigCard(props) {
76
+ const { t } = props;
77
+ const tr = t;
78
+ const [state, setState] = (0, import_react.useState)({ kind: "loading" });
79
+ const [copied, setCopied] = (0, import_react.useState)(false);
80
+ const [copyFailed, setCopyFailed] = (0, import_react.useState)(false);
81
+ (0, import_react.useEffect)(() => {
82
+ let alive = true;
83
+ void fetchStatus(false).then((result) => {
84
+ if (alive) setState(result);
85
+ });
86
+ return () => {
87
+ alive = false;
88
+ };
89
+ }, []);
90
+ const recheck = () => {
91
+ setState({ kind: "loading" });
92
+ setCopied(false);
93
+ setCopyFailed(false);
94
+ void fetchStatus(true).then((result) => setState(result));
95
+ };
96
+ const copy = (command) => {
97
+ setCopyFailed(false);
98
+ const clipboard = typeof navigator === "undefined" ? void 0 : navigator.clipboard;
99
+ if (clipboard === void 0) {
100
+ setCopyFailed(true);
101
+ return;
102
+ }
103
+ void clipboard.writeText(command).then(
104
+ () => setCopied(true),
105
+ () => setCopyFailed(true)
106
+ );
107
+ };
108
+ 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-note", children: t("status.loading") }) });
110
+ }
111
+ if (state.kind === "error") {
112
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-kimi-cu-card", children: [
113
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-note", children: t("status.error") }),
114
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-actions", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.Button, { variant: "outline", size: "sm", onClick: recheck, children: t("status.retry") }) })
115
+ ] });
116
+ }
117
+ const status = state.status;
118
+ 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-note", children: t("status.unsupported") }) });
120
+ }
121
+ const install = status.install;
122
+ const docs = install === null ? null : docsUrl(install);
123
+ const legacy = status.notes.includes("legacy-install");
124
+ const commandMissing = status.notes.includes("mcp-command-missing");
125
+ const doctorFailed = status.installed && status.doctor.ran && !status.doctor.ok;
126
+ const notReady = doctorFailed || status.installed && commandMissing;
127
+ const showInstall = !status.installed || legacy || commandMissing;
128
+ const badge = !status.installed ? t("status.missing.title") : notReady ? t("status.notReady.title") : t("status.ready.title");
129
+ 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-head", children: [
131
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.Tag, { tone: !status.installed || notReady ? "danger" : "info", children: badge }),
132
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.Button, { variant: "ghost", size: "sm", onClick: recheck, children: t("status.recheck") })
133
+ ] }),
134
+ status.installed ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-kimi-cu-meta", children: [
135
+ status.version === null ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
136
+ t("status.version"),
137
+ ": ",
138
+ status.version
139
+ ] }),
140
+ status.path === null ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "dsh-kimi-cu-path", children: [
141
+ t("status.path"),
142
+ ": ",
143
+ status.path
144
+ ] })
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
+ ] }) : null,
155
+ status.installed && !notReady && !legacy ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-note", children: t("status.ready.hint") }) : null,
156
+ showInstall && install !== null ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-kimi-cu-section", children: [
157
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("pre", { className: "dsh-kimi-cu-command", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("code", { children: install.command }) }),
158
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-kimi-cu-actions", children: [
159
+ /* @__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") }),
160
+ 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") })
161
+ ] }),
162
+ copyFailed ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-note", children: t("status.copyFailed") }) : null,
163
+ /* @__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)) })
164
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-actions", 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") }) })
165
+ ] });
166
+ }
167
+
168
+ // 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-head {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n}\n\n.dsh-kimi-cu-meta {\n display: flex;\n flex-wrap: wrap;\n gap: 12px;\n color: var(--dsw-alias-label-secondary);\n font-size: 12px;\n line-height: 18px;\n}\n\n.dsh-kimi-cu-path {\n word-break: break-all;\n}\n\n.dsh-kimi-cu-note {\n color: var(--dsw-alias-label-secondary);\n font-size: 12px;\n line-height: 18px;\n}\n\n.dsh-kimi-cu-section {\n display: flex;\n flex-direction: column;\n gap: 8px;\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 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";
170
+
171
+ // src/client/locales.ts
172
+ var NS = "kimiCu";
173
+ var en = {
174
+ "status.loading": "Checking KimiCU\u2026",
175
+ "status.error": "Couldn't read the KimiCU status.",
176
+ "status.retry": "Retry",
177
+ "status.recheck": "Check again",
178
+ "status.unsupported": "This plugin supports macOS and Windows only; no KimiCU connection starts on this platform.",
179
+ "status.missing.title": "KimiCU is not installed",
180
+ "status.missing.hint": "Install the official runtime, then check again.",
181
+ "status.notReady.title": "KimiCU is installed but not ready",
182
+ "status.notReady.hint": "Fix the failed checks below, then check again.",
183
+ "status.ready.title": "KimiCU is ready",
184
+ "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
+ "status.copy": "Copy command",
186
+ "status.copied": "Copied",
187
+ "status.copyFailed": "Copy failed; select the command manually.",
188
+ "status.docs": "Official docs",
189
+ "status.version": "Version",
190
+ "status.path": "Path",
191
+ "step.install": "Install the official KimiCU runtime.",
192
+ "step.grant-permissions": "In System Settings, grant Accessibility and Screen Recording to KimiCU.",
193
+ "step.reload-plugin": "Turn this plugin off and on again on the Plugins page, or restart DSH.",
194
+ "step.upgrade": "Upgrade KimiCU to 0.3.8 or later.",
195
+ "note.legacy-install": "An older KimiCU install was found; upgrade it so the MCP row can use the new path.",
196
+ "note.override-missing": "KIMI_CU_WINDOWS_EXE points to a file that does not exist; fix the path or unset it.",
197
+ "note.mcp-command-missing": "The MCP row will launch a file that does not exist; upgrade KimiCU or point KIMI_CU_WINDOWS_EXE at the installed kimi-cu.exe.",
198
+ "note.detection-failed": "Detection failed; see the error and try again.",
199
+ "check.accessibility": "Accessibility",
200
+ "check.screen-recording": "Screen Recording",
201
+ "check.skylight": "SkyLight post-to-pid",
202
+ "check.bg-input": "Background input",
203
+ "check.signed-keyboard": "Signed keyboard",
204
+ "check.mcp": "MCP server",
205
+ "fix.macos": "Open System Settings \u2192 Privacy & Security and enable Accessibility and Screen Recording for KimiCU.",
206
+ "fix.windows": "KimiCU needs the same privilege level as the target app; use its control panel to enable administrator mode when needed.",
207
+ "doctor.failed": "doctor reported a failure",
208
+ "doctor.notRun": "doctor was not run"
209
+ };
210
+ var zh = {
211
+ "status.loading": "\u6B63\u5728\u68C0\u6D4B KimiCU\u2026",
212
+ "status.error": "\u8BFB\u4E0D\u5230 KimiCU \u7684\u72B6\u6001\u3002",
213
+ "status.retry": "\u91CD\u8BD5",
214
+ "status.recheck": "\u91CD\u65B0\u68C0\u6D4B",
215
+ "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
+ "status.missing.title": "\u672A\u68C0\u6D4B\u5230 KimiCU",
217
+ "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\u8FD8\u6CA1\u5C31\u7EEA",
219
+ "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": "KimiCU \u5DF2\u5C31\u7EEA",
221
+ "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
+ "status.copy": "\u590D\u5236\u547D\u4EE4",
223
+ "status.copied": "\u5DF2\u590D\u5236",
224
+ "status.copyFailed": "\u590D\u5236\u5931\u8D25\uFF0C\u8BF7\u624B\u52A8\u9009\u62E9\u547D\u4EE4\u3002",
225
+ "status.docs": "\u5B98\u65B9\u6587\u6863",
226
+ "status.version": "\u7248\u672C",
227
+ "status.path": "\u8DEF\u5F84",
228
+ "step.install": "\u5B89\u88C5\u5B98\u65B9 KimiCU \u8FD0\u884C\u65F6\u3002",
229
+ "step.grant-permissions": "\u5728\u7CFB\u7EDF\u8BBE\u7F6E\u91CC\u4E3A KimiCU \u5F00\u542F\u8F85\u52A9\u529F\u80FD\u4E0E\u5C4F\u5E55\u5F55\u5236\u3002",
230
+ "step.reload-plugin": "\u5728\u63D2\u4EF6\u9875\u628A\u672C\u63D2\u4EF6\u5173\u4E00\u6B21\u518D\u5F00\u4E00\u6B21\uFF0C\u6216\u91CD\u542F DSH\u3002",
231
+ "step.upgrade": "\u628A KimiCU \u5347\u7EA7\u5230 0.3.8 \u6216\u66F4\u65B0\u7248\u672C\u3002",
232
+ "note.legacy-install": "\u68C0\u6D4B\u5230\u65E7\u7248 KimiCU \u5B89\u88C5\u76EE\u5F55\uFF1B\u5347\u7EA7\u540E MCP \u884C\u624D\u80FD\u7528\u4E0A\u65B0\u8DEF\u5F84\u3002",
233
+ "note.override-missing": "KIMI_CU_WINDOWS_EXE \u6307\u5411\u7684\u6587\u4EF6\u4E0D\u5B58\u5728\uFF1B\u6539\u8DEF\u5F84\u6216\u53BB\u6389\u5B83\u3002",
234
+ "note.mcp-command-missing": "MCP \u884C\u8981\u542F\u52A8\u7684\u6587\u4EF6\u4E0D\u5B58\u5728\uFF1B\u5347\u7EA7 KimiCU\uFF0C\u6216\u628A KIMI_CU_WINDOWS_EXE \u6307\u5411\u5DF2\u5B89\u88C5\u7684 kimi-cu.exe\u3002",
235
+ "note.detection-failed": "\u68C0\u6D4B\u5931\u8D25\uFF1B\u770B\u9519\u8BEF\u4FE1\u606F\u540E\u91CD\u8BD5\u3002",
236
+ "check.accessibility": "\u8F85\u52A9\u529F\u80FD",
237
+ "check.screen-recording": "\u5C4F\u5E55\u5F55\u5236",
238
+ "check.skylight": "SkyLight post-to-pid",
239
+ "check.bg-input": "\u540E\u53F0\u8F93\u5165",
240
+ "check.signed-keyboard": "\u7B7E\u540D\u952E\u76D8",
241
+ "check.mcp": "MCP \u670D\u52A1",
242
+ "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
+ "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
+ "doctor.failed": "doctor \u62A5\u544A\u4E86\u5931\u8D25",
245
+ "doctor.notRun": "doctor \u6CA1\u6709\u8DD1\u8D77\u6765"
246
+ };
247
+
248
+ // src/client/index.ts
249
+ var name = "@lynn123411/dsh-kimi-cu";
250
+ var inject = ["slots", "locale"];
251
+ var BUNDLE_CONFIG_SLOT = "plugins.bundle.config";
252
+ var STYLE_KEY = name + "/ConfigCard.css";
253
+ function injectStyles() {
254
+ if (typeof document === "undefined") return;
255
+ const existing = document.head.querySelector(`style[data-plugin-css="${STYLE_KEY}"]`);
256
+ const tag = existing ?? document.createElement("style");
257
+ tag.dataset.plugin = name;
258
+ tag.dataset.pluginCss = STYLE_KEY;
259
+ tag.textContent = ConfigCard_default;
260
+ if (existing === null) document.head.appendChild(tag);
261
+ }
262
+ function removeStyles() {
263
+ if (typeof document === "undefined") return;
264
+ for (const tag of document.head.querySelectorAll(`style[data-plugin="${name}"]`)) tag.remove();
265
+ }
266
+ function apply(ctx) {
267
+ ctx.effect(() => {
268
+ injectStyles();
269
+ return () => {
270
+ removeStyles();
271
+ };
272
+ }, "dsh-kimi-cu: stylesheets");
273
+ ctx.effect(() => ctx.locale.register(NS, { zh, en }), "dsh-kimi-cu: dictionaries");
274
+ ctx.slots.inject(BUNDLE_CONFIG_SLOT, () => ctx.slots.register({
275
+ name: BUNDLE_CONFIG_SLOT,
276
+ key: name,
277
+ locale: NS
278
+ }, ConfigCard));
279
+ }
280
+ return module.exports; } });
281
+ //# sourceMappingURL=client.js.map