opencode-copilot-statusline 1.0.0 → 1.0.2

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 (2) hide show
  1. package/dist/tui.js +17 -6
  2. package/package.json +1 -1
package/dist/tui.js CHANGED
@@ -11,6 +11,17 @@ import { Plugin, usePlugin } from "@opencode/plugin/tui";
11
11
  import { useTerminalDimensions } from "@opentui/solid";
12
12
  import { createEffect, createSignal, onCleanup, Show } from "solid-js";
13
13
 
14
+ // ../core/src/theme.ts
15
+ function statusColors(theme) {
16
+ const text = theme?.text;
17
+ const feedback = (kind) => text?.feedback?.[kind]?.base ?? text?.feedback?.[kind]?.default;
18
+ return {
19
+ muted: text?.muted ?? text?.subdued,
20
+ error: feedback("error"),
21
+ info: feedback("info")
22
+ };
23
+ }
24
+
14
25
  // src/rpc.ts
15
26
  import { Rpc } from "@opencode/plugin/rpc";
16
27
  var usageSchema = {
@@ -80,17 +91,17 @@ function CopilotUsage(props) {
80
91
  const dims = useTerminalDimensions();
81
92
  const detailed = () => props.showDetails() || dims().width >= DETAILED_WIDTH;
82
93
  const fg = () => {
83
- const t = ctx.theme;
94
+ const colors = statusColors(ctx.theme);
84
95
  const u = props.usage();
85
96
  if (!u)
86
- return props.loaded() ? t.text.feedback.error.default : t.text.subdued;
97
+ return props.loaded() ? colors.error : colors.muted;
87
98
  if (u.unlimited)
88
- return t.text.subdued;
99
+ return colors.muted;
89
100
  if (u.usedPercent >= 90)
90
- return t.text.feedback.error.default;
101
+ return colors.error;
91
102
  if (u.usedPercent >= 70)
92
- return t.text.feedback.info.default;
93
- return t.text.subdued;
103
+ return colors.info;
104
+ return colors.muted;
94
105
  };
95
106
  let generation = 0;
96
107
  async function check(id) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-copilot-statusline",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "OpenCode TUI plugin: display GitHub Copilot quota (premium requests, with a chat fallback for Copilot Free) in the footer statusline. V2-native, zero-config, no cookies.",
5
5
  "type": "module",
6
6
  "license": "MIT",