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
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,24 @@ The next SDK version is **2.0.0**, on the same opencode **2.3.0** pin already re
- `OpenCodeServer.FindIncumbentAsync` reports whether the registered background service that answers at a given URL is ready, starting or stopping, or failed (`OpenCodeServerIncumbent`, `OpenCodeServerState`), as opencode's `serve --service` checks, before it binds, whether a compatible service already owns its address; it answers null when no compatible registered service answers there.
- `RpcDefinition` declares a plugin's RPC definition once, with `Method` (`RpcMethod<TInput, TOutput>`) and `Event` (`RpcEventDefinition<TData>`) descriptors that carry your source-generated JSON metadata, so it works under native AOT and on every target. `client.Rpc.CallAsync(method, input)` calls a method with typed input and output, as opencode's own client binds a definition, and a failure the RPC registry or the plugin reports throws `OpenCodeRpcException` with its `ErrorType`, its message and its data. It derives from `OpenCodeApiException`, which is no longer sealed, so an existing `catch (OpenCodeApiException)` still catches it.
- `client.Events.SubscribeAsync(rpcEvent)` yields one RPC definition's events as `RpcEventPayload<TData>`, the shared `EventRpc` and its data read with your metadata, as opencode's own client subscribes to a definition's events. It selects nothing at the feed and keeps only its own events, so queued unrelated events count against its 4,096-event queue, and an event whose data does not match your type throws `OpenCodeTransportException`.
- `OpenCodeServiceConfiguration` adds typed administration of the background service's config,
matching the CLI's `service get`, `set`, and `unset` surface. `ReadAsync` returns an
`OpenCodeServiceConfig` without the password or remote route and migrates or repairs legacy
config as the CLI's read does. `GetOrCreatePasswordAsync` returns a stored password or creates
and stores one when it is absent or empty. Setters change the hostname, port, password, CORS
origins, environment entries and disabled flag; `UnsetAsync(OpenCodeServiceSetting)` and
`UnsetEnvironmentVariableAsync` remove settings, and `DisableRemoteAsync` turns remote access
off. Sets and unsets stop the registered service first except `SetDisabledAsync(false)` and
unsetting Disabled; nothing restarts it. `OpenCodeServiceConfigOptions` selects the channel and
installed-version comparand. `ReadAsync`, `GetOrCreatePasswordAsync`, and the set and unset
operations refuse a config or donor the CLI may read but the SDK's JSON reader rejects, rather
than returning empty settings or erasing them.
- `OpenCodeServiceConfiguration.EnableRemoteAsync` turns remote access on through the installed
`opencode service set remote true`, using the `CliCommand` and `Environment` members of
`OpenCodeServiceConfigOptions`. Only `EnableRemoteAsync` reads those two members. After CLI
success, the SDK reads and returns the selected config's secret route through the shared
migrating and repairing read. The SDK does not check that the command, channel and environment
agree. Cancellation after CLI success can leave remote access enabled.

### 🔧 Changes

Expand All @@ -48,6 +66,10 @@ The next SDK version is **2.0.0**, on the same opencode **2.3.0** pin already re
### 🐛 Fixes

- `client.Rpc.CallAsync` runs until the plugin's method returns, as opencode's own client does: it no longer takes the client-wide `NetworkTimeout` (100 s by default). A per-call `NetworkTimeout` still bounds it, and the cancellation token is its deadline.
- Legacy service-config and registration migration now write the decoded UTF-8 text opencode's
CLI writes: one leading byte-order mark is dropped and invalid sequences become U+FFFD. A donor
whose decoded text still begins with U+FEFF is not migrated. Before: donor bytes were copied
unchanged.

### 📚 Documentation

Expand Down
7 changes: 7 additions & 0 deletions GLOSSARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,13 @@ _Avoid_: guarded server handle, shared handle (draft names for the same thing)
The CLI's compiled release identity that selects the registration and service-config filenames and
the legacy-migration rules. The SDK has none compiled in: a caller may name one.

**SDK-managed write**:
A service-configuration operation that assigns or removes a setting through the SDK:
`OpenCodeServiceConfiguration.GetOrCreatePasswordAsync`, `SetDisabledAsync`, `SetHostnameAsync`,
`SetPortAsync`, `SetPasswordAsync`, `SetCorsOriginsAsync`, `SetEnvironmentVariableAsync`,
`DisableRemoteAsync`, `UnsetAsync`, or `UnsetEnvironmentVariableAsync`. The term excludes
`ReadAsync` and `EnableRemoteAsync`, even though their config reads can migrate or repair a file.

#### Snapshot and refresh

**Protocol surface**:
Expand Down
15 changes: 9 additions & 6 deletions docs/ROADMAP.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Roadmap

Date: 2026-11-15
Date: 2026-11-17

Operational state: what ships today, what is queued next, what is still open, and what is known to
be incomplete. This file is a summary and shrinks as work lands. `../AGENTS.md` routes to the
Expand Down Expand Up @@ -171,11 +171,14 @@ These do not block `1.0.0` and run beside the road.
carriers stay the representation; existing types are never retrofitted (ADR-0036).
- A Hosting package, if a concrete consumer — the MCP server or a first external host — needs
host-owned process lifecycle.
- Research: turning the service's remote access on and off from .NET. Upstream exposes it only
through the CLI (`opencode service set remote`, `opencode pair --remote`) over an OpenTunnel
route, not through its client library or the HTTP API; the SDK reads the setting and surfaces
the remote URL in `ServerInfo.Urls`, and would have to author CLI config contents for the first
time, where today it only copies a config verbatim when it migrates one.
- Research: remote access beyond service configuration. `OpenCodeServiceConfiguration`
([#213](https://github.com/opencode-dotnet/opencode-sdk-dotnet/issues/213)) reads and changes the
background service's config through typed `service get`, `set`, and `unset` operations.
Sets and unsets stop the service except turning the disabled flag off or unsetting it.
`DisableRemoteAsync` turns remote access off; `EnableRemoteAsync` runs the installed
`opencode service set remote true` for OpenTunnel setup, then reads and returns the selected
config's route. The SDK does not yet offer remote-address pairing (`opencode pair --remote`) or
tunnel setup without an installed CLI; the latter would need an OpenTunnel client integration.

## Open Questions

Expand Down
Loading
Loading