oc-go-usage-display 1.1.0 → 2.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.
Files changed (42) hide show
  1. package/README.md +245 -93
  2. package/bin/lib.js +395 -37
  3. package/bin/oc-go-usage-display-init.js +42 -13
  4. package/bin/oc-go-usage-display-remove.js +22 -17
  5. package/bin/oc-go-usage-display-show.js +47 -39
  6. package/bin/oc-go-usage-display-status.js +31 -52
  7. package/bin/oc-go-usage-display-update.js +27 -14
  8. package/dist/helpers.d.ts +116 -0
  9. package/dist/helpers.d.ts.map +1 -0
  10. package/dist/helpers.js +568 -0
  11. package/dist/helpers.js.map +1 -0
  12. package/dist/index.d.ts +5 -13
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.js +249 -159
  15. package/dist/index.js.map +1 -1
  16. package/dist/plugins/oc-go-usage-display.kilo.ts +678 -0
  17. package/dist/plugins/oc-go-usage-display.kilo.tsx +1272 -0
  18. package/dist/plugins/oc-go-usage-display.ts +678 -0
  19. package/dist/plugins/oc-go-usage-display.tsx +1018 -0
  20. package/dist/shared.d.ts +75 -7
  21. package/dist/shared.d.ts.map +1 -1
  22. package/dist/shared.js +448 -25
  23. package/dist/shared.js.map +1 -1
  24. package/dist/tui-shared.d.ts +109 -0
  25. package/dist/tui-shared.d.ts.map +1 -0
  26. package/dist/tui-shared.js +372 -0
  27. package/dist/tui-shared.js.map +1 -0
  28. package/dist/tui.d.ts +0 -17
  29. package/dist/tui.d.ts.map +1 -1
  30. package/dist/tui.js +229 -282
  31. package/dist/tui.js.map +1 -1
  32. package/dist/tui.kilo.d.ts +8 -0
  33. package/dist/tui.kilo.d.ts.map +1 -0
  34. package/dist/tui.kilo.js +502 -0
  35. package/dist/tui.kilo.js.map +1 -0
  36. package/package.json +46 -14
  37. package/src/helpers.ts +733 -0
  38. package/src/index.ts +316 -175
  39. package/src/shared.ts +545 -28
  40. package/src/tui-shared.tsx +705 -0
  41. package/src/tui.kilo.tsx +816 -0
  42. package/src/tui.tsx +352 -366
package/dist/tui.js CHANGED
@@ -1,321 +1,268 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "@opentui/solid/jsx-runtime";
2
- import { For, Show, createEffect, createSignal } from "solid-js";
3
- import { extractSnapshotFromApiPayload, formatResetDuration, isRecord, mockSnapshot, readAuthJsonApiKey, toNonEmptyString, unavailableSnapshot, } from "./shared.js";
4
- // Re-exported so `dist/tui.js` keeps the helper surface used by tests.
5
- export { formatResetDuration };
6
- // ---------------------------------------------------------------------------
7
- // Constants
8
- // ---------------------------------------------------------------------------
9
- const API_USAGE_URL = "https://opencode.ai/zen/go/v1/usage";
10
- const POLL_INTERVAL_MS = 60_000;
11
- const FETCH_TIMEOUT_MS = 10_000;
2
+ import { For, Show, createMemo, createSignal } from "solid-js";
3
+ import { buildGoModelFooters, buildModelMixSummary, relevantReset, formatPercentCell, meterSeverityForPercent, modelDisplayName, shortModelName, weightGoModels, } from "./helpers.js";
4
+ import { aggregateModelUsageFromMessages, errorMessage, MODELS_EMPTY_LABEL, OPENCODE_MODEL_NAME_MAX_CHARS, TOP_GO_MODELS_LABEL, } from "./shared.js";
5
+ import { CollapsibleSection, GoStatusline, GoUsageBlock, MeterBar, createCollapseState, createUsageStore, isGoUsageProvider, logUsageError, makeProviderResolver, readModelDisplayName, reactiveChild, resolveSurfaceSelection, } from "./tui-shared.js";
6
+ import { EVENT_TTL_MS, POLL_INTERVAL_MS } from "./tui-shared.js";
7
+ // This entry is the opencode build, so it resolves `OPENCODE_OC_GO_*` and never
8
+ // reads a Kilo-prefixed name.
9
+ const HOST = "opencode";
12
10
  const SLOT_ORDER = 50;
13
- const KV_DISPLAY_KEY = "display";
14
- const KV_COLLAPSED_SIDEBAR_KEY = "collapsed_sidebar";
15
- const KV_COLLAPSED_STATUSLINE_KEY = "collapsed_statusline";
16
- const KV_COLLAPSED_LEGACY_KEY = "collapsed";
17
- const LOG_SERVICE = "oc-go-usage-display";
18
- // ---------------------------------------------------------------------------
19
- // Small pure helpers
20
- // ---------------------------------------------------------------------------
21
- function isDisplayMode(value) {
22
- return value === "sidebar" || value === "statusline" || value === "both";
23
- }
24
- export function surfaceSelectionFromDisplayMode(mode) {
25
- return { sidebar: mode !== "statusline", statusline: mode !== "sidebar" };
26
- }
27
- export function parseBooleanFlag(value) {
28
- if (typeof value === "boolean")
29
- return value;
30
- if (typeof value === "number") {
31
- if (value === 1)
32
- return true;
33
- if (value === 0)
34
- return false;
35
- return null;
11
+ // The factory body lives here so the exported `goUsageTui` can wrap the whole
12
+ // initialization in a single fail-safe boundary. A throwing factory would
13
+ // destabilize the host's plugin load, so it must never reject.
14
+ async function initializeTui(api, options) {
15
+ const surfaces = resolveSurfaceSelection(options, api, HOST);
16
+ const usageStore = createUsageStore(api, HOST);
17
+ const collapse = createCollapseState(api);
18
+ const [activeProviderId, setActiveProviderId] = createSignal(undefined);
19
+ try {
20
+ const modelString = api.state?.config?.model;
21
+ if (typeof modelString === "string" && modelString.length > 0) {
22
+ const providerPart = modelString.split("/")[0];
23
+ if (providerPart !== undefined && providerPart.length > 0)
24
+ setActiveProviderId(providerPart);
25
+ }
36
26
  }
37
- if (typeof value !== "string")
38
- return null;
39
- const normalized = value.trim().toLowerCase();
40
- if (normalized === "1" || normalized === "true")
41
- return true;
42
- if (normalized === "0" || normalized === "false")
43
- return false;
44
- return null;
45
- }
46
- export function isSnapshotEmpty(snapshot) {
47
- return snapshot.rolling === null && snapshot.weekly === null && snapshot.monthly === null;
48
- }
49
- export function formatCompactLine(snapshot) {
50
- const rolling = snapshot.rolling === null ? "5h n/a" : `5h ${snapshot.rolling.percent}%`;
51
- const weekly = snapshot.weekly === null ? "7d n/a" : `7d ${snapshot.weekly.percent}%`;
52
- const monthly = snapshot.monthly === null ? "30d n/a" : `30d ${snapshot.monthly.percent}%`;
53
- return `Go ${rolling} | ${weekly} | ${monthly}`;
54
- }
55
- export function buildUsageRows(snapshot) {
56
- const rows = [];
57
- if (snapshot.rolling !== null) {
58
- const reset = formatResetDuration(snapshot.rolling.resetInSec) ?? snapshot.rolling.resetText;
59
- rows.push({ label: "5h", value: `${snapshot.rolling.percent}%${reset ? ` · resets ${reset}` : ""}` });
27
+ catch {
28
+ // State may not be ready; fall through to the event signal.
60
29
  }
61
- if (snapshot.weekly !== null)
62
- rows.push({ label: "7d", value: `${snapshot.weekly.percent}%` });
63
- if (snapshot.monthly !== null)
64
- rows.push({ label: "30d", value: `${snapshot.monthly.percent}%` });
65
- return rows;
66
- }
67
- // ---------------------------------------------------------------------------
68
- // Settings boundary (new toggles > legacy display; tui.json options > env >
69
- // api.kv > default both on)
70
- // ---------------------------------------------------------------------------
71
- function resolveSurfaceSelection(options, api) {
72
- if (options !== undefined) {
73
- const sidebarOption = parseBooleanFlag(options.sidebar);
74
- const statuslineOption = parseBooleanFlag(options.statusline);
75
- if (sidebarOption !== null || statuslineOption !== null) {
76
- return { sidebar: sidebarOption ?? true, statusline: statuslineOption ?? true };
30
+ const resolveActiveProviderId = makeProviderResolver(api.state, activeProviderId);
31
+ // The host's message store is where the per-model mix comes from, and it
32
+ // changes without the plan changing. Bumping this token on the same events
33
+ // that refresh the plan keeps the mix from going stale behind a host that
34
+ // reuses the element it was handed instead of re-invoking this subtree (see
35
+ // the reactivity note in `tui-shared`).
36
+ const [stateToken, setStateToken] = createSignal(0);
37
+ function readSessionMessages(sessionId) {
38
+ if (sessionId.length === 0)
39
+ return [];
40
+ try {
41
+ return api.state.session.messages(sessionId);
42
+ }
43
+ catch {
44
+ return [];
77
45
  }
78
- if (isDisplayMode(options.display))
79
- return surfaceSelectionFromDisplayMode(options.display);
80
- }
81
- const sidebarEnv = parseBooleanFlag(process.env.OPENCODE_GO_SIDEBAR);
82
- const statuslineEnv = parseBooleanFlag(process.env.OPENCODE_GO_STATUSLINE);
83
- if (sidebarEnv !== null || statuslineEnv !== null) {
84
- return { sidebar: sidebarEnv ?? true, statusline: statuslineEnv ?? true };
85
46
  }
86
- const displayEnv = toNonEmptyString(process.env.OPENCODE_GO_DISPLAY);
87
- if (displayEnv !== null && isDisplayMode(displayEnv)) {
88
- return surfaceSelectionFromDisplayMode(displayEnv);
47
+ // One model row: the display name the catalog gives it, then its weight bar
48
+ // and percent pushed to the right edge so the bars line up down the block.
49
+ function WeightedModelRow(props) {
50
+ const rounded = createMemo(() => Math.round(props.model.share));
51
+ const name = createMemo(() => modelDisplayName(readModelDisplayName(api, props.model.providerID, props.model.modelID), props.model.modelID, OPENCODE_MODEL_NAME_MAX_CHARS));
52
+ return (_jsxs("box", { flexDirection: "row", gap: 1, flexShrink: 0, children: [_jsx("text", { fg: props.theme.current.text, wrapMode: "none", flexShrink: 0, children: name() }), _jsx(MeterBar, { theme: props.theme, percent: props.model.share, severity: meterSeverityForPercent(rounded()) }), _jsx("text", { fg: props.theme.current.textMuted, wrapMode: "none", flexShrink: 0, children: formatPercentCell(rounded()) })] }));
89
53
  }
90
- try {
91
- const stored = api.kv.get(KV_DISPLAY_KEY, "both");
92
- if (isDisplayMode(stored))
93
- return surfaceSelectionFromDisplayMode(stored);
54
+ // The model mix. Collapsed by default: the one-line summary is the cheap
55
+ // answer, and this block already leads a sidebar that the host's own Context
56
+ // panel follows. The count in the header is every Go model the session used,
57
+ // not the three rows below it, so a truncated ranking says so.
58
+ function TopGoModelsSection(props) {
59
+ const [isExpanded, setIsExpanded] = createSignal(false);
60
+ const weights = createMemo(() => weightGoModels(props.usage()?.models ?? []));
61
+ const rows = () => weights().models;
62
+ // The collapsed line names the same models the expanded rows do, in as few
63
+ // cells as the sidebar has.
64
+ const mix = createMemo(() => buildModelMixSummary(rows().map((model) => ({
65
+ name: shortModelName(modelDisplayName(readModelDisplayName(api, model.providerID, model.modelID), model.modelID, OPENCODE_MODEL_NAME_MAX_CHARS)),
66
+ share: model.share,
67
+ }))));
68
+ const body = createMemo(() => (_jsxs("box", { flexDirection: "column", gap: 1, paddingTop: 1, paddingLeft: 2, children: [_jsx(For, { each: rows(), children: (model) => _jsx(WeightedModelRow, { theme: props.theme, model: model }) }), _jsx(For, { each: buildGoModelFooters(weights()), children: (line) => (_jsx("text", { fg: props.theme.current.textMuted, wrapMode: "none", children: line })) })] })));
69
+ // The whole section is one function child, because two rules apply here and
70
+ // both are about the same thing: the host reuses the element it was handed,
71
+ // so a plain value is read once at mount. That is why the conditions below
72
+ // are read INSIDE this memo (re-running it is what re-reads them) and why
73
+ // `Show` is given a value rather than an accessor -- solid's `Show` memoizes
74
+ // `when` and never calls it, so an accessor here is a function object, and a
75
+ // function object is always truthy. The real host caught exactly that: a
76
+ // session with no assistant messages rendered `Top Go models (0)` with a
77
+ // caret that opened onto nothing.
78
+ const section = createMemo(() => {
79
+ // No models yet is not a fold: there is nothing to fold, and a caret that
80
+ // opens onto an empty box reads as a broken section.
81
+ if (weights().goModels === 0) {
82
+ return (_jsxs("box", { flexDirection: "column", children: [_jsx("text", { fg: props.theme.current.text, wrapMode: "none", children: _jsx("b", { children: TOP_GO_MODELS_LABEL }) }), _jsx("text", { fg: props.theme.current.textMuted, wrapMode: "none", children: MODELS_EMPTY_LABEL })] }));
83
+ }
84
+ return (_jsxs("box", { flexDirection: "column", children: [_jsx(CollapsibleSection, { theme: props.theme, label: TOP_GO_MODELS_LABEL, count: () => weights().goModels, expanded: isExpanded, onToggle: () => setIsExpanded((current) => !current), body: body }), _jsx(Show, { when: !isExpanded(), children: _jsx("text", { fg: props.theme.current.textMuted, wrapMode: "none", paddingLeft: 2, children: reactiveChild(mix) }) })] }));
85
+ });
86
+ return _jsx("box", { flexDirection: "column", children: reactiveChild(section) });
94
87
  }
95
- catch {
96
- // Persisted settings are best-effort; fall through to the default.
88
+ function GoSidebarPanel(props) {
89
+ const planResetLine = createMemo(() => {
90
+ const snapshot = usageStore.snapshot();
91
+ if (snapshot === null || snapshot.source === "unavailable")
92
+ return null;
93
+ return relevantReset(snapshot);
94
+ });
95
+ const sessionUsage = createMemo(() => {
96
+ stateToken();
97
+ return aggregateModelUsageFromMessages(readSessionMessages(props.sessionId));
98
+ });
99
+ return (_jsxs("box", { flexDirection: "column", gap: 1, children: [_jsx(GoUsageBlock, { api: api, theme: props.theme, snapshot: usageStore.snapshot, resetLine: planResetLine }), _jsx(TopGoModelsSection, { theme: props.theme, usage: sessionUsage })] }));
97
100
  }
98
- return { sidebar: true, statusline: true };
99
- }
100
- function readCollapsedFlag(api, key) {
101
- try {
102
- return api.kv.get(key, false) === true;
101
+ if (surfaces.sidebar) {
102
+ // Host-owned slot: `register` returns an id but the SDK exposes no
103
+ // unregister API, so there is nothing to dispose here (the slot dies
104
+ // with the host). Interval/event/command teardown below is the full
105
+ // dispose path.
106
+ try {
107
+ api.slots.register({
108
+ order: SLOT_ORDER,
109
+ slots: {
110
+ sidebar_content(ctx, props) {
111
+ // Individually guarded: a later render must never throw into the host.
112
+ try {
113
+ if (props.session_id.length === 0)
114
+ return null;
115
+ if (!isGoUsageProvider(resolveActiveProviderId(props.session_id)))
116
+ return null;
117
+ if (api.route.current.name !== "session")
118
+ return null;
119
+ if (collapse.isSidebarCollapsed())
120
+ return null;
121
+ return _jsx(GoSidebarPanel, { theme: ctx.theme, sessionId: props.session_id });
122
+ }
123
+ catch {
124
+ return null;
125
+ }
126
+ },
127
+ },
128
+ });
129
+ }
130
+ catch {
131
+ // Additive slot: a registration failure must not abort the plugin.
132
+ }
103
133
  }
104
- catch {
105
- return false;
134
+ if (surfaces.statusline) {
135
+ // Host-owned slot (see sidebar note above): no unregister API exists,
136
+ // so disposal is a no-op for slots.
137
+ try {
138
+ api.slots.register({
139
+ order: SLOT_ORDER,
140
+ slots: {
141
+ session_prompt_right(_ctx, props) {
142
+ // Individually guarded: a later render must never throw into the host.
143
+ try {
144
+ if (props.session_id.length === 0)
145
+ return null;
146
+ if (!isGoUsageProvider(resolveActiveProviderId(props.session_id)))
147
+ return null;
148
+ if (collapse.isStatuslineCollapsed())
149
+ return null;
150
+ return _jsx(GoStatusline, { snapshot: usageStore.snapshot });
151
+ }
152
+ catch {
153
+ return null;
154
+ }
155
+ },
156
+ },
157
+ });
158
+ }
159
+ catch {
160
+ // Additive slot: a registration failure must not abort the plugin.
161
+ }
106
162
  }
107
- }
108
- function migrateLegacyCollapsedFlag(api) {
109
- let legacyCollapsed = false;
163
+ // `api.command` is a deprecated legacy shim that hosts may omit; guard so
164
+ // the plugin still initializes and disposes safely without it.
165
+ let unregisterToggleCommand = () => { };
110
166
  try {
111
- legacyCollapsed = api.kv.get(KV_COLLAPSED_LEGACY_KEY, false) === true;
167
+ const unregister = api.command?.register(() => [
168
+ {
169
+ title: "Go usage: toggle sidebar",
170
+ value: "oc-go-usage-display.toggle-sidebar",
171
+ category: "Go",
172
+ onSelect: () => collapse.toggleSidebar(),
173
+ },
174
+ {
175
+ title: "Go usage: toggle statusline",
176
+ value: "oc-go-usage-display.toggle-statusline",
177
+ category: "Go",
178
+ onSelect: () => collapse.toggleStatusline(),
179
+ },
180
+ ]);
181
+ if (typeof unregister === "function")
182
+ unregisterToggleCommand = unregister;
112
183
  }
113
184
  catch {
114
- return;
185
+ // Legacy command registration is optional; ignore failures.
115
186
  }
116
- if (!legacyCollapsed)
117
- return;
187
+ let unsubscribeSession = () => { };
188
+ let unsubscribeMessage = () => { };
118
189
  try {
119
- api.kv.set(KV_COLLAPSED_SIDEBAR_KEY, true);
120
- api.kv.set(KV_COLLAPSED_STATUSLINE_KEY, true);
121
- api.kv.set(KV_COLLAPSED_LEGACY_KEY, false);
190
+ const unsubscribe = api.event.on("session.updated", (event) => {
191
+ const providerId = event?.properties?.info?.model?.providerID;
192
+ if (providerId !== undefined)
193
+ setActiveProviderId(providerId);
194
+ usageStore.refreshSafely(0);
195
+ });
196
+ if (typeof unsubscribe === "function")
197
+ unsubscribeSession = unsubscribe;
122
198
  }
123
199
  catch {
124
- // Collapse state is best-effort persistence only.
200
+ // Event subscription is additive; a failure must not abort the plugin.
125
201
  }
126
- }
127
- // ---------------------------------------------------------------------------
128
- // Data boundary (auth.json -> Bearer usage fetch; throws nothing)
129
- // ---------------------------------------------------------------------------
130
- async function fetchJsonWithTimeout(url, apiKey) {
131
- const controller = new AbortController();
132
- const timer = setTimeout(() => controller.abort(), FETCH_TIMEOUT_MS);
133
202
  try {
134
- const response = await fetch(url, {
135
- signal: controller.signal,
136
- headers: { Authorization: `Bearer ${apiKey}`, Accept: "application/json" },
203
+ const unsubscribe = api.event.on("message.updated", () => {
204
+ usageStore.refreshSafely(EVENT_TTL_MS);
205
+ // The model's share of the session changes with every finished message,
206
+ // not only when the plan does.
207
+ setStateToken((current) => current + 1);
137
208
  });
138
- if (response.status === 401 || response.status === 403)
139
- return { __rejected: true };
140
- if (!response.ok)
141
- return null;
142
- try {
143
- return (await response.json());
144
- }
145
- catch {
146
- return null;
147
- }
209
+ if (typeof unsubscribe === "function")
210
+ unsubscribeMessage = unsubscribe;
148
211
  }
149
212
  catch {
150
- return null;
151
- }
152
- finally {
153
- clearTimeout(timer);
154
- }
155
- }
156
- async function loadUsageSnapshot() {
157
- if (process.env.OPENCODE_GO_MOCK === "1")
158
- return mockSnapshot();
159
- const apiKey = toNonEmptyString(process.env.OPENCODE_GO_API_KEY) ?? readAuthJsonApiKey();
160
- if (apiKey === null)
161
- return null;
162
- const payload = await fetchJsonWithTimeout(API_USAGE_URL, apiKey);
163
- if (payload === null)
164
- return null;
165
- // Mirror the server: a rejected key is a distinct unavailable snapshot
166
- // (surfaced via `apiError`) rather than a silent null.
167
- if (isRecord(payload) && payload.__rejected === true) {
168
- return unavailableSnapshot("API key rejected (401/403)");
213
+ // Event subscription is additive; a failure must not abort the plugin.
169
214
  }
170
- return extractSnapshotFromApiPayload(payload);
171
- }
172
- async function logUsageError(api, message) {
215
+ let pollTimer = null;
173
216
  try {
174
- await api.client.app.log({ service: LOG_SERVICE, level: "error", message });
217
+ pollTimer = setInterval(() => usageStore.refreshSafely(), POLL_INTERVAL_MS);
175
218
  }
176
219
  catch {
177
- // Logging is best-effort; the usage display must never break the host.
220
+ // No poll timer: the on-demand refresh below still runs.
178
221
  }
179
- }
180
- // ---------------------------------------------------------------------------
181
- // TUI plugin
182
- // ---------------------------------------------------------------------------
183
- const goUsageTui = async (api, options) => {
184
- const surfaces = resolveSurfaceSelection(options, api);
185
- migrateLegacyCollapsedFlag(api);
186
- const [usageSnapshot, setUsageSnapshot] = createSignal(null);
187
- const [isSidebarCollapsed, setIsSidebarCollapsed] = createSignal(readCollapsedFlag(api, KV_COLLAPSED_SIDEBAR_KEY));
188
- const [isStatuslineCollapsed, setIsStatuslineCollapsed] = createSignal(readCollapsedFlag(api, KV_COLLAPSED_STATUSLINE_KEY));
189
- let cachedAt = 0;
190
- let refreshInFlight = false;
191
- async function refreshUsage() {
192
- if (refreshInFlight)
193
- return;
194
- if (Date.now() - cachedAt < POLL_INTERVAL_MS && usageSnapshot() !== null)
195
- return;
196
- refreshInFlight = true;
197
- try {
198
- const snapshot = await loadUsageSnapshot();
199
- if (snapshot === null) {
200
- if (usageSnapshot() === null) {
201
- await logUsageError(api, "Go usage unavailable (not configured or request failed)");
222
+ try {
223
+ api.lifecycle.onDispose(() => {
224
+ // Each teardown step is isolated: one throwing unsubscribe must not
225
+ // prevent the rest (or leak into the host's dispose pass).
226
+ if (pollTimer !== null) {
227
+ try {
228
+ clearInterval(pollTimer);
229
+ }
230
+ catch {
231
+ // noop
202
232
  }
203
- return;
204
233
  }
205
- cachedAt = Date.now();
206
- setUsageSnapshot(snapshot);
207
- }
208
- catch {
209
- // Keep stale data; the panel simply shows the last known snapshot.
210
- }
211
- finally {
212
- refreshInFlight = false;
213
- }
214
- }
215
- function toggleSidebarCollapsed() {
216
- const next = !isSidebarCollapsed();
217
- setIsSidebarCollapsed(next);
218
- try {
219
- api.kv.set(KV_COLLAPSED_SIDEBAR_KEY, next);
220
- }
221
- catch {
222
- // Collapse state is best-effort persistence only.
223
- }
224
- }
225
- function toggleStatuslineCollapsed() {
226
- const next = !isStatuslineCollapsed();
227
- setIsStatuslineCollapsed(next);
228
- try {
229
- api.kv.set(KV_COLLAPSED_STATUSLINE_KEY, next);
230
- }
231
- catch {
232
- // Collapse state is best-effort persistence only.
233
- }
234
- }
235
- function GoSidebarPanel(props) {
236
- createEffect(() => {
237
- const snapshot = usageSnapshot();
238
- if (snapshot !== null && snapshot.source === "unavailable") {
239
- void logUsageError(api, snapshot.apiError ? `Go usage unavailable (${snapshot.apiError})` : "Go usage snapshot unavailable");
234
+ for (const teardown of [unsubscribeSession, unsubscribeMessage, unregisterToggleCommand]) {
235
+ try {
236
+ teardown();
237
+ }
238
+ catch {
239
+ // noop
240
+ }
240
241
  }
241
242
  });
242
- return (_jsxs("box", { flexDirection: "column", children: [_jsx("text", { fg: props.theme.current.text, children: _jsx("b", { children: "Go Usage" }) }), _jsx(Show, { when: usageSnapshot(), fallback: _jsx("text", { fg: props.theme.current.textMuted, wrapMode: "none", children: "Go loading\u2026" }), children: (snapshot) => (_jsx(For, { each: buildUsageRows(snapshot()), children: (row) => (_jsxs("text", { fg: props.theme.current.textMuted, wrapMode: "none", children: [row.label, " ", row.value] })) })) })] }));
243
243
  }
244
- function GoStatusline() {
245
- return (_jsx(Show, { when: usageSnapshot(), fallback: null, children: (snapshot) => {
246
- if (isSnapshotEmpty(snapshot()))
247
- return null;
248
- return _jsx("text", { children: formatCompactLine(snapshot()) });
249
- } }));
244
+ catch {
245
+ // Lifecycle registration is best-effort; never leak a timer into the host.
246
+ if (pollTimer !== null) {
247
+ try {
248
+ clearInterval(pollTimer);
249
+ }
250
+ catch {
251
+ // noop
252
+ }
253
+ }
250
254
  }
251
- if (surfaces.sidebar) {
252
- // Host-owned slot: `register` returns an id but the SDK exposes no
253
- // unregister API, so there is nothing to dispose here (the slot dies
254
- // with the host). Interval/event/command teardown below is the full
255
- // dispose path.
256
- api.slots.register({
257
- order: SLOT_ORDER,
258
- slots: {
259
- sidebar_content(ctx, props) {
260
- if (props.session_id.length === 0)
261
- return null;
262
- if (api.route.current.name !== "session")
263
- return null;
264
- if (isSidebarCollapsed())
265
- return null;
266
- return _jsx(GoSidebarPanel, { theme: ctx.theme });
267
- },
268
- },
269
- });
255
+ await usageStore.refresh();
256
+ }
257
+ const goUsageTui = async (api, options) => {
258
+ try {
259
+ await initializeTui(api, options);
270
260
  }
271
- if (surfaces.statusline) {
272
- // Host-owned slot (see sidebar note above): no unregister API exists,
273
- // so disposal is a no-op for slots.
274
- api.slots.register({
275
- order: SLOT_ORDER,
276
- slots: {
277
- session_prompt_right(_ctx, props) {
278
- if (props.session_id.length === 0)
279
- return null;
280
- if (isStatuslineCollapsed())
281
- return null;
282
- return _jsx(GoStatusline, {});
283
- },
284
- },
285
- });
261
+ catch (error) {
262
+ // Best-effort and non-blocking: never delay plugin resolution on the host
263
+ // log and never let an initialization error reject into the host.
264
+ void logUsageError(api, `Go usage TUI failed to initialize: ${errorMessage(error)}; continuing without display`);
286
265
  }
287
- // `api.command` is a deprecated legacy shim that hosts may omit; guard so
288
- // the plugin still initializes and disposes safely without it.
289
- const unregisterToggleCommand = api.command?.register(() => [
290
- {
291
- title: "Go usage: toggle sidebar",
292
- value: "oc-go-usage-display.toggle-sidebar",
293
- category: "Go",
294
- onSelect: () => toggleSidebarCollapsed(),
295
- },
296
- {
297
- title: "Go usage: toggle statusline",
298
- value: "oc-go-usage-display.toggle-statusline",
299
- category: "Go",
300
- onSelect: () => toggleStatuslineCollapsed(),
301
- },
302
- ]) ?? (() => { });
303
- const unsubscribeSession = api.event.on("session.updated", () => {
304
- void refreshUsage();
305
- });
306
- const unsubscribeMessage = api.event.on("message.updated", () => {
307
- void refreshUsage();
308
- });
309
- const pollTimer = setInterval(() => {
310
- void refreshUsage();
311
- }, POLL_INTERVAL_MS);
312
- api.lifecycle.onDispose(() => {
313
- clearInterval(pollTimer);
314
- unsubscribeSession();
315
- unsubscribeMessage();
316
- unregisterToggleCommand();
317
- });
318
- await refreshUsage();
319
266
  };
320
267
  export default { id: "oc-go-usage-display", tui: goUsageTui };
321
268
  //# sourceMappingURL=tui.js.map
package/dist/tui.js.map CHANGED
@@ -1 +1 @@
1
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AAC;AAC7B,CAAC;AAED,MAAM,UAAU,GAAc,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE;IACnD,IAAI,CAAC;QACH,MAAM,aAAa,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IACpC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,0EAA0E;QAC1E,kEAAkE;QAClE,KAAK,aAAa,CAChB,GAAG,EACH,sCAAsC,YAAY,CAAC,KAAK,CAAC,8BAA8B,CACxF,CAAC;IACJ,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,EAAE,EAAE,EAAE,qBAAqB,EAAE,GAAG,EAAE,UAAU,EAA4B,CAAC"}
@@ -0,0 +1,8 @@
1
+ /** @jsxImportSource @opentui/solid */
2
+ import type { TuiPlugin } from "@kilocode/plugin/tui";
3
+ declare const _default: {
4
+ id: string;
5
+ tui: TuiPlugin;
6
+ };
7
+ export default _default;
8
+ //# sourceMappingURL=tui.kilo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tui.kilo.d.ts","sourceRoot":"","sources":["../src/tui.kilo.tsx"],"names":[],"mappings":"AAAA,sCAAsC;AAoEtC,OAAO,KAAK,EACV,SAAS,EAKV,MAAM,sBAAsB,CAAC;;;;;AAquB9B,wBAAwF"}