diff --git a/reference/api-catalog.md b/reference/api-catalog.md index bd73bee..53bf7e4 100644 --- a/reference/api-catalog.md +++ b/reference/api-catalog.md @@ -80,32 +80,59 @@ Lithe 的插件公共 API 按 [API 实施计划](https://github.com/1lck/Lithe-I ### 已公开的宿主方法 -后端向宿主发送的请求,前缀都是 `lithe/host/`。“协议”列是最低的 `litheFunctions` 版本。除 `getCapabilities`、`subscriptions/dispose`、`workspace/listContexts` 外,协议 3 的方法都要带 `context: {contextID, generation}`。除 `credentials.store` 外,下表的权限都要求清单声明 `backend` 2,否则安装时拒绝。 - -| 方法 | 权限 | 协议 | API | +后端向宿主发送的请求,前缀都是 `lithe/host/`,下表省略前缀。一个 API 编号下可以有多个方法,每个方法单独一行,按 API 编号排列。 + +- **“API”列是规划编号**,来自 [API 实施计划](https://github.com/1lck/Lithe-IDEA/blob/preview/docs/development/macos-plugin-api-plan.md),和“协议”列的 `litheFunctions` 版本、清单里的能力版本分开记录。同一个 API 的方法可以分几个 PR 陆续加入;协议 3 里向后兼容地新增方法,也不升协议版本。每个方法哪天、由哪个 PR 首次加入,见[插件协议更新记录](protocol-changelog.md#宿主方法按-api-编号)。 +- **“协议”列**是最低的 `litheFunctions` 版本。除 `getCapabilities`、`subscriptions/dispose`、`workspace/listContexts` 外,协议 3 的方法都要带 `context: {contextID, generation}`。 +- **“权限”列**:除 `credentials.store` 外,都要求清单声明 `backend` 2,否则安装时拒绝。 + +| API | 方法 | 用途 | 权限 | 协议 | +| --- | --- | --- | --- | --- | +| API-01、API-37 | `getCapabilities` | 查询协商的协议版本、后端运行位置(`backendAuthority`)、当前可用的服务和限制;由 Core 直接回答 | 每个插件会话都有 | 3 | +| API-01 | `subscriptions/dispose` | 取消一个订阅,即 `workspace/watch`、`editor/registerActions`、`terminal/onExit` 返回的 `subscriptionID`;未知或已取消的 ID 也返回 `null` | 每个插件会话都有 | 3 | +| API-05 | `workspace/listContexts` | 列出当前的工作区上下文,带变化序号 `revision` | `workspace.metadata` | 3 | +| API-05 | `workspace/getContext` | 读取一个工作区上下文 | `workspace.metadata` | 3 | +| API-05 | `workspace/getFolders` | 列出上下文的根目录,每个根目录带 `rootID` | `workspace.metadata` | 3 | +| API-06 | `workspace/readDirectory` | 分页列出目录项 | `workspace.files.read` | 3 | +| API-06 | `workspace/stat` | 读取文件或目录的类型、大小和修改时间 | `workspace.files.read` | 3 | +| API-06 | `workspace/readFile` | 读取磁盘上的文件,返回文本或 base64,超过上限时截断 | `workspace.files.read` | 3 | +| API-07 | `workspace/watch` | 监听文件或目录的变化,事件经 `subscriptions/notify` 送达 | `workspace.files.watch` | 3 | +| API-08 | `workspace/findFiles` | 在一个根目录下按名称查找文件,分页 | `workspace.search` | 3 | +| API-08 | `workspace/findText` | 在磁盘内容中搜索文本,按行返回匹配,分页 | `workspace.search` | 3 | +| API-09 | `documents/list` | 列出已打开文档的摘要 | `documents.read` | 3 | +| API-09 | `documents/getSnapshot` | 读取文档当前缓冲区的全文,包含未保存的修改 | `documents.read` | 3 | +| API-09 | `editor/getActive` | 读取前台文本标签的文档摘要,没有时为 `null` | `documents.read` | 3 | +| API-09 | `editor/getSelections` | 读取文档的全部选区和主选区 | `documents.read` | 3 | +| API-10 | `editor/applyEdits` | 按范围批量编辑,先校验 `expectedVersion` | `editor.edit` | 3 | +| API-10 | `editor/replaceSelections` | 替换选区的文本:一个替换文本用于全部选区,或每个选区一个 | `editor.edit` | 3 | +| API-10 | `editor/insertText` | 在指定位置插入文本 | `editor.edit` | 3 | +| API-15 | `editor/open` | 在编辑器中打开文件,没有缓冲区时从磁盘读取;可以前台或后台打开,并定位光标 | `editor.open` | 3 | +| API-15 | `editor/reveal` | 参数和 `editor/open` 相同,但只处理已打开的文件;文件没打开时返回 `plugin.host.notFound`,不会从磁盘打开 | `editor.open` | 3 | +| API-16 | `preview/openHTML` | 打开 HTML 文件的预览(`editorAndPreview` 或 `previewOnly`),预览使用实时缓冲区 | `preview.open` | 3 | +| API-16 | `browser/openExternal` | 在外部浏览器打开 HTTP(S) 地址或已保存的 HTML 文件 | `browser.open` | 3 | +| API-17 | `window/showInformation` | 显示信息消息,可以带按钮,返回用户点的按钮序号 | `window.messages` | 3 | +| API-17 | `window/showWarning` | 显示警告消息,用法同 `showInformation` | `window.messages` | 3 | +| API-17 | `window/showError` | 显示错误消息,用法同 `showInformation` | `window.messages` | 3 | +| API-21 | `credentials/get` | 读取本插件保存的密钥,没有时为 `null` | `credentials.store` | 2 | +| API-21 | `credentials/set` | 保存密钥,最多 16 KiB | `credentials.store` | 2 | +| API-21 | `credentials/delete` | 删除密钥,没有保存过也返回 `null` | `credentials.store` | 2 | +| API-24 | `terminal/create` | 经执行确认创建插件自有原生终端,返回 `terminalID` 和 `generation` | `terminal.create` | 3 | +| API-24 | `terminal/show` | 显示并选中本插件的终端 | `terminal.create` | 3 | +| API-24 | `terminal/close` | 结束进程树并关闭标签,按字节预算保留显示历史和启动配置 | `terminal.create` | 3 | +| API-24 | `terminal/reopen` | 经重新确认,用原启动配置创建新进程,`generation` 加 1,并恢复有界的显示历史 | `terminal.create` | 3 | +| API-24 | `terminal/dispose` | 关闭终端,彻底释放句柄、启动配置和历史 | `terminal.create` | 3 | +| API-24 | `terminal/onExit` | 订阅终端每个 `generation` 的退出结果 | `terminal.create` | 3 | +| API-27 | `editor/registerActions` | 注册编辑器动作:把后端的普通函数绑定到文件范围(`selector`),返回 `subscriptionID` | `editor.actions`(同时需要 `documents.read`) | 3 | + +快捷键导入提供者另有 `keymapImport/listInputs`、`keymapImport/readChunk` 两个方法,属于 `litheKeymapImport` 协议,不在 API-01–44 内,见[快捷键导入](domains/keymap-import.md)。 + +宿主发给后端的通知(后端不回复),前缀同样是 `lithe/host/`: + +| API | 通知 | 用途 | 授予条件 | | --- | --- | --- | --- | -| `credentials/get`、`credentials/set`、`credentials/delete` | `credentials.store` | 2 | API-21 | -| `getCapabilities`、`subscriptions/dispose` | 每个插件会话都有 | 3 | API-01、API-37 | -| `workspace/listContexts`、`workspace/getContext`、`workspace/getFolders` | `workspace.metadata` | 3 | API-05 | -| `workspace/readDirectory`、`workspace/stat`、`workspace/readFile` | `workspace.files.read` | 3 | API-06 | -| `workspace/watch` | `workspace.files.watch` | 3 | API-07 | -| `workspace/findFiles`、`workspace/findText` | `workspace.search` | 3 | API-08 | -| `documents/list`、`documents/getSnapshot`、`editor/getActive`、`editor/getSelections` | `documents.read` | 3 | API-09 | -| `editor/applyEdits`、`editor/replaceSelections`、`editor/insertText` | `editor.edit` | 3 | API-10 | -| `editor/open`、`editor/reveal` | `editor.open` | 3 | API-15 | -| `preview/openHTML` | `preview.open` | 3 | API-16 | -| `browser/openExternal` | `browser.open` | 3 | API-16 | -| `window/showInformation`、`window/showWarning`、`window/showError` | `window.messages` | 3 | API-17 | -| `editor/registerActions` | `editor.actions`(同时需要 `documents.read`) | 3 | API-27 | -| `terminal/create`、`show`、`close`、`reopen`、`dispose`、`onExit` | `terminal.create` | 3 | API-24 | - -宿主发给后端的通知(后端不回复): - -| 通知 | 授予条件 | API | -| --- | --- | --- | -| `lithe/host/workspace/didChangeContexts` | `workspace.metadata` | API-04、API-05 | -| `lithe/host/subscriptions/notify` | 每个插件会话都有 | API-07、API-24 | -| `lithe/host/commands/didRun` | 每个插件会话都有 | API-02 | +| API-02 | `commands/didRun` | 用户运行了本插件的命令;只是事件,不表示命令的业务操作已经成功 | 每个插件会话都有 | +| API-04、API-05 | `workspace/didChangeContexts` | 工作区上下文有变化,带新的 `revision`;后端再调用 `listContexts` 读取 | `workspace.metadata` | +| API-07、API-24 | `subscriptions/notify` | 送达一个订阅的事件,例如文件变化(`workspace/watch`)、终端退出(`terminal/onExit`) | 每个插件会话都有 | ### 限制 @@ -203,32 +230,59 @@ The manifest, marketplace, package trust, and shortcut import are installation a ### Public host methods -Requests a backend sends to the host, all prefixed `lithe/host/`. The “Protocol” column is the lowest `litheFunctions` version. Apart from `getCapabilities`, `subscriptions/dispose`, and `workspace/listContexts`, every protocol 3 method takes `context: {contextID, generation}`. Apart from `credentials.store`, every permission below requires the manifest to declare `backend` 2, or installation refuses it. - -| Method | Permission | Protocol | API | +Requests a backend sends to the host, all prefixed `lithe/host/`; the tables omit the prefix. One API ID can cover several methods; each method has its own row, ordered by API ID. + +- **The “API” column holds planning IDs** from the [API implementation plan](https://github.com/1lck/Lithe-IDEA/blob/preview/docs/development/macos-plugin-api-plan.md). They are recorded separately from the `litheFunctions` version in the “Protocol” column and from manifest capability versions. The methods of one API can arrive over several PRs, and a backward-compatible method added within protocol 3 does not bump the protocol version. The date and PR that first added each method are in the [protocol changelog](protocol-changelog.md#宿主方法按-api-编号) (Chinese only). +- **The “Protocol” column** is the lowest `litheFunctions` version. Apart from `getCapabilities`, `subscriptions/dispose`, and `workspace/listContexts`, every protocol 3 method takes `context: {contextID, generation}`. +- **The “Permission” column**: apart from `credentials.store`, every permission requires the manifest to declare `backend` 2, or installation refuses it. + +| API | Method | Purpose | Permission | Protocol | +| --- | --- | --- | --- | --- | +| API-01, API-37 | `getCapabilities` | Reports the negotiated protocol version, where the backend runs (`backendAuthority`), and the services and limits available now; Core answers it itself | Every plugin-owned session | 3 | +| API-01 | `subscriptions/dispose` | Cancels a subscription, that is, a `subscriptionID` returned by `workspace/watch`, `editor/registerActions`, or `terminal/onExit`; an unknown or already disposed ID also returns `null` | Every plugin-owned session | 3 | +| API-05 | `workspace/listContexts` | Lists the current workspace contexts with the change counter `revision` | `workspace.metadata` | 3 | +| API-05 | `workspace/getContext` | Reads one workspace context | `workspace.metadata` | 3 | +| API-05 | `workspace/getFolders` | Lists the context's root folders, each with a `rootID` | `workspace.metadata` | 3 | +| API-06 | `workspace/readDirectory` | Lists directory entries page by page | `workspace.files.read` | 3 | +| API-06 | `workspace/stat` | Reads the kind, size, and modification time of a file or directory | `workspace.files.read` | 3 | +| API-06 | `workspace/readFile` | Reads a file from disk as text or base64, truncated past the limit | `workspace.files.read` | 3 | +| API-07 | `workspace/watch` | Watches a file or directory for changes; events arrive through `subscriptions/notify` | `workspace.files.watch` | 3 | +| API-08 | `workspace/findFiles` | Finds files by name under one root, page by page | `workspace.search` | 3 | +| API-08 | `workspace/findText` | Searches disk content for text and returns matching lines, page by page | `workspace.search` | 3 | +| API-09 | `documents/list` | Lists summaries of the open documents | `documents.read` | 3 | +| API-09 | `documents/getSnapshot` | Reads the full text of a document's current buffer, unsaved changes included | `documents.read` | 3 | +| API-09 | `editor/getActive` | Reads the document summary of the foreground text tab, or `null` | `documents.read` | 3 | +| API-09 | `editor/getSelections` | Reads all of a document's selections and the primary one | `documents.read` | 3 | +| API-10 | `editor/applyEdits` | Applies a batch of range edits after checking `expectedVersion` | `editor.edit` | 3 | +| API-10 | `editor/replaceSelections` | Replaces the text of selections: one replacement for all of them, or one per selection | `editor.edit` | 3 | +| API-10 | `editor/insertText` | Inserts text at a position | `editor.edit` | 3 | +| API-15 | `editor/open` | Opens a file in the editor, reading it from disk when no buffer exists; opens it in the foreground or background and can place the caret | `editor.open` | 3 | +| API-15 | `editor/reveal` | Takes the same params as `editor/open` but only handles files already open; a file that is not open returns `plugin.host.notFound` and is not opened from disk | `editor.open` | 3 | +| API-16 | `preview/openHTML` | Opens a preview of an HTML file (`editorAndPreview` or `previewOnly`) that uses the live buffer | `preview.open` | 3 | +| API-16 | `browser/openExternal` | Opens an HTTP(S) URL or a saved HTML file in the external browser | `browser.open` | 3 | +| API-17 | `window/showInformation` | Shows an information message, optionally with buttons, and returns the index of the button the user chose | `window.messages` | 3 | +| API-17 | `window/showWarning` | Shows a warning message; used like `showInformation` | `window.messages` | 3 | +| API-17 | `window/showError` | Shows an error message; used like `showInformation` | `window.messages` | 3 | +| API-21 | `credentials/get` | Reads a secret this plugin stored, or `null` | `credentials.store` | 2 | +| API-21 | `credentials/set` | Stores a secret of at most 16 KiB | `credentials.store` | 2 | +| API-21 | `credentials/delete` | Deletes a secret; also returns `null` when nothing was stored | `credentials.store` | 2 | +| API-24 | `terminal/create` | Creates a plugin-owned native terminal after execution consent and returns `terminalID` and `generation` | `terminal.create` | 3 | +| API-24 | `terminal/show` | Shows and selects one of this plugin's terminals | `terminal.create` | 3 | +| API-24 | `terminal/close` | Ends the process tree and closes the tab, keeping display history within a byte budget and the launch settings | `terminal.create` | 3 | +| API-24 | `terminal/reopen` | After renewed consent, starts a new process with the original launch settings, increments `generation`, and restores bounded display history | `terminal.create` | 3 | +| API-24 | `terminal/dispose` | Closes the terminal and releases its handle, launch settings, and history for good | `terminal.create` | 3 | +| API-24 | `terminal/onExit` | Subscribes to the exit outcome of each `generation` of a terminal | `terminal.create` | 3 | +| API-27 | `editor/registerActions` | Registers editor actions that bind an ordinary backend function to file ranges (`selector`) and returns a `subscriptionID` | `editor.actions` (also needs `documents.read`) | 3 | + +Shortcut import providers also have two methods, `keymapImport/listInputs` and `keymapImport/readChunk`. They belong to the `litheKeymapImport` protocol, outside API-01–44; see [Shortcut import](domains/keymap-import.md). + +Notifications the host sends to a backend (the backend answers none), also prefixed `lithe/host/`: + +| API | Notification | Purpose | Granted by | | --- | --- | --- | --- | -| `credentials/get`, `credentials/set`, `credentials/delete` | `credentials.store` | 2 | API-21 | -| `getCapabilities`, `subscriptions/dispose` | Every plugin-owned session | 3 | API-01, API-37 | -| `workspace/listContexts`, `workspace/getContext`, `workspace/getFolders` | `workspace.metadata` | 3 | API-05 | -| `workspace/readDirectory`, `workspace/stat`, `workspace/readFile` | `workspace.files.read` | 3 | API-06 | -| `workspace/watch` | `workspace.files.watch` | 3 | API-07 | -| `workspace/findFiles`, `workspace/findText` | `workspace.search` | 3 | API-08 | -| `documents/list`, `documents/getSnapshot`, `editor/getActive`, `editor/getSelections` | `documents.read` | 3 | API-09 | -| `editor/applyEdits`, `editor/replaceSelections`, `editor/insertText` | `editor.edit` | 3 | API-10 | -| `editor/open`, `editor/reveal` | `editor.open` | 3 | API-15 | -| `preview/openHTML` | `preview.open` | 3 | API-16 | -| `browser/openExternal` | `browser.open` | 3 | API-16 | -| `window/showInformation`, `window/showWarning`, `window/showError` | `window.messages` | 3 | API-17 | -| `editor/registerActions` | `editor.actions` (also needs `documents.read`) | 3 | API-27 | -| `terminal/create`, `show`, `close`, `reopen`, `dispose`, `onExit` | `terminal.create` | 3 | API-24 | - -Notifications the host sends to a backend (the backend answers none): - -| Notification | Granted by | API | -| --- | --- | --- | -| `lithe/host/workspace/didChangeContexts` | `workspace.metadata` | API-04, API-05 | -| `lithe/host/subscriptions/notify` | Every plugin-owned session | API-07, API-24 | -| `lithe/host/commands/didRun` | Every plugin-owned session | API-02 | +| API-02 | `commands/didRun` | The user ran one of this plugin's commands; it is an event only and does not mean the command's business action succeeded | Every plugin-owned session | +| API-04, API-05 | `workspace/didChangeContexts` | The workspace contexts changed, with the new `revision`; the backend then calls `listContexts` to read them | `workspace.metadata` | +| API-07, API-24 | `subscriptions/notify` | Delivers an event of one subscription, such as a file change (`workspace/watch`) or a terminal exit (`terminal/onExit`) | Every plugin-owned session | ### Limits diff --git a/reference/protocol-changelog.md b/reference/protocol-changelog.md index e7f95eb..061b2de 100644 --- a/reference/protocol-changelog.md +++ b/reference/protocol-changelog.md @@ -8,7 +8,10 @@ - **记录到**:`preview` 的 [`5d38352a1`](https://github.com/1lck/Lithe-IDEA/commit/5d38352a1757a70fd5fa297d7aa3e43bb2e33607)([#1752](https://github.com/1lck/Lithe-IDEA/pull/1752)),即本仓库 `contract/v1/` 当前副本的来源。 - **每一版的内容和宿主现状**:见[能力与协议版本对照](capabilities-and-versions.md)。字段和行为以 [`contract/v1/README.md`](../contract/v1/README.md) 为准,官方 SDK 的发版见 [SDK 发版历史](capabilities-and-versions.md#sdk-发版历史)。 -时间线的“协议 / API”一列里,**加粗**的是这个 PR 新增的版本号;没有加粗的,是同一版本内的补充、宿主接入或说明修正。 +时间线的两列这样读: + +- **API 编号**:这个 PR 涉及的 API-01–44 规划编号,来自 [API 实施计划](https://github.com/1lck/Lithe-IDEA/blob/preview/docs/development/macos-plugin-api-plan.md),和协议版本、能力版本分开记录。编号由 [#1548](https://github.com/1lck/Lithe-IDEA/pull/1548)(2026-10-28)引入,更早的 PR 没有编号,按计划“API-01–44 完成度总表”里各编号对应的既有能力补填,例如 `debugAdapters` 是 API-30,`vcsProviders` 是 API-31。— 表示没有改到具体 API,例如清单、市场、包信任、SDK 或契约文档整理。 +- **协议 / 能力**:**加粗**的是这个 PR 新增的版本号;没有加粗的,是同一版本内的补充、宿主接入或说明修正。 ## 按协议查首次出现 @@ -83,6 +86,53 @@ | `litheKeymapImport` | 1 | 2026-11-03 | [#1695](https://github.com/1lck/Lithe-IDEA/pull/1695) | | `litheLogging` | 1 | 2026-11-04 | [#1699](https://github.com/1lck/Lithe-IDEA/pull/1699) | +### 宿主方法(按 API 编号) + +函数协议 3 里向后兼容地新增方法时不升协议版本,上面的版本表看不出某个方法是什么时候加的,所以宿主方法和通知在这里逐个登记。一个 API 编号下可以有多个方法,每个方法一行,记首次加入的日期和 PR。方法名省略前缀 `lithe/host/`;用途和权限见 [API 总表](api-catalog.md#已公开的宿主方法)。`keymapImport/*` 属于 `litheKeymapImport` 协议,不在 API-01–44 内。 + +| API | 方法 | 协议 | 日期 | PR | +| --- | --- | --- | --- | --- | +| API-01、API-37 | `getCapabilities` | 3 | 2026-10-30 | [#1595](https://github.com/1lck/Lithe-IDEA/pull/1595) | +| API-01 | `subscriptions/dispose` | 3 | 2026-10-30 | [#1595](https://github.com/1lck/Lithe-IDEA/pull/1595) | +| API-02 | `commands/didRun`(通知) | 3 | 2026-10-30 | [#1595](https://github.com/1lck/Lithe-IDEA/pull/1595) | +| API-04、API-05 | `workspace/didChangeContexts`(通知) | 3 | 2026-10-30 | [#1595](https://github.com/1lck/Lithe-IDEA/pull/1595) | +| API-05 | `workspace/listContexts` | 3 | 2026-10-30 | [#1595](https://github.com/1lck/Lithe-IDEA/pull/1595) | +| API-05 | `workspace/getContext` | 3 | 2026-10-30 | [#1595](https://github.com/1lck/Lithe-IDEA/pull/1595) | +| API-05 | `workspace/getFolders` | 3 | 2026-10-30 | [#1595](https://github.com/1lck/Lithe-IDEA/pull/1595) | +| API-06 | `workspace/readDirectory` | 3 | 2026-10-30 | [#1595](https://github.com/1lck/Lithe-IDEA/pull/1595) | +| API-06 | `workspace/stat` | 3 | 2026-10-30 | [#1595](https://github.com/1lck/Lithe-IDEA/pull/1595) | +| API-06 | `workspace/readFile` | 3 | 2026-10-30 | [#1595](https://github.com/1lck/Lithe-IDEA/pull/1595) | +| API-07 | `workspace/watch` | 3 | 2026-10-30 | [#1595](https://github.com/1lck/Lithe-IDEA/pull/1595) | +| API-07、API-24 | `subscriptions/notify`(通知) | 3 | 2026-10-30 | [#1595](https://github.com/1lck/Lithe-IDEA/pull/1595) | +| API-08 | `workspace/findFiles` | 3 | 2026-10-30 | [#1595](https://github.com/1lck/Lithe-IDEA/pull/1595) | +| API-08 | `workspace/findText` | 3 | 2026-10-30 | [#1595](https://github.com/1lck/Lithe-IDEA/pull/1595) | +| API-09 | `documents/list` | 3 | 2026-10-30 | [#1595](https://github.com/1lck/Lithe-IDEA/pull/1595) | +| API-09 | `documents/getSnapshot` | 3 | 2026-10-30 | [#1595](https://github.com/1lck/Lithe-IDEA/pull/1595) | +| API-09 | `editor/getActive` | 3 | 2026-10-30 | [#1595](https://github.com/1lck/Lithe-IDEA/pull/1595) | +| API-09 | `editor/getSelections` | 3 | 2026-10-30 | [#1595](https://github.com/1lck/Lithe-IDEA/pull/1595) | +| API-10 | `editor/applyEdits` | 3 | 2026-10-30 | [#1595](https://github.com/1lck/Lithe-IDEA/pull/1595) | +| API-10 | `editor/replaceSelections` | 3 | 2026-10-30 | [#1595](https://github.com/1lck/Lithe-IDEA/pull/1595) | +| API-10 | `editor/insertText` | 3 | 2026-10-30 | [#1595](https://github.com/1lck/Lithe-IDEA/pull/1595) | +| API-15 | `editor/open` | 3 | 2026-10-30 | [#1595](https://github.com/1lck/Lithe-IDEA/pull/1595) | +| API-15 | `editor/reveal` | 3 | 2026-10-30 | [#1595](https://github.com/1lck/Lithe-IDEA/pull/1595) | +| API-16 | `preview/openHTML` | 3 | 2026-10-30 | [#1595](https://github.com/1lck/Lithe-IDEA/pull/1595) | +| API-16 | `browser/openExternal` | 3 | 2026-10-30 | [#1595](https://github.com/1lck/Lithe-IDEA/pull/1595) | +| API-17 | `window/showInformation` | 3 | 2026-10-30 | [#1595](https://github.com/1lck/Lithe-IDEA/pull/1595) | +| API-17 | `window/showWarning` | 3 | 2026-10-30 | [#1595](https://github.com/1lck/Lithe-IDEA/pull/1595) | +| API-17 | `window/showError` | 3 | 2026-10-30 | [#1595](https://github.com/1lck/Lithe-IDEA/pull/1595) | +| API-21 | `credentials/get` | 2 | 2026-10-24 | [#1470](https://github.com/1lck/Lithe-IDEA/pull/1470) | +| API-21 | `credentials/set` | 2 | 2026-10-24 | [#1470](https://github.com/1lck/Lithe-IDEA/pull/1470) | +| API-21 | `credentials/delete` | 2 | 2026-10-24 | [#1470](https://github.com/1lck/Lithe-IDEA/pull/1470) | +| API-24 | `terminal/create` | 3 | 2026-11-02 | [#1653](https://github.com/1lck/Lithe-IDEA/pull/1653) | +| API-24 | `terminal/show` | 3 | 2026-11-02 | [#1653](https://github.com/1lck/Lithe-IDEA/pull/1653) | +| API-24 | `terminal/close` | 3 | 2026-11-02 | [#1653](https://github.com/1lck/Lithe-IDEA/pull/1653) | +| API-24 | `terminal/reopen` | 3 | 2026-11-02 | [#1653](https://github.com/1lck/Lithe-IDEA/pull/1653) | +| API-24 | `terminal/dispose` | 3 | 2026-11-02 | [#1653](https://github.com/1lck/Lithe-IDEA/pull/1653) | +| API-24 | `terminal/onExit` | 3 | 2026-11-02 | [#1653](https://github.com/1lck/Lithe-IDEA/pull/1653) | +| API-27 | `editor/registerActions` | 3 | 2026-10-31 | [#1617](https://github.com/1lck/Lithe-IDEA/pull/1617) | +| — | `keymapImport/listInputs` | 3 | 2026-11-03 | [#1695](https://github.com/1lck/Lithe-IDEA/pull/1695) | +| — | `keymapImport/readChunk` | 3 | 2026-11-03 | [#1695](https://github.com/1lck/Lithe-IDEA/pull/1695) | + ## 时间线(新的在上) ### 2026-11-05 @@ -95,129 +145,129 @@ ### 2026-11-04 -| PR | 修改人 | 协议 / API | 改了什么 | -| --- | --- | --- | --- | -| [#1724](https://github.com/1lck/Lithe-IDEA/pull/1724) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | 包签名 | 新增 `fixtures/signature-vectors.json`,是发布者签名的跨平台测试向量:RFC 8032 测试密钥、带非 ASCII 文件名的固定包和它的规范化载荷。同一 PR 的语言服务器启动失败清理、归档解压加固属于宿主行为,没有改字段。 | -| [#1558](https://github.com/1lck/Lithe-IDEA/pull/1558) | [@Mucheen](https://github.com/Mucheen) | **`buildProviders` 7–11**、**`litheBuild` 7–11**、**`buildSystems` 3、4**、**`litheBuildConfiguration` 1** | 7 基于真实来源的原生配置,8 内联测试报告,9 不透明语义测试选择器,10 类型化运行选项与服务/任务运行准备,11 注册表连接调试。`buildSystems` 3 是实例级选项,4 是声明式项目准备角色。 | -| [#1720](https://github.com/1lck/Lithe-IDEA/pull/1720) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | `litheLogging` 1:声明式插件 | 声明式贡献没有自己的进程,发不了 `lithe/log`,改由执行方在 `plugins//host` 通道代记 `plugins.operation.finished` 和 `plugins.operation.failed`。每次启动语言服务器或调试适配器、每次运行构建模型或依赖命令,各记为一次操作。失败时带一个错误码,例如 `host.planFailed`、`host.executableUnavailable`、`host.launchFailed`。 | -| [#1699](https://github.com/1lck/Lithe-IDEA/pull/1699) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | **`litheLogging` 1** | 插件拥有的每个进程都可以协商 `capabilities.experimental.litheLogging`,然后用通知 `lithe/log` 发结构化诊断。参数只接受固定字段,未知字段会被拒绝。新增 `fixtures/plugin-logging.json`。 | +| PR | 修改人 | API 编号 | 协议 / 能力 | 改了什么 | +| --- | --- | --- | --- | --- | +| [#1724](https://github.com/1lck/Lithe-IDEA/pull/1724) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | — | 包签名 | 新增 `fixtures/signature-vectors.json`,是发布者签名的跨平台测试向量:RFC 8032 测试密钥、带非 ASCII 文件名的固定包和它的规范化载荷。同一 PR 的语言服务器启动失败清理、归档解压加固属于宿主行为,没有改字段。 | +| [#1558](https://github.com/1lck/Lithe-IDEA/pull/1558) | [@Mucheen](https://github.com/Mucheen) | API-29 | **`buildProviders` 7–11**、**`litheBuild` 7–11**、**`buildSystems` 3、4**、**`litheBuildConfiguration` 1** | 7 基于真实来源的原生配置,8 内联测试报告,9 不透明语义测试选择器,10 类型化运行选项与服务/任务运行准备,11 注册表连接调试。`buildSystems` 3 是实例级选项,4 是声明式项目准备角色。 | +| [#1720](https://github.com/1lck/Lithe-IDEA/pull/1720) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | API-22 | `litheLogging` 1:声明式插件 | 声明式贡献没有自己的进程,发不了 `lithe/log`,改由执行方在 `plugins//host` 通道代记 `plugins.operation.finished` 和 `plugins.operation.failed`。每次启动语言服务器或调试适配器、每次运行构建模型或依赖命令,各记为一次操作。失败时带一个错误码,例如 `host.planFailed`、`host.executableUnavailable`、`host.launchFailed`。 | +| [#1699](https://github.com/1lck/Lithe-IDEA/pull/1699) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | API-22 | **`litheLogging` 1** | 插件拥有的每个进程都可以协商 `capabilities.experimental.litheLogging`,然后用通知 `lithe/log` 发结构化诊断。参数只接受固定字段,未知字段会被拒绝。新增 `fixtures/plugin-logging.json`。 | ### 2026-11-03 -| PR | 修改人 | 协议 / API | 改了什么 | -| --- | --- | --- | --- | -| [#1695](https://github.com/1lck/Lithe-IDEA/pull/1695) | [@1lck](https://github.com/1lck) | **`keymapImportProviders` 1**、**`litheKeymapImport` 1**、函数协议 3 的宿主方法 | 快捷键导入提供者,需要 `backend` 2 和对应权限。后端在 `initialize` 中选出要启用的提供者,宿主向它发 `lithe/keymap/import`。单独授权后,后端可以调用 `lithe/host/keymapImport/listInputs` 和 `readChunk`。 | -| [#1676](https://github.com/1lck/Lithe-IDEA/pull/1676) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | 启动模板 `${logDir}` | 新增模板变量 `${logDir}`,是当前会话 `plugins//files/` 的绝对路径,由宿主显式传入 `logDirectory`。语言服务器和插件后端可用,`validationArguments` 不可用。`logDirectory` 缺失、为空或不是绝对路径时返回 `plugin.launch.invalidRequest`。 | +| PR | 修改人 | API 编号 | 协议 / 能力 | 改了什么 | +| --- | --- | --- | --- | --- | +| [#1695](https://github.com/1lck/Lithe-IDEA/pull/1695) | [@1lck](https://github.com/1lck) | — | **`keymapImportProviders` 1**、**`litheKeymapImport` 1**、函数协议 3 的宿主方法 | 快捷键导入提供者,需要 `backend` 2 和对应权限。后端在 `initialize` 中选出要启用的提供者,宿主向它发 `lithe/keymap/import`。单独授权后,后端可以调用 `lithe/host/keymapImport/listInputs` 和 `readChunk`。 | +| [#1676](https://github.com/1lck/Lithe-IDEA/pull/1676) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | API-22 | 启动模板 `${logDir}` | 新增模板变量 `${logDir}`,是当前会话 `plugins//files/` 的绝对路径,由宿主显式传入 `logDirectory`。语言服务器和插件后端可用,`validationArguments` 不可用。`logDirectory` 缺失、为空或不是绝对路径时返回 `plugin.launch.invalidRequest`。 | ### 2026-11-02 -| PR | 修改人 | 协议 / API | 改了什么 | -| --- | --- | --- | --- | -| [#1661](https://github.com/1lck/Lithe-IDEA/pull/1661) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | `toolDefinitions` 1、`toolchainProviders` 1:宿主现状 | macOS 开始声明这两个能力,用于只读的工具链设置页。Windows 不声明。保存固定版本、`toolchainConsumers` 仍未实现。 | -| [#1653](https://github.com/1lck/Lithe-IDEA/pull/1653) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | 函数协议 3:插件原生终端 | 新增权限 `terminal.create`(需要 `backend` 2),授予宿主方法 `lithe/host/terminal/create`、`show`、`close`、`reopen`。后端创建和管理自己的原生终端,reopen 时保留有界的显示历史。 | -| [#1650](https://github.com/1lck/Lithe-IDEA/pull/1650) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | 函数协议说明 | 契约改为说明函数协议 1–3,并按实际情况描述官方 SDK 实现的协议。不改字段。 | -| [#1646](https://github.com/1lck/Lithe-IDEA/pull/1646) | [@FxRayHughes](https://github.com/FxRayHughes) | 清单 schema:`settings` 2、`languageServers` 2 | schema 补上 Core 从 #1395 起已经支持的这两个版本。 | +| PR | 修改人 | API 编号 | 协议 / 能力 | 改了什么 | +| --- | --- | --- | --- | --- | +| [#1661](https://github.com/1lck/Lithe-IDEA/pull/1661) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | API-23 | `toolDefinitions` 1、`toolchainProviders` 1:宿主现状 | macOS 开始声明这两个能力,用于只读的工具链设置页。Windows 不声明。保存固定版本、`toolchainConsumers` 仍未实现。 | +| [#1653](https://github.com/1lck/Lithe-IDEA/pull/1653) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | API-24 | 函数协议 3:插件原生终端 | 新增权限 `terminal.create`(需要 `backend` 2),授予宿主方法 `lithe/host/terminal/create`、`show`、`close`、`reopen`、`dispose`、`onExit`。后端创建和管理自己的原生终端:`close` 后按字节预算保留显示历史和启动配置,`reopen` 经重新确认后用原配置启动新进程并恢复历史,`dispose` 彻底释放句柄,`onExit` 订阅每个 generation 的退出结果。只支持 macOS 和本机工作区。 | +| [#1650](https://github.com/1lck/Lithe-IDEA/pull/1650) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | — | 函数协议说明 | 契约改为说明函数协议 1–3,并按实际情况描述官方 SDK 实现的协议。不改字段。 | +| [#1646](https://github.com/1lck/Lithe-IDEA/pull/1646) | [@FxRayHughes](https://github.com/FxRayHughes) | API-19、API-25 | 清单 schema:`settings` 2、`languageServers` 2 | schema 补上 Core 从 #1395 起已经支持的这两个版本。 | ### 2026-11-01 -| PR | 修改人 | 协议 / API | 改了什么 | -| --- | --- | --- | --- | -| [#1643](https://github.com/1lck/Lithe-IDEA/pull/1643) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | 契约文档链接 | 工具链提案的链接和 schema `$id` 检查改为符合 lithe-plugin-docs 的同步规则。不改字段。 | -| [#1581](https://github.com/1lck/Lithe-IDEA/pull/1581) | [@FxRayHughes](https://github.com/FxRayHughes) | **`toolDefinitions` 1**、**`toolchainProviders` 1**、**`executableResolution` 2**、**`litheToolchains` 1**(提案) | 插件注入的工具链框架。工具定义描述工具的身份、目录布局、发现方式和候选,需要 `executableResolution` 2。工具链提供者需要 `backend` 2,通过 `litheToolchains` 协议回答 `toolchains/query`。同时新增 `proposals/toolchains/` 提案和本机工具链文档 `.lithe/toolchains/local.json` 版本 1。 | +| PR | 修改人 | API 编号 | 协议 / 能力 | 改了什么 | +| --- | --- | --- | --- | --- | +| [#1643](https://github.com/1lck/Lithe-IDEA/pull/1643) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | — | 契约文档链接 | 工具链提案的链接和 schema `$id` 检查改为符合 lithe-plugin-docs 的同步规则。不改字段。 | +| [#1581](https://github.com/1lck/Lithe-IDEA/pull/1581) | [@FxRayHughes](https://github.com/FxRayHughes) | API-23 | **`toolDefinitions` 1**、**`toolchainProviders` 1**、**`executableResolution` 2**、**`litheToolchains` 1**(提案) | 插件注入的工具链框架。工具定义描述工具的身份、目录布局、发现方式和候选,需要 `executableResolution` 2。工具链提供者需要 `backend` 2,通过 `litheToolchains` 协议回答 `toolchains/query`。同时新增 `proposals/toolchains/` 提案和本机工具链文档 `.lithe/toolchains/local.json` 版本 1。 | ### 2026-10-31 -| PR | 修改人 | 协议 / API | 改了什么 | -| --- | --- | --- | --- | -| [#1617](https://github.com/1lck/Lithe-IDEA/pull/1617) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | **`languages` 2**、函数协议 3:编辑器动作 | `languages[].grammar` 是包内的 Monarch 语法,`languages[].configuration` 是编辑器配置,用到其中任一项都要声明 `languages` 2。后端用 `lithe/host/editor/registerActions` 注册不依赖语言服务器的编辑器动作,用户触发时宿主按普通插件函数调用。 | +| PR | 修改人 | API 编号 | 协议 / 能力 | 改了什么 | +| --- | --- | --- | --- | --- | +| [#1617](https://github.com/1lck/Lithe-IDEA/pull/1617) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | API-25、API-27 | **`languages` 2**、函数协议 3:编辑器动作 | `languages[].grammar` 是包内的 Monarch 语法,`languages[].configuration` 是编辑器配置,用到其中任一项都要声明 `languages` 2。后端用 `lithe/host/editor/registerActions`(API-27)注册不依赖语言服务器的编辑器动作,用户触发时宿主按普通插件函数调用。 | ### 2026-10-30 -| PR | 修改人 | 协议 / API | 改了什么 | -| --- | --- | --- | --- | -| [#1595](https://github.com/1lck/Lithe-IDEA/pull/1595) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | **`backend` 2**、**`ui` 4**、**`litheFunctions` 3** | `backend` 2:后端可以在 `onWorkspaceOpen` 或插件命令时启动,通过函数协议接收工作区上下文,并可读取 `workspace.metadata`。`ui` 4:不打开工具窗口的后端命令。函数协议 3:工作区上下文与能力发现(`lithe/host/getCapabilities`、`lithe/host/workspace/*`)、宿主通知订阅,以及公共的文档、文件、窗口方法。 | +| PR | 修改人 | API 编号 | 协议 / 能力 | 改了什么 | +| --- | --- | --- | --- | --- | +| [#1595](https://github.com/1lck/Lithe-IDEA/pull/1595) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | API-01、API-02、API-04–10、API-15–17、API-37、API-40、API-41 | **`backend` 2**、**`ui` 4**、**`litheFunctions` 3** | `backend` 2:后端可以在 `onWorkspaceOpen` 或插件命令时启动,通过函数协议接收工作区上下文,并可读取 `workspace.metadata`。`ui` 4:不打开工具窗口的后端命令。函数协议 3:工作区上下文与能力发现(`lithe/host/getCapabilities`、`lithe/host/workspace/*`)、宿主通知订阅,以及公共的文档、文件、窗口方法。各方法见[宿主方法(按 API 编号)](#宿主方法按-api-编号)。 | ### 2026-10-28 -| PR | 修改人 | 协议 / API | 改了什么 | -| --- | --- | --- | --- | -| [#1517](https://github.com/1lck/Lithe-IDEA/pull/1517) | [@Mucheen](https://github.com/Mucheen) | **`buildProviders` 2–6**、**`litheBuild` 2–6**、**`buildModelInputs` 1**、**`debugAdapters` 2**、**`litheTestDiscovery` 1** | 2 任务执行(`lithe/build/execute`),3 测试执行和测试发现(`lithe/build/test`、`lithe/build/discoverTests`),4 应用运行准备(`lithe/build/prepareRun`),5 原生调试准备(`lithe/build/prepareDebug`),6 只读模型输入。`buildModelInputs` 1 用于在已启用的工作区插件之间共享公开模型。`debugAdapters` 2 支持绑定调试目标的参数和环境变量。 | -| [#1483](https://github.com/1lck/Lithe-IDEA/pull/1483) | [@Mucheen](https://github.com/Mucheen) | **`packageTrust` 1** | 新增 `vendor.bundledSignatureRequirement`:随宿主发布、由发布者签名的插件副本按来源信任。Java Support 从此单独分发。 | +| PR | 修改人 | API 编号 | 协议 / 能力 | 改了什么 | +| --- | --- | --- | --- | --- | +| [#1517](https://github.com/1lck/Lithe-IDEA/pull/1517) | [@Mucheen](https://github.com/Mucheen) | API-29、API-30 | **`buildProviders` 2–6**、**`litheBuild` 2–6**、**`buildModelInputs` 1**、**`debugAdapters` 2**、**`litheTestDiscovery` 1** | 2 任务执行(`lithe/build/execute`),3 测试执行和测试发现(`lithe/build/test`、`lithe/build/discoverTests`),4 应用运行准备(`lithe/build/prepareRun`),5 原生调试准备(`lithe/build/prepareDebug`),6 只读模型输入。`buildModelInputs` 1 用于在已启用的工作区插件之间共享公开模型。`debugAdapters` 2 支持绑定调试目标的参数和环境变量。 | +| [#1483](https://github.com/1lck/Lithe-IDEA/pull/1483) | [@Mucheen](https://github.com/Mucheen) | — | **`packageTrust` 1** | 新增 `vendor.bundledSignatureRequirement`:随宿主发布、由发布者签名的插件副本按来源信任。Java Support 从此单独分发。 | ### 2026-10-27 -| PR | 修改人 | 协议 / API | 改了什么 | -| --- | --- | --- | --- | -| [#1525](https://github.com/1lck/Lithe-IDEA/pull/1525) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | `debugAdapters` 1:远程 attach | `attach` 配置的 `targetBindings` 可以带 `connection`(远端主机和端口),`debug.attach` 权限也覆盖远程 attach。适配器仍在本机运行,只有被调试进程在远端。 | -| [#1520](https://github.com/1lck/Lithe-IDEA/pull/1520) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | `debugAdapters` 1:`tcpLanguageServer` 传输 | 新增传输方式 `tcpLanguageServer`:调试适配器由插件自己的语言服务器承载,例如 JDT LS 里的 Java Debug Server。`endpoint` 用 `languageID` 指定语言服务器,用 `command` 指定启动命令。 | -| [#1512](https://github.com/1lck/Lithe-IDEA/pull/1512) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | `debugAdapters` 1:macOS 宿主 | macOS 开始运行调试适配器,插件可热激活。新增 `configurations.launch.executable`:调试目标是适配器不能直接调试的源文件(C、C++、Swift)时,从插件的文件设置或最多 8 个候选路径找可执行文件。新增 `console.commandPrefix` 和 `console.commands[]`,供调试控制台使用。 | +| PR | 修改人 | API 编号 | 协议 / 能力 | 改了什么 | +| --- | --- | --- | --- | --- | +| [#1525](https://github.com/1lck/Lithe-IDEA/pull/1525) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | API-30 | `debugAdapters` 1:远程 attach | `attach` 配置的 `targetBindings` 可以带 `connection`(远端主机和端口),`debug.attach` 权限也覆盖远程 attach。适配器仍在本机运行,只有被调试进程在远端。 | +| [#1520](https://github.com/1lck/Lithe-IDEA/pull/1520) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | API-30 | `debugAdapters` 1:`tcpLanguageServer` 传输 | 新增传输方式 `tcpLanguageServer`:调试适配器由插件自己的语言服务器承载,例如 JDT LS 里的 Java Debug Server。`endpoint` 用 `languageID` 指定语言服务器,用 `command` 指定启动命令。 | +| [#1512](https://github.com/1lck/Lithe-IDEA/pull/1512) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | API-30 | `debugAdapters` 1:macOS 宿主 | macOS 开始运行调试适配器,插件可热激活。新增 `configurations.launch.executable`:调试目标是适配器不能直接调试的源文件(C、C++、Swift)时,从插件的文件设置或最多 8 个候选路径找可执行文件。新增 `console.commandPrefix` 和 `console.commands[]`,供调试控制台使用。 | ### 2026-10-26 -| PR | 修改人 | 协议 / API | 改了什么 | -| --- | --- | --- | --- | -| [#1510](https://github.com/1lck/Lithe-IDEA/pull/1510) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | **插件 API 级别 4**、**`debugAdapters` 1**、**`serverProcess` 2** | 新增 `debugAdapters[]`,用来声明 DAP 适配器的启动、传输、配置和权限,需要 API 级别 4。`serverProcess` 2 新增 `runSelectedRuntime`,只用于调试适配器。 | +| PR | 修改人 | API 编号 | 协议 / 能力 | 改了什么 | +| --- | --- | --- | --- | --- | +| [#1510](https://github.com/1lck/Lithe-IDEA/pull/1510) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | API-23、API-30 | **插件 API 级别 4**、**`debugAdapters` 1**、**`serverProcess` 2** | 新增 `debugAdapters[]`,用来声明 DAP 适配器的启动、传输、配置和权限,需要 API 级别 4。`serverProcess` 2 新增 `runSelectedRuntime`,只用于调试适配器。 | ### 2026-10-24 -| PR | 修改人 | 协议 / API | 改了什么 | -| --- | --- | --- | --- | -| [#1470](https://github.com/1lck/Lithe-IDEA/pull/1470) | [@1lck](https://github.com/1lck) | **`backend` 1**、**`litheFunctions` 2** | 插件后端:插件自己的长驻进程,为自己的网页提供服务。函数协议 2 加入宿主服务,即凭据 `lithe/host/credentials/get`、`set`、`delete`;宿主把插件权限允许的服务列表传给后端。 | -| [#1424](https://github.com/1lck/Lithe-IDEA/pull/1424) | [@Mucheen](https://github.com/Mucheen) | `ui` 2:Windows 宿主 | Windows 声明式插件宿主上线,用 WebView2 实现包内网页并声明 `ui` 1、2,不声明 `ui` 3。 | -| [#1423](https://github.com/1lck/Lithe-IDEA/pull/1423) | [@arkleselect](https://github.com/arkleselect) | **`ui` 3**、**原生 UI 文档 schema 1** | 宿主渲染的原生控件,新增 `native-ui.schema.json`。 | -| [#1452](https://github.com/1lck/Lithe-IDEA/pull/1452) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | **`projectGenerators` 1** | 新建项目窗口里的项目生成器,可以用模板文件、脚手架命令或归档下载生成项目,需要 `project.generate` 权限。 | +| PR | 修改人 | API 编号 | 协议 / 能力 | 改了什么 | +| --- | --- | --- | --- | --- | +| [#1470](https://github.com/1lck/Lithe-IDEA/pull/1470) | [@1lck](https://github.com/1lck) | API-21 | **`backend` 1**、**`litheFunctions` 2** | 插件后端:插件自己的长驻进程,为自己的网页提供服务。函数协议 2 加入宿主服务,即凭据 `lithe/host/credentials/get`、`set`、`delete`;宿主把插件权限允许的服务列表传给后端。 | +| [#1424](https://github.com/1lck/Lithe-IDEA/pull/1424) | [@Mucheen](https://github.com/Mucheen) | API-14 | `ui` 2:Windows 宿主 | Windows 声明式插件宿主上线,用 WebView2 实现包内网页并声明 `ui` 1、2,不声明 `ui` 3。 | +| [#1423](https://github.com/1lck/Lithe-IDEA/pull/1423) | [@arkleselect](https://github.com/arkleselect) | API-13 | **`ui` 3**、**原生 UI 文档 schema 1** | 宿主渲染的原生控件,新增 `native-ui.schema.json`。 | +| [#1452](https://github.com/1lck/Lithe-IDEA/pull/1452) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | API-33 | **`projectGenerators` 1** | 新建项目窗口里的项目生成器,可以用模板文件、脚手架命令或归档下载生成项目,需要 `project.generate` 权限。 | ### 2026-10-23 -| PR | 修改人 | 协议 / API | 改了什么 | -| --- | --- | --- | --- | -| [#1430](https://github.com/1lck/Lithe-IDEA/pull/1430) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | **`vcsProviders` 1**、**`litheVcs` 1** | VCS 提供者。协议在 `initialize` 的 `experimental.litheVcs` 中协商,定义见主仓库的 `shared/contracts/vcs-provider-v1.md`。 | -| [#1442](https://github.com/1lck/Lithe-IDEA/pull/1442) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | 契约发布 | 契约开始发布到 lithe-plugin-docs,fixtures 按能力改名,SDK 移出主仓库。不改字段。 | -| [#1420](https://github.com/1lck/Lithe-IDEA/pull/1420) | [@Mucheen](https://github.com/Mucheen) | **`buildSystems` 2**、**`executableResolution` 1** | 构建系统可以把可执行文件路径交给插件设置来配置。共享的可执行文件候选:统一的候选排序和严格选择。 | +| PR | 修改人 | API 编号 | 协议 / 能力 | 改了什么 | +| --- | --- | --- | --- | --- | +| [#1430](https://github.com/1lck/Lithe-IDEA/pull/1430) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | API-31 | **`vcsProviders` 1**、**`litheVcs` 1** | VCS 提供者。协议在 `initialize` 的 `experimental.litheVcs` 中协商,定义见主仓库的 `shared/contracts/vcs-provider-v1.md`。 | +| [#1442](https://github.com/1lck/Lithe-IDEA/pull/1442) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | — | 契约发布 | 契约开始发布到 lithe-plugin-docs,fixtures 按能力改名,SDK 移出主仓库。不改字段。 | +| [#1420](https://github.com/1lck/Lithe-IDEA/pull/1420) | [@Mucheen](https://github.com/Mucheen) | API-23、API-29 | **`buildSystems` 2**、**`executableResolution` 1** | 构建系统可以把可执行文件路径交给插件设置来配置。共享的可执行文件候选:统一的候选排序和严格选择。 | ### 2026-10-21 -| PR | 修改人 | 协议 / API | 改了什么 | -| --- | --- | --- | --- | -| [#1395](https://github.com/1lck/Lithe-IDEA/pull/1395) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | **`languageServers` 2**、**`settings` 2** | `workspaceConfiguration` 用于向语言服务器推送工作区配置。设置 2 新增放置位置(`page`、`section`)、作用域、生效方式,`multiSelect`、`text`、`file`、`directory` 类型和页面按钮;插件可以注册设置页。 | -| [#1382](https://github.com/1lck/Lithe-IDEA/pull/1382) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | `litheBuild` 1 | 构建提供者的请求可以带 `refresh`(用户要求重新加载)和 `tool.executable`(宿主解析出的构建工具绝对路径)。两者都是可选字段,协议仍是版本 1。 | +| PR | 修改人 | API 编号 | 协议 / 能力 | 改了什么 | +| --- | --- | --- | --- | --- | +| [#1395](https://github.com/1lck/Lithe-IDEA/pull/1395) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | API-19、API-25 | **`languageServers` 2**、**`settings` 2** | `workspaceConfiguration` 用于向语言服务器推送工作区配置。设置 2 新增放置位置(`page`、`section`)、作用域、生效方式,`multiSelect`、`text`、`file`、`directory` 类型和页面按钮;插件可以注册设置页。 | +| [#1382](https://github.com/1lck/Lithe-IDEA/pull/1382) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | API-29 | `litheBuild` 1 | 构建提供者的请求可以带 `refresh`(用户要求重新加载)和 `tool.executable`(宿主解析出的构建工具绝对路径)。两者都是可选字段,协议仍是版本 1。 | ### 2026-10-20 -| PR | 修改人 | 协议 / API | 改了什么 | -| --- | --- | --- | --- | -| [#1379](https://github.com/1lck/Lithe-IDEA/pull/1379) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | 官方 Java SDK | Java 后端 SDK 首发,当时从主仓库发布。契约补充:探测 `java` 运行时版本用 `-version`,Java 8 也能识别。 | -| [#1366](https://github.com/1lck/Lithe-IDEA/pull/1366) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | 网页调用插件函数 | macOS 把每个构建提供者进程作为所属插件的会话启动。插件网页的桥接新增 `functions.list`、`functions.invoke`、`functions.cancel`、`functions.progress`。 | -| [#1365](https://github.com/1lck/Lithe-IDEA/pull/1365) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | 官方 Node SDK | Node 后端 SDK 首发,实现函数协议和 `litheBuild` 1。 | -| [#1358](https://github.com/1lck/Lithe-IDEA/pull/1358) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | **`litheFunctions` 1** | 插件函数协议:注册、撤回、调用、结果、进度、取消,在 `initialize` 的 `capabilities.experimental.litheFunctions` 中协商,由 Core 负责路由。 | -| [#1356](https://github.com/1lck/Lithe-IDEA/pull/1356) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | `litheBuild` 1:macOS 宿主 | macOS 开始启动构建提供者并发送 `lithe/build/*` 请求。每个提供者是独立进程,工作区关闭、插件停用或插件包被替换前会停止。 | +| PR | 修改人 | API 编号 | 协议 / 能力 | 改了什么 | +| --- | --- | --- | --- | --- | +| [#1379](https://github.com/1lck/Lithe-IDEA/pull/1379) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | — | 官方 Java SDK | Java 后端 SDK 首发,当时从主仓库发布。契约补充:探测 `java` 运行时版本用 `-version`,Java 8 也能识别。 | +| [#1366](https://github.com/1lck/Lithe-IDEA/pull/1366) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | API-14 | 网页调用插件函数 | macOS 把每个构建提供者进程作为所属插件的会话启动。插件网页的桥接新增 `functions.list`、`functions.invoke`、`functions.cancel`、`functions.progress`。 | +| [#1365](https://github.com/1lck/Lithe-IDEA/pull/1365) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | — | 官方 Node SDK | Node 后端 SDK 首发,实现函数协议和 `litheBuild` 1。 | +| [#1358](https://github.com/1lck/Lithe-IDEA/pull/1358) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | API-22 | **`litheFunctions` 1** | 插件函数协议:注册、撤回、调用、结果、进度、取消,在 `initialize` 的 `capabilities.experimental.litheFunctions` 中协商,由 Core 负责路由。 | +| [#1356](https://github.com/1lck/Lithe-IDEA/pull/1356) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | API-29 | `litheBuild` 1:macOS 宿主 | macOS 开始启动构建提供者并发送 `lithe/build/*` 请求。每个提供者是独立进程,工作区关闭、插件停用或插件包被替换前会停止。 | ### 2026-10-19 -| PR | 修改人 | 协议 / API | 改了什么 | -| --- | --- | --- | --- | -| [#1345](https://github.com/1lck/Lithe-IDEA/pull/1345) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | 社区插件安装 | 社区插件除了从第三方市场安装,还可以从本地 ZIP 或解包目录安装:宿主先取私有快照,再请用户确认安装审查。包里有签名文档时仍然必须通过验证。 | -| [#1339](https://github.com/1lck/Lithe-IDEA/pull/1339) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | `ui` 2:宿主现状 | macOS 用 WKWebView 实现包内网页并声明 `ui` 1、2。Windows 当时只声明 `ui` 1,`ui` 2 插件返回 `plugin.api.unsupported`,直到 #1424。 | +| PR | 修改人 | API 编号 | 协议 / 能力 | 改了什么 | +| --- | --- | --- | --- | --- | +| [#1345](https://github.com/1lck/Lithe-IDEA/pull/1345) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | — | 社区插件安装 | 社区插件除了从第三方市场安装,还可以从本地 ZIP 或解包目录安装:宿主先取私有快照,再请用户确认安装审查。包里有签名文档时仍然必须通过验证。 | +| [#1339](https://github.com/1lck/Lithe-IDEA/pull/1339) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | API-14 | `ui` 2:宿主现状 | macOS 用 WKWebView 实现包内网页并声明 `ui` 1、2。Windows 当时只声明 `ui` 1,`ui` 2 插件返回 `plugin.api.unsupported`,直到 #1424。 | ### 2026-10-18 -| PR | 修改人 | 协议 / API | 改了什么 | -| --- | --- | --- | --- | -| [#1334](https://github.com/1lck/Lithe-IDEA/pull/1334) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | **`ui` 2** | 工具窗口中的包内网页。 | -| [#1318](https://github.com/1lck/Lithe-IDEA/pull/1318) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | **插件 API 级别 3**(`requires`)、**`buildSystems` 1**、**`buildProviders` 1**、**`litheBuild` 1**、**`litheBuildModel` / `litheDependencies` / `litheTestResults` 1** | 从级别 3 起,插件要按能力声明版本,首批 8 个能力都是版本 1(见上方能力表);市场索引里级别 3 的版本必须带 `requires`。新增声明式构建工具插件,以及构建提供者协议 `litheBuild` 1(`lithe/build/model`、`lithe/build/dependencies`)。 | +| PR | 修改人 | API 编号 | 协议 / 能力 | 改了什么 | +| --- | --- | --- | --- | --- | +| [#1334](https://github.com/1lck/Lithe-IDEA/pull/1334) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | API-14 | **`ui` 2** | 工具窗口中的包内网页。 | +| [#1318](https://github.com/1lck/Lithe-IDEA/pull/1318) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | API-29 | **插件 API 级别 3**(`requires`)、**`buildSystems` 1**、**`buildProviders` 1**、**`litheBuild` 1**、**`litheBuildModel` / `litheDependencies` / `litheTestResults` 1** | 从级别 3 起,插件要按能力声明版本,首批 8 个能力都是版本 1(见上方能力表);市场索引里级别 3 的版本必须带 `requires`。新增声明式构建工具插件,以及构建提供者协议 `litheBuild` 1(`lithe/build/model`、`lithe/build/dependencies`)。 | ### 2026-10-15 -| PR | 修改人 | 协议 / API | 改了什么 | -| --- | --- | --- | --- | -| [#1206](https://github.com/1lck/Lithe-IDEA/pull/1206) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | 插件 API 级别 2:`ui` 与 `ui.contribute` | 级别 2 加入第一阶段工作台 UI(宿主渲染的工具窗口和命令)和 `ui.contribute` 权限。`languages` 不再必填,插件可以只提供 UI。 | +| PR | 修改人 | API 编号 | 协议 / 能力 | 改了什么 | +| --- | --- | --- | --- | --- | +| [#1206](https://github.com/1lck/Lithe-IDEA/pull/1206) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | API-03 | 插件 API 级别 2:`ui` 与 `ui.contribute` | 级别 2 加入第一阶段工作台 UI(宿主渲染的工具窗口和命令)和 `ui.contribute` 权限。`languages` 不再必填,插件可以只提供 UI。 | ### 2026-10-14 -| PR | 修改人 | 协议 / API | 改了什么 | -| --- | --- | --- | --- | -| [#1214](https://github.com/1lck/Lithe-IDEA/pull/1214) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | **插件 API 级别 2** | 新增启动模板(`arguments` 可用变量)、`runtimeDependencies` 的 `java`、`initializationOptions`、`hostIntegration`(仅官方插件)、包内或已发现运行时启动(`runtime`、`packagedRuntime`)和插件设置。Java Support 改为声明式官方插件。 | -| [#1170](https://github.com/1lck/Lithe-IDEA/pull/1170) | [@1lck](https://github.com/1lck) | **契约 v1**:**插件 API 级别 1**、**清单 `schemaVersion` 2**、**市场索引 `schemaVersion` 1** | 契约 v1 进入 `preview`:语言、语言服务器(`packaged` 和 `systemCommand` 启动)、`node` 和 `go` 运行时依赖、运行和测试提供者,以及市场索引和标准用例。 | +| PR | 修改人 | API 编号 | 协议 / 能力 | 改了什么 | +| --- | --- | --- | --- | --- | +| [#1214](https://github.com/1lck/Lithe-IDEA/pull/1214) | [@xiaoyumuxi](https://github.com/xiaoyumuxi) | API-19、API-23、API-25 | **插件 API 级别 2** | 新增启动模板(`arguments` 可用变量)、`runtimeDependencies` 的 `java`、`initializationOptions`、`hostIntegration`(仅官方插件)、包内或已发现运行时启动(`runtime`、`packagedRuntime`)和插件设置。Java Support 改为声明式官方插件。 | +| [#1170](https://github.com/1lck/Lithe-IDEA/pull/1170) | [@1lck](https://github.com/1lck) | API-23、API-25 | **契约 v1**:**插件 API 级别 1**、**清单 `schemaVersion` 2**、**市场索引 `schemaVersion` 1** | 契约 v1 进入 `preview`:语言、语言服务器(`packaged` 和 `systemCommand` 启动)、`node` 和 `go` 运行时依赖、运行和测试提供者,以及市场索引和标准用例。 | ## 维护 @@ -230,12 +280,14 @@ ``` 2. 按日期把这些 PR 补到时间线最上面。新增的版本号要加粗,并写进“按协议查首次出现”的表。 -3. “修改人”填原 PR 作者的 GitHub 账号,写成 `[@账号](https://github.com/账号)`。账号可以这样查: +3. “API 编号”填这个 PR 涉及的全部 API-01–44 编号,取自 PR 描述里的“原计划编号”。PR 没写时按 [API 实施计划](https://github.com/1lck/Lithe-IDEA/blob/preview/docs/development/macos-plugin-api-plan.md) 判断,不要自编新号;不属于任何编号的写 —。 +4. PR 新增了宿主方法或通知时,每个方法在“宿主方法(按 API 编号)”表里加一行,写明 API 编号、协议、日期和 PR;同时在 [API 总表](api-catalog.md#已公开的宿主方法)中英两张方法表里各加一行,写明用途、权限和协议。同一个 API 下的方法分几个 PR 加入时,各自登记自己的 PR。 +5. “修改人”填原 PR 作者的 GitHub 账号,写成 `[@账号](https://github.com/账号)`。账号可以这样查: ```sh gh pr view --repo 1lck/Lithe-IDEA --json author --jq .author.login ``` -4. 把开头的“记录到”改成本次同步的 commit。 -5. 同时更新[能力与协议版本对照](capabilities-and-versions.md)和受影响的功能页。 -6. 在同步 PR 的描述里列出本次登记的 PR,并直接写 `@账号` 提到每位修改人,请他们核对自己那一行。本页里的 `[@账号](…)` 只是链接,不会通知任何人。 +6. 把开头的“记录到”改成本次同步的 commit。 +7. 同时更新[能力与协议版本对照](capabilities-and-versions.md)和受影响的功能页。 +8. 在同步 PR 的描述里列出本次登记的 PR,并直接写 `@账号` 提到每位修改人,请他们核对自己那一行。本页里的 `[@账号](…)` 只是链接,不会通知任何人。