Skip to content

Commit be5d12d

Browse files
docs(java-sdk): document pinned source vendoring (#2140)
1 parent dcb3d77 commit be5d12d

7 files changed

Lines changed: 49 additions & 26 deletions

File tree

‎shared/plugins/README.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ Schema 只检查 JSON 结构。ID 引用、权限、激活事件、模板变量
111111
| [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` 依赖;编译成每个平台各一份的插件后端可执行文件 |
112112
| [Go](sdk/go/README.md) | 未发布 | Go 1.27.4+ | Go 模块标签 `shared/plugins/sdk/go/v<版本>`,由 Go 模块代理分发,没有 Release 附件;还没有打过标签 | `go get` 锁定标签或 commit(`go.sum` 记录内容哈希);编译成每个平台各一份的插件后端可执行文件 |
113113
| [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/` 复制进插件包,用相对路径导入 |
114-
| [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 |
114+
| [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 |
115115

116116
Rust 的 Git 依赖这样写:
117117

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

128-
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 仓库发布的版本。
128+
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。
129129

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

@@ -332,7 +332,7 @@ A plugin that uses only language servers, run, and test needs no backend. When y
332332
| [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 |
333333
| [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 |
334334
| [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 |
335-
| [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 |
335+
| [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 |
336336

337337
The Rust Git dependency looks like this:
338338

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

349-
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.
349+
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.
350350

351351
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.
352352

‎shared/plugins/guides/plugin-backend-workspace.md‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
> 四个官方 SDK 都实现了本篇的协议:Node.js SDK 0.5.0、Java SDK 0.5.0、Rust SDK 0.4.0 和 Go SDK(还没有发布标签)
1414
> (见各自 README 的 Host services:[Node.js](../sdk/node/README.md#host-services)、[Java](../sdk/java/README.md#host-services)、
1515
> [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)、
16-
> [sdk-java-v0.5.0](https://github.com/Lithe-IDEA/Lithe-core-rust/releases/tag/sdk-java-v0.5.0)、
17-
> [sdk-rust-v0.4.0](https://github.com/Lithe-IDEA/Lithe-core-rust/releases/tag/sdk-rust-v0.4.0))。用其他语言需要自己处理下文的请求和通知。
16+
> [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))。用其他语言需要自己处理下文的请求和通知。
1817
> 各能力在 Core 和桌面端的支持情况见[能力与协议版本对照](../reference/capabilities-and-versions.md)。对契约有疑问,请到
1918
> [Lithe-core-rust 的 Issues](https://github.com/Lithe-IDEA/Lithe-core-rust/issues) 反馈。
2019
@@ -339,8 +338,7 @@ The [contract](../contract/v1/README.md#backend-lifecycle-and-workspace-contexts
339338
> 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)
340339
> (see Host services in each README: [Node.js](../sdk/node/README.md#host-services), [Java](../sdk/java/README.md#host-services),
341340
> [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),
342-
> [sdk-java-v0.5.0](https://github.com/Lithe-IDEA/Lithe-core-rust/releases/tag/sdk-java-v0.5.0),
343-
> [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.
341+
> [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.
344342
> 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
345343
> [Lithe-core-rust Issues](https://github.com/Lithe-IDEA/Lithe-core-rust/issues).
346344

‎shared/plugins/guides/plugin-logging.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

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

11-
本文的 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 标为预发布。
11+
本文的 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 标为预发布。
1212

1313
### 每种事实与级别
1414

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

105105
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.
106106

107-
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.
107+
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.
108108

109109
### Facts and levels
110110

‎shared/plugins/reference/capabilities-and-versions.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ Core 列以本仓库 `main` 上的 Core 源码为准([`capabilities.rs`](https
116116

117117
### 官方 SDK
118118

119-
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)。
119+
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)。
120120

121121
---
122122

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

235235
### Official SDKs
236236

237-
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.
237+
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.

0 commit comments

Comments
 (0)