pi-agent-extensions 0.4.0 → 0.4.1
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.
|
@@ -139,7 +139,8 @@ class PowerlineFooter implements Component {
|
|
|
139
139
|
ctxColor = YELLOW;
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
-
|
|
142
|
+
const pctDisplay = pct % 1 === 0 ? pct.toFixed(0) : pct.toFixed(1);
|
|
143
|
+
contextInfo = `${ctxColor}${this.formatTokens(used)}/${this.formatTokens(total)} (${pctDisplay}%)${RESET}`;
|
|
143
144
|
|
|
144
145
|
// Cost estimation from model pricing
|
|
145
146
|
if (model?.cost && contextUsage.usageTokens > 0) {
|
|
@@ -150,8 +151,10 @@ class PowerlineFooter implements Component {
|
|
|
150
151
|
(inputTokens * model.cost.input) / 1_000_000 +
|
|
151
152
|
(outputTokens * model.cost.output) / 1_000_000;
|
|
152
153
|
|
|
153
|
-
if (cost
|
|
154
|
+
if (cost >= 0.005) {
|
|
154
155
|
costInfo = ` ${DIM}|${RESET} ${PEACH}$${cost.toFixed(2)}${RESET}`;
|
|
156
|
+
} else if (cost > 0) {
|
|
157
|
+
costInfo = ` ${DIM}|${RESET} ${PEACH}<$0.01${RESET}`;
|
|
155
158
|
}
|
|
156
159
|
}
|
|
157
160
|
}
|