@bacnh85/pi-sub 0.1.2 → 0.1.3

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 (3) hide show
  1. package/README.md +3 -3
  2. package/index.ts +3 -3
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Pi extension that shows subscription usage for the currently selected supported model provider.
4
4
 
5
- V1 supports OpenAI Codex models by reading Pi's auth state from `~/.pi/agent/auth.json` (or `$PI_CODING_AGENT_DIR/auth.json`) and displays a separate subscription line below the editor only while the active Pi model provider is `openai-codex`.
5
+ V1 supports OpenAI Codex models by reading Pi's auth state from `~/.pi/agent/auth.json` (or `$PI_CODING_AGENT_DIR/auth.json`) and displays a subscription footer status after Pi's built-in status/token usage line only while the active Pi model provider is `openai-codex`.
6
6
 
7
7
  ## Install
8
8
 
@@ -26,7 +26,7 @@ pi -e ./extensions/pi-sub
26
26
 
27
27
  ## What it shows
28
28
 
29
- The footer status includes:
29
+ The footer status appears after Pi's built-in status/token usage line and includes:
30
30
 
31
31
  - active account email;
32
32
  - subscription plan, such as `Plus`;
@@ -54,7 +54,7 @@ When Pi OpenAI Codex auth is available, `/sub` shows the active account usage:
54
54
 
55
55
  ```text
56
56
  ACCOUNT PLAN 5H USAGE WEEKLY USAGE LAST ACTIVITY
57
- * hangdanchi@gmail.com Plus 85% (18:12) 80% (08:00 on 2 Jul) Now
57
+ * user@example.com Plus 85% (18:12) 80% (08:00 on 2 Jul) Now
58
58
  ```
59
59
 
60
60
  ## Refresh behavior
package/index.ts CHANGED
@@ -277,7 +277,7 @@ function maxPercent(account: SubscriptionAccountSnapshot | undefined): number {
277
277
 
278
278
  function renderSubscriptionLine(ctx: ExtensionContext, state: State): void {
279
279
  if (!state.adapter) {
280
- ctx.ui.setWidget(STATUS_KEY, undefined);
280
+ ctx.ui.setStatus(STATUS_KEY, undefined);
281
281
  return;
282
282
  }
283
283
  const theme = ctx.ui.theme;
@@ -301,7 +301,7 @@ function renderSubscriptionLine(ctx: ExtensionContext, state: State): void {
301
301
  line = pieces.join(" · ");
302
302
  color = maxPercent(account) >= 90 ? "error" : maxPercent(account) >= 80 ? "warning" : "dim";
303
303
  }
304
- ctx.ui.setWidget(STATUS_KEY, [theme.fg(color, line)], { placement: "belowEditor" });
304
+ ctx.ui.setStatus(STATUS_KEY, theme.fg(color, line));
305
305
  }
306
306
 
307
307
  function startTimer(ctx: ExtensionContext, state: State): void {
@@ -413,7 +413,7 @@ export default function (pi: ExtensionAPI) {
413
413
 
414
414
  pi.on("session_shutdown", async (_event, ctx) => {
415
415
  stopTimer(state);
416
- ctx.ui.setWidget(STATUS_KEY, undefined);
416
+ ctx.ui.setStatus(STATUS_KEY, undefined);
417
417
  });
418
418
 
419
419
  pi.registerCommand("sub", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bacnh85/pi-sub",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Pi extension showing subscription usage for supported model providers.",
5
5
  "type": "module",
6
6
  "license": "MIT",