@aexol/spectral 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.
@@ -192,7 +192,10 @@ function supportsReasoning(modelId) {
192
192
  }
193
193
  /**
194
194
  * Calculate credits from token usage using per-model credit rates.
195
- * Mirrors backend billing logic for Agent UI telemetry.
195
+ *
196
+ * NOTE: We intentionally keep higher precision here (no 2-decimal rounding)
197
+ * so small turns don't collapse to 0.00 in live UI aggregation. Rendering
198
+ * layers decide final display precision.
196
199
  */
197
200
  function calculateCredits(inputTokens, outputTokens, cacheReadTokens = 0, cacheWriteTokens = 0, creditInputPer1M, creditOutputPer1M, creditCachedInputPer1M, creditCacheReadPer1M, creditCacheWritePer1M) {
198
201
  const inputRate = creditInputPer1M ?? 0;
@@ -206,11 +209,11 @@ function calculateCredits(inputTokens, outputTokens, cacheReadTokens = 0, cacheW
206
209
  (cacheWriteTokens / 1_000_000) * cacheWriteRate;
207
210
  if (inputRate === 0 && outputRate === 0 && cacheReadRate === 0 && cacheWriteRate === 0) {
208
211
  if (cachedInputRate > 0) {
209
- return Math.round(((inputTokens + cacheReadTokens + cacheWriteTokens) / 1_000_000) * cachedInputRate * 100) / 100;
212
+ return ((inputTokens + cacheReadTokens + cacheWriteTokens) / 1_000_000) * cachedInputRate;
210
213
  }
211
214
  return 0;
212
215
  }
213
- return Math.round(credits * 100) / 100;
216
+ return credits;
214
217
  }
215
218
  /**
216
219
  * Parse the newline-delimited JSON of wire events persisted alongside an
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aexol/spectral",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
4
4
  "description": "Always-on coding agent for Aexol — branded pi wrapper with relay-based browser access.",
5
5
  "type": "module",
6
6
  "private": false,