diff --git a/.github/workflows/release-rust-sdk.yml b/.github/workflows/release-rust-sdk.yml index dd03051..fefc8f7 100644 --- a/.github/workflows/release-rust-sdk.yml +++ b/.github/workflows/release-rust-sdk.yml @@ -70,4 +70,4 @@ jobs: asset="lithe-plugin-sdk-rust-$VERSION.crate" gh release create "$TAG" "dist/$asset" "dist/$asset.sha256" \ --title "Rust plugin SDK $VERSION" \ - --notes "Official Rust plugin SDK $VERSION for Lithe plugin backends. Requires Rust 1.87 or newer and depends only on serde_json. Depend on the tag through Git, or pin the archive by its SHA-256 (\`$asset.sha256\`) and vendor the unpacked crate; see sdk/rust/README.md." + --notes "Official Rust plugin SDK $VERSION for Lithe plugin backends. Requires Rust 1.87 or newer and depends only on serde_json and base64. Depend on the tag through Git, or pin the archive by its SHA-256 (\`$asset.sha256\`) and vendor the unpacked crate; see sdk/rust/README.md." diff --git a/guides/native-terminals.md b/guides/native-terminals.md index 61bfa68..4bbf552 100644 --- a/guides/native-terminals.md +++ b/guides/native-terminals.md @@ -1,7 +1,7 @@ # Open a native Lithe terminal from a plugin -These SDK wrappers are an **unreleased addition** and require a host that -advertises the terminal methods. The checked-in contract mirror is pinned to +These SDK wrappers ship from Node.js SDK 0.3.0, Java SDK 0.3.0, and Rust SDK +0.2.0, and require a host that advertises the terminal methods. The checked-in contract mirror is pinned to the merged host change, [Lithe #1653](https://github.com/1lck/Lithe-IDEA/pull/1653), at `f64d262c48f1ff5ad1778b301138596493a09ad5`. The mirror is generated by `scripts/contract.mjs sync`, never edited manually. See the diff --git a/guides/plugin-logging.md b/guides/plugin-logging.md index d5b6053..364e87b 100644 --- a/guides/plugin-logging.md +++ b/guides/plugin-logging.md @@ -2,9 +2,9 @@ 新版本插件使用 `litheLogging` 1 与 `lithe/log` 发送受限的操作事实,由宿主的共享事件目录、脱敏、队列和文件写入器落盘。三个 SDK 不再提供自由文本 `log` 接口,也没有 stderr 回退。插件无需实现 v2 文件格式、文件轮转、脱敏器或后台写入线程。 -宿主必须在 initialize 中提供 `capabilities.experimental.litheLogging.versions: [1]`,SDK 回复 `capabilities.experimental.litheLogging.version: 1`。缺少协议时,新 SDK 拒绝初始化;不自动退回旧日志。初始化尚未协商时的失败只通过原有 RPC 错误与宿主进程生命周期记录,不能提前发送未协商的日志通知。 +宿主必须在 initialize 中提供 `capabilities.experimental.litheLogging.versions: [1]`,SDK 回复 `capabilities.experimental.litheLogging.version: 1`。缺少协议时,SDK 拒绝初始化;不自动退回旧日志。初始化尚未协商时的失败只通过原有 RPC 错误与宿主进程生命周期记录,不能提前发送未协商的日志通知。 -本文描述源码中的新 API。插件本轮将源码与真实哈希一起固定在可复现的构建输入中;正式发布 SDK 后也可以改为锁定真实 release tag 与 SHA-256。不要引用不存在的发布版本或开发机的绝对 path 依赖。 +本文的 API 从 Node.js SDK 0.3.0、Java SDK 0.3.0 和 Rust SDK 0.2.0 开始提供。插件在构建输入中锁定对应的 release tag 与 SHA-256,不要引用开发机的绝对 path 依赖。用这些版本构建的插件只能在提供 `litheLogging` 1 的 Lithe 版本上启动。 ## 每种事实与级别 diff --git a/sdk/java/README.md b/sdk/java/README.md index b5c827b..abacbea 100644 --- a/sdk/java/README.md +++ b/sdk/java/README.md @@ -16,16 +16,16 @@ same rules and error mapping: cancellation, and registration at runtime. From version 2 a backend may call [host services](#host-services); version 3 adds workspace, document, editor, and window services, command events, and workspace contexts. -- **`litheKeymapImport` 1** (unreleased): independently negotiated shortcut +- **`litheKeymapImport` 1** (from 0.3.0): independently negotiated shortcut import providers reading only explicitly selected source snapshots. The SDK requires Java 8 or newer and has no runtime dependencies. JSON values are plain `Map`, `List`, `String`, `Long`, `Double`, `Boolean`, and `null` (see `Json`). -## Shortcut import providers (unreleased) +## Shortcut import providers -Declare `backend.keymapImportProvider(id, handler)` before listening. Its +Available from SDK 0.3.0. Declare `backend.keymapImportProvider(id, handler)` before listening. Its handler receives a `KeymapSnapshot` with `providerId()`, `snapshotId()`, `listInputs()` and `readChunk(fileId, offset, maximumBytes)`, plus the normal call context. Paths returned by `listInputs` are relative labels; reads use @@ -70,7 +70,9 @@ the same one the Node.js sample answers. Releases are published on [this repository's Releases page](https://github.com/Lithe-IDEA/lithe-plugin-docs/releases) and tagged `sdk-java-v`. Version 0.2.0 adds plugin-function protocols 2 -and 3. Version 0.1.0 was released from the Lithe +and 3. Version 0.3.0 adds shortcut import providers, native terminals, and typed +diagnostics through `litheLogging` 1, and removes the free-text `log` API. +Version 0.1.0 was released from the Lithe repository before the SDK moved here; its [release](https://github.com/1lck/Lithe-IDEA/releases/tag/sdk-java-v0.1.0) stays available. A release ships @@ -86,7 +88,9 @@ JAR it starts must hold everything it loads. ## Logging -The new SDK requires `experimental.litheLogging` version 1 at initialization. +From version 0.3.0, the SDK requires `experimental.litheLogging` version 1 +at initialization and refuses a host that does not offer it, so a backend +built on 0.3.0 or later starts only in a Lithe release that offers it. See [plugin logging](../../guides/plugin-logging.md) for the typed diagnostics API, host-owned catalog, exact levels, operation correlation and `${logDir}`. Use `diagnostics.degraded/recovered` (Rust: `diagnostics().degraded/recovered`) @@ -302,9 +306,9 @@ The two native workflow samples demonstrate independent producer and consumer backends in the Core end-to-end tests. Their engine is fictional; this does not migrate Maven, JDT, LLDB or existing plugin business logic. -## Native terminal API (unreleased) +## Native terminal API -The SDK includes wrappers for plugin-owned native terminal create/show/close, +From version 0.3.0, the SDK includes wrappers for plugin-owned native terminal create/show/close, reopen with bounded display history, disposal and exit subscriptions. These methods are discovered within protocol 3; they require a newer host and `terminal.create`, not a new protocol version. See diff --git a/sdk/java/examples/sample-build/pom.xml b/sdk/java/examples/sample-build/pom.xml index ad5a043..f9e7bb9 100644 --- a/sdk/java/examples/sample-build/pom.xml +++ b/sdk/java/examples/sample-build/pom.xml @@ -7,7 +7,7 @@ io.github.lithe-idea lithe-plugin-sdk-java-parent - 0.2.0 + 0.3.0 ../../pom.xml diff --git a/sdk/java/examples/sample-native-build/pom.xml b/sdk/java/examples/sample-native-build/pom.xml index 38f9e7c..d599197 100644 --- a/sdk/java/examples/sample-native-build/pom.xml +++ b/sdk/java/examples/sample-native-build/pom.xml @@ -7,7 +7,7 @@ io.github.lithe-idea lithe-plugin-sdk-java-parent - 0.2.0 + 0.3.0 ../../pom.xml diff --git a/sdk/java/plugin-sdk/pom.xml b/sdk/java/plugin-sdk/pom.xml index cd317b3..04d604d 100644 --- a/sdk/java/plugin-sdk/pom.xml +++ b/sdk/java/plugin-sdk/pom.xml @@ -7,7 +7,7 @@ io.github.lithe-idea lithe-plugin-sdk-java-parent - 0.2.0 + 0.3.0 lithe-plugin-sdk-java diff --git a/sdk/java/pom.xml b/sdk/java/pom.xml index c6c9767..34cd08b 100644 --- a/sdk/java/pom.xml +++ b/sdk/java/pom.xml @@ -11,7 +11,7 @@ io.github.lithe-idea lithe-plugin-sdk-java-parent - 0.2.0 + 0.3.0 pom diff --git a/sdk/node/README.md b/sdk/node/README.md index aad62f9..ce93464 100644 --- a/sdk/node/README.md +++ b/sdk/node/README.md @@ -19,16 +19,16 @@ on stdio and implements Lithe's backend protocols from - **`litheVcs` 1**: typed `lithe/vcs/*` requests, for a plugin's `vcsProviders` entry, from the [VCS provider contract](https://github.com/1lck/Lithe-IDEA/blob/preview/shared/contracts/vcs-provider-v1.md). -- **`litheKeymapImport` 1** (unreleased): independently negotiated shortcut +- **`litheKeymapImport` 1** (from 0.3.0): independently negotiated shortcut import providers reading only explicitly selected source snapshots. The SDK owns the wire format, negotiation, cancellation, process cleanup, and error mapping. Your code supplies only handlers. Node 20.3 or newer is required; declare it as the runtime's `minimumVersion`. -## Shortcut import providers (unreleased) +## Shortcut import providers -Declare `backend.keymapImportProvider(id, handler)` before listening. Its +Available from SDK 0.3.0. Declare `backend.keymapImportProvider(id, handler)` before listening. Its handler receives a snapshot with `providerID`, `snapshotID`, `listInputs()` and `readChunk(fileID, offset, maximumBytes)`, plus the normal call context. Paths returned by `listInputs` are relative labels; reads use opaque file IDs. @@ -115,7 +115,9 @@ real Core session. ## Getting the SDK Releases are published on [this repository's Releases page](https://github.com/Lithe-IDEA/lithe-plugin-docs/releases) and -tagged `sdk-node-v`. A release ships +tagged `sdk-node-v`. Version 0.3.0 adds shortcut import providers, native terminals, and typed +diagnostics through `litheLogging` 1, and removes the free-text `log` API. +A release ships `lithe-plugin-sdk-node-.tgz` and a `.sha256` file holding the archive's SHA-256. The SDK is not published to the npm registry. Use it like this: @@ -132,7 +134,9 @@ package. The SDK has no dependencies. ## Logging -The new SDK requires `experimental.litheLogging` version 1 at initialization. +From version 0.3.0, the SDK requires `experimental.litheLogging` version 1 +at initialization and refuses a host that does not offer it, so a backend +built on 0.3.0 or later starts only in a Lithe release that offers it. See [plugin logging](../../guides/plugin-logging.md) for the typed diagnostics API, host-owned catalog, exact levels, operation correlation and `${logDir}`. Use `diagnostics.degraded/recovered` (Rust: `diagnostics().degraded/recovered`) @@ -361,9 +365,9 @@ The two native workflow samples demonstrate independent producer and consumer backends in the Core end-to-end tests. Their engine is fictional; this does not migrate Maven, JDT, LLDB or existing plugin business logic. -## Native terminal API (unreleased) +## Native terminal API -The SDK includes wrappers for plugin-owned native terminal create/show/close, +From version 0.3.0, the SDK includes wrappers for plugin-owned native terminal create/show/close, reopen with bounded display history, disposal and exit subscriptions. These methods are discovered within protocol 3; they require a newer host and `terminal.create`, not a new protocol version. See diff --git a/sdk/node/package-lock.json b/sdk/node/package-lock.json index 59e037c..6ff00f0 100644 --- a/sdk/node/package-lock.json +++ b/sdk/node/package-lock.json @@ -1,12 +1,12 @@ { "name": "@lithe/plugin-sdk", - "version": "0.2.0", + "version": "0.3.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@lithe/plugin-sdk", - "version": "0.2.0", + "version": "0.3.0", "license": "Apache-2.0", "devDependencies": { "@types/node": "20.19.9", diff --git a/sdk/node/package.json b/sdk/node/package.json index 75a6a0a..add560d 100644 --- a/sdk/node/package.json +++ b/sdk/node/package.json @@ -1,6 +1,6 @@ { "name": "@lithe/plugin-sdk", - "version": "0.2.0", + "version": "0.3.0", "description": "Official SDK for Lithe plugin backends: plugin functions and build providers over the LSP base protocol.", "license": "Apache-2.0", "private": true, diff --git a/sdk/rust/Cargo.lock b/sdk/rust/Cargo.lock index dca7db9..6b10f06 100644 --- a/sdk/rust/Cargo.lock +++ b/sdk/rust/Cargo.lock @@ -16,7 +16,7 @@ checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" [[package]] name = "lithe-plugin-sdk" -version = "0.1.0" +version = "0.2.0" dependencies = [ "base64", "serde_json", @@ -48,7 +48,7 @@ dependencies = [ [[package]] name = "sample-backend" -version = "0.1.0" +version = "0.2.0" dependencies = [ "lithe-plugin-sdk", "serde_json", diff --git a/sdk/rust/Cargo.toml b/sdk/rust/Cargo.toml index cd09681..f737b1e 100644 --- a/sdk/rust/Cargo.toml +++ b/sdk/rust/Cargo.toml @@ -3,7 +3,7 @@ members = ["plugin-sdk", "examples/sample-backend"] resolver = "2" [workspace.package] -version = "0.1.0" +version = "0.2.0" edition = "2021" license = "Apache-2.0" # std::io::pipe, used by the tests. diff --git a/sdk/rust/README.md b/sdk/rust/README.md index 932e3ba..f1bb266 100644 --- a/sdk/rust/README.md +++ b/sdk/rust/README.md @@ -15,7 +15,7 @@ platform. It speaks the LSP base protocol on stdio and implements, from by the host in the platform's secret store (the Keychain on macOS), and from version 3 workspace contexts, files, documents, editors, preview, the browser, window messages, commands, and subscriptions. -- **`litheKeymapImport` 1** (unreleased): independently negotiated shortcut +- **`litheKeymapImport` 1** (from 0.2.0): independently negotiated shortcut import providers reading only explicitly selected source snapshots. The SDK owns the wire format, negotiation, cancellation, and error mapping. @@ -26,9 +26,9 @@ Build providers and VCS providers are not part of this SDK yet; write build providers with the [Node.js](../node/README.md) or [Java](../java/README.md) SDK, and VCS providers with the Node.js SDK. -## Shortcut import providers (unreleased) +## Shortcut import providers -Declare `keymap_import_provider(id, handler)` before listening. The host +Available from SDK 0.2.0. Declare `keymap_import_provider(id, handler)` before listening. The host negotiates IDs independently of plugin functions; a handler receives a `KeymapImportRequest` and a call-scoped `Context`. Use `request.list_inputs(context.host())` and `request.read_chunk(context.host(), @@ -88,7 +88,9 @@ the scenario in Releases are published on [this repository's Releases page](https://github.com/Lithe-IDEA/lithe-plugin-docs/releases) -and tagged `sdk-rust-v`. The SDK is not published to crates.io. +and tagged `sdk-rust-v`. Version 0.2.0 adds shortcut import providers, native terminals, and typed +diagnostics through `litheLogging` 1, and removes the free-text `log` API. +The SDK is not published to crates.io. Either way below fetches it at build time, never at runtime, and pins its exact contents: @@ -97,7 +99,7 @@ exact contents: ```toml [dependencies] - lithe-plugin-sdk = { git = "https://github.com/Lithe-IDEA/lithe-plugin-docs", tag = "sdk-rust-v0.1.0" } + lithe-plugin-sdk = { git = "https://github.com/Lithe-IDEA/lithe-plugin-docs", tag = "sdk-rust-v0.2.0" } ``` - **Vendored archive.** A release ships `lithe-plugin-sdk-rust-.crate` @@ -107,7 +109,9 @@ exact contents: ## Logging -The new SDK requires `experimental.litheLogging` version 1 at initialization. +From version 0.2.0, the SDK requires `experimental.litheLogging` version 1 +at initialization and refuses a host that does not offer it, so a backend +built on 0.2.0 or later starts only in a Lithe release that offers it. See [plugin logging](../../guides/plugin-logging.md) for the typed diagnostics API, host-owned catalog, exact levels, operation correlation and `${logDir}`. Use `diagnostics.degraded/recovered` (Rust: `diagnostics().degraded/recovered`) @@ -312,9 +316,9 @@ host; `tests/host_services.rs` checks the host services against the contract's fixture. The end-to-end check builds the sample, installs it as a package, and runs it through a real Core session. -## Native terminal API (unreleased) +## Native terminal API -The SDK includes wrappers for plugin-owned native terminal create/show/close, +From version 0.2.0, the SDK includes wrappers for plugin-owned native terminal create/show/close, reopen with bounded display history, disposal and exit subscriptions. These methods are discovered within protocol 3; they require a newer host and `terminal.create`, not a new protocol version. See