- 使用 import { Plugin } from "@opencode/plugin/tui"
- 使用 Plugin.define({ id, setup(context) }) 格式
- api.* 调用全部替换为 context.*: api.event.on → context.data.on, api.ui.toast → context.ui.toast.show, api.ui.dialog.* → context.ui.dialog.*, api.command.register + api.keymap.registerLayer 合并为 context.keymap.layer({commands, bindings})
- package.json exports 添加 ./tui 入口点,engines.opencode 升级为 >=2.0.0
- 已通过 minimal-v2-test 验证 v2 格式可正确加载
27 lines
505 B
JSON
27 lines
505 B
JSON
{
|
|
"name": "oc-session-all",
|
|
"version": "2.1.0",
|
|
"description": "OpenCode v2 TUI plugin: browse and switch to any session across all projects",
|
|
"main": "tui.js",
|
|
"type": "module",
|
|
"exports": {
|
|
".": "./tui.js",
|
|
"./tui": "./tui.js"
|
|
},
|
|
"scripts": {
|
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
},
|
|
"keywords": [
|
|
"opencode",
|
|
"tui",
|
|
"plugin",
|
|
"session",
|
|
"picker"
|
|
],
|
|
"author": "",
|
|
"license": "MIT",
|
|
"engines": {
|
|
"opencode": ">=2.0.0"
|
|
}
|
|
}
|