@warpmetrics/warp 0.0.21 → 0.0.22

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@warpmetrics/warp",
3
- "version": "0.0.21",
3
+ "version": "0.0.22",
4
4
  "description": "Measure your agents, not your LLM calls.",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -1,4 +1,4 @@
1
- // Warpmetrics SDK — Registries
1
+ // Warpmetrics SDK — Registries
2
2
  // Module-level state that tracks runs, groups, and calls in memory.
3
3
 
4
4
  /** @type {Map<string, object>} run id → run data */
@@ -139,20 +139,14 @@ export async function flush() {
139
139
  if (config.debug) {
140
140
  console.error('[warpmetrics] Flush failed:', err.message);
141
141
  }
142
- // Only re-queue if it's not a rate limit error (429)
143
- // Rate limit errors should wait for the next flush interval
144
- const isRateLimit = err.message?.includes('429') || err.message?.includes('RATE_LIMIT');
145
- if (!isRateLimit) {
146
- // Re-queue so nothing is lost.
147
- queue.runs.unshift(...batch.runs);
148
- queue.groups.unshift(...batch.groups);
149
- queue.calls.unshift(...batch.calls);
150
- queue.links.unshift(...batch.links);
151
- queue.outcomes.unshift(...batch.outcomes);
152
- queue.acts.unshift(...batch.acts);
153
- } else if (config.debug) {
154
- console.warn('[warpmetrics] Rate limited - discarding batch to avoid retry loop. Will retry on next flush.');
155
- }
142
+ // Re-queue so nothing is lost.
143
+ queue.runs.unshift(...batch.runs);
144
+ queue.groups.unshift(...batch.groups);
145
+ queue.calls.unshift(...batch.calls);
146
+ queue.links.unshift(...batch.links);
147
+ queue.outcomes.unshift(...batch.outcomes);
148
+ queue.acts.unshift(...batch.acts);
149
+ throw err;
156
150
  }
157
151
  }
158
152
 
@@ -49,7 +49,7 @@ export function trace(target, data) {
49
49
  if (data.opts) event.opts = data.opts;
50
50
  if (data.cost != null) {
51
51
  const costNum = Number(data.cost);
52
- if (!isNaN(costNum)) event.costOverride = Math.round(costNum * 1_000_000);
52
+ if (!isNaN(costNum)) event.cost = costNum;
53
53
  }
54
54
 
55
55
  logCall(event);