fix(tui): resolve plugin SDK imports at runtime (#44822)
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
import { Plugin, PluginContextProvider, usePlugin } from "@opencode-ai/plugin/tui"
|
||||
import { ensureRuntimePluginSupport } from "@opentui/solid/runtime-plugin-support/configure"
|
||||
|
||||
ensureRuntimePluginSupport()
|
||||
ensureRuntimePluginSupport({
|
||||
additional: {
|
||||
"@opencode-ai/plugin/tui": { Plugin, PluginContextProvider, usePlugin },
|
||||
},
|
||||
})
|
||||
|
||||
@@ -15,6 +15,9 @@ export default Plugin.define({
|
||||
})
|
||||
```
|
||||
|
||||
Import `@opencode-ai/plugin/tui` directly. OpenCode resolves this import at runtime, so local CLI plugins do not need an
|
||||
absolute path to an OpenCode checkout.
|
||||
|
||||
## Context
|
||||
|
||||
`setup` receives configuration, app metadata, the current location, the OpenCode client, cached data, theme tokens, the
|
||||
|
||||
@@ -54,3 +54,6 @@ OpenCode also discovers JavaScript and TypeScript plugins from `plugins/tui` und
|
||||
<global-config>/plugins/tui/status.ts
|
||||
<project>/.opencode/plugins/tui/status.ts
|
||||
```
|
||||
|
||||
Discovered plugins can import `@opencode-ai/plugin/tui` directly; OpenCode resolves the package at runtime. See
|
||||
[Building CLI plugins](/build/plugins/cli) for examples.
|
||||
|
||||
Reference in New Issue
Block a user