@narumitw/pi-codex-usage 0.1.17 → 0.1.19
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/README.md +2 -2
- package/package.json +1 -1
- package/src/codex-usage.ts +5 -5
package/README.md
CHANGED
|
@@ -66,8 +66,8 @@ information on rate limits and credits
|
|
|
66
66
|
When the selected Pi model provider is `openai-codex`, `pi-codex-usage` refreshes a compact statusline item automatically:
|
|
67
67
|
|
|
68
68
|
```text
|
|
69
|
-
codex 59% 5h 61% wk
|
|
70
|
-
codex spark 100% 5h 100% wk
|
|
69
|
+
📊 codex 59% 5h 61% wk
|
|
70
|
+
📊 codex spark 100% 5h 100% wk
|
|
71
71
|
```
|
|
72
72
|
|
|
73
73
|
The statusline value uses the cached usage snapshot and refreshes every five minutes while the current model remains `openai-codex`.
|
package/package.json
CHANGED
package/src/codex-usage.ts
CHANGED
|
@@ -204,7 +204,7 @@ export default function codexUsage(pi: ExtensionAPI) {
|
|
|
204
204
|
return;
|
|
205
205
|
}
|
|
206
206
|
|
|
207
|
-
ctx.ui.setStatus(STATUS_KEY, "
|
|
207
|
+
ctx.ui.setStatus(STATUS_KEY, "📊 checking");
|
|
208
208
|
const result = await queryUsage(ctx, { timeoutMs: DEFAULT_TIMEOUT_MS });
|
|
209
209
|
if (requestId !== statuslineRequestId) return;
|
|
210
210
|
if (!isOpenAICodexModel(ctx.model)) {
|
|
@@ -213,7 +213,7 @@ export default function codexUsage(pi: ExtensionAPI) {
|
|
|
213
213
|
}
|
|
214
214
|
|
|
215
215
|
if (!result.ok) {
|
|
216
|
-
ctx.ui.setStatus(STATUS_KEY, "
|
|
216
|
+
ctx.ui.setStatus(STATUS_KEY, "📊 usage error");
|
|
217
217
|
scheduleStatuslineRefresh(ctx);
|
|
218
218
|
return;
|
|
219
219
|
}
|
|
@@ -250,7 +250,7 @@ export default function codexUsage(pi: ExtensionAPI) {
|
|
|
250
250
|
}
|
|
251
251
|
|
|
252
252
|
let keepStatusline = false;
|
|
253
|
-
if (options.value.statusline) ctx.ui.setStatus(STATUS_KEY, "
|
|
253
|
+
if (options.value.statusline) ctx.ui.setStatus(STATUS_KEY, "📊 checking");
|
|
254
254
|
try {
|
|
255
255
|
const result = await queryUsage(ctx, options.value);
|
|
256
256
|
if (!result.ok) {
|
|
@@ -825,9 +825,9 @@ export function formatCodexUsageStatusline(
|
|
|
825
825
|
model?: CodexUsageModel,
|
|
826
826
|
): string {
|
|
827
827
|
const snapshot = selectSnapshotForModel(report, model);
|
|
828
|
-
if (!snapshot) return "
|
|
828
|
+
if (!snapshot) return "📊 usage unavailable";
|
|
829
829
|
|
|
830
|
-
const parts = [formatStatuslinePrefix(snapshot)];
|
|
830
|
+
const parts = [`📊 ${formatStatuslinePrefix(snapshot)}`];
|
|
831
831
|
if (snapshot.primary) parts.push(`${formatRemainingPercent(snapshot.primary)} 5h`);
|
|
832
832
|
if (snapshot.secondary) parts.push(`${formatRemainingPercent(snapshot.secondary)} wk`);
|
|
833
833
|
if (parts.length === 1 && snapshot.credits) parts.push(formatCredits(snapshot.credits));
|