@snack-kit/porygon 0.3.0 → 0.4.0

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/dist/index.js CHANGED
@@ -817,14 +817,15 @@ function mapClaudeEvent(event, sessionId) {
817
817
  return [];
818
818
  }
819
819
  if (isResultEvent(event)) {
820
+ const usage = event.usage;
820
821
  return [{
821
822
  ...baseFields,
822
823
  type: "result",
823
824
  text: event.result,
824
- costUsd: event.cost_usd,
825
+ costUsd: event.total_cost_usd ?? event.cost_usd,
825
826
  durationMs: event.duration_ms,
826
- inputTokens: event.input_tokens,
827
- outputTokens: event.output_tokens
827
+ inputTokens: usage?.input_tokens ?? event.input_tokens,
828
+ outputTokens: usage?.output_tokens ?? event.output_tokens
828
829
  }];
829
830
  }
830
831
  return [];