Installing @opencode-ai/plugin@^0.9.11 cannot import the tool helper reliably.
import { tool } from "@opencode-ai/plugin" may raise TS2305, and import { tool } from "@opencode-ai/plugin/tool" may raise TS2307, depending on the TS resolver.
This blocks defining custom tools in .opencode/tool/*.ts.
Impact
Custom tools fail to typecheck/compile in external repos.
Friction adopting Opencode plugin tooling.
Reproduction
- Fresh repo
- bun add @opencode-ai/plugin@^0.9.11
- Create .opencode/tool/foo.ts:
import { tool } from "@opencode-ai/plugin/"
Proposed fix (repo: packages/plugin)
Update packages/plugin/package.json:
{
"name": "@opencode-ai/plugin",
"version": "0.9.12",
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"default": "./dist/index.js"
},
"./tool": {
"types": "./dist/tool.d.ts",
"import": "./dist/tool.js",
"default": "./dist/tool.js"
}
},
"files": ["dist"],
"scripts": {
"build": "tsc -p tsconfig.json",
"prepublishOnly": "bun run build"
}
}
Installing @opencode-ai/plugin@^0.9.11 cannot import the tool helper reliably.
import { tool } from "@opencode-ai/plugin" may raise TS2305, and import { tool } from "@opencode-ai/plugin/tool" may raise TS2307, depending on the TS resolver.
This blocks defining custom tools in .opencode/tool/*.ts.
Impact
Custom tools fail to typecheck/compile in external repos.
Friction adopting Opencode plugin tooling.
Reproduction
import { tool } from "@opencode-ai/plugin/"Proposed fix (repo: packages/plugin)
Update packages/plugin/package.json: