Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions shared/plugins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ Schema 只检查 JSON 结构。ID 引用、权限、激活事件、模板变量
| [Rust](sdk/rust/README.md) | 0.4.0 | Rust 1.87+ | [`sdk-rust-v0.4.0`](https://github.com/Lithe-IDEA/Lithe-core-rust/releases/tag/sdk-rust-v0.4.0):`lithe-plugin-sdk-rust-0.4.0.crate` 和 `.sha256` | 用 Git 依赖锁定标签(`Cargo.lock` 记录 commit),或解压后作为 `path` 依赖;编译成每个平台各一份的插件后端可执行文件 |
| [Go](sdk/go/README.md) | 未发布 | Go 1.27.4+ | Go 模块标签 `shared/plugins/sdk/go/v<版本>`,由 Go 模块代理分发,没有 Release 附件;还没有打过标签 | `go get` 锁定标签或 commit(`go.sum` 记录内容哈希);编译成每个平台各一份的插件后端可执行文件 |
| [Node.js](sdk/node/README.md) | 0.5.0 | Node.js 20.3+ | [`sdk-node-v0.5.0`](https://github.com/Lithe-IDEA/Lithe-core-rust/releases/tag/sdk-node-v0.5.0):`lithe-plugin-sdk-node-0.5.0.tgz` 和 `.sha256` | 解压后把 `package/` 复制进插件包,用相对路径导入 |
| [Java](sdk/java/README.md) | 0.5.0 | Java 8+ | [`sdk-java-v0.5.0`](https://github.com/Lithe-IDEA/Lithe-core-rust/releases/tag/sdk-java-v0.5.0):`lithe-plugin-sdk-java-0.5.0.jar` 和 `.sha256` | shade 进后端 JAR |
| [Java](sdk/java/README.md) | 0.5.0(源码版本) | Java 8+ | 尚无对应 Release;[固定 Core commit 引入源码](sdk/java/README.md#getting-the-sdk) | `sdk.lock.json` 固定 commit 和每个文件的 SHA-256,和后端一起编译进 JAR |

Rust 的 Git 依赖这样写:

Expand All @@ -125,7 +125,7 @@ Go 这样引入(第一个标签发布前写 `main` 上的 commit,Go 会记
go get github.com/Lithe-IDEA/Lithe-core-rust/shared/plugins/sdk/go@<标签或 commit>
```

SDK 的源码都在本目录的 `sdk/` 下。Node.js、Java 和 Rust SDK 发布在 [Core 仓库的 Releases](https://github.com/Lithe-IDEA/Lithe-core-rust/releases) 里(标签 `sdk-node-v<版本>`、`sdk-java-v<版本>`、`sdk-rust-v<版本>`),不在 npm、Maven 或 crates.io 上;Go SDK 是本仓库子目录里的 Go 模块,版本就是标签 `shared/plugins/sdk/go/v<版本>`,由 Go 模块代理和校验和数据库分发。Rust 和 Go SDK 只实现插件后端(`backend`):插件函数和宿主服务;构建后端请用 Node.js 或 Java SDK,VCS 后端请用 Node.js SDK。各 SDK 的 README 有 “What the Lithe desktop serves” 一节,说明 Lithe 桌面端提供哪些协议;各协议的版本见[进程协议版本](reference/capabilities-and-versions.md#进程协议版本)。以上版本说的都是版本 `0` 的协议;已退役的 `lithe-plugin-docs` 仓库发布过更早的 SDK,它们说的是旧协议,Lithe 桌面端不接受用它们写的插件,请只使用 Core 仓库发布的版本。
SDK 的源码都在本目录的 `sdk/` 下。Node.js 和 Rust SDK 的发布入口是 [Core 仓库的 Releases](https://github.com/Lithe-IDEA/Lithe-core-rust/releases)(标签 `sdk-node-v<版本>`、`sdk-rust-v<版本>`),不在 npm 或 crates.io 上;Java SDK 暂无对应 Release,也不发布到 Maven 仓库,按[获取说明](sdk/java/README.md#getting-the-sdk)固定 Core commit 引入源码;Go SDK 是本仓库子目录里的 Go 模块,版本就是标签 `shared/plugins/sdk/go/v<版本>`,由 Go 模块代理和校验和数据库分发。Rust 和 Go SDK 只实现插件后端(`backend`):插件函数和宿主服务;构建后端请用 Node.js 或 Java SDK,VCS 后端请用 Node.js SDK。各 SDK 的 README 有 “What the Lithe desktop serves” 一节,说明 Lithe 桌面端提供哪些协议;各协议的版本见[进程协议版本](reference/capabilities-and-versions.md#进程协议版本)。以上版本说的都是版本 `0` 的协议;已退役的 `lithe-plugin-docs` 仓库发布过更早的 SDK,它们说的是旧协议,Lithe 桌面端不接受用它们写的插件,请只使用 Core 仓库中的 SDK。

SDK 与插件后端在构建时下载,并按锁定的 SHA-256(或 Git commit、`go.sum`)校验;插件包安装后没有 `npm install` 步骤。独立的大型依赖可声明 [`managedRuntimes`](contract/v1/README.md#managed-runtimes):宿主在用户批准安装后校验并准备,完整缓存可离线复用;插件自身不能用启动脚本绕过这项声明或自行改写包。

Expand Down Expand Up @@ -332,7 +332,7 @@ A plugin that uses only language servers, run, and test needs no backend. When y
| [Rust](sdk/rust/README.md) | 0.4.0 | Rust 1.87+ | [`sdk-rust-v0.4.0`](https://github.com/Lithe-IDEA/Lithe-core-rust/releases/tag/sdk-rust-v0.4.0): `lithe-plugin-sdk-rust-0.4.0.crate` and `.sha256` | Pin the tag as a Git dependency (`Cargo.lock` records the commit), or unpack it as a `path` dependency; compile one backend executable per platform |
| [Go](sdk/go/README.md) | Unreleased | Go 1.27.4+ | Go module tags `shared/plugins/sdk/go/v<version>`, served by the Go module proxy with no Release assets; not tagged yet | Pin a tag or commit with `go get` (`go.sum` records the content hash); compile one backend executable per platform |
| [Node.js](sdk/node/README.md) | 0.5.0 | Node.js 20.3+ | [`sdk-node-v0.5.0`](https://github.com/Lithe-IDEA/Lithe-core-rust/releases/tag/sdk-node-v0.5.0): `lithe-plugin-sdk-node-0.5.0.tgz` and `.sha256` | Unpack it, copy `package/` into the plugin package, and import it by relative path |
| [Java](sdk/java/README.md) | 0.5.0 | Java 8+ | [`sdk-java-v0.5.0`](https://github.com/Lithe-IDEA/Lithe-core-rust/releases/tag/sdk-java-v0.5.0): `lithe-plugin-sdk-java-0.5.0.jar` and `.sha256` | Shade it into the backend JAR |
| [Java](sdk/java/README.md) | 0.5.0 (source version) | Java 8+ | No corresponding Release; [vendor sources from a pinned Core commit](sdk/java/README.md#getting-the-sdk) | Pin the commit and per-file SHA-256 in `sdk.lock.json`, then compile into the backend JAR |

The Rust Git dependency looks like this:

Expand All @@ -346,7 +346,7 @@ Add the Go SDK like this (until the first tag, name a commit of `main`; Go recor
go get github.com/Lithe-IDEA/Lithe-core-rust/shared/plugins/sdk/go@<tag or commit>
```

All SDK sources live under `sdk/` in this directory. The Node.js, Java, and Rust SDKs are published in the [Core repository's Releases](https://github.com/Lithe-IDEA/Lithe-core-rust/releases) (tags `sdk-node-v<version>`, `sdk-java-v<version>`, `sdk-rust-v<version>`), not on npm, Maven, or crates.io; the Go SDK is a Go module in a subdirectory of this repository, its versions are the tags `shared/plugins/sdk/go/v<version>`, and the Go module proxy and checksum database serve it. The Rust and Go SDKs implement only the plugin backend (`backend`): plugin functions and host services; write build backends with the Node.js or Java SDK and VCS backends with the Node.js SDK. Each SDK's README has a "What the Lithe desktop serves" section naming the protocols the Lithe desktop client provides; the version of each protocol is in [Process protocol versions](reference/capabilities-and-versions.md#process-protocol-versions). The versions above all speak the version `0` protocols; the retired `lithe-plugin-docs` repository published earlier SDKs that speak an older protocol, and the Lithe desktop client does not accept plugins written with them, so use only versions released from the Core repository.
All SDK sources live under `sdk/` in this directory. The Node.js and Rust SDK release location is the [Core repository's Releases](https://github.com/Lithe-IDEA/Lithe-core-rust/releases) (tags `sdk-node-v<version>` and `sdk-rust-v<version>`), not npm or crates.io; the Java SDK has no corresponding Release or Maven repository publication, so [vendor its sources from a pinned Core commit](sdk/java/README.md#getting-the-sdk); the Go SDK is a Go module in a subdirectory of this repository, its versions are the tags `shared/plugins/sdk/go/v<version>`, and the Go module proxy and checksum database serve it. The Rust and Go SDKs implement only the plugin backend (`backend`): plugin functions and host services; write build backends with the Node.js or Java SDK and VCS backends with the Node.js SDK. Each SDK's README has a "What the Lithe desktop serves" section naming the protocols the Lithe desktop client provides; the version of each protocol is in [Process protocol versions](reference/capabilities-and-versions.md#process-protocol-versions). The versions above all speak the version `0` protocols; the retired `lithe-plugin-docs` repository published earlier SDKs that speak an older protocol, and the Lithe desktop client does not accept plugins written with them, so use only SDKs from the Core repository.

Download SDKs and plugin backends at build time and verify against the SHA-256 (or Git commit, or `go.sum`) you pinned. An installed package has no `npm install` step. Large independent dependencies can declare [`managedRuntimes`](contract/v1/README.md#managed-runtimes): the host verifies and prepares them after approved installation, and complete cached sets work offline. Plugin launch scripts must not bypass this declaration or rewrite the package.

Expand Down
6 changes: 2 additions & 4 deletions shared/plugins/guides/plugin-backend-workspace.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
> 四个官方 SDK 都实现了本篇的协议:Node.js SDK 0.5.0、Java SDK 0.5.0、Rust SDK 0.4.0 和 Go SDK(还没有发布标签)
> (见各自 README 的 Host services:[Node.js](../sdk/node/README.md#host-services)、[Java](../sdk/java/README.md#host-services)、
> [Rust](../sdk/rust/README.md#host-services)、[Go](../sdk/go/README.md#host-services);发布页:[sdk-node-v0.5.0](https://github.com/Lithe-IDEA/Lithe-core-rust/releases/tag/sdk-node-v0.5.0)、
> [sdk-java-v0.5.0](https://github.com/Lithe-IDEA/Lithe-core-rust/releases/tag/sdk-java-v0.5.0)、
> [sdk-rust-v0.4.0](https://github.com/Lithe-IDEA/Lithe-core-rust/releases/tag/sdk-rust-v0.4.0))。用其他语言需要自己处理下文的请求和通知。
> [sdk-rust-v0.4.0](https://github.com/Lithe-IDEA/Lithe-core-rust/releases/tag/sdk-rust-v0.4.0);Java SDK [固定 Core commit 引入源码](../sdk/java/README.md#getting-the-sdk))。用其他语言需要自己处理下文的请求和通知。
> 各能力在 Core 和桌面端的支持情况见[能力与协议版本对照](../reference/capabilities-and-versions.md)。对契约有疑问,请到
> [Lithe-core-rust 的 Issues](https://github.com/Lithe-IDEA/Lithe-core-rust/issues) 反馈。

Expand Down Expand Up @@ -339,8 +338,7 @@ The [contract](../contract/v1/README.md#backend-lifecycle-and-workspace-contexts
> All four official SDKs implement the protocol in this guide: Node.js SDK 0.5.0, Java SDK 0.5.0, Rust SDK 0.4.0, and the Go SDK (not tagged yet)
> (see Host services in each README: [Node.js](../sdk/node/README.md#host-services), [Java](../sdk/java/README.md#host-services),
> [Rust](../sdk/rust/README.md#host-services), [Go](../sdk/go/README.md#host-services); release pages: [sdk-node-v0.5.0](https://github.com/Lithe-IDEA/Lithe-core-rust/releases/tag/sdk-node-v0.5.0),
> [sdk-java-v0.5.0](https://github.com/Lithe-IDEA/Lithe-core-rust/releases/tag/sdk-java-v0.5.0),
> [sdk-rust-v0.4.0](https://github.com/Lithe-IDEA/Lithe-core-rust/releases/tag/sdk-rust-v0.4.0)). With another language, handle the requests and notifications below yourself.
> [sdk-rust-v0.4.0](https://github.com/Lithe-IDEA/Lithe-core-rust/releases/tag/sdk-rust-v0.4.0); Java uses [sources from a pinned Core commit](../sdk/java/README.md#getting-the-sdk)). With another language, handle the requests and notifications below yourself.
> For how far Core and the desktop support each capability, see the [capability and protocol versions](../reference/capabilities-and-versions.md). Questions about the contract go to
> [Lithe-core-rust Issues](https://github.com/Lithe-IDEA/Lithe-core-rust/issues).

Expand Down
4 changes: 2 additions & 2 deletions shared/plugins/guides/plugin-logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

宿主必须在 initialize 中提供 `capabilities.experimental.litheLogging.versions: [0]`,SDK 回复 `capabilities.experimental.litheLogging.version: 0`。缺少协议时,SDK 拒绝初始化;不自动退回其他日志方式。初始化尚未协商时的失败只通过原有 RPC 错误与宿主进程生命周期记录,不能提前发送未协商的日志通知。

本文的 API 由 Node.js SDK 0.5.0、Java SDK 0.5.0、Rust SDK 0.4.0 和 Go SDK 提供,前三个的发布标签分别为 `sdk-node-v0.5.0`、`sdk-java-v0.5.0` 和 `sdk-rust-v0.4.0`;Go SDK 的版本是模块标签 `shared/plugins/sdk/go/v<版本>`,目前还没有打过标签。插件在构建输入中锁定对应的 release tag 与 SHA-256(Go 由 `go.sum` 锁定),不要引用开发机的绝对 path 依赖。这些 SDK 要求宿主提供 `litheLogging` 0;在提供它的 Lithe 稳定版发布之前,用这些 SDK 构建的插件把 GitHub Release 标为预发布。
本文的 API 由 Node.js SDK 0.5.0、Java SDK 0.5.0、Rust SDK 0.4.0 和 Go SDK 提供,Node.js 和 Rust 的发布标签分别为 `sdk-node-v0.5.0` 和 `sdk-rust-v0.4.0`;Java SDK [固定 Core commit 引入源码](../sdk/java/README.md#getting-the-sdk);Go SDK 的版本是模块标签 `shared/plugins/sdk/go/v<版本>`,目前还没有打过标签。插件在构建输入中锁定对应的 release tag 与 SHA-256(Java 源码用 `sdk.lock.json` 固定 Core commit 和逐文件哈希,Go 由 `go.sum` 锁定),不要引用开发机的绝对 path 依赖。这些 SDK 要求宿主提供 `litheLogging` 0;在提供它的 Lithe 稳定版发布之前,用这些 SDK 构建的插件把 GitHub Release 标为预发布。

### 每种事实与级别

Expand Down Expand Up @@ -104,7 +104,7 @@ Plugins use `litheLogging` 0 and `lithe/log` to send restricted operation facts.

The host must offer `capabilities.experimental.litheLogging.versions: [0]` in initialize, and the SDK replies with `capabilities.experimental.litheLogging.version: 0`. When the protocol is missing, the SDK refuses to initialize; it does not fall back to another logging path. A failure before initialization has negotiated logging is recorded only through the existing RPC error and the host's process lifecycle; the plugin must not send a log notification before negotiation.

The APIs in this guide are provided by Node.js SDK 0.5.0, Java SDK 0.5.0, Rust SDK 0.4.0, and the Go SDK. The first three have release tags `sdk-node-v0.5.0`, `sdk-java-v0.5.0`, and `sdk-rust-v0.4.0`; the Go SDK's versions are the module tags `shared/plugins/sdk/go/v<version>`, and none has been pushed yet. Pin the matching release tag and SHA-256 in your build inputs (for Go, `go.sum` pins it); do not depend on an absolute path on a development machine. These SDKs require the host to offer `litheLogging` 0; until a stable Lithe release offers it, mark the GitHub Release of a plugin built with these SDKs as a prerelease.
The APIs in this guide are provided by Node.js SDK 0.5.0, Java SDK 0.5.0, Rust SDK 0.4.0, and the Go SDK. Node.js and Rust have release tags `sdk-node-v0.5.0` and `sdk-rust-v0.4.0`; Java uses [sources from a pinned Core commit](../sdk/java/README.md#getting-the-sdk); the Go SDK's versions are the module tags `shared/plugins/sdk/go/v<version>`, and none has been pushed yet. Pin the matching release tag and SHA-256 in your build inputs (for Java sources, `sdk.lock.json` pins the Core commit and per-file hashes; for Go, `go.sum` pins it); do not depend on an absolute path on a development machine. These SDKs require the host to offer `litheLogging` 0; until a stable Lithe release offers it, mark the GitHub Release of a plugin built with these SDKs as a prerelease.

### Facts and levels

Expand Down
4 changes: 2 additions & 2 deletions shared/plugins/reference/capabilities-and-versions.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ Core 列以本仓库 `main` 上的 Core 源码为准([`capabilities.rs`](https

### 官方 SDK

Node.js SDK 0.5.0、Java SDK 0.5.0、Rust SDK 0.4.0 和还没发布的 Go SDK 说的是版本 `0` 的协议;`main` 上的 Node.js 和 Java SDK 源码另外支持 `litheBuild` `1`(`lithe/build/runEntrypoints`),`main` 上的 Rust SDK 源码新增了 `litheBuild` `0` 和 `1`,都回答宿主提供的最新版本,随下一次 SDK 发布提供;各 SDK 封装哪些协议见契约的 [Official backend SDK](../contract/v1/README.md#official-backend-sdk) 和各自的 [Node.js](../sdk/node/README.md)、[Java](../sdk/java/README.md)、[Rust](../sdk/rust/README.md)、[Go](../sdk/go/README.md) README。Node.js、Java、Rust 的下载地址在 [Lithe-core-rust 的 Releases](https://github.com/Lithe-IDEA/Lithe-core-rust/releases);Go SDK 不放 Releases,用 `go get` 按模块标签 `shared/plugins/sdk/go/v<版本>` 获取。新插件优先用 Rust 或 Go SDK,理由见[插件开发总览](../README.md)。
Node.js SDK 0.5.0、Java SDK 0.5.0、Rust SDK 0.4.0 和还没发布的 Go SDK 说的是版本 `0` 的协议;`main` 上的 Node.js 和 Java SDK 源码另外支持 `litheBuild` `1`(`lithe/build/runEntrypoints`),`main` 上的 Rust SDK 源码新增了 `litheBuild` `0` 和 `1`,都回答宿主提供的最新版本,随下一次 SDK 发布提供;各 SDK 封装哪些协议见契约的 [Official backend SDK](../contract/v1/README.md#official-backend-sdk) 和各自的 [Node.js](../sdk/node/README.md)、[Java](../sdk/java/README.md)、[Rust](../sdk/rust/README.md)、[Go](../sdk/go/README.md) README。Node.js、Rust 的发布入口在 [Lithe-core-rust 的 Releases](https://github.com/Lithe-IDEA/Lithe-core-rust/releases);Java SDK 按[获取说明](../sdk/java/README.md#getting-the-sdk)固定 Core commit 引入源码;Go SDK 不放 Releases,用 `go get` 按模块标签 `shared/plugins/sdk/go/v<版本>` 获取。新插件优先用 Rust 或 Go SDK,理由见[插件开发总览](../README.md)。

---

Expand Down Expand Up @@ -234,4 +234,4 @@ The `version` of an exported or called plugin function (1 to 1000) is not a cont

### Official SDKs

Node.js SDK 0.5.0, Java SDK 0.5.0, Rust SDK 0.4.0, and the unreleased Go SDK speak the version `0` protocols; the Node.js and Java SDK sources on `main` also speak `litheBuild` `1` (`lithe/build/runEntrypoints`), and the Rust SDK source on `main` adds `litheBuild` `0` and `1`; each answers the newest version the host offers, which the next SDK release ships; which protocols each SDK wraps is in the contract's [Official backend SDK](../contract/v1/README.md#official-backend-sdk) and in the [Node.js](../sdk/node/README.md), [Java](../sdk/java/README.md), [Rust](../sdk/rust/README.md), and [Go](../sdk/go/README.md) READMEs. Node.js, Java, and Rust downloads are on the [Lithe-core-rust Releases](https://github.com/Lithe-IDEA/Lithe-core-rust/releases) page; the Go SDK is not on Releases and is fetched with `go get` by module tag `shared/plugins/sdk/go/v<version>`. New plugins should prefer the Rust or Go SDK; see the [plugin overview](../README.md) for why.
Node.js SDK 0.5.0, Java SDK 0.5.0, Rust SDK 0.4.0, and the unreleased Go SDK speak the version `0` protocols; the Node.js and Java SDK sources on `main` also speak `litheBuild` `1` (`lithe/build/runEntrypoints`), and the Rust SDK source on `main` adds `litheBuild` `0` and `1`; each answers the newest version the host offers, which the next SDK release ships; which protocols each SDK wraps is in the contract's [Official backend SDK](../contract/v1/README.md#official-backend-sdk) and in the [Node.js](../sdk/node/README.md), [Java](../sdk/java/README.md), [Rust](../sdk/rust/README.md), and [Go](../sdk/go/README.md) READMEs. Node.js and Rust use the [Lithe-core-rust Releases](https://github.com/Lithe-IDEA/Lithe-core-rust/releases) page; Java uses [sources from a pinned Core commit](../sdk/java/README.md#getting-the-sdk); the Go SDK is not on Releases and is fetched with `go get` by module tag `shared/plugins/sdk/go/v<version>`. New plugins should prefer the Rust or Go SDK; see the [plugin overview](../README.md) for why.
Loading