Skip to content

Commit b156aba

Browse files
committed
fix(tui): restore dedicated tui entrypoint
1 parent 08d8812 commit b156aba

4 files changed

Lines changed: 40 additions & 14 deletions

File tree

index.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@ import { configureClientAuth, isSecureMode } from "./lib/auth"
2020

2121
const id = "opencode-dynamic-context-pruning"
2222

23-
let tuiPlugin: Record<string, unknown> = {}
24-
try {
25-
tuiPlugin = (await import("./tui/index")).default
26-
} catch {}
27-
2823
const server: Plugin = (async (ctx) => {
2924
const config = getConfig(ctx)
3025

@@ -142,5 +137,4 @@ const server: Plugin = (async (ctx) => {
142137
export default {
143138
id,
144139
server,
145-
...tuiPlugin,
146140
}

package-lock.json

Lines changed: 15 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@
66
"description": "OpenCode plugin that optimizes token usage by pruning obsolete tool outputs from conversation context",
77
"main": "./dist/index.js",
88
"types": "./dist/index.d.ts",
9+
"exports": {
10+
".": {
11+
"types": "./dist/index.d.ts",
12+
"import": "./dist/index.js"
13+
},
14+
"./tui": {
15+
"types": "./dist/tui/index.d.ts",
16+
"import": "./dist/tui/index.js"
17+
}
18+
},
919
"scripts": {
1020
"clean": "rm -rf dist",
1121
"build": "npm run clean && tsc",
@@ -40,7 +50,19 @@
4050
"peerDependencies": {
4151
"@opencode-ai/plugin": ">=1.2.0",
4252
"@opentui/core": ">=0.1.87",
43-
"@opentui/solid": ">=0.0.0-20260307"
53+
"@opentui/solid": ">=0.0.0-20260307",
54+
"solid-js": ">=1.9.9 <2"
55+
},
56+
"peerDependenciesMeta": {
57+
"@opentui/core": {
58+
"optional": true
59+
},
60+
"@opentui/solid": {
61+
"optional": true
62+
},
63+
"solid-js": {
64+
"optional": true
65+
}
4466
},
4567
"dependencies": {
4668
"@anthropic-ai/tokenizer": "^0.0.4",
@@ -55,6 +77,7 @@
5577
"@opentui/solid": "0.0.0-20260307-536c401b",
5678
"@types/node": "^25.5.0",
5779
"prettier": "^3.8.1",
80+
"solid-js": "1.9.9",
5881
"tsx": "^4.21.0",
5982
"typescript": "^6.0.2"
6083
},

tui/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { createSummaryRoute } from "./routes/summary"
77
import { NAMES } from "./shared/names"
88

99
const tui: TuiPlugin = async (api) => {
10-
const config = getConfigForDirectory(process.cwd(), (title, message) => {
10+
const config = getConfigForDirectory(api.state.path.directory, (title, message) => {
1111
api.ui.toast({
1212
title,
1313
message,

0 commit comments

Comments
 (0)