@parcha/agentrun-import 0.1.0-beta.57 → 0.1.0-beta.58

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/wrapped.d.ts CHANGED
@@ -31,11 +31,13 @@ export type Wrapped = {
31
31
  requests: number;
32
32
  tokens: number;
33
33
  }[];
34
+ /** `unpricedRequests` per model: of its requests, those its `cost` leaves out (all of them: no price was known). */
34
35
  models: {
35
36
  model: string;
36
37
  requests: number;
37
38
  tokens: Tokens;
38
39
  cost: number;
40
+ unpricedRequests: number;
39
41
  }[];
40
42
  sources: {
41
43
  source: string;
package/dist/wrapped.js CHANGED
@@ -49,7 +49,7 @@ export async function wrappedHome(home, year, options = {}) {
49
49
  const h = by(harnesses, harnessOf(totals.source), () => ({ sessions: 0, requests: 0, tokens: 0 }));
50
50
  h.requests += 1;
51
51
  h.tokens += held;
52
- const m = by(models, r.model ?? "unknown", () => ({ requests: 0, tokens: noTokens(), cost: 0 }));
52
+ const m = by(models, r.model ?? "unknown", () => ({ requests: 0, tokens: noTokens(), cost: 0, unpricedRequests: 0 }));
53
53
  m.requests += 1;
54
54
  if (r.usage)
55
55
  addTokens(m.tokens, r.usage);
@@ -58,8 +58,10 @@ export async function wrappedHome(home, year, options = {}) {
58
58
  // A request with no usage (pi leaves it off an aborted request) is unpriced; known zero usage is free and priced.
59
59
  if (r.usage)
60
60
  by(usages, r.model ?? "unknown", () => []).push(r.usage);
61
- else
61
+ else {
62
62
  out.unpricedRequests += 1;
63
+ m.unpricedRequests += 1;
64
+ }
63
65
  }
64
66
  },
65
67
  });
@@ -78,8 +80,10 @@ export async function wrappedHome(home, year, options = {}) {
78
80
  // The caller's price answers per request: one it cannot price is left out alone.
79
81
  for (const usage of paid) {
80
82
  const one = await options.price(known, usage);
81
- if (one === undefined)
83
+ if (one === undefined) {
82
84
  out.unpricedRequests += 1;
85
+ models.get(model).unpricedRequests += 1;
86
+ }
83
87
  else
84
88
  usd = (usd ?? 0) + one;
85
89
  }
@@ -88,8 +92,10 @@ export async function wrappedHome(home, year, options = {}) {
88
92
  }
89
93
  else if (prices)
90
94
  usd = await priceRequests(paid.map((usage) => ({ ...(known ? { model: known } : {}), usage })), prices);
91
- if (usd === undefined)
95
+ if (usd === undefined) {
92
96
  out.unpricedRequests += paid.length;
97
+ models.get(model).unpricedRequests += paid.length;
98
+ }
93
99
  else {
94
100
  out.cost += usd;
95
101
  models.get(model).cost = usd;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parcha/agentrun-import",
3
- "version": "0.1.0-beta.57",
3
+ "version": "0.1.0-beta.58",
4
4
  "description": "Reads the coding-agent sessions under a home (Claude Code, Codex, pi) into one Session shape, with normalized token usage, subagents under their parent, byte-offset cursors for re-reads, and per-session totals.",
5
5
  "keywords": [
6
6
  "agentrun",