fix: load the claims plugin without the @opencode/plugin import (#17)
fix: load the claims plugin without the @opencode/plugin import (#17) Co-authored-by: David Gwilliam <dhgwilliam@gmail.com> Co-committed-by: David Gwilliam <dhgwilliam@gmail.com>
This commit was merged in pull request #17.
This commit is contained in:
@@ -28,6 +28,21 @@ is appended as a system part for that request.
|
||||
All classification lives in the Go binary, so the plugin cannot drift from the
|
||||
tested implementation.
|
||||
|
||||
## Why there is no `@opencode/plugin` import
|
||||
|
||||
The docs show `import { Plugin } from "@opencode/plugin"`, but a local plugin
|
||||
loaded by path cannot resolve that bare specifier. Verified by experiment:
|
||||
|
||||
| File | Imports | Result |
|
||||
|---|---|---|
|
||||
| `index.js` | none | active |
|
||||
| `index.ts` | none | active |
|
||||
| `index.ts` | `@opencode/plugin` | failed to load |
|
||||
| `index.ts` | `@opencode-ai/plugin` | failed to load |
|
||||
|
||||
`Plugin.define` is an identity function in the runtime, so exporting the
|
||||
definition object directly is exactly equivalent. Only `node:` builtins resolve.
|
||||
|
||||
## Enable
|
||||
|
||||
```jsonc
|
||||
|
||||
Reference in New Issue
Block a user