Repository navigation
feat(plugins): zero-build TS/ESM plugins, strict UI props, and live heap telemetry - #2283
Merged
Merged
Conversation
…props, heap telemetry)
Bump all 21 anomalyco/rune workspace pins to 3845da27466cc649437e1543cb51b8ec115df99c
(Track A: zero-build .ts + ESM, AbortController/AbortSignal/task.signal, rich 5-line
source-snippet error cards, ScriptOptions::strict_props) and adopt the new DX across
opencode-plugin-runtime, opencode-plugin-spec, opencode-desktop, and built-in plugins:
- Enable zero-build .ts + ESM external plugins in opencode-plugin-runtime (sources.rs &
hot.rs): include .ts (skipping .d.ts) in kept() and script_sources(), and fall back
from default init.js to init.ts when init.js is absent.
- Enable ScriptOptions::strict_props in desktop plugin VMs for debug builds, --plugin-hot,
and all non-bundled plugins so UI prop typos fail loudly even in release builds.
- Migrate all 48 require("@self/...") calls across built-in plugins to relative "./..."
and strip all 164 redundant view.Handler/v.Handler wrappers while keeping view.Handler
in runtime and .d.ts for backwards compatibility.
- Upgrade opencode-plugin-spec TS codegen and regenerate all 15 contract artifacts:
add AbortController, AbortSignal, and task.signal globals, export UI prop/type aliases
(BoxProps, TextProps, RichItem, RichSegment, Point, Event, Size, Color, Handler, etc.)
directly on declare module "@opencode/ui" and "@rune/ui", and include .ts globs in
plugins/tsconfig.json.
- Surface live per-plugin heap usage (KB / MB) on Settings > Extensions > Plugins cards.
- Clean up PR #2262 review leftovers in aux_windows/dispatch.rs (restore window_id from
nearest active frame on WrapEvent::Exit), opencode-plugin-runtime/src/js.rs (verify
ctx.is_fn in async_method and update JsArgs doc comment), and extra blank lines in
services/mod.rs and native/mod.rs.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
- Scope ScriptOptions::strict_props to debug builds, --plugin-hot, and Tier::Dev so installed User/Override plugins preserve Compat::NewerMinor forward compatibility in release builds. - Skip unused .ts files in script_sources() when the resolved plugin entry is .js. - Match both .js: and .ts: (earliest occurrence) in opencode-plugin-runtime console::location() for clickable Debug console source links. - Include app-half VM heap memory alongside window-half memory in Plugin::memory_bytes() for Settings > Extensions > Plugins telemetry. - Align WrapState::active_target() with WrapEvent::Exit (nearest active frame) and accept .ts (excluding .d.ts) in desktop build.rs and runtime/sources.rs.
This was referenced Dec 3, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adopts
anomalyco/rune3845da27466cc649437e1543cb51b8ec115df99c(PR#3373) across all 21 workspace pins and ships Track B plugin author DX improvements acrossopencode-plugin-runtime,opencode-plugin-spec,opencode-desktop, and the 17 built-in plugins.Changes
Cargo.toml,Cargo.lock): Updated all 21anomalyco/runedependency and patch pins to3845da27466cc649437e1543cb51b8ec115df99c..ts+ ESM external plugins (crates/opencode-plugin-runtime/src/sources.rs,hot.rs): Accepted.tsmodules (excluding.d.ts) inkept(),script_sources(), and hot-reload watching, with automatic default entry fallback frominit.jstoinit.tswheninit.jsis absent. Built-inplugins/*.jsremain CommonJS.apps/desktop/src/plugin_host/runtime/vm.rs): EnabledScriptOptions::strict_props(cfg!(debug_assertions) || flag("--plugin-hot") || tier != Tier::Bundled)so external and dev plugins surface UI prop typos immediately even on release builds.plugins/): Migrated all 48require("@self/...")calls to relativerequire("./...")and removed all 164 redundantview.Handler(...)/v.Handler(...)wrappers (keepingview.Handlerintact in the runtime and.d.tsfor backwards compatibility).crates/opencode-plugin-spec/src/codegen/ts.rs,plugins/opencode.d.ts,plugins/types/ui.d.ts,plugins/tsconfig.json): AddedAbortController,AbortSignal, andtask.signal: AbortSignal, exported UI type aliases (BoxProps,TextProps,RichItem,RichSegment,Point,Event,Size,Color,Handler, etc.) directly ondeclare module "@opencode/ui"and"@rune/ui", included.tsglobs inplugins/tsconfig.json, and regenerated all 15 spec artifacts.apps/desktop/src/plugin_host/mod.rs,apps/desktop/src/plugin_host/ui/view.rs): Appended live VM heap usage (· 185 KB/· 1.2 MB) to the Settings › Extensions › Plugins metadata line when running.#2262review follow-ups:apps/desktop/src/plugin_host/aux_windows/dispatch.rs: Restorewindow_idonWrapEvent::Exitfrom the nearest active frame (frames.iter().rev().find_map(Option::as_ref)).crates/opencode-plugin-runtime/src/js.rs: Validatectx.is_fn(func)inasync_methodand refresh theJsArgsdoc comment.apps/desktop/src/plugin_host/services/mod.rs&native/mod.rs: Remove extra blank lines.Verification
cargo clippy -p opencode-plugin-runtime --no-deps -- -D warnings: pass (0 warnings)cargo check -p opencode-desktop: pass (0 errors)cargo check -p opencode-web --target wasm32-unknown-unknown: pass (0 errors)bun scripts/web-clock.ts: pass (1214 files, 50 crates)pwsh scripts/guardrails.ps1: 11/11 pass (arch-check,file-size,folder-shape,dialog-size,tables-check15/15,plugin-props981 calls / 0 unknown,external-open,net-trust,engine-revision,office-engine-revision,cursor-allow)tsc -p plugins/tsconfig.json --noEmit+ strict TS probe (import("@opencode/ui").BoxProps,AbortController,AbortSignal,task.signal): exit 0Bun.Transpilerparse check across all 80plugins/**/*.jsfiles: passLive Headless Proofs (
opencode-desktop)On, 0 errors, liveKBheap badges):.ts+ ESM plugin (init.ts+helper.ts, noentryfield inplugin.toml,AbortController,task.signal,ctx.services,ui.rich):.tsruntime error card (init.ts:21:131:1 line mapping + 5-line snippet + caret + Reload / Copy stack) &strict_props(true)unknown prop rejection (init.ts:11:14):