@llblab/pi-codex-usage 0.3.4 โ†’ 0.3.5

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/CHANGELOG.md CHANGED
@@ -1,5 +1,6 @@
1
1
  # Changelog
2
2
 
3
+ - `0.3.5` Refined the compact statusline bar with quadrant glyphs, darker bar coloring, and blink-on-segment-change behavior. Impact: Codex quota changes are easier to notice while routine refreshes stay visually stable.
3
4
  - `0.3.4` Added package banner metadata and README hero image. Impact: Pi/package listings can show the Codex Usage banner while npm packages include the image asset.
4
5
  - `Fork baseline` Imported `extensions/pi-codex-usage` from `narumiruna/pi-extensions` as a standalone `@llblab/pi-codex-usage` package. Impact: the extension can be installed and maintained independently.
5
6
  - `Minimal statusline` Removed command-driven report output and narrowed the extension to a zero-configuration statusline widget. Impact: runtime behavior is automatic while `openai-codex` is active.
package/README.md CHANGED
@@ -20,7 +20,7 @@ This repository is a minimal fork of [`narumiruna/pi-extensions/extensions/pi-co
20
20
  - Pi OpenAI Codex provider auth is used first
21
21
  - Codex CLI app-server remains available as a fallback
22
22
  - Missing auth, subscription, plan, or quota windows are shown as `n/a`, not as an error
23
- - Successful updates briefly redraw the bar without changing its width
23
+ - Successful updates briefly redraw the bar only when a ten-step segment changes
24
24
  - Network/provider failures keep the last good bar briefly, then show `error`
25
25
  - No commands or configuration are required
26
26
 
@@ -43,10 +43,10 @@ pi install git:github.com/llblab/pi-codex-usage
43
43
  Normal usage:
44
44
 
45
45
  ```text
46
- codex [๐œบƒ๐œบƒ๐œนฃ๐œน“๐œน“]
46
+ codex โ–ˆโ–ˆโ–ˆโ–€โ–€
47
47
  ```
48
48
 
49
- The five-character bar encodes two ten-step limits at once: the top sextants are the 5-hour limit, and the bottom sextants are the weekly limit.
49
+ The five-character bar encodes two ten-step limits at once: the top quadrants are the 5-hour limit, and the bottom quadrants are the weekly limit.
50
50
 
51
51
  Unavailable because Codex auth or subscription quota is not available:
52
52
 
package/banner.png CHANGED
Binary file
package/index.ts CHANGED
@@ -16,21 +16,21 @@ const MAX_ERROR_BODY_CHARS = 600;
16
16
  const STATUS_LABEL_TEXT = "codex";
17
17
  const DUAL_BAR_CHARS = [
18
18
  " ",
19
- "๐œน‘",
20
- "๐œน’",
21
- "๐œน“",
22
- "๐œน ",
23
- "๐œนก",
24
- "๐œนข",
25
- "๐œนฃ",
26
- "๐œนฐ",
27
- "๐œนฑ",
28
- "๐œนฒ",
29
- "๐œนณ",
30
- "๐œบ€",
31
- "๐œบ",
32
- "๐œบ‚",
33
- "๐œบƒ",
19
+ "โ–˜",
20
+ "โ–",
21
+ "โ–€",
22
+ "โ––",
23
+ "โ–Œ",
24
+ "โ–ž",
25
+ "โ–›",
26
+ "โ–—",
27
+ "โ–š",
28
+ "โ–",
29
+ "โ–œ",
30
+ "โ–„",
31
+ "โ–™",
32
+ "โ–Ÿ",
33
+ "โ–ˆ",
34
34
  ];
35
35
 
36
36
  type UsageSource = "pi-auth" | "codex-app-server";
@@ -222,11 +222,15 @@ export default function codexUsage(pi: ExtensionAPI) {
222
222
  return;
223
223
  }
224
224
 
225
+ const previousReport = cache?.report;
226
+ const blink = previousReport
227
+ ? formatReportBar(previousReport) !== formatReportBar(result.report)
228
+ : false;
225
229
  failedRefreshes = 0;
226
230
  cache = { createdAt: Date.now(), report: result.report };
227
231
  setUsageStatusline(ctx, result.report, {
228
232
  autoRefresh: true,
229
- blink: cache !== undefined,
233
+ blink,
230
234
  model,
231
235
  });
232
236
  };
@@ -684,24 +688,22 @@ export function formatCodexUsageStatusline(
684
688
  ctx: ExtensionContext,
685
689
  _model?: CodexUsageModel,
686
690
  ): string {
687
- const snapshot = selectPrimaryCodexSnapshot(report);
688
- if (!snapshot) return formatStatuslineText(ctx, "n/a");
691
+ return formatStatuslineText(ctx, formatReportBar(report) ?? "n/a");
692
+ }
689
693
 
690
- if (!snapshot.primary && !snapshot.secondary)
691
- return formatStatuslineText(ctx, "n/a");
692
- return formatStatuslineText(
693
- ctx,
694
- `[${formatDualLimitBar(snapshot.primary, snapshot.secondary)}]`,
695
- );
694
+ function formatReportBar(report: CodexUsageReport): string | undefined {
695
+ const snapshot = selectPrimaryCodexSnapshot(report);
696
+ if (!snapshot || (!snapshot.primary && !snapshot.secondary)) return undefined;
697
+ return formatDualLimitBar(snapshot.primary, snapshot.secondary);
696
698
  }
697
699
 
698
700
  function formatStatuslineText(ctx: ExtensionContext, value: string): string {
699
701
  const label = ctx.ui.theme.fg("accent", STATUS_LABEL_TEXT);
700
- return `${label} ${ctx.ui.theme.fg("muted", value)}`;
702
+ return `${label} ${ctx.ui.theme.fg("dim", value)}`;
701
703
  }
702
704
 
703
705
  function formatEmptyStatuslineBar(ctx: ExtensionContext): string {
704
- return formatStatuslineText(ctx, "[\u00a0\u00a0\u00a0\u00a0\u00a0]");
706
+ return formatStatuslineText(ctx, "\u00a0\u00a0\u00a0\u00a0\u00a0");
705
707
  }
706
708
 
707
709
  function formatStatuslineProblem(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@llblab/pi-codex-usage",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
4
4
  "private": false,
5
5
  "description": "Minimal Pi extension that shows primary Codex ChatGPT subscription usage limits.",
6
6
  "keywords": [