@lynn123411/dsh-kimi-cu 0.3.6 → 0.3.8
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/README.md +5 -5
- package/lib/client.js +178 -45
- package/lib/client.js.map +2 -2
- package/lib/index.js +121 -92
- package/lib/index.js.map +2 -2
- package/package.json +1 -1
- package/scripts/check-bundle.mjs +1 -1
- package/scripts/test-card.mjs +228 -44
- package/scripts/test-exclusivity.mjs +46 -3
- package/scripts/test-status.mjs +87 -20
- package/scripts/test-update.mjs +6 -1
- package/skills/macos/kimi-cu/SKILL.md +29 -18
- package/skills/windows/kimi-cu/SKILL.md +21 -61
package/README.md
CHANGED
|
@@ -35,7 +35,7 @@ dsh plugin --profile web add @lynn123411/dsh-kimi-cu
|
|
|
35
35
|
| 更新 | 更新清单的比对结果或当前阶段;失败时给失败原因与原始输出 | 「检查更新」/「更新到 x.y.z」/「已是最新」/「更新中」 |
|
|
36
36
|
| 文档 | — | 官方文档链接 |
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
点「重新检测」后,「检查明细」显示安装、MCP 启动入口、连接状态和参与判定的 `doctor` 检查项。展开「排查详情」可查看单独的 MCP 启动路径和 macOS 检测进程的诊断项。确实未安装、检测到旧安装目录或启动文件缺失时会给出安装或升级步骤。Windows 启动路径配置错误时会提示修正环境变量。平台不受支持时卡片会说明原因。
|
|
39
39
|
|
|
40
40
|
## 实现
|
|
41
41
|
|
|
@@ -56,10 +56,10 @@ MCP 连接不占 patch 行:宿主半边探测到可执行文件之后调用 `m
|
|
|
56
56
|
宿主半边在 `src/server/`:
|
|
57
57
|
|
|
58
58
|
- `resolve.ts`:纯函数,解析安装位置、MCP 命令与安装计划;不受支持的平台给出 `mcp: null`。
|
|
59
|
-
- `doctor.ts
|
|
60
|
-
- `status.ts`:把上面两样合成 `KimiCuStatus`,缓存 10
|
|
59
|
+
- `doctor.ts`:执行 `kimi-cu doctor`,结合退出状态和检查项判定通过、失败或无法确认。macOS 用服务检查项判定,调用进程的结果单独报告。Windows 解析 `version=` 和 `mcp=`。
|
|
60
|
+
- `status.ts`:把上面两样合成 `KimiCuStatus`,缓存 10 秒。并发调用共用探测,`refresh` 绕过缓存。升级验收会等一次在安装替换之后开始的探测。
|
|
61
61
|
|
|
62
|
-
Windows
|
|
62
|
+
Windows 优先使用 `KIMI_CU_WINDOWS_EXE` 启动。覆盖路径无效时仍会尝试发现默认安装,MCP 等路径修正后才能启动。缺少 `LOCALAPPDATA` 时跳过默认目录检查。只发现旧目录时引导升级。
|
|
63
63
|
|
|
64
64
|
`doctor` 报告服务与调用者上下文的检查;服务不可达时可用 `xpc-ping` 进一步诊断(见随包 macOS 技能)。
|
|
65
65
|
|
|
@@ -83,7 +83,7 @@ macOS 与 Windows 各有一份更新清单,版本号互不可比。页面打
|
|
|
83
83
|
|
|
84
84
|
### 桌面操作独占槽位
|
|
85
85
|
|
|
86
|
-
本机检查通过、MCP 启动文件存在且管理器可用时,插件会注册 MCP
|
|
86
|
+
本机检查通过、MCP 启动文件存在且管理器可用时,插件会注册 MCP 连接。重检超时或输出不完整时,保留现有连接并报告本次无法确认。如果宿主提供 `computerUse` 服务,插件会先调用 `computerUse.register()` 为 `kimi-cu` 占用桌面操作槽位。自定义宿主组合可以省略 `computerUse`,此时 KimiCU 仍由 MCP 管理器接入,连接没有 `computerUse` 提供的独占保护。槽位冲突会显示占用方。MCP 注册或连接终态失败时撤回注册并释放槽位,后续可重新检测补连。管理器报告清理未完成时,保留槽位至宿主停止,避免旧连接和新后端同时控制桌面。
|
|
87
87
|
|
|
88
88
|
### 技能按平台分两条
|
|
89
89
|
|
package/lib/client.js
CHANGED
|
@@ -118,10 +118,11 @@ async function startUpdate(onEvent) {
|
|
|
118
118
|
// src/client/ConfigCard.tsx
|
|
119
119
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
120
120
|
var NOTE_KEYS = {
|
|
121
|
-
"
|
|
121
|
+
"detection-failed": "note.detection-failed",
|
|
122
122
|
"override-missing": "note.override-missing",
|
|
123
|
-
"
|
|
124
|
-
"
|
|
123
|
+
"localappdata-missing": "note.localappdata-missing",
|
|
124
|
+
"legacy-install": "note.legacy-install",
|
|
125
|
+
"mcp-command-missing": "note.mcp-command-missing"
|
|
125
126
|
};
|
|
126
127
|
function mcpHintKey(state) {
|
|
127
128
|
switch (state) {
|
|
@@ -143,6 +144,7 @@ function mcpHintKey(state) {
|
|
|
143
144
|
var CHECK_KEYS = {
|
|
144
145
|
accessibility: "check.accessibility",
|
|
145
146
|
"screen-recording": "check.screen-recording",
|
|
147
|
+
"runtime-control": "check.runtime-control",
|
|
146
148
|
skylight: "check.skylight",
|
|
147
149
|
"bg-input": "check.bg-input",
|
|
148
150
|
"signed-keyboard": "check.signed-keyboard",
|
|
@@ -152,6 +154,26 @@ function checkLabel(tr, check) {
|
|
|
152
154
|
const key = CHECK_KEYS[check.id];
|
|
153
155
|
return key === void 0 ? check.label : tr(key);
|
|
154
156
|
}
|
|
157
|
+
var CHECK_MARKS = { passed: "\u2705", failed: "\u274C", unknown: "\u2754" };
|
|
158
|
+
function CheckResults({ checks, tr }) {
|
|
159
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ul", { className: "dsh-kimi-cu-check-list", children: checks.map((check) => {
|
|
160
|
+
const outcome = check.ok === true ? "passed" : check.ok === false ? "failed" : "unknown";
|
|
161
|
+
const result = tr("check." + outcome);
|
|
162
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("li", { className: outcome === "failed" ? "dsh-kimi-cu-error" : void 0, children: [
|
|
163
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { role: "img", "aria-label": result, title: result, children: CHECK_MARKS[outcome] }),
|
|
164
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
165
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dsh-kimi-cu-check-name", children: checkLabel(tr, check) }),
|
|
166
|
+
check.id === "runtime-control" && check.ok === false ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-hint dsh-kimi-cu-detail", children: check.label }) : null
|
|
167
|
+
] })
|
|
168
|
+
] }, check.id);
|
|
169
|
+
}) });
|
|
170
|
+
}
|
|
171
|
+
function getDoctorOutcome(doctor) {
|
|
172
|
+
if (doctor.outcome !== void 0) return doctor.outcome;
|
|
173
|
+
if (!doctor.ran) return "not-run";
|
|
174
|
+
if (doctor.ok) return "passed";
|
|
175
|
+
return doctor.checks.some((check) => check.ok === false) ? "failed" : "unknown";
|
|
176
|
+
}
|
|
155
177
|
function toUpdateState(result) {
|
|
156
178
|
return result.kind === "ok" ? { kind: "ready", check: result.check } : { kind: "unavailable", message: result.message };
|
|
157
179
|
}
|
|
@@ -162,7 +184,9 @@ function docsUrl(install) {
|
|
|
162
184
|
function ConfigCard(props) {
|
|
163
185
|
const { t } = props;
|
|
164
186
|
const tr = t;
|
|
187
|
+
const checksHeading = (0, import_react.useId)();
|
|
165
188
|
const [state, setState] = (0, import_react.useState)({ kind: "loading" });
|
|
189
|
+
const [showAllChecks, setShowAllChecks] = (0, import_react.useState)(false);
|
|
166
190
|
const [copied, setCopied] = (0, import_react.useState)(false);
|
|
167
191
|
const [copyFailed, setCopyFailed] = (0, import_react.useState)(false);
|
|
168
192
|
const [update, setUpdate] = (0, import_react.useState)({ kind: "checking" });
|
|
@@ -245,6 +269,7 @@ function ConfigCard(props) {
|
|
|
245
269
|
setRun({ kind: "interrupted" });
|
|
246
270
|
setUpdate({ kind: "checking" });
|
|
247
271
|
void fetchStatus(true).then((result) => {
|
|
272
|
+
if (result.kind === "ok") setShowAllChecks(true);
|
|
248
273
|
setState(result);
|
|
249
274
|
loadUpdate();
|
|
250
275
|
});
|
|
@@ -300,14 +325,42 @@ function ConfigCard(props) {
|
|
|
300
325
|
}
|
|
301
326
|
const install = status.install;
|
|
302
327
|
const docs = install === null ? null : docsUrl(install);
|
|
328
|
+
const detectionFailed = status.notes.includes("detection-failed");
|
|
329
|
+
const overrideMissing = status.notes.includes("override-missing");
|
|
330
|
+
const localAppDataMissing = status.notes.includes("localappdata-missing");
|
|
331
|
+
const pathIssue = overrideMissing || localAppDataMissing;
|
|
303
332
|
const legacy = status.notes.includes("legacy-install");
|
|
304
333
|
const commandMissing = status.notes.includes("mcp-command-missing");
|
|
305
|
-
const
|
|
334
|
+
const installUnknown = detectionFailed || !status.installed && pathIssue;
|
|
335
|
+
const launcherUnknown = detectionFailed || localAppDataMissing && !overrideMissing;
|
|
336
|
+
const launcher = status.doctor.outcome === void 0 && (!status.installed || pathIssue || commandMissing) ? null : status.mcp;
|
|
337
|
+
const doctorOutcome = getDoctorOutcome(status.doctor);
|
|
338
|
+
const diagnosticChecks = status.doctor.diagnosticChecks ?? [];
|
|
339
|
+
const launcherPath = launcher !== null && launcher.command !== status.path ? launcher.command : null;
|
|
340
|
+
const doctorUnconfirmed = status.installed && (doctorOutcome === "unknown" || doctorOutcome === "not-run");
|
|
341
|
+
const localCheckFailed = status.installed && (doctorOutcome === "failed" || launcher === null && !launcherUnknown);
|
|
306
342
|
const mcpHint = mcpHintKey(status.mcpStatus?.state);
|
|
307
|
-
const
|
|
308
|
-
const
|
|
309
|
-
const
|
|
310
|
-
const
|
|
343
|
+
const canConnect = status.installed && !detectionFailed && !pathIssue && launcher !== null && doctorOutcome === "passed";
|
|
344
|
+
const connectionHint = status.mcpStatus == null && !canConnect ? "status.mcpNotConnected" : mcpHint;
|
|
345
|
+
const connectionText = tr(connectionHint ?? "status.mcpConnected");
|
|
346
|
+
const connectionError = mcpHint === null ? void 0 : status.mcpStatus?.lastError;
|
|
347
|
+
const showInstall = !detectionFailed && !pathIssue && (!status.installed || legacy || commandMissing);
|
|
348
|
+
const checks = showAllChecks ? status.doctor.checks : status.doctor.checks.filter((check) => check.ok !== true);
|
|
349
|
+
const showDoctor = showAllChecks || status.installed && doctorOutcome !== "passed" || Boolean(status.doctor.error);
|
|
350
|
+
const failedPermission = (id) => status.platform === "darwin" && status.doctor.checks.some((check) => check.id === id && check.ok === false);
|
|
351
|
+
const accessibilityFailed = failedPermission("accessibility");
|
|
352
|
+
const screenRecordingFailed = failedPermission("screen-recording");
|
|
353
|
+
const permissionHint = accessibilityFailed && screenRecordingFailed ? t("fix.macos") : accessibilityFailed ? t("fix.accessibility") : screenRecordingFailed ? t("fix.screenRecording") : null;
|
|
354
|
+
const badge = (() => {
|
|
355
|
+
if (detectionFailed) return t("status.detectionFailed");
|
|
356
|
+
if (pathIssue) return t("status.pathIssue");
|
|
357
|
+
if (!status.installed) return t("status.missing.title");
|
|
358
|
+
if (localCheckFailed) return t("status.notReady.title");
|
|
359
|
+
if (doctorUnconfirmed) return t("status.localUnknown");
|
|
360
|
+
if (mcpHint !== null) return t("status.mcpNotReady");
|
|
361
|
+
return t("status.ready.title");
|
|
362
|
+
})();
|
|
363
|
+
const ready = canConnect && mcpHint === null;
|
|
311
364
|
const updateHint = (() => {
|
|
312
365
|
if (run.kind === "running") return tr("update.stage." + run.stage);
|
|
313
366
|
if (run.kind === "failed") return tr("update.failed." + run.failure);
|
|
@@ -337,17 +390,68 @@ function ConfigCard(props) {
|
|
|
337
390
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-kimi-cu-row", children: [
|
|
338
391
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-label", children: t("status.state") }),
|
|
339
392
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-kimi-cu-value", children: [
|
|
340
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.Tag, { tone:
|
|
341
|
-
status.installed
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
393
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.Tag, { tone: ready ? "info" : "danger", children: badge }),
|
|
394
|
+
!status.installed && !installUnknown ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-hint", children: t("status.missing.hint") }) : null,
|
|
395
|
+
ready && !showAllChecks && !legacy ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-hint", children: t("status.ready.hint") }) : null,
|
|
396
|
+
!showAllChecks && connectionHint !== null && (canConnect || status.mcpStatus != null) ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-kimi-cu-hint dsh-kimi-cu-detail", children: [
|
|
397
|
+
connectionText,
|
|
398
|
+
connectionError ? " \xB7 " + connectionError : ""
|
|
346
399
|
] }) : null,
|
|
347
|
-
|
|
400
|
+
Object.entries(NOTE_KEYS).map(([note, key]) => status.notes.includes(note) && !(pathIssue && note === "mcp-command-missing") ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-hint", children: t(key) }, note) : null)
|
|
348
401
|
] }),
|
|
349
402
|
/* @__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") }) })
|
|
350
403
|
] }),
|
|
404
|
+
showDoctor ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "dsh-kimi-cu-check-panel", "aria-labelledby": checksHeading, children: [
|
|
405
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("header", { className: "dsh-kimi-cu-check-header", children: [
|
|
406
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", { id: checksHeading, children: t("status.checks") }),
|
|
407
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("dl", { className: "dsh-kimi-cu-verdict", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
408
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("dt", { children: t("doctor.summary") }),
|
|
409
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("dd", { className: doctorOutcome === "failed" ? "dsh-kimi-cu-error" : void 0, children: [
|
|
410
|
+
doctorOutcome !== "not-run" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { "aria-hidden": "true", children: CHECK_MARKS[doctorOutcome] }) : null,
|
|
411
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: tr("check." + doctorOutcome) })
|
|
412
|
+
] })
|
|
413
|
+
] }) })
|
|
414
|
+
] }),
|
|
415
|
+
showAllChecks ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("dl", { className: "dsh-kimi-cu-check-overview", children: [
|
|
416
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
417
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("dt", { children: t("status.installation") }),
|
|
418
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("dd", { children: installUnknown ? t("check.unknown") : status.installed ? t("check.installed") : t("check.missing") })
|
|
419
|
+
] }),
|
|
420
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
421
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("dt", { children: t("status.launcher") }),
|
|
422
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("dd", { children: launcher !== null ? t("check.found") : launcherUnknown ? t("check.unknown") : t("check.missing") })
|
|
423
|
+
] }),
|
|
424
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
425
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("dt", { children: t("status.connection") }),
|
|
426
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("dd", { className: "dsh-kimi-cu-detail", children: [
|
|
427
|
+
connectionText,
|
|
428
|
+
connectionError ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "dsh-kimi-cu-connection-error", children: [
|
|
429
|
+
" \xB7 ",
|
|
430
|
+
connectionError
|
|
431
|
+
] }) : null
|
|
432
|
+
] })
|
|
433
|
+
] })
|
|
434
|
+
] }) : null,
|
|
435
|
+
checks.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "dsh-kimi-cu-service-checks", "aria-label": t("doctor.service"), children: [
|
|
436
|
+
showAllChecks && diagnosticChecks.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h4", { children: t("doctor.service") }) : null,
|
|
437
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CheckResults, { checks, tr })
|
|
438
|
+
] }) : null,
|
|
439
|
+
status.doctor.error ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-hint dsh-kimi-cu-error dsh-kimi-cu-detail", children: status.doctor.error }) : null,
|
|
440
|
+
permissionHint !== null ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-hint", children: permissionHint }) : null,
|
|
441
|
+
showAllChecks && (launcherPath !== null || diagnosticChecks.length > 0) ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("details", { className: "dsh-kimi-cu-check-group", children: [
|
|
442
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("summary", { children: t("status.troubleshooting") }),
|
|
443
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-kimi-cu-troubleshooting", children: [
|
|
444
|
+
launcherPath !== null ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
445
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h4", { children: t("status.launcherPath") }),
|
|
446
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("code", { className: "dsh-kimi-cu-detail", children: launcherPath })
|
|
447
|
+
] }) : null,
|
|
448
|
+
diagnosticChecks.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { "aria-label": t("doctor.diagnostic"), children: [
|
|
449
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h4", { children: t("doctor.diagnostic") }),
|
|
450
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CheckResults, { checks: diagnosticChecks, tr })
|
|
451
|
+
] }) : null
|
|
452
|
+
] })
|
|
453
|
+
] }) : null
|
|
454
|
+
] }) : null,
|
|
351
455
|
status.installed ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
352
456
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-kimi-cu-row", children: [
|
|
353
457
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-label", children: t("status.version") }),
|
|
@@ -373,17 +477,6 @@ function ConfigCard(props) {
|
|
|
373
477
|
] }) })
|
|
374
478
|
] }) : null
|
|
375
479
|
] }) : null,
|
|
376
|
-
doctorFailed ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-kimi-cu-row", children: [
|
|
377
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-label", children: t("status.checks") }),
|
|
378
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-kimi-cu-span", children: [
|
|
379
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-hint", children: t("status.notReady.hint") }),
|
|
380
|
-
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: [
|
|
381
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: check.ok ? "\u2705" : "\u274C" }),
|
|
382
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: checkLabel(tr, check) })
|
|
383
|
-
] }, check.id)) }),
|
|
384
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-hint", children: status.platform === "darwin" ? t("fix.macos") : t("fix.windows") })
|
|
385
|
-
] })
|
|
386
|
-
] }) : null,
|
|
387
480
|
showInstall && install !== null ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-kimi-cu-row", children: [
|
|
388
481
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-label", children: t("status.install") }),
|
|
389
482
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-kimi-cu-span", children: [
|
|
@@ -393,7 +486,7 @@ function ConfigCard(props) {
|
|
|
393
486
|
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") })
|
|
394
487
|
] }),
|
|
395
488
|
copyFailed ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-hint", children: t("status.copyFailed") }) : null,
|
|
396
|
-
/* @__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)) })
|
|
489
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("ol", { className: "dsh-kimi-cu-steps", children: install.steps.filter((step) => !status.installed || step !== "grant-permissions").map((step) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { children: tr("step." + step) }, step)) })
|
|
397
490
|
] })
|
|
398
491
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-kimi-cu-row", children: [
|
|
399
492
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-kimi-cu-label", children: t("status.docs.label") }),
|
|
@@ -403,7 +496,7 @@ function ConfigCard(props) {
|
|
|
403
496
|
}
|
|
404
497
|
|
|
405
498
|
// src/client/ConfigCard.css
|
|
406
|
-
var ConfigCard_default =
|
|
499
|
+
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-check-panel {\n display: grid;\n gap: 12px;\n min-width: 0;\n padding: 12px;\n border: var(--dsh-hairline-width, 0.5px) solid var(--dsw-alias-settings-card-stroke);\n border-radius: var(--dsw-radius-sm);\n background: var(--dsw-alias-settings-card-fill);\n color: var(--dsw-alias-label-primary);\n font-size: 12px;\n line-height: 18px;\n overflow-wrap: anywhere;\n}\n\n.dsh-kimi-cu-check-header {\n display: flex;\n flex-wrap: wrap;\n justify-content: space-between;\n align-items: baseline;\n gap: 4px 12px;\n}\n\n.dsh-kimi-cu-check-header h3 {\n margin: 0;\n font-size: 13px;\n font-weight: 600;\n}\n\n.dsh-kimi-cu-verdict,\n.dsh-kimi-cu-check-panel dd {\n margin: 0;\n}\n\n.dsh-kimi-cu-verdict > div,\n.dsh-kimi-cu-verdict dd {\n display: flex;\n gap: 6px;\n}\n\n.dsh-kimi-cu-check-overview,\n.dsh-kimi-cu-check-list {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(min(100%, 144px), 1fr));\n gap: 6px 12px;\n margin: 0;\n}\n\n.dsh-kimi-cu-check-overview {\n grid-template-columns: repeat(auto-fit, minmax(min(100%, 128px), 1fr));\n gap: 8px 12px;\n}\n\n.dsh-kimi-cu-check-overview dd {\n margin-top: 2px;\n font-size: 13px;\n font-weight: 500;\n}\n\n.dsh-kimi-cu-check-panel dt,\n.dsh-kimi-cu-connection-error,\n.dsh-kimi-cu-check-panel h4 {\n color: var(--dsw-alias-label-secondary);\n}\n\n.dsh-kimi-cu-check-panel h4 {\n margin: 0 0 6px;\n font-size: inherit;\n font-weight: 500;\n}\n\n.dsh-kimi-cu-check-list {\n list-style: none;\n padding: 0;\n color: var(--dsw-alias-label-secondary);\n}\n\n.dsh-kimi-cu-check-list li {\n display: flex;\n min-width: 0;\n gap: 6px;\n}\n\n.dsh-kimi-cu-check-list li > [role="img"] {\n flex: none;\n}\n\n.dsh-kimi-cu-service-checks,\n.dsh-kimi-cu-check-group {\n min-width: 0;\n border-top: var(--dsh-hairline-width, 0.5px) solid var(--dsw-alias-settings-card-stroke);\n padding-top: 10px;\n}\n\n.dsh-kimi-cu-troubleshooting {\n display: grid;\n gap: 12px;\n margin-top: 8px;\n}\n\n.dsh-kimi-cu-detail {\n overflow-wrap: anywhere;\n white-space: pre-wrap;\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.dsh-kimi-cu-check-group 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';
|
|
407
500
|
|
|
408
501
|
// src/client/locales.ts
|
|
409
502
|
var NS = "kimiCu";
|
|
@@ -416,13 +509,17 @@ var en = {
|
|
|
416
509
|
"status.missing.title": "KimiCU is not installed",
|
|
417
510
|
"status.missing.hint": "Install the official runtime, then check again.",
|
|
418
511
|
"status.notReady.title": "KimiCU is installed but local checks failed",
|
|
419
|
-
"status.
|
|
512
|
+
"status.localUnknown": "Local checks could not be confirmed",
|
|
513
|
+
"status.detectionFailed": "KimiCU detection failed",
|
|
514
|
+
"status.pathIssue": "KimiCU path configuration needs attention",
|
|
420
515
|
"status.mcpFailed": "MCP connection failed",
|
|
421
516
|
"status.mcpNotReady": "MCP is not ready",
|
|
517
|
+
"status.mcpConnected": "MCP is connected",
|
|
422
518
|
"status.mcpConflict": "Another provider owns desktop control",
|
|
423
519
|
"status.mcpConnecting": "Connecting to the MCP server\u2026",
|
|
424
520
|
"status.mcpReconnecting": "Reconnecting to the MCP server\u2026",
|
|
425
521
|
"status.mcpDisconnected": "MCP is disconnected. Check again to reconnect.",
|
|
522
|
+
"status.mcpNotConnected": "MCP is disconnected",
|
|
426
523
|
"status.ready.title": "Local checks passed",
|
|
427
524
|
"status.ready.hint": "If the model cannot see the mcp__kimi-cu__* tools, check the connection again.",
|
|
428
525
|
"status.copy": "Copy command",
|
|
@@ -433,26 +530,42 @@ var en = {
|
|
|
433
530
|
"status.path": "Path",
|
|
434
531
|
"status.state": "Status",
|
|
435
532
|
"status.checks": "Checks",
|
|
533
|
+
"status.installation": "Installation",
|
|
534
|
+
"status.launcher": "MCP launcher",
|
|
535
|
+
"status.launcherPath": "MCP launcher path",
|
|
536
|
+
"status.connection": "Connection",
|
|
537
|
+
"status.troubleshooting": "Troubleshooting details",
|
|
436
538
|
"status.install": "Install",
|
|
437
539
|
"status.docs.label": "Docs",
|
|
438
540
|
"step.install": "Install the official KimiCU runtime.",
|
|
439
541
|
"step.grant-permissions": "In System Settings, grant Accessibility and Screen Recording to KimiCU.",
|
|
440
542
|
"step.recheck": "Click Check again on this page to connect KimiCU.",
|
|
441
543
|
"step.upgrade": "Upgrade KimiCU to 0.3.8 or later.",
|
|
442
|
-
"note.legacy-install": "
|
|
443
|
-
"note.override-missing": "KIMI_CU_WINDOWS_EXE points to a file that does not exist
|
|
444
|
-
"note.
|
|
445
|
-
"note.
|
|
544
|
+
"note.legacy-install": "KimiCU was found in a legacy installation directory.",
|
|
545
|
+
"note.override-missing": "KIMI_CU_WINDOWS_EXE points to a file that does not exist. Correct the path or unset it.",
|
|
546
|
+
"note.localappdata-missing": "LOCALAPPDATA is unset. Start DSH in a Windows user session with LOCALAPPDATA set, or set KIMI_CU_WINDOWS_EXE to the full path to kimi-cu.exe.",
|
|
547
|
+
"note.mcp-command-missing": "The MCP launcher is missing. Update or reinstall KimiCU.",
|
|
548
|
+
"note.detection-failed": "See the error below and check again.",
|
|
549
|
+
"check.installed": "Installed",
|
|
550
|
+
"check.found": "Found",
|
|
551
|
+
"check.missing": "Not found",
|
|
552
|
+
"check.passed": "Passed",
|
|
553
|
+
"check.failed": "Failed",
|
|
554
|
+
"check.unknown": "Could not confirm",
|
|
555
|
+
"check.not-run": "Not run",
|
|
446
556
|
"check.accessibility": "Accessibility",
|
|
447
557
|
"check.screen-recording": "Screen Recording",
|
|
558
|
+
"check.runtime-control": "Runtime control channel",
|
|
448
559
|
"check.skylight": "SkyLight post-to-pid",
|
|
449
560
|
"check.bg-input": "Background input",
|
|
450
561
|
"check.signed-keyboard": "Signed keyboard",
|
|
451
562
|
"check.mcp": "MCP server",
|
|
452
563
|
"fix.macos": "Open System Settings \u2192 Privacy & Security and enable Accessibility and Screen Recording for KimiCU.",
|
|
453
|
-
"fix.
|
|
454
|
-
"
|
|
455
|
-
"doctor.
|
|
564
|
+
"fix.accessibility": "Open System Settings \u2192 Privacy & Security and enable Accessibility for KimiCU.",
|
|
565
|
+
"fix.screenRecording": "Open System Settings \u2192 Privacy & Security and enable Screen Recording for KimiCU.",
|
|
566
|
+
"doctor.summary": "Diagnostic result",
|
|
567
|
+
"doctor.service": "KimiCU service",
|
|
568
|
+
"doctor.diagnostic": "Process running the check (for troubleshooting only)",
|
|
456
569
|
"update.check": "Check for updates",
|
|
457
570
|
"update.action": "Update",
|
|
458
571
|
"update.to": "Update to",
|
|
@@ -489,13 +602,17 @@ var zh = {
|
|
|
489
602
|
"status.missing.title": "\u672A\u68C0\u6D4B\u5230 KimiCU",
|
|
490
603
|
"status.missing.hint": "\u5148\u5B89\u88C5\u5B98\u65B9\u8FD0\u884C\u65F6\uFF0C\u518D\u56DE\u6765\u91CD\u65B0\u68C0\u6D4B\u3002",
|
|
491
604
|
"status.notReady.title": "\u5DF2\u5B89\u88C5 KimiCU\uFF0C\u4F46\u672C\u673A\u68C0\u67E5\u672A\u901A\u8FC7",
|
|
492
|
-
"status.
|
|
605
|
+
"status.localUnknown": "\u672C\u673A\u68C0\u67E5\u7ED3\u679C\u65E0\u6CD5\u786E\u8BA4",
|
|
606
|
+
"status.detectionFailed": "KimiCU \u68C0\u6D4B\u5931\u8D25",
|
|
607
|
+
"status.pathIssue": "\u8BF7\u4FEE\u6B63 KimiCU \u8DEF\u5F84\u914D\u7F6E",
|
|
493
608
|
"status.mcpFailed": "MCP \u8FDE\u63A5\u5931\u8D25",
|
|
494
609
|
"status.mcpNotReady": "MCP \u5C1A\u672A\u5C31\u7EEA",
|
|
610
|
+
"status.mcpConnected": "MCP \u5DF2\u8FDE\u63A5",
|
|
495
611
|
"status.mcpConflict": "\u684C\u9762\u64CD\u4F5C\u5DF2\u7531\u5176\u4ED6\u540E\u7AEF\u5360\u7528",
|
|
496
612
|
"status.mcpConnecting": "\u6B63\u5728\u8FDE\u63A5 MCP\u2026",
|
|
497
613
|
"status.mcpReconnecting": "\u6B63\u5728\u91CD\u65B0\u8FDE\u63A5 MCP\u2026",
|
|
498
614
|
"status.mcpDisconnected": "MCP \u672A\u8FDE\u63A5\u3002\u70B9\u51FB\u91CD\u65B0\u68C0\u6D4B\u53EF\u5C1D\u8BD5\u8FDE\u63A5\u3002",
|
|
615
|
+
"status.mcpNotConnected": "MCP \u672A\u8FDE\u63A5",
|
|
499
616
|
"status.ready.title": "\u672C\u673A\u68C0\u67E5\u901A\u8FC7",
|
|
500
617
|
"status.ready.hint": "\u5982\u679C\u6A21\u578B\u770B\u4E0D\u5230 mcp__kimi-cu__* \u5DE5\u5177\uFF0C\u8BF7\u91CD\u65B0\u68C0\u6D4B\u8FDE\u63A5\u3002",
|
|
501
618
|
"status.copy": "\u590D\u5236\u547D\u4EE4",
|
|
@@ -505,27 +622,43 @@ var zh = {
|
|
|
505
622
|
"status.version": "\u7248\u672C",
|
|
506
623
|
"status.path": "\u8DEF\u5F84",
|
|
507
624
|
"status.state": "\u72B6\u6001",
|
|
508
|
-
"status.checks": "\
|
|
625
|
+
"status.checks": "\u68C0\u67E5\u660E\u7EC6",
|
|
626
|
+
"status.installation": "\u5B89\u88C5\u72B6\u6001",
|
|
627
|
+
"status.launcher": "MCP \u542F\u52A8\u5165\u53E3",
|
|
628
|
+
"status.launcherPath": "MCP \u542F\u52A8\u8DEF\u5F84",
|
|
629
|
+
"status.connection": "\u8FDE\u63A5",
|
|
630
|
+
"status.troubleshooting": "\u6392\u67E5\u8BE6\u60C5",
|
|
509
631
|
"status.install": "\u5B89\u88C5",
|
|
510
632
|
"status.docs.label": "\u6587\u6863",
|
|
511
633
|
"step.install": "\u5B89\u88C5\u5B98\u65B9 KimiCU \u8FD0\u884C\u65F6\u3002",
|
|
512
634
|
"step.grant-permissions": "\u5728\u7CFB\u7EDF\u8BBE\u7F6E\u91CC\u4E3A KimiCU \u5F00\u542F\u8F85\u52A9\u529F\u80FD\u4E0E\u5C4F\u5E55\u5F55\u5236\u3002",
|
|
513
635
|
"step.recheck": "\u56DE\u5230\u672C\u9875\uFF0C\u70B9\u51FB\u91CD\u65B0\u68C0\u6D4B\u4EE5\u8FDE\u63A5 KimiCU\u3002",
|
|
514
636
|
"step.upgrade": "\u628A KimiCU \u5347\u7EA7\u5230 0.3.8 \u6216\u66F4\u65B0\u7248\u672C\u3002",
|
|
515
|
-
"note.legacy-install": "\u68C0\u6D4B\u5230\u65E7\u7248 KimiCU \u5B89\u88C5\u76EE\u5F55\
|
|
516
|
-
"note.override-missing": "KIMI_CU_WINDOWS_EXE \u6307\u5411\u7684\u6587\u4EF6\u4E0D\u5B58\u5728\
|
|
517
|
-
"note.
|
|
518
|
-
"note.
|
|
637
|
+
"note.legacy-install": "\u68C0\u6D4B\u5230\u65E7\u7248 KimiCU \u5B89\u88C5\u76EE\u5F55\u3002",
|
|
638
|
+
"note.override-missing": "KIMI_CU_WINDOWS_EXE \u6307\u5411\u7684\u6587\u4EF6\u4E0D\u5B58\u5728\uFF0C\u8BF7\u4FEE\u6B63\u8DEF\u5F84\u6216\u53D6\u6D88\u8BBE\u7F6E\u3002",
|
|
639
|
+
"note.localappdata-missing": "\u672A\u8BBE\u7F6E LOCALAPPDATA\u3002\u8BF7\u5728\u8BBE\u6709\u8BE5\u53D8\u91CF\u7684 Windows \u7528\u6237\u4F1A\u8BDD\u4E2D\u542F\u52A8 DSH\uFF0C\u6216\u5C06 KIMI_CU_WINDOWS_EXE \u8BBE\u4E3A kimi-cu.exe \u7684\u5B8C\u6574\u8DEF\u5F84\u3002",
|
|
640
|
+
"note.mcp-command-missing": "MCP \u542F\u52A8\u6587\u4EF6\u4E0D\u5B58\u5728\uFF0C\u8BF7\u66F4\u65B0\u6216\u91CD\u65B0\u5B89\u88C5 KimiCU\u3002",
|
|
641
|
+
"note.detection-failed": "\u8BF7\u67E5\u770B\u4E0B\u65B9\u9519\u8BEF\u4FE1\u606F\uFF0C\u518D\u91CD\u65B0\u68C0\u6D4B\u3002",
|
|
642
|
+
"check.installed": "\u5DF2\u5B89\u88C5",
|
|
643
|
+
"check.found": "\u5DF2\u627E\u5230",
|
|
644
|
+
"check.missing": "\u672A\u627E\u5230",
|
|
645
|
+
"check.passed": "\u901A\u8FC7",
|
|
646
|
+
"check.failed": "\u672A\u901A\u8FC7",
|
|
647
|
+
"check.unknown": "\u65E0\u6CD5\u786E\u8BA4",
|
|
648
|
+
"check.not-run": "\u672A\u8FD0\u884C",
|
|
519
649
|
"check.accessibility": "\u8F85\u52A9\u529F\u80FD",
|
|
520
650
|
"check.screen-recording": "\u5C4F\u5E55\u5F55\u5236",
|
|
651
|
+
"check.runtime-control": "\u8FD0\u884C\u65F6\u63A7\u5236\u901A\u9053",
|
|
521
652
|
"check.skylight": "SkyLight post-to-pid",
|
|
522
653
|
"check.bg-input": "\u540E\u53F0\u8F93\u5165",
|
|
523
654
|
"check.signed-keyboard": "\u7B7E\u540D\u952E\u76D8",
|
|
524
655
|
"check.mcp": "MCP \u670D\u52A1",
|
|
525
656
|
"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",
|
|
526
|
-
"fix.
|
|
527
|
-
"
|
|
528
|
-
"doctor.
|
|
657
|
+
"fix.accessibility": "\u6253\u5F00\u7CFB\u7EDF\u8BBE\u7F6E \u2192 \u9690\u79C1\u4E0E\u5B89\u5168\u6027\uFF0C\u4E3A KimiCU \u5F00\u542F\u8F85\u52A9\u529F\u80FD\u3002",
|
|
658
|
+
"fix.screenRecording": "\u6253\u5F00\u7CFB\u7EDF\u8BBE\u7F6E \u2192 \u9690\u79C1\u4E0E\u5B89\u5168\u6027\uFF0C\u4E3A KimiCU \u5F00\u542F\u5C4F\u5E55\u5F55\u5236\u3002",
|
|
659
|
+
"doctor.summary": "\u8BCA\u65AD\u7ED3\u679C",
|
|
660
|
+
"doctor.service": "KimiCU \u670D\u52A1",
|
|
661
|
+
"doctor.diagnostic": "\u8FD0\u884C\u68C0\u6D4B\u7684\u8FDB\u7A0B\uFF08\u4EC5\u4F9B\u6392\u67E5\uFF09",
|
|
529
662
|
"update.check": "\u68C0\u67E5\u66F4\u65B0",
|
|
530
663
|
"update.action": "\u66F4\u65B0",
|
|
531
664
|
"update.to": "\u66F4\u65B0\u5230",
|