Files
opencode-greenpt-usage/package.json
Stéphan Sainléger dadc93a22d chg: [opencode-greenpt-usage] port the TUI plugin to OpenCode 2
V1 TUI modules no longer load: replace ``{ id, tui }`` with
``Plugin.define({ id, setup })``, register the section on
``sidebar.content``, and expose commands through ``context.keymap.layer``.

Move balance, clock and usage state onto ``context.storage.store/memory``
so host subscribers rerender; plugin-created signals stayed stale in the
V2 renderer. Read V2 assistant messages (``type``,
``model.providerID``/``model.id``) and subscribe through ``context.data``.

Configure the package directory in ``cli.json`` instead of the source
file; document the V2 install. Typecheck, 49 unit tests and the live
GreenPT integration test pass, and the sidebar renders the balance.
2026-11-18 23:01:40 +01:00

45 lines
1.0 KiB
JSON

{
"name": "opencode-greenpt-usage",
"version": "0.1.0",
"description": "OpenCode 2 TUI plugin that shows the remaining GreenPT API credit balance in the sidebar.",
"type": "module",
"license": "AGPL-3.0-or-later",
"keywords": [
"opencode",
"opencode-plugin",
"tui",
"greenpt",
"credits",
"balance"
],
"engines": {
"opencode": ">=2.0.0"
},
"exports": {
".": "./src/index.tsx",
"./tui": "./src/index.tsx"
},
"scripts": {
"test": "vitest run",
"test:integration": "GREENPT_INTEGRATION=1 vitest run test/integration.greenpt.test.ts",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@opencode/plugin": "^2.0.32"
},
"peerDependencies": {
"@opentui/core": ">=0.6.6",
"@opentui/solid": ">=0.6.6",
"solid-js": ">=1.9.0"
},
"devDependencies": {
"@opencode/plugin": "^2.0.32",
"@opentui/core": "^0.6.6",
"@opentui/solid": "^0.6.6",
"@types/node": "^24.0.0",
"solid-js": "^1.9.0",
"typescript": "^5.6.0",
"vitest": "^3.0.0"
}
}