Skip to content

feat: add plugin marketplace and native mcp oauth - #4525

Merged
liruifengv merged 49 commits into
mainfrom
feat/plugin-center-marketplace
Nov 3, 2026
Merged

liruifengv merged 49 commits into
mainfrom
feat/plugin-center-marketplace

Conversation

@liruifengv

@liruifengv liruifengv commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Requirement or Bug

插件用户需要统一的市场目录、详情预览、安装更新和旧插件迁移;声明 OAuth 的远程 MCP 还需要可控的授权与卸载清理。这个 PR 在 core 建立上述服务端能力,并同步 CLI、SDK 与 Web 产物。

Bug Reproduction Steps

N/A

Root Cause

N/A

Code Changes

核心思路

以 PluginMarketplaceService 解析市场目录和安装来源,以 PluginService 统一编排预览、安装、更新与旧记录迁移;以内容 SHA-256 为主键共享 ZIP 与解析结果;在现有原生 OAuth 管理面上补齐禁用、卸载和授权取消的生命周期。Browser Extension / Computer Use 保留各自 capability 检测与设置流程,只把插件包安装、改名迁移和来源记录接入统一市场链路。

flowchart TD
    A[Desktop / Web / CLI / SDK] --> B[kap-server 插件与 MCP 管理接口]
    B --> C[PluginService]
    C --> D[PluginMarketplaceService]
    D --> E[市场目录与版本解析]
    C --> F[PluginManager]
    F --> G[ZIP 磁盘缓存]
    G --> H[locale-neutral 解析缓存]
    B --> I[Workspace MCP 配置与 OAuth 生命周期]
    I --> J[授权取消、回调清理与凭据失效]
Loading

市场接口返回插件元数据,ZIP 仍从条目的 source 下载;预览与安装共享同一 ZIP 获取入口,因此不需要分别下载。OAuth 清理由 server 随配置生命周期执行,避免 UI、重连和代理进程各自决定何时取消授权或清理凭据。

1. 插件市场与安装编排

  • 根据 KIMI_CODE_BASE_URL、provider 和 region 配置请求 ${baseUrl}/plugins/marketplace,不再固定读取 CDN 的 marketplace.json。
  • 市场请求使用当前 Kimi OAuth token;未登录时允许尝试匿名目录请求。ZIP 下载遇到同源 401/403 时携带 token 重试。
  • 同时支持自定义 source 安装和 marketplaceId + expectedVersion 安装。
  • 预览后市场版本发生变化时返回 PLUGIN_CATALOG_CHANGED,要求刷新目录后重试。
  • 安装前校验当前操作系统、ZIP SHA-256,以及 manifest 插件 ID 与市场条目是否一致。

2. ZIP 磁盘缓存与详情预览

  • ZIP 缓存到 ~/.kimi-code/plugins/cache/archives/<sha256>.zip,按内容寻址;读取时重新校验,损坏或被修改时删除并重下。
  • 相同 SHA 的下载与解析分别 single-flight,并发预览、安装不会重复下载。
  • 临时文件写入后原子 rename,ZIP 总缓存按 500 MB LRU 清理。
  • 进程内保留最近 20 个插件的 locale-neutral 解析结果,包含 manifest、Skill 和 locale 资源。
  • previewPlugin 不写入已安装记录即可返回 MCP 与 Skill 清单;切换 locale 只重新生成文案,不重新下载或解压。
  • 自定义插件没有预期 SHA 时保留原来的直接下载路径,不进入市场内容缓存。

3. 插件元数据与能力清单

  • 插件记录增加 origin、catalogId、installedAt,区分市场插件、自定义插件和旧记录。
  • 详情统一提供 MCP 与 Skill 的名称、描述、图标、runtime 名称、启停状态和传输类型。
  • 支持 defaultLocale、多语言资源以及 mcpOverrides / skillOverrides。
  • 市场文案区分 shortDescription、longDescription 和 cliDescription。
  • distribution、billing、userLevel 等分发字段随目录契约透传。

会员、region、billing 的可见性由市场服务端决定;core 本地负责操作系统与官方 capability 是否适用的过滤,不重新实现会员规则。

4. Browser Extension / Computer Use 官方链路

  • 保留 capability 的检测、安装引导与系统设置流程,插件包安装从硬编码 CDN ZIP 改为通过市场解析版本、来源和 SHA。
  • Browser Extension 使用新 ID kimi-browser-extension,继续识别旧 ID kimi-webbridge;升级时通过 migrateFrom 迁移记录并保留安装时间与能力状态。
  • Computer Use 继续区分 macOS 的 kimi-cu 和 Windows 的 kimi-cu-win。
  • macOS Computer Use 将权限状态拆成“辅助功能”和“屏幕录制”两个独立步骤,准确展示缺失权限。

这里变化的是包来源、命名和旧记录映射,不是把 Browser/CU 简单改成普通插件,也不是重写它们的原生检测链路。

5. MCP OAuth 生命周期

  • 声明 auth: "oauth" 的 HTTP/SSE MCP 使用原生 OAuth 管理面;本 PR 重点补齐插件场景下的生命周期收尾。
  • cancelAuthorization 取消活动授权流程、中止等待并关闭回调监听。
  • 禁用 MCP 时取消正在进行的授权;卸载 MCP 或插件时同时取消授权并使对应凭据失效。
  • Program 将 OAuth 服务注入 workspace MCP 配置管理,确保配置变更触发清理。
  • 清理失败记录 warning,不阻断禁用或卸载。
  • 旧 mcp-remote token 不做隐式迁移,切换到原生 OAuth 包后需要一次显式重新授权。

6. kap-server、Klient 与 Node SDK

  • 新增 GET /plugins/marketplace,返回合并本地安装版本、启停状态和更新状态的市场目录。
  • 新增 POST /plugins/preview,不安装即可读取 MCP 与 Skill 能力。
  • 扩展 POST /plugins,支持市场 ID、预期版本和旧插件迁移;插件详情支持 locale 与完整能力清单。
  • 新增 PLUGIN_CATALOG_CHANGED 错误码,并在 Node SDK 中标记为可重试,提示刷新市场。
  • Klient 与 Node SDK 同步插件来源、目录 ID、能力元数据和新安装参数。

7. CLI / TUI

  • 默认市场地址跟随当前 base URL 和认证环境,市场安装、更新与状态展示接入新目录契约。
  • 使用 locale 对应的 cliDescription,不再复用 UI 长介绍。
  • 对 Browser Extension / Computer Use 做 capability 去重和旧 ID 匹配。
  • 插件来源标签区分插件市场、自定义来源和旧记录。

8. 市场构建、内置数据与 Web 产物

  • 市场构建脚本为本地和远程 ZIP 统一写入 sha256sum,本地开发市场服务器生成同样的摘要。
  • 内置市场数据补齐版本、固定 ZIP 地址、平台、分发和 billing 字段,内置 WebBridge manifest 改为 kimi-browser-extension。
  • 同步最新 apps/kimi-code/dist-web,包含插件市场与 OAuth 界面。
  • 补中英文插件文档、Server API 文档及对应 changeset。

阅读指南

  • packages/agent-core-v2/src/app/plugin/marketplaceService.ts:市场地址、认证、版本和安装来源解析。
  • packages/agent-core-v2/src/app/plugin/pluginService.ts:自定义与市场安装、详情预览和管理读写编排。
  • packages/agent-core-v2/src/app/plugin/manager.ts:ZIP 安装、manifest 校验、能力预览、locale 与解析缓存。
  • packages/agent-core-v2/src/app/plugin/packageCache.ts:ZIP 校验、原子写入、并发去重和 LRU。
  • packages/agent-core-v2/src/app/capability/entries/:Browser Extension / Computer Use 的官方链路与迁移。
  • packages/agent-core-v2/src/mcpCore/oauth/service.ts 和 workspaceMcpConfigService.ts:OAuth 取消、卸载清理与凭据失效。
  • packages/kap-server/src/routes/plugins.ts 和 protocol/rest-plugin.ts:插件 HTTP 契约。
  • apps/kimi-code/src/tui/、packages/klient/、packages/node-sdk/:CLI、类型和 SDK 透传;构建脚本、文档、测试与 dist-web 可随后阅读。

Screenshots / Recordings

以下截图来自与本 dist-web 同源的 Web UI,使用隔离的临时 home,只读取公开市场插件,没有执行安装或账号授权。

插件市场列表与安装入口:

插件市场列表

详情中的介绍、MCP 应用和技能:

插件详情与能力

Behavior Changes and Affected Users

行为 改动前 改动后 受影响用户与退路
默认市场目录 读取固定 CDN marketplace.json 跟随当前 base URL 请求 /plugins/marketplace,使用对应认证上下文 desktop/web/CLI/SDK 用户;显式市场 URL 环境变量仍可覆盖。
市场安装 按来源直接下载,目录与安装可能使用不同版本 按预期版本解析并校验平台、SHA 与插件 ID,目录变化要求刷新重试 市场插件用户;自定义 source 安装保持原路径。
详情预览与安装 每次预览可能下载并解压,安装再下载一次 同 SHA 共享 ZIP 与解析缓存,预览后安装不重复下载 市场插件用户;缓存失效或损坏时自动重下。
server 重启后的预览 重新下载 ZIP 磁盘 ZIP 命中后不再下载,只重新解析一次 重启 desktop 或 daemon 的用户,无需操作。
locale 切换 可能重新下载和解压 同一份 locale-neutral 解析数据生成对应语言文案 切换界面语言的用户,无需操作。
插件来源记录 只有本地安装来源 增加市场来源、目录 ID 与旧记录映射 老安装记录继续读取;无来源记录按旧数据展示。
Browser Extension 使用 kimi-webbridge 和硬编码 CDN 包 使用 kimi-browser-extension,包安装走市场,旧记录可迁移 已安装旧版用户保留 capability 检测和设置流程,无需手动迁移。
Computer Use 插件包使用固定 CDN 地址,macOS 权限聚合展示 包安装走市场,辅助功能与屏幕录制分别展示 macOS/Windows 老用户继续使用既有 capability 流程。
原生 OAuth 授权流程可能与 MCP 配置存活期不一致 禁用取消活动授权,卸载同时清理授权与凭据 OAuth 插件用户;旧 mcp-remote token 不迁移,需要一次显式重授权。
CLI 插件展示 使用通用描述和 capability 特定匹配 使用本地化 cliDescription,统一市场状态与来源标签 CLI/TUI 用户;本地插件路径保持可用。
插件 API 与 SDK 只支持按 source 安装,详情字段较少 支持市场安装、预览、locale、来源与能力元数据,新增目录变化错误 desktop/web/CLI/SDK 消费方随新契约同步升级。

受影响模块与验证

  • agent-core-v2:市场解析、安装、缓存、旧记录迁移、capability 和 OAuth 生命周期均有对应单元测试。
  • kap-server:市场合并、预览、安装、目录变化、平台过滤和缓存行为由路由测试覆盖。
  • klient / node-sdk:新契约、错误码和 SDK 透传已同步;既有 sdk-rpc-client-v2.test.ts 102/102 通过。
  • 合并最新 main 后重新验证:mcpManagement.test.ts 58 项与 plugins.test.ts 26 项,合计 84/84 通过。
  • code-app 侧完成类型检查、浏览器与授权相关回归测试,Web 生产构建成功,产物已同步到本 PR。
  • 真实接口缓存验证:连续两次预览、一次安装及 server 重启后的再次预览,ZIP 下载计数始终为 1,缓存文件 SHA-256 与原包一致。

未完成的验证:没有使用真实 Vercel 账号完成登录,因此真实账号的 token 交换和 Vercel 工具调用仍待验证;没有执行全量回归测试。

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue.(无关联 issue,需求背景与实现范围见上文。)
  • I have added tests that prove my feature works.
  • The behavior-change table above is complete; 原生 OAuth 的一次显式重授权已明确列出,旧 mcp-remote 包与官方 capability 路径保持可用。
  • Ran gen-changesets skill, or this PR needs no changeset.(已保留插件 OAuth 与 Web UI 的 patch changeset。)
  • Ran gen-docs skill, or this PR needs no doc update.(已检查文档需求,并同步插件与 Server API 中英文文档。)

Copilot AI balanced review requested due to automatic review settings October 29, 2026 11:42
@changeset-bot

changeset-bot Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: f72b932

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@moonshot-ai/kimi-code Patch
@moonshot-ai/agent-core-v2 Patch
@moonshot-ai/kap-server Patch
@moonshot-ai/kimi-code-sdk Minor
kimi-code Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

code-app: bce227c948f3b6cbc9371ac4d80d1deb132a4370
code-app: 34092014df516f8ec0bf91adf78c75c9ddd9a60d
# Conflicts:
#	apps/kimi-code/dist-web/assets/CodeBlockNode-DN6tN-fd.js
#	apps/kimi-code/dist-web/assets/CodeBlockNode-DnNeGjd2.js
#	apps/kimi-code/dist-web/assets/CodeBlockNode-UZZg5gHp.js
#	apps/kimi-code/dist-web/assets/PreCodeBlock-CwnbxLyB.js
#	apps/kimi-code/dist-web/assets/PreCodeBlock-DKgDTiZH.js
#	apps/kimi-code/dist-web/assets/PreCodeBlock-De4sXzpb.js
#	apps/kimi-code/dist-web/assets/Tooltip-CBoeS4mO.js
#	apps/kimi-code/dist-web/assets/Tooltip-CKClijn4.js
#	apps/kimi-code/dist-web/assets/Tooltip-CsVtTVYl.js
#	apps/kimi-code/dist-web/assets/abnfDiagram-VRR7QNED-C0F_mbj1.js
#	apps/kimi-code/dist-web/assets/abnfDiagram-VRR7QNED-Dw7C85u7.js
#	apps/kimi-code/dist-web/assets/abnfDiagram-VRR7QNED-Id86ug7C.js
#	apps/kimi-code/dist-web/assets/arc-Bsib46yB.js
#	apps/kimi-code/dist-web/assets/arc-CBcVCQMr.js
#	apps/kimi-code/dist-web/assets/arc-CBqyenpI.js
#	apps/kimi-code/dist-web/assets/architectureDiagram-ZJ3FMSHR-BU3h4qH_.js
#	apps/kimi-code/dist-web/assets/architectureDiagram-ZJ3FMSHR-nh3c_qTo.js
#	apps/kimi-code/dist-web/assets/architectureDiagram-ZJ3FMSHR-uDBghsgL.js
#	apps/kimi-code/dist-web/assets/blockDiagram-677ZJIJ3-B6F4Cp_k.js
#	apps/kimi-code/dist-web/assets/blockDiagram-677ZJIJ3-DVoda3uu.js
#	apps/kimi-code/dist-web/assets/blockDiagram-677ZJIJ3-DWIUQjzE.js
#	apps/kimi-code/dist-web/assets/c4Diagram-LMCZKHZV-Bu_3WzlR.js
#	apps/kimi-code/dist-web/assets/c4Diagram-LMCZKHZV-DK8zAX4-.js
#	apps/kimi-code/dist-web/assets/c4Diagram-LMCZKHZV-DubDU1Hh.js
#	apps/kimi-code/dist-web/assets/chunk-2Q5K7J3B-BG6es7i7.js
#	apps/kimi-code/dist-web/assets/chunk-2Q5K7J3B-BhqfYswo.js
#	apps/kimi-code/dist-web/assets/chunk-2Q5K7J3B-DL_oG78-.js
#	apps/kimi-code/dist-web/assets/chunk-32BRIVSS-Bs2qOQkG.js
#	apps/kimi-code/dist-web/assets/chunk-32BRIVSS-CYFkA-hP.js
#	apps/kimi-code/dist-web/assets/chunk-32BRIVSS-DompFR0C.js
#	apps/kimi-code/dist-web/assets/chunk-5VM5RSS4-BRm-UcvZ.js
#	apps/kimi-code/dist-web/assets/chunk-5VM5RSS4-CZPfFxs8.js
#	apps/kimi-code/dist-web/assets/chunk-5VM5RSS4-DactliZz.js
#	apps/kimi-code/dist-web/assets/chunk-EX3LRPZG-DDKia6Wx.js
#	apps/kimi-code/dist-web/assets/chunk-EX3LRPZG-DKeya_Nh.js
#	apps/kimi-code/dist-web/assets/chunk-EX3LRPZG-DNGZpN35.js
#	apps/kimi-code/dist-web/assets/chunk-JWPE2WC7-BlIxYDeZ.js
#	apps/kimi-code/dist-web/assets/chunk-JWPE2WC7-CLdUjjB6.js
#	apps/kimi-code/dist-web/assets/chunk-JWPE2WC7-DiGu-64o.js
#	apps/kimi-code/dist-web/assets/chunk-MOJQB5TN-BSyzgfKN.js
#	apps/kimi-code/dist-web/assets/chunk-MOJQB5TN-B_4qq8M2.js
#	apps/kimi-code/dist-web/assets/chunk-MOJQB5TN-TDhzsKaU.js
#	apps/kimi-code/dist-web/assets/chunk-RYQCIY6F-BBtlUlC2.js
#	apps/kimi-code/dist-web/assets/chunk-RYQCIY6F-BWPNh9WA.js
#	apps/kimi-code/dist-web/assets/chunk-RYQCIY6F-Doiirtiw.js
#	apps/kimi-code/dist-web/assets/chunk-V7JOEXUC-BeBDLO_d.js
#	apps/kimi-code/dist-web/assets/chunk-V7JOEXUC-gc4j6mJE.js
#	apps/kimi-code/dist-web/assets/chunk-V7JOEXUC-hOjH0svY.js
#	apps/kimi-code/dist-web/assets/chunk-VR4S4FIN-8bf_mCzp.js
#	apps/kimi-code/dist-web/assets/chunk-VR4S4FIN-C0Aw3V2v.js
#	apps/kimi-code/dist-web/assets/chunk-VR4S4FIN-CBSF7Uhy.js
#	apps/kimi-code/dist-web/assets/chunk-XXDRQBXY-9kW4cjFh.js
#	apps/kimi-code/dist-web/assets/chunk-XXDRQBXY-Di7YUrsz.js
#	apps/kimi-code/dist-web/assets/chunk-XXDRQBXY-h83Z76mT.js
#	apps/kimi-code/dist-web/assets/cose-bilkent-JH36ORCC-BJZkFZnP.js
#	apps/kimi-code/dist-web/assets/cose-bilkent-JH36ORCC-NLouu6tm.js
#	apps/kimi-code/dist-web/assets/cose-bilkent-JH36ORCC-Rq-Oi3RS.js
#	apps/kimi-code/dist-web/assets/cynefin-VYW2F7L2-BXN2FRZL.js
#	apps/kimi-code/dist-web/assets/cynefin-VYW2F7L2-CPEG8-Vi.js
#	apps/kimi-code/dist-web/assets/cynefin-VYW2F7L2-KkOFmjEG.js
#	apps/kimi-code/dist-web/assets/cynefinDiagram-TSTJHNR4-BxQYNKgE.js
#	apps/kimi-code/dist-web/assets/cynefinDiagram-TSTJHNR4-ClIEQzxH.js
#	apps/kimi-code/dist-web/assets/cynefinDiagram-TSTJHNR4-Cx1H0a5W.js
#	apps/kimi-code/dist-web/assets/dagre-VKFMJZFB-D0TIaws6.js
#	apps/kimi-code/dist-web/assets/dagre-VKFMJZFB-DmTFvAJt.js
#	apps/kimi-code/dist-web/assets/dagre-VKFMJZFB-ptq00KuZ.js
#	apps/kimi-code/dist-web/assets/diagram-FQU43EPY-BJ0uLCEZ.js
#	apps/kimi-code/dist-web/assets/diagram-FQU43EPY-BrJ6XXhF.js
#	apps/kimi-code/dist-web/assets/diagram-FQU43EPY-Dd0HSMZA.js
#	apps/kimi-code/dist-web/assets/diagram-G47NLZAW-BihKArCL.js
#	apps/kimi-code/dist-web/assets/diagram-G47NLZAW-Bo2riSBI.js
#	apps/kimi-code/dist-web/assets/diagram-G47NLZAW-DVqQNs4W.js
#	apps/kimi-code/dist-web/assets/diagram-NH7WQ7WH-DT8Wun3S.js
#	apps/kimi-code/dist-web/assets/diagram-NH7WQ7WH-DeFBJSVr.js
#	apps/kimi-code/dist-web/assets/diagram-NH7WQ7WH-pI2gpWBg.js
#	apps/kimi-code/dist-web/assets/diagram-OA4YK3LP-CDDFynlc.js
#	apps/kimi-code/dist-web/assets/diagram-OA4YK3LP-CsiOOqY1.js
#	apps/kimi-code/dist-web/assets/diagram-OA4YK3LP-DzDSMAZf.js
#	apps/kimi-code/dist-web/assets/diagram-WEI45ONY-CKDZSMR2.js
#	apps/kimi-code/dist-web/assets/diagram-WEI45ONY-CXBgtykE.js
#	apps/kimi-code/dist-web/assets/diagram-WEI45ONY-DRDdsmaR.js
#	apps/kimi-code/dist-web/assets/ebnfDiagram-CCIWWBDH-3u_QW33C.js
#	apps/kimi-code/dist-web/assets/ebnfDiagram-CCIWWBDH-B-sMl9AN.js
#	apps/kimi-code/dist-web/assets/ebnfDiagram-CCIWWBDH-CPZtqNO1.js
#	apps/kimi-code/dist-web/assets/erDiagram-Q63AITRT-BUUoeEan.js
#	apps/kimi-code/dist-web/assets/erDiagram-Q63AITRT-DlsWQCVk.js
#	apps/kimi-code/dist-web/assets/erDiagram-Q63AITRT-OXNvxKyl.js
#	apps/kimi-code/dist-web/assets/flowDiagram-23GEKE2U-BgRIGxtY.js
#	apps/kimi-code/dist-web/assets/flowDiagram-23GEKE2U-Cpg_K1S0.js
#	apps/kimi-code/dist-web/assets/flowDiagram-23GEKE2U-D03iyCLb.js
#	apps/kimi-code/dist-web/assets/ganttDiagram-NO4QXBWP-BPjlGhob.js
#	apps/kimi-code/dist-web/assets/ganttDiagram-NO4QXBWP-CrTDxXwh.js
#	apps/kimi-code/dist-web/assets/ganttDiagram-NO4QXBWP-CvsplL3l.js
#	apps/kimi-code/dist-web/assets/gitGraphDiagram-IHSO6WYX-CBqntniz.js
#	apps/kimi-code/dist-web/assets/gitGraphDiagram-IHSO6WYX-CkPzgGiM.js
#	apps/kimi-code/dist-web/assets/gitGraphDiagram-IHSO6WYX-DGTxB2o0.js
#	apps/kimi-code/dist-web/assets/index-4jSVmVLR.css
#	apps/kimi-code/dist-web/assets/index-AgSzbavm.js
#	apps/kimi-code/dist-web/assets/index-B68Y3p9W.js
#	apps/kimi-code/dist-web/assets/index-BJ3eGrh9.js
#	apps/kimi-code/dist-web/assets/index-BTn4U4mS.js
#	apps/kimi-code/dist-web/assets/index-BvkSYG-C.js
#	apps/kimi-code/dist-web/assets/index-BzZ34GS1.js
#	apps/kimi-code/dist-web/assets/index-CEWtXGqT.js
#	apps/kimi-code/dist-web/assets/index-CIEFQm8q.js
#	apps/kimi-code/dist-web/assets/index-CQcWT59y.js
#	apps/kimi-code/dist-web/assets/index10-B5ifztdO.js
#	apps/kimi-code/dist-web/assets/index10-D0AEmZyD.js
#	apps/kimi-code/dist-web/assets/index10-X5vZpglB.js
#	apps/kimi-code/dist-web/assets/index5-COtrqpTL.js
#	apps/kimi-code/dist-web/assets/index5-CR9IbT_I.js
#	apps/kimi-code/dist-web/assets/index5-DuOTUxfY.js
#	apps/kimi-code/dist-web/assets/index6-BidN6rkR.js
#	apps/kimi-code/dist-web/assets/index6-BosaMqz3.js
#	apps/kimi-code/dist-web/assets/index6-CoOgkfRu.js
#	apps/kimi-code/dist-web/assets/index8-B3kOd_lN.js
#	apps/kimi-code/dist-web/assets/index8-BkZ_nVKY.js
#	apps/kimi-code/dist-web/assets/index8-CkikbLH9.js
#	apps/kimi-code/dist-web/assets/index9-6cg8BGrC.js
#	apps/kimi-code/dist-web/assets/index9-BbcZIVAx.js
#	apps/kimi-code/dist-web/assets/index9-tIE0Vojz.js
#	apps/kimi-code/dist-web/assets/infoDiagram-FWYZ7A6U-BTsrmCcp.js
#	apps/kimi-code/dist-web/assets/infoDiagram-FWYZ7A6U-BnROAGmN.js
#	apps/kimi-code/dist-web/assets/infoDiagram-FWYZ7A6U-i0sqzIdk.js
#	apps/kimi-code/dist-web/assets/ishikawaDiagram-FXEZZL3T-CD2HXIn9.js
#	apps/kimi-code/dist-web/assets/ishikawaDiagram-FXEZZL3T-CG4SQ4h6.js
#	apps/kimi-code/dist-web/assets/ishikawaDiagram-FXEZZL3T-CWi6p4Fs.js
#	apps/kimi-code/dist-web/assets/journeyDiagram-5HDEW3XC-69Mpdm1i.js
#	apps/kimi-code/dist-web/assets/journeyDiagram-5HDEW3XC-DN7ziWf0.js
#	apps/kimi-code/dist-web/assets/journeyDiagram-5HDEW3XC-DoXENIdm.js
#	apps/kimi-code/dist-web/assets/kanban-definition-HUTT4EX6-BRn8cYnl.js
#	apps/kimi-code/dist-web/assets/kanban-definition-HUTT4EX6-Cn4uJR7z.js
#	apps/kimi-code/dist-web/assets/kanban-definition-HUTT4EX6-vX5StZkg.js
#	apps/kimi-code/dist-web/assets/linear-CDah2Fig.js
#	apps/kimi-code/dist-web/assets/linear-Cyvch2b1.js
#	apps/kimi-code/dist-web/assets/linear-eT45Pk4H.js
#	apps/kimi-code/dist-web/assets/markstream-9V28iECG.js
#	apps/kimi-code/dist-web/assets/markstream-BD7TOIP5.js
#	apps/kimi-code/dist-web/assets/markstream-Bi91cHW2.js
#	apps/kimi-code/dist-web/assets/mermaid.core-BTdvNJFM.js
#	apps/kimi-code/dist-web/assets/mermaid.core-BigoYC3R.js
#	apps/kimi-code/dist-web/assets/mermaid.core-CPvYwC1W.js
#	apps/kimi-code/dist-web/assets/mindmap-definition-LN4V7U3C-B8mfB2gJ.js
#	apps/kimi-code/dist-web/assets/mindmap-definition-LN4V7U3C-CQgNs0q1.js
#	apps/kimi-code/dist-web/assets/mindmap-definition-LN4V7U3C-hUFoFMn_.js
#	apps/kimi-code/dist-web/assets/pegDiagram-2B236MQR-7cr_V7js.js
#	apps/kimi-code/dist-web/assets/pegDiagram-2B236MQR-DRysFqa8.js
#	apps/kimi-code/dist-web/assets/pegDiagram-2B236MQR-rHOWnNl6.js
#	apps/kimi-code/dist-web/assets/pieDiagram-ENE6RG2P-BothDbBB.js
#	apps/kimi-code/dist-web/assets/pieDiagram-ENE6RG2P-CF2EEouT.js
#	apps/kimi-code/dist-web/assets/pieDiagram-ENE6RG2P-G7nomqX9.js
#	apps/kimi-code/dist-web/assets/quadrantDiagram-ABIIQ3AL-BEvlLLL9.js
#	apps/kimi-code/dist-web/assets/quadrantDiagram-ABIIQ3AL-BzvL4DZU.js
#	apps/kimi-code/dist-web/assets/quadrantDiagram-ABIIQ3AL-DSWGD1og.js
#	apps/kimi-code/dist-web/assets/railroadDiagram-RFXS5EU6-C204BVeM.js
#	apps/kimi-code/dist-web/assets/railroadDiagram-RFXS5EU6-DrzununQ.js
#	apps/kimi-code/dist-web/assets/railroadDiagram-RFXS5EU6-tMYfgW3B.js
#	apps/kimi-code/dist-web/assets/requirementDiagram-TGXJPOKE-BDgbCoqu.js
#	apps/kimi-code/dist-web/assets/requirementDiagram-TGXJPOKE-BwZTxUww.js
#	apps/kimi-code/dist-web/assets/requirementDiagram-TGXJPOKE-CloEciiT.js
#	apps/kimi-code/dist-web/assets/sankeyDiagram-HTMAVEWB-4xW6Sp9V.js
#	apps/kimi-code/dist-web/assets/sankeyDiagram-HTMAVEWB-BXKQrGMx.js
#	apps/kimi-code/dist-web/assets/sankeyDiagram-HTMAVEWB-aV3OD9GV.js
#	apps/kimi-code/dist-web/assets/sequenceDiagram-DBY2YBRQ-Bi6rVWH0.js
#	apps/kimi-code/dist-web/assets/sequenceDiagram-DBY2YBRQ-BnQzDUtU.js
#	apps/kimi-code/dist-web/assets/sequenceDiagram-DBY2YBRQ-DpzxIYFA.js
#	apps/kimi-code/dist-web/assets/sizeCapture-X5ZJPWSS-Do5KxOE0.js
#	apps/kimi-code/dist-web/assets/sizeCapture-X5ZJPWSS-gWXyZzoI.js
#	apps/kimi-code/dist-web/assets/sizeCapture-X5ZJPWSS-zaoKWXBh.js
#	apps/kimi-code/dist-web/assets/stateDiagram-2N3HPSRC-BvSRgWBd.js
#	apps/kimi-code/dist-web/assets/stateDiagram-2N3HPSRC-CSBDJyOQ.js
#	apps/kimi-code/dist-web/assets/stateDiagram-2N3HPSRC-DbnAxkh4.js
#	apps/kimi-code/dist-web/assets/swimlanes-5IMT3BWC-CzbmjPLM.js
#	apps/kimi-code/dist-web/assets/swimlanes-5IMT3BWC-DQZfDcOF.js
#	apps/kimi-code/dist-web/assets/swimlanes-5IMT3BWC-JtIWmWxC.js
#	apps/kimi-code/dist-web/assets/timeline-definition-FHXFAJF6-DAdAcwVP.js
#	apps/kimi-code/dist-web/assets/timeline-definition-FHXFAJF6-DzJM0sQI.js
#	apps/kimi-code/dist-web/assets/timeline-definition-FHXFAJF6-T9GJ5Hp2.js
#	apps/kimi-code/dist-web/assets/vennDiagram-L72KCM5P-CPRS6YoG.js
#	apps/kimi-code/dist-web/assets/vennDiagram-L72KCM5P-C_wspp6X.js
#	apps/kimi-code/dist-web/assets/vennDiagram-L72KCM5P-DuiLWTnw.js
#	apps/kimi-code/dist-web/assets/vue.runtime.esm-bundler-BpD3cemV.js
#	apps/kimi-code/dist-web/assets/vue.runtime.esm-bundler-CSkTYLTh.js
#	apps/kimi-code/dist-web/assets/vue.runtime.esm-bundler-DrbcV_y0.js
#	apps/kimi-code/dist-web/assets/wardleyDiagram-EHGQE667-BVtPoREV.js
#	apps/kimi-code/dist-web/assets/wardleyDiagram-EHGQE667-DaNV0jkS.js
#	apps/kimi-code/dist-web/assets/wardleyDiagram-EHGQE667-vztNr3wj.js
#	apps/kimi-code/dist-web/assets/xychartDiagram-FW5EYKEG-C0ZiXh9l.js
#	apps/kimi-code/dist-web/assets/xychartDiagram-FW5EYKEG-MOZl_6XO.js
#	apps/kimi-code/dist-web/assets/xychartDiagram-FW5EYKEG-UOnbMUrX.js
#	apps/kimi-code/dist-web/index.html
#	packages/agent-core-v2/src/program/program.ts
#	packages/node-sdk/src/sdk-rpc-client-v2.ts
code-app: 58f637b4642109ad38f9c6a22a4c2e16af489929
code-app: fc4c87dcbc1a4e1fe7aa6f5947f89b7f358b2ca2
code-app: 6d15295b66c9b9c0d6caf5a0adbd7bb53ded447e
code-app: ccbbf58a8db6aa81e106892ab4ea206fbc379c1e
code-app: 8df46fd4ac24caa5667a2463952306347c549580
code-app: 667924aa29d0e33fc96fbded2a8f375bccce1df8
code-app: a641f2f0e0ebd2e366b7a3bfad2bb652d4b51f5a
@liruifengv
liruifengv marked this pull request as ready for review November 2, 2026 02:58
@liruifengv

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-03T07:02:32.781900Z f72b932 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@pkg-pr-new

pkg-pr-new Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@f72b932
npx https://pkg.pr.new/@moonshot-ai/kimi-code@f72b932

commit: f72b932

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4522a37f10

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread apps/kimi-code/src/constant/app.ts Resolved
@liruifengv

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

💡 Codex Review

const summary = await ctx.plugins.installPlugin({
marketplaceId: config.id,
expectedVersion: entry.version,
});

P1 Badge Pass catalog digests into capability installs

Installing Kimi CU from the official catalog always fails because this request omits entry.sha256sum, while PluginMarketplaceService.resolveInstall() rejects every digest-bearing ZIP when expectedSha256 is absent. The browser-extension capability has the same regression at kimiWebbridge.ts:200, where it calls resolveInstall(PLUGIN_ID, undefined), so both official capability installation paths terminate with “requires the displayed SHA-256 digest” before downloading anything. Carry the catalog digest through both capability flows.

AGENTS.md reference: AGENTS.md:L127-L129


https://github.com/MoonshotAI/kimi-code/blob/f32d0fb8e874157cb27bdaa8bf26d7a1f33b18fd/apps/kimi-code/dist-web/assets/index-DZx2OsVe.js#L148
P1 Badge Send the displayed digest from the web marketplace

For every non-capability ZIP entry opened or installed from the bundled web UI, the synced client sends only marketplaceId and expectedVersion: the bundle contains no expectedSha256 or even sha256sum handling. The server now rejects digest-bearing marketplace previews and installs that omit this field, so viewing capabilities or installing entries such as Superpowers fails with “requires the displayed SHA-256 digest”; update the code-app client to forward the catalog digest and resync this bundle.

AGENTS.md reference: AGENTS.md:L123-L125


const catalog = await loadPluginMarketplace({
workDir: host.state.appState.workDir,
source,
});
panel.setMarketplace(catalog.plugins, catalog.source);

P2 Badge Keep resolving versions for bare GitHub catalog entries

When a custom marketplace entry uses the documented bare GitHub repository source and omits version, this loader now renders the parsed catalog immediately and never performs the previous latest-release lookup. deriveVersionFromGithubSource() cannot derive a version from a bare repository URL, so computeUpdateStatus() can no longer show marketplace update badges for these existing catalogs even though installation still follows the latest release; retain the background version enrichment for custom GitHub entries.

AGENTS.md reference: AGENTS.md:L111-L113


for (const name of remove) {
await this.cancelAuthorization(name, this.current[name]);
if (!preserveOAuthCredentials) {
await this.invalidateAuthorization(name, this.current[name]);
}

P2 Badge Revoke plugin OAuth credentials without an active workspace

When a plugin is removed through the app-global REST or SDK API before any workspace instance has been created—for example, immediately after restarting the server—there is no WorkspaceMcpConfigService subscribed to the plugin reload. This workspace-scoped loop is the only automatic call to oauth.invalidate, so the uninstall succeeds while that plugin's OAuth tokens, client registration, discovery state, and refresh bookkeeping remain stored; perform the cleanup from the app-global plugin removal path using the removed plugin's MCP entries.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@liruifengv
liruifengv merged commit 8019337 into main Nov 3, 2026
16 checks passed
@liruifengv
liruifengv deleted the feat/plugin-center-marketplace branch November 3, 2026 07:06
@github-actions github-actions Bot mentioned this pull request Nov 3, 2026
7723qqq pushed a commit to 7723qqq/kimi-code that referenced this pull request Nov 4, 2026
Fifteen rows enter the ledger: the six commits that landed on
upstream/main after the last refresh, and the nine commits that reach
main only through the release/2026-11-04 sync (MoonshotAI#4674), which is where
the 2.5.0 changelog entries come from.

Each 2.5.0 row records what it needs from this tree, so the next batch
starts from the blocker instead of rediscovering it:

- MoonshotAI#4658 and MoonshotAI#4659 are ported (79a4199, 7a531f5) with tests that
  fail on the pre-change tree.
- MoonshotAI#4649 is in_progress: its agent-core-v2 half landed in 2fa7b6b,
  while the footer and welcome half needs the pull-request API of MoonshotAI#4527
  and the session workdir of MoonshotAI#4062.
- MoonshotAI#4653, MoonshotAI#4666 and MoonshotAI#4670 build on the MoonshotAI#4525 plugin marketplace, absent
  here; MoonshotAI#4670 additionally needs isError2.
- MoonshotAI#4664 needs the MoonshotAI#4062 remote environments.
- MoonshotAI#4667 and MoonshotAI#4672 are generated-bundle and release commits; settling
  them as not-applicable needs a signature.

Rows were appended by a one-off writer because --refresh fetches and
that fetch does not complete on this network; the file still parses
under the tool's own column contract, and --verify --batch B5 passes
both new probes.
7723qqq pushed a commit to 7723qqq/kimi-code that referenced this pull request Nov 4, 2026
7723qqq pushed a commit to 7723qqq/kimi-code that referenced this pull request Nov 4, 2026
…locale

First slice of upstream 8019337 (MoonshotAI#4525). The fork's marketplace entry
knew a plugin's id, source, tier and blurb; the catalog upstream serves also
carries a distribution record (category, region, default install, weight,
user level), per-platform availability, localized descriptions, an icon, an
archive filename and a SHA-256 digest, and its clients are told to filter on
all of it.

`marketplace.ts` now models those fields and parses them: a `distribution`
record decides both `classification` and `tier` (an entry without one falls
back to its `tier`), platform aliases normalize to `darwin`/`win32` and are
deduplicated, a malformed digest, a distribution without a known category and
an empty platform list are rejected at parse time, and locale entries accept
either a plain string or the localized-text object.

Everything is additive and optional, so the existing marketplace service,
manager and TUI consumers keep compiling untouched; the availability cache
and the client filter that read these fields land in the following slice.

Verified: agent-core-v2 typecheck clean, check-no-comments clean; new
`marketplace.test.ts` 9 pass and the plugin suites 121 pass.
7723qqq pushed a commit to 7723qqq/kimi-code that referenced this pull request Nov 4, 2026
Second slice of upstream 8019337 (MoonshotAI#4525), and the seam MoonshotAI#4653 needs. An
entry can now declare the clients it serves and the platforms it runs on;
`marketplaceEntryInstallableOnHost` requires both to match the host, while
`marketplaceEntryVisibleOnHost` also shows a cloud-only entry anywhere
without making it installable there. `pluginClientForIdentity` maps the
desktop identity to `desktop` and every other host to `cli`.

Parsing keeps an absent `clients` list open to everyone, drops unknown client
names, and turns a non-array into an empty list rather than silently
admitting the entry — the three behaviours upstream pins.

Verified: agent-core-v2 typecheck clean, check-no-comments clean;
`marketplace.test.ts` 13 pass.
7723qqq pushed a commit to 7723qqq/kimi-code that referenced this pull request Nov 4, 2026
7723qqq pushed a commit to 7723qqq/kimi-code that referenced this pull request Nov 4, 2026
Third slice of upstream 8019337 (MoonshotAI#4525). A plugin manifest can now carry
`interface.defaultLocale`, `interface.locales` (a path to the locale file),
and per-entry `mcpOverrides` / `skillOverrides`; the type side also gains
`PluginInterfaceOverride`, `PluginSkillInfo`, `PluginSkillRecord` and
`PluginCapabilities`.

The manifest parser was an allowlist, so without this change the new keys
would have been read as unknown fields and silently dropped: `readInterface`
now picks them up and `readInterfaceOverrides` keeps only entries that carry
at least one field, so `{ empty: {} }` does not become an override.

Everything is optional, so no stored record changes shape and no migration is
needed; loading the referenced locale file and projecting it onto the plugin
record is the next slice, together with the record `origin`/`catalogId`
provenance the availability cache will key on.

Verified: agent-core-v2 typecheck clean, check-no-comments clean; manifest
suite 22 pass including the two new cases (locale metadata alone still yields
an interface; unknown override entries are dropped).
7723qqq pushed a commit to 7723qqq/kimi-code that referenced this pull request Nov 4, 2026
Fourth slice of upstream 8019337 (MoonshotAI#4525), and the provenance MoonshotAI#4653's
availability cache keys on. `PluginRecord` and `PluginSummary` now carry
`origin` (`marketplace` | `custom` | `unknown`) and an optional `catalogId`.

The installed-file record keeps both fields optional and `recordFrom`
defaults a missing origin to `unknown`, so an `installed.json` written before
this change still loads and is not mislabelled as marketplace or custom. No
rewrite of existing files is needed; the next persist simply writes the new
fields.

Classifying a fresh install is deliberately left out: the marketplace install
path that knows the catalog entry does not exist in the fork yet, so every
install would be labelled from a guess. `install()` therefore still produces
`unknown` until that path passes the entry.

Verified: agent-core-v2 typecheck clean, check-no-comments clean; plugin
suites 129 pass, including two new cases — a pre-origin record reads as
`unknown`, and a marketplace origin with its catalog id survives a reload.
7723qqq pushed a commit to 7723qqq/kimi-code that referenced this pull request Nov 4, 2026
7723qqq pushed a commit to 7723qqq/kimi-code that referenced this pull request Nov 4, 2026
Fifth slice of upstream 8019337 (MoonshotAI#4525). `interface.locales` names a
directory of per-locale JSON files; until now the field was parsed and then
ignored. `readInterfaceLocales` reads the directory, keys each entry by the
file's name without `.json`, and stores the result on the parsed manifest and
on `PluginRecord.interfaceLocales`.

Every failure mode is a diagnostic, not an exception: a path that escapes the
plugin root, a path that is not a directory, an unreadable entry, a locale
file with no supported display fields, and invalid JSON each warn and leave
the rest of the locale set intact — a plugin with one broken translation
still shows the others.

Local-form notes: the fork's manifest parser already had
`resolvePluginPathField`, `isDir`, `isFile` and `isWithin`, so the loader is
the upstream body unchanged. The record copy is one line in `recordFrom`; the
preceding slice's field-reading test had pointed `locales` at a file that did
not exist, which now warns, so that case drops the field and the new cases own
locale loading.

Verified: agent-core-v2 typecheck clean, check-no-comments clean; manifest
suite 24 pass (locale files keyed by name, unsupported-fields warning,
non-directory warning) and plugin suites 131 pass.
7723qqq pushed a commit to 7723qqq/kimi-code that referenced this pull request Nov 4, 2026
The availability half of upstream 45e8f0e0f0e (MoonshotAI#4653), built on the fields the
MoonshotAI#4525 slices added. `PluginAvailabilityStore` keeps
`<home>/plugins/availability.json`: per marketplace source, each catalog
entry's client list, platform list, artifact digest and check time. `update()`
writes only when a value actually changed and reports whether it did;
`refresh()` reloads; `entryFor()` resolves an installed record back to its
catalog entry by source and catalog id, and `supports()` answers whether this
host may install it.

Resolution follows the record's provenance: a `custom` plugin is always
allowed, a `marketplace` plugin is matched through the source it came from,
and an `unknown` plugin must match the artifact digest it was installed from —
when several catalog entries claim the same id the lookup returns a
restrictive empty entry rather than guessing.

Local-form divergence: upstream locks with `proper-lockfile`, which is not a
dependency here. The equivalent is an `open(..., 'wx')` lock file with a
50 ms retry, a 10 s wait and a 5 s stale reclaim, so a crashed writer cannot
block the next one; the write itself is still temp-file plus rename. Corrupt
JSON throws instead of being read as an empty cache.

Verified: agent-core-v2 typecheck clean, check-no-comments clean; plugin suite
137 pass including the new availability cases (single change signal,
concurrent writers, stale-lock reclaim, provenance matching, corrupt cache).
7723qqq pushed a commit to 7723qqq/kimi-code that referenced this pull request Nov 4, 2026
7723qqq pushed a commit to 7723qqq/kimi-code that referenced this pull request Nov 4, 2026
7723qqq pushed a commit to 7723qqq/kimi-code that referenced this pull request Nov 4, 2026
…equivalent

MoonshotAI#4525: the marketplace half is ported and the native MCP OAuth capability is served by this fork's own mcpCore/oauth subsystem (service/provider/store/coordinator/callback-server, single-flight refresh, createMcpOAuthFetch wired through connection-manager), so the row is equivalent rather than ported. MoonshotAI#4514: kimi-inspect removed, with its only server-side client (the event.di.* opt-in) and the workspace/changeset/nix references.
7723qqq pushed a commit to 7723qqq/kimi-code that referenced this pull request Nov 5, 2026
… resolve seam

The row looked like a 34-file mechanical port, but its installer call goes
through `installResolvedMarketplacePlugin(plugins, input, resolved, requiredSkill)`,
which needs `marketplace.resolveInstall` and the `MarketplacePluginInstall` type
from upstream's `app/plugin/marketplaceService.ts`. That file has no counterpart
here: the marketplace port (MoonshotAI#4525, equivalent) carried the entry model and parser
only, and this tree installs through `manager.install` plus
`availability.matchByArtifact`, so there is nothing for the capability entry to
hand over.

A trial apply was written and then fully reverted (11 conflicted files, and the
new pluginService/kimiCu imports resolve against symbols this tree does not
export), and the engine typecheck is clean again. The row now names the
prerequisite: port the resolveInstall seam and the type, and the row turns back
into a mechanical port.
7723qqq pushed a commit to 7723qqq/kimi-code that referenced this pull request Nov 5, 2026
…ection layer

The row reads as a two-file change, but it edits `pluginInterfaceForLocale`,
which this tree does not have: the fork's plugin manager parses and stores
`interfaceLocales` and declares `PluginCapabilities`, yet nothing builds the
inspection surface that consumes them (no `pluginCapabilities`,
`pluginSkillsInfo` or `pluginMcpServersInfo`). Porting the selector alone would
leave it uncalled.

Prerequisite named in the row: the inspection half of MoonshotAI#4525, which the ledger
already marks equivalent with a note listing only the entry model and parser as
ported.

Ledger: MoonshotAI#4666 blocked; closed 79, remaining 20.
7723qqq pushed a commit to 7723qqq/kimi-code that referenced this pull request Nov 5, 2026
…tall

Port of upstream MoonshotAI/kimi-code 5e85af3 (MoonshotAI#4670).

Installing or updating the Windows Kimi Computer Use plugin while its
processes are running fails on a locked directory, and the old failure
surfaced only after the installer had already started. The capability now
asks first: `install` reports `confirmationRequired: 'stop-processes'`
instead of throwing, the caller re-invokes it with
`stopRunningProcesses: true`, and only then are the matching processes
stopped and the install retried.

Process discovery is scoped precisely: only `kimi-cu.exe` images whose
executable sits at one of the known install paths, in the current session,
and whose command line starts with an `agent` / `agent-background` / `mcp`
mode. Anything else with that name is left alone, and the stop path
re-verifies each process's image path and start time before killing it, so
a recycled pid cannot take out an unrelated process.

`IPluginService.withMcpServersSuspended(id, task)` holds a plugin's MCP
servers out of the projection for the duration of a task and restores them
afterwards — the running MCP child process would otherwise keep the plugin
directory busy. The confirmation reaches the surfaces: the TUI mounts a
stop-processes dialog and cancels cleanly on Escape, kap-server accepts an
optional install body, and klient / node-sdk forward it.

Local-form notes:
- `kimiCu.ts` installs through `installPluginLayer(ctx, windowsPlugin())`
  here; upstream routes it through
  `installResolvedMarketplacePlugin` from the marketplace service this fork
  does not have (MoonshotAI#4525's seam). The wrapper sits around the existing call,
  so the suspension and the consent check apply identically.
- The dialog copy and the "still running" notice go through `t()` with
  en/zh keys, and the two new error codes get `errorCodes.*` entries, since
  both gates are enforced here.
- `capabilityInstallOptionsSchema` is `.strict()`, which
  `check:strict-request-bodies` requires at this boundary.
- Two test-only fixes for this host rather than for the product: the
  integration case compares the executable through `[IO.Path]::GetFullPath`
  on both sides and accepts either form in the command line, because a
  short-path `%TEMP%` (`ADMINI~1`) otherwise never matches; and its temp
  directory is removed with retries, since Windows releases the image
  handle just after `exit`. Both reproduce on the unmodified upstream test.

Verified: agent-core-v2 typecheck clean; kimiCu 43 pass, windowsCuProcesses
1 pass (twice in a row), capabilityService 13, pluginService 33,
pluginCommand 2, skillCatalog 24, agentProfileLoader 24; kap-server
capabilities + sessionEventBroadcaster + sessions 176; klient 32; node-sdk
sdk-rpc-client-v2 86; apps/kimi-code plugins-capability 15 and
plugins-selector 50; oxlint --type-aware 0 errors; check:no-comments,
check:no-hardcoded-prose, check:locale-keys, check:locale-placeholders,
check:t-coverage, check:strict-request-bodies and
check:status-surface-i18n green.
7723qqq pushed a commit to 7723qqq/kimi-code that referenced this pull request Nov 15, 2026
The web bundle aligned to upstream f082f04 calls endpoints this fork
never carried. Port the missing halves of two upstream changes.

MoonshotAI#4525: engine PluginMarketplaceService and PluginPackageCache,
PluginManager.inspect, per-record skills, PluginService.previewPlugin and
install-by-marketplaceId, plus GET /plugins/{id}, POST /plugins/preview,
the install request union and the full marketplace wire shape.

MoonshotAI#4336: IWorkspaceService.readProjectConfigDirs, POST
/workspaces/{id}/primary, GET /workspaces/project-config-dirs,
additional_dirs normalization on create/update and the upstream
dedupeByRoot split.

Free 40934 for plugin.catalog_changed by renumbering the prompt-optimizer
codes, and update the API surface snapshot, plugin and workspace tests,
the orphan-export baseline and the ledger rows.
7723qqq pushed a commit to 7723qqq/kimi-code that referenced this pull request Nov 15, 2026
Port the capability half of upstream MoonshotAI#4525. kimiWebbridge now installs
the canonical kimi-browser-extension from the marketplace and migrates a
legacy kimi-webbridge record while keeping its required skill, kimiCu
installs kimi-cu / kimi-cu-win by marketplaceId with the fixed-CDN
fallback, and the macOS probe reports per-permission steps.

The plugin panel replaces a capability's own catalog row (canonical or
legacy id) with the injected capability row and carries the catalog
version onto it, and the post-remove note recognizes the canonical id.
The dev marketplace fixture and its manifest move to the canonical id so
`bun run dev:cli` and the CDN zip describe the same plugin.

Drop the kap-server capability lookup's legacy id alternative now that
the capability descriptor and the catalog agree.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants