@leo000001/opencode-quota-sidebar 2.0.23 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/types.d.ts CHANGED
@@ -109,6 +109,12 @@ export type CachedSessionUsage = {
109
109
  recentProviders?: RecentProviderEvent[];
110
110
  providers: Record<string, CachedProviderUsage>;
111
111
  };
112
+ export type SidebarPanelState = {
113
+ version: 1;
114
+ updatedAt: number;
115
+ usage?: CachedSessionUsage;
116
+ quotas?: QuotaSnapshot[];
117
+ };
112
118
  /** Tracks incremental aggregation cursor for a session (P1). */
113
119
  export type IncrementalCursor = {
114
120
  /** ID of the last processed assistant message. */
@@ -129,6 +135,8 @@ export type SessionState = SessionTitleState & {
129
135
  dirty?: boolean;
130
136
  /** Incremental aggregation cursor (P1). */
131
137
  cursor?: IncrementalCursor;
138
+ /** Cached TUI sidebar panel payload for the session. */
139
+ sidebarPanel?: SidebarPanelState;
132
140
  };
133
141
  export type SessionDayChunk = {
134
142
  version: 1;
@@ -150,8 +158,8 @@ export type QuotaSidebarConfig = {
150
158
  enabled: boolean;
151
159
  width: number;
152
160
  /**
153
- * `auto`: compact by default, but keep the actively selected TUI session
154
- * multiline when the plugin can positively identify it.
161
+ * `auto`: keep the shared session title compact and let the dedicated TUI
162
+ * sidebar plugin render the rich panel layout.
155
163
  */
156
164
  titleMode?: SidebarTitleMode;
157
165
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@leo000001/opencode-quota-sidebar",
3
- "version": "2.0.23",
4
- "description": "OpenCode plugin that shows quota and token usage in session titles",
3
+ "version": "3.0.0",
4
+ "description": "OpenCode plugin that shows quota and token usage in TUI sidebar panels and compact session titles",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -9,10 +9,19 @@
9
9
  ".": {
10
10
  "types": "./dist/index.d.ts",
11
11
  "default": "./dist/index.js"
12
+ },
13
+ "./tui": {
14
+ "types": "./dist/tui.d.ts",
15
+ "default": "./dist/tui.tsx"
12
16
  }
13
17
  },
18
+ "oc-plugin": [
19
+ "server",
20
+ "tui"
21
+ ],
14
22
  "files": [
15
23
  "dist/*.js",
24
+ "dist/tui.tsx",
16
25
  "dist/*.d.ts",
17
26
  "dist/providers/**/*.js",
18
27
  "dist/providers/**/*.d.ts",
@@ -25,7 +34,7 @@
25
34
  ],
26
35
  "scripts": {
27
36
  "clean": "node -e \"const fs=require('fs'); fs.rmSync('dist',{recursive:true,force:true}); fs.rmSync('tsconfig.tsbuildinfo',{force:true});\"",
28
- "build": "npm run clean && tsc -p tsconfig.json",
37
+ "build": "npm run clean && tsc -p tsconfig.json && node ./scripts/prepare-tui-dist.mjs",
29
38
  "prepare": "npm run build",
30
39
  "prepack": "npm run build",
31
40
  "prepublishOnly": "npm run typecheck && npm run build && npm test",
@@ -56,12 +65,17 @@
56
65
  "node": ">=18"
57
66
  },
58
67
  "peerDependencies": {
59
- "@opencode-ai/plugin": "^1.2.10",
60
- "@opencode-ai/sdk": "^1.2.10"
68
+ "@opencode-ai/plugin": "^1.3.5",
69
+ "@opencode-ai/sdk": "^1.3.5"
70
+ },
71
+ "dependencies": {
72
+ "@opentui/core": "^0.1.92",
73
+ "@opentui/solid": "^0.1.92",
74
+ "solid-js": "^1.9.10"
61
75
  },
62
76
  "devDependencies": {
63
- "@opencode-ai/plugin": "^1.2.10",
64
- "@opencode-ai/sdk": "^1.2.10",
77
+ "@opencode-ai/plugin": "^1.3.5",
78
+ "@opencode-ai/sdk": "^1.3.5",
65
79
  "@types/node": "^22.13.10",
66
80
  "typescript": "^5.8.2"
67
81
  }