@polka-codes/core 0.9.13 → 0.9.15

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.
@@ -1806,7 +1806,7 @@ declare class UsageMeter {
1806
1806
  cost: number;
1807
1807
  };
1808
1808
  /** Print a concise usage summary to console. */
1809
- printUsage(): void;
1809
+ printUsage(customConsole?: Console): void;
1810
1810
  onFinishHandler(llm: LanguageModelV2): (evt: {
1811
1811
  totalUsage: LanguageModelV2Usage;
1812
1812
  providerMetadata: any;
package/dist/index.js CHANGED
@@ -1252,9 +1252,9 @@ var UsageMeter = class {
1252
1252
  return { ...this.#totals, messageCount: this.#calls };
1253
1253
  }
1254
1254
  /** Print a concise usage summary to console. */
1255
- printUsage() {
1255
+ printUsage(customConsole = console) {
1256
1256
  const u = this.usage;
1257
- console.log(
1257
+ customConsole.log(
1258
1258
  `Usage - messages: ${u.messageCount}, input: ${u.input}, cached: ${u.cachedRead}, output: ${u.output}, cost: $${u.cost.toFixed(4)}`
1259
1259
  );
1260
1260
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polka-codes/core",
3
- "version": "0.9.13",
3
+ "version": "0.9.15",
4
4
  "license": "AGPL-3.0",
5
5
  "author": "github@polka.codes",
6
6
  "type": "module",