mirror of
https://github.com/anomalyco/opencode.git
synced 2026-08-29 07:32:17 +00:00
fix(tui): resolve plugin SDK imports at runtime (#44822)
This commit is contained in:
parent
a9042a58ab
commit
2e4b2c82f4
3 changed files with 12 additions and 1 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue