{"type":"session","version":3,"id":"setup-check","timestamp":"2026-01-01T09:00:00.000Z","cwd":"/tmp/longhaul-setup-check"}
{"type":"message","id":"u0","parentId":null,"timestamp":"2026-01-01T09:00:15.000Z","message":{"role":"user","content":"Before we change anything: what does src/report.ts do?","timestamp":1767258015000}}
{"type":"message","id":"a0","parentId":"u0","timestamp":"2026-01-01T09:00:30.000Z","message":{"role":"assistant","content":[{"type":"text","text":"Reading it."},{"type":"toolCall","id":"a0-c0","name":"read","arguments":{"path":"src/report.ts"}}],"api":"openai-completions","provider":"example","model":"example-model","usage":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"totalTokens":0,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1767258030000}}
{"type":"message","id":"r0","parentId":"a0","timestamp":"2026-01-01T09:00:45.000Z","message":{"role":"toolResult","toolCallId":"a0-c0","toolName":"read","content":[{"type":"text","text":"// src/report.ts\n\nimport type { Row, Summary } from \"./types.ts\";\n\nexport function ordersSummary0(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"orders\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"orders\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function ordersSummary1(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"orders\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"orders\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function ordersSummary2(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"orders\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"orders\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function ordersSummary3(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"orders\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"orders\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function ordersSummary4(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"orders\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"orders\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function ordersSummary5(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"orders\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"orders\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function ordersSummary6(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"orders\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"orders\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function ordersSummary7(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"orders\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"orders\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function ordersSummary8(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"orders\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"orders\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function ordersSummary9(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"orders\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"orders\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function refundsSummary0(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"refunds\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"refunds\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function refundsSummary1(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"refunds\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"refunds\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function refundsSummary2(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"refunds\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"refunds\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function refundsSummary3(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"refunds\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"refunds\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function refundsSummary4(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"refunds\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"refunds\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function refundsSummary5(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"refunds\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"refunds\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function refundsSummary6(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"refunds\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"refunds\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function refundsSummary7(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"refunds\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"refunds\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function refundsSummary8(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"refunds\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"refunds\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function refundsSummary9(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"refunds\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"refunds\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function invoicesSummary0(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"invoices\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"invoices\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function invoicesSummary1(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"invoices\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"invoices\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function invoicesSummary2(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"invoices\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"invoices\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function invoicesSummary3(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"invoices\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"invoices\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function invoicesSummary4(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"invoices\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"invoices\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function invoicesSummary5(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"invoices\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"invoices\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function invoicesSummary6(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"invoices\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"invoices\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function invoicesSummary7(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"invoices\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"invoices\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function invoicesSummary8(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"invoices\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"invoices\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function invoicesSummary9(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"invoices\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"invoices\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function payoutsSummary0(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"payouts\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"payouts\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function payoutsSummary1(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"payouts\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"payouts\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function payoutsSummary2(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"payouts\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"payouts\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function payoutsSummary3(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"payouts\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"payouts\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function payoutsSummary4(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"payouts\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"payouts\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function payoutsSummary5(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"payouts\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"payouts\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function payoutsSummary6(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"payouts\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"payouts\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function payoutsSummary7(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"payouts\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"payouts\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function payoutsSummary8(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"payouts\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"payouts\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function payoutsSummary9(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"payouts\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"payouts\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function customersSummary0(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"customers\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"customers\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function customersSummary1(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"customers\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"customers\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function customersSummary2(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"customers\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"customers\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function customersSummary3(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"customers\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"customers\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function customersSummary4(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"customers\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"customers\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function customersSummary5(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"customers\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"customers\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function customersSummary6(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"customers\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"customers\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function customersSummary7(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"customers\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"customers\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function customersSummary8(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"customers\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"customers\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function customersSummary9(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"customers\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"customers\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function productsSummary0(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"products\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"products\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function productsSummary1(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"products\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"products\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function productsSummary2(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"products\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"products\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function productsSummary3(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"products\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"products\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function productsSummary4(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"products\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"products\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function productsSummary5(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"products\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"products\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function productsSummary6(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"products\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"products\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function productsSummary7(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"products\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"products\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function productsSummary8(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"products\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"products\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function productsSummary9(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"products\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"products\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function shipmentsSummary0(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"shipments\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"shipments\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function shipmentsSummary1(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"shipments\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"shipments\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function shipmentsSummary2(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"shipments\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"shipments\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function shipmentsSummary3(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"shipments\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"shipments\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function shipmentsSummary4(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"shipments\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"shipments\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function shipmentsSummary5(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"shipments\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"shipments\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function shipmentsSummary6(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"shipments\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"shipments\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function shipmentsSummary7(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"shipments\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"shipments\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function shipmentsSummary8(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"shipments\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"shipments\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function shipmentsSummary9(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"shipments\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"shipments\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function returnsSummary0(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"returns\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"returns\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function returnsSummary1(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"returns\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"returns\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function returnsSummary2(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"returns\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"returns\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function returnsSummary3(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"returns\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"returns\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function returnsSummary4(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"returns\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"returns\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function returnsSummary5(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"returns\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"returns\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function returnsSummary6(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"returns\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"returns\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function returnsSummary7(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"returns\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"returns\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function returnsSummary8(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"returns\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"returns\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function returnsSummary9(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"returns\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"returns\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function couponsSummary0(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"coupons\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"coupons\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function couponsSummary1(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"coupons\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"coupons\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function couponsSummary2(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"coupons\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"coupons\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function couponsSummary3(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"coupons\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"coupons\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function couponsSummary4(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"coupons\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"coupons\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function couponsSummary5(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"coupons\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"coupons\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function couponsSummary6(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"coupons\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"coupons\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function couponsSummary7(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"coupons\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"coupons\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function couponsSummary8(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"coupons\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"coupons\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function couponsSummary9(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"coupons\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"coupons\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function taxesSummary0(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"taxes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"taxes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function taxesSummary1(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"taxes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"taxes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function taxesSummary2(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"taxes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"taxes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function taxesSummary3(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"taxes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"taxes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function taxesSummary4(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"taxes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"taxes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function taxesSummary5(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"taxes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"taxes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function taxesSummary6(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"taxes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"taxes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function taxesSummary7(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"taxes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"taxes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function taxesSummary8(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"taxes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"taxes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function taxesSummary9(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"taxes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"taxes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function subscriptionsSummary0(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"subscriptions\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"subscriptions\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function subscriptionsSummary1(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"subscriptions\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"subscriptions\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function subscriptionsSummary2(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"subscriptions\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"subscriptions\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function subscriptionsSummary3(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"subscriptions\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"subscriptions\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function subscriptionsSummary4(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"subscriptions\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"subscriptions\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function subscriptionsSummary5(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"subscriptions\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"subscriptions\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function subscriptionsSummary6(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"subscriptions\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"subscriptions\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function subscriptionsSummary7(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"subscriptions\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"subscriptions\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function subscriptionsSummary8(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"subscriptions\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"subscriptions\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function subscriptionsSummary9(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"subscriptions\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"subscriptions\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function disputesSummary0(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"disputes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"disputes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function disputesSummary1(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"disputes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"disputes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function disputesSummary2(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"disputes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"disputes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function disputesSummary3(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"disputes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"disputes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function disputesSummary4(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"disputes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"disputes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function disputesSummary5(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"disputes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"disputes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function disputesSummary6(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"disputes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"disputes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function disputesSummary7(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"disputes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"disputes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function disputesSummary8(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"disputes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"disputes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function disputesSummary9(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"disputes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"disputes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}"}],"isError":false,"timestamp":1767258045000}}
{"type":"message","id":"a0b","parentId":"r0","timestamp":"2026-01-01T09:01:00.000Z","message":{"role":"assistant","content":[{"type":"text","text":"It builds one summary per report kind and date range: a count, a total and an average, all in cents."}],"api":"openai-completions","provider":"example","model":"example-model","usage":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"totalTokens":0,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"stop","timestamp":1767258060000}}
{"type":"message","id":"u1","parentId":"a0b","timestamp":"2026-01-01T09:01:15.000Z","message":{"role":"user","content":"Add a CSV export to the reports page. Stream the rows; do not add any new dependencies.","timestamp":1767258075000}}
{"type":"message","id":"a1","parentId":"u1","timestamp":"2026-01-01T09:01:30.000Z","message":{"role":"assistant","content":[{"type":"text","text":"I'll read the report module first."},{"type":"toolCall","id":"a1-c0","name":"read","arguments":{"path":"src/report.ts"}}],"api":"openai-completions","provider":"example","model":"example-model","usage":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"totalTokens":0,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1767258090000}}
{"type":"message","id":"r1","parentId":"a1","timestamp":"2026-01-01T09:01:45.000Z","message":{"role":"toolResult","toolCallId":"a1-c0","toolName":"read","content":[{"type":"text","text":"// src/report.ts\n\nimport type { Row, Summary } from \"./types.ts\";\n\nexport function ordersSummary0(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"orders\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"orders\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function ordersSummary1(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"orders\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"orders\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function ordersSummary2(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"orders\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"orders\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function ordersSummary3(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"orders\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"orders\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function ordersSummary4(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"orders\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"orders\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function ordersSummary5(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"orders\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"orders\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function ordersSummary6(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"orders\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"orders\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function ordersSummary7(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"orders\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"orders\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function ordersSummary8(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"orders\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"orders\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function ordersSummary9(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"orders\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"orders\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function refundsSummary0(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"refunds\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"refunds\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function refundsSummary1(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"refunds\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"refunds\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function refundsSummary2(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"refunds\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"refunds\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function refundsSummary3(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"refunds\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"refunds\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function refundsSummary4(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"refunds\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"refunds\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function refundsSummary5(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"refunds\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"refunds\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function refundsSummary6(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"refunds\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"refunds\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function refundsSummary7(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"refunds\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"refunds\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function refundsSummary8(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"refunds\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"refunds\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function refundsSummary9(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"refunds\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"refunds\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function invoicesSummary0(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"invoices\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"invoices\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function invoicesSummary1(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"invoices\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"invoices\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function invoicesSummary2(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"invoices\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"invoices\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function invoicesSummary3(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"invoices\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"invoices\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function invoicesSummary4(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"invoices\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"invoices\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function invoicesSummary5(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"invoices\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"invoices\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function invoicesSummary6(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"invoices\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"invoices\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function invoicesSummary7(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"invoices\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"invoices\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function invoicesSummary8(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"invoices\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"invoices\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function invoicesSummary9(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"invoices\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"invoices\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function payoutsSummary0(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"payouts\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"payouts\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function payoutsSummary1(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"payouts\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"payouts\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function payoutsSummary2(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"payouts\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"payouts\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function payoutsSummary3(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"payouts\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"payouts\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function payoutsSummary4(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"payouts\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"payouts\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function payoutsSummary5(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"payouts\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"payouts\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function payoutsSummary6(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"payouts\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"payouts\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function payoutsSummary7(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"payouts\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"payouts\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function payoutsSummary8(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"payouts\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"payouts\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function payoutsSummary9(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"payouts\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"payouts\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function customersSummary0(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"customers\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"customers\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function customersSummary1(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"customers\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"customers\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function customersSummary2(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"customers\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"customers\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function customersSummary3(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"customers\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"customers\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function customersSummary4(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"customers\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"customers\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function customersSummary5(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"customers\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"customers\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function customersSummary6(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"customers\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"customers\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function customersSummary7(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"customers\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"customers\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function customersSummary8(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"customers\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"customers\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function customersSummary9(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"customers\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"customers\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function productsSummary0(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"products\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"products\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function productsSummary1(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"products\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"products\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function productsSummary2(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"products\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"products\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function productsSummary3(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"products\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"products\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function productsSummary4(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"products\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"products\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function productsSummary5(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"products\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"products\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function productsSummary6(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"products\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"products\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function productsSummary7(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"products\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"products\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function productsSummary8(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"products\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"products\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function productsSummary9(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"products\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"products\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function shipmentsSummary0(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"shipments\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"shipments\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function shipmentsSummary1(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"shipments\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"shipments\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function shipmentsSummary2(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"shipments\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"shipments\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function shipmentsSummary3(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"shipments\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"shipments\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function shipmentsSummary4(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"shipments\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"shipments\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function shipmentsSummary5(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"shipments\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"shipments\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function shipmentsSummary6(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"shipments\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"shipments\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function shipmentsSummary7(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"shipments\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"shipments\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function shipmentsSummary8(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"shipments\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"shipments\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function shipmentsSummary9(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"shipments\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"shipments\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function returnsSummary0(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"returns\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"returns\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function returnsSummary1(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"returns\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"returns\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function returnsSummary2(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"returns\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"returns\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function returnsSummary3(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"returns\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"returns\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function returnsSummary4(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"returns\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"returns\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function returnsSummary5(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"returns\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"returns\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function returnsSummary6(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"returns\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"returns\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function returnsSummary7(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"returns\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"returns\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function returnsSummary8(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"returns\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"returns\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function returnsSummary9(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"returns\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"returns\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function couponsSummary0(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"coupons\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"coupons\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function couponsSummary1(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"coupons\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"coupons\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function couponsSummary2(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"coupons\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"coupons\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function couponsSummary3(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"coupons\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"coupons\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function couponsSummary4(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"coupons\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"coupons\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function couponsSummary5(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"coupons\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"coupons\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function couponsSummary6(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"coupons\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"coupons\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function couponsSummary7(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"coupons\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"coupons\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function couponsSummary8(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"coupons\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"coupons\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function couponsSummary9(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"coupons\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"coupons\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function taxesSummary0(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"taxes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"taxes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function taxesSummary1(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"taxes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"taxes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function taxesSummary2(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"taxes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"taxes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function taxesSummary3(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"taxes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"taxes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function taxesSummary4(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"taxes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"taxes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function taxesSummary5(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"taxes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"taxes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function taxesSummary6(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"taxes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"taxes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function taxesSummary7(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"taxes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"taxes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function taxesSummary8(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"taxes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"taxes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function taxesSummary9(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"taxes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"taxes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function subscriptionsSummary0(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"subscriptions\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"subscriptions\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function subscriptionsSummary1(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"subscriptions\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"subscriptions\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function subscriptionsSummary2(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"subscriptions\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"subscriptions\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function subscriptionsSummary3(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"subscriptions\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"subscriptions\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function subscriptionsSummary4(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"subscriptions\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"subscriptions\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function subscriptionsSummary5(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"subscriptions\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"subscriptions\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function subscriptionsSummary6(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"subscriptions\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"subscriptions\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function subscriptionsSummary7(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"subscriptions\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"subscriptions\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function subscriptionsSummary8(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"subscriptions\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"subscriptions\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function subscriptionsSummary9(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"subscriptions\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"subscriptions\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function disputesSummary0(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"disputes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"disputes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function disputesSummary1(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"disputes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"disputes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function disputesSummary2(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"disputes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"disputes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function disputesSummary3(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"disputes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"disputes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function disputesSummary4(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"disputes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"disputes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function disputesSummary5(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"disputes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"disputes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function disputesSummary6(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"disputes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"disputes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function disputesSummary7(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"disputes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"disputes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function disputesSummary8(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"disputes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"disputes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function disputesSummary9(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"disputes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"disputes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}"}],"isError":false,"timestamp":1767258105000}}
{"type":"message","id":"a2","parentId":"r1","timestamp":"2026-01-01T09:02:00.000Z","message":{"role":"assistant","content":[{"type":"text","text":"Running the existing tests before changing anything."},{"type":"toolCall","id":"a2-c0","name":"bash","arguments":{"command":"npm test"}}],"api":"openai-completions","provider":"example","model":"example-model","usage":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"totalTokens":0,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1767258120000}}
{"type":"message","id":"r2","parentId":"a2","timestamp":"2026-01-01T09:02:15.000Z","message":{"role":"toolResult","toolCallId":"a2-c0","toolName":"bash","content":[{"type":"text","text":"ok 1 - report orders summary 0\nok 2 - report refunds summary 1\nok 3 - report invoices summary 2\nok 4 - report payouts summary 3\nok 5 - report orders summary 4\nok 6 - report refunds summary 5\nok 7 - report invoices summary 6\nok 8 - report payouts summary 7\nok 9 - report orders summary 8\nok 10 - report refunds summary 9\nok 11 - report invoices summary 10\nok 12 - report payouts summary 11\nok 13 - report orders summary 12\nok 14 - report refunds summary 13\nok 15 - report invoices summary 14\nok 16 - report payouts summary 15\nok 17 - report orders summary 16\nok 18 - report refunds summary 17\nok 19 - report invoices summary 18\nok 20 - report payouts summary 19\nok 21 - report orders summary 20\nok 22 - report refunds summary 21\nok 23 - report invoices summary 22\nok 24 - report payouts summary 23\nok 25 - report orders summary 24\nok 26 - report refunds summary 25\nok 27 - report invoices summary 26\nok 28 - report payouts summary 27\nok 29 - report orders summary 28\nok 30 - report refunds summary 29\nok 31 - report invoices summary 30\nok 32 - report payouts summary 31\nok 33 - report orders summary 32\nok 34 - report refunds summary 33\nok 35 - report invoices summary 34\nok 36 - report payouts summary 35\nok 37 - report orders summary 36\nok 38 - report refunds summary 37\nok 39 - report invoices summary 38\nok 40 - report payouts summary 39\nok 41 - report orders summary 40\nok 42 - report refunds summary 41\nok 43 - report invoices summary 42\nok 44 - report payouts summary 43\nok 45 - report orders summary 44\nok 46 - report refunds summary 45\nok 47 - report invoices summary 46\nok 48 - report payouts summary 47\nok 49 - report orders summary 48\nok 50 - report refunds summary 49\nok 51 - report invoices summary 50\nok 52 - report payouts summary 51\nok 53 - report orders summary 52\nok 54 - report refunds summary 53\nok 55 - report invoices summary 54\nok 56 - report payouts summary 55\nok 57 - report orders summary 56\nok 58 - report refunds summary 57\nok 59 - report invoices summary 58\nok 60 - report payouts summary 59\nok 61 - report orders summary 60\nok 62 - report refunds summary 61\nok 63 - report invoices summary 62\nok 64 - report payouts summary 63\nok 65 - report orders summary 64\nok 66 - report refunds summary 65\nok 67 - report invoices summary 66\nok 68 - report payouts summary 67\nok 69 - report orders summary 68\nok 70 - report refunds summary 69\nok 71 - report invoices summary 70\nok 72 - report payouts summary 71\nok 73 - report orders summary 72\nok 74 - report refunds summary 73\nok 75 - report invoices summary 74\nok 76 - report payouts summary 75\nok 77 - report orders summary 76\nok 78 - report refunds summary 77\nok 79 - report invoices summary 78\nok 80 - report payouts summary 79\nok 81 - report orders summary 80\nok 82 - report refunds summary 81\nok 83 - report invoices summary 82\nok 84 - report payouts summary 83\nok 85 - report orders summary 84\nok 86 - report refunds summary 85\nok 87 - report invoices summary 86\nok 88 - report payouts summary 87\nok 89 - report orders summary 88\nok 90 - report refunds summary 89\nok 91 - report invoices summary 90\nok 92 - report payouts summary 91\nok 93 - report orders summary 92\nok 94 - report refunds summary 93\nok 95 - report invoices summary 94\nok 96 - report payouts summary 95\nok 97 - report orders summary 96\nok 98 - report refunds summary 97\nok 99 - report invoices summary 98\nok 100 - report payouts summary 99\nok 101 - report orders summary 100\nok 102 - report refunds summary 101\nok 103 - report invoices summary 102\nok 104 - report payouts summary 103\nok 105 - report orders summary 104\nok 106 - report refunds summary 105\nok 107 - report invoices summary 106\nok 108 - report payouts summary 107\nok 109 - report orders summary 108\nok 110 - report refunds summary 109\nok 111 - report invoices summary 110\nok 112 - report payouts summary 111\nok 113 - report orders summary 112\nok 114 - report refunds summary 113\nok 115 - report invoices summary 114\nok 116 - report payouts summary 115\nok 117 - report orders summary 116\nok 118 - report refunds summary 117\nok 119 - report invoices summary 118\nok 120 - report payouts summary 119\nok 121 - report orders summary 120\nok 122 - report refunds summary 121\nok 123 - report invoices summary 122\nok 124 - report payouts summary 123\nok 125 - report orders summary 124\nok 126 - report refunds summary 125\nok 127 - report invoices summary 126\nok 128 - report payouts summary 127\nok 129 - report orders summary 128\nok 130 - report refunds summary 129\nok 131 - report invoices summary 130\nok 132 - report payouts summary 131\nok 133 - report orders summary 132\nok 134 - report refunds summary 133\nok 135 - report invoices summary 134\nok 136 - report payouts summary 135\nok 137 - report orders summary 136\nok 138 - report refunds summary 137\nok 139 - report invoices summary 138\nok 140 - report payouts summary 139\nok 141 - report orders summary 140\nok 142 - report refunds summary 141\nok 143 - report invoices summary 142\nok 144 - report payouts summary 143\nok 145 - report orders summary 144\nok 146 - report refunds summary 145\nok 147 - report invoices summary 146\nok 148 - report payouts summary 147\nok 149 - report orders summary 148\nok 150 - report refunds summary 149\nok 151 - report invoices summary 150\nok 152 - report payouts summary 151\nok 153 - report orders summary 152\nok 154 - report refunds summary 153\nok 155 - report invoices summary 154\nok 156 - report payouts summary 155\nok 157 - report orders summary 156\nok 158 - report refunds summary 157\nok 159 - report invoices summary 158\nok 160 - report payouts summary 159\n# tests 160\n# pass 160\n# fail 0\n[exit 0]"}],"isError":false,"timestamp":1767258135000}}
{"type":"message","id":"u2","parentId":"r2","timestamp":"2026-01-01T09:02:30.000Z","message":{"role":"user","content":"Never build the whole file in memory; some exports have a million rows.","timestamp":1767258150000}}
{"type":"message","id":"a3","parentId":"u2","timestamp":"2026-01-01T09:02:45.000Z","message":{"role":"assistant","content":[{"type":"text","text":"Understood. I'll write rows to the response as they are produced."},{"type":"toolCall","id":"a3-c0","name":"write","arguments":{"path":"src/export.ts","content":"export async function* csvRows() {}\n"}}],"api":"openai-completions","provider":"example","model":"example-model","usage":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"totalTokens":0,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1767258165000}}
{"type":"message","id":"r3","parentId":"a3","timestamp":"2026-01-01T09:03:00.000Z","message":{"role":"toolResult","toolCallId":"a3-c0","toolName":"write","content":[{"type":"text","text":"Wrote src/export.ts"}],"isError":false,"timestamp":1767258180000}}
{"type":"message","id":"a4","parentId":"r3","timestamp":"2026-01-01T09:03:15.000Z","message":{"role":"assistant","content":[{"type":"text","text":"Reading the report module again to wire the export into each summary."},{"type":"toolCall","id":"a4-c0","name":"read","arguments":{"path":"src/report.ts"}}],"api":"openai-completions","provider":"example","model":"example-model","usage":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"totalTokens":0,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1767258195000}}
{"type":"message","id":"r4","parentId":"a4","timestamp":"2026-01-01T09:03:30.000Z","message":{"role":"toolResult","toolCallId":"a4-c0","toolName":"read","content":[{"type":"text","text":"// src/report.ts\n\nimport type { Row, Summary } from \"./types.ts\";\n\nexport function ordersSummary0(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"orders\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"orders\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function ordersSummary1(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"orders\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"orders\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function ordersSummary2(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"orders\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"orders\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function ordersSummary3(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"orders\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"orders\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function ordersSummary4(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"orders\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"orders\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function ordersSummary5(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"orders\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"orders\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function ordersSummary6(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"orders\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"orders\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function ordersSummary7(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"orders\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"orders\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function ordersSummary8(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"orders\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"orders\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function ordersSummary9(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"orders\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"orders\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function refundsSummary0(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"refunds\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"refunds\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function refundsSummary1(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"refunds\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"refunds\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function refundsSummary2(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"refunds\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"refunds\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function refundsSummary3(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"refunds\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"refunds\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function refundsSummary4(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"refunds\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"refunds\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function refundsSummary5(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"refunds\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"refunds\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function refundsSummary6(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"refunds\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"refunds\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function refundsSummary7(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"refunds\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"refunds\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function refundsSummary8(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"refunds\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"refunds\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function refundsSummary9(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"refunds\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"refunds\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function invoicesSummary0(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"invoices\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"invoices\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function invoicesSummary1(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"invoices\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"invoices\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function invoicesSummary2(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"invoices\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"invoices\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function invoicesSummary3(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"invoices\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"invoices\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function invoicesSummary4(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"invoices\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"invoices\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function invoicesSummary5(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"invoices\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"invoices\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function invoicesSummary6(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"invoices\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"invoices\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function invoicesSummary7(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"invoices\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"invoices\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function invoicesSummary8(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"invoices\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"invoices\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function invoicesSummary9(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"invoices\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"invoices\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function payoutsSummary0(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"payouts\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"payouts\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function payoutsSummary1(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"payouts\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"payouts\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function payoutsSummary2(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"payouts\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"payouts\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function payoutsSummary3(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"payouts\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"payouts\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function payoutsSummary4(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"payouts\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"payouts\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function payoutsSummary5(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"payouts\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"payouts\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function payoutsSummary6(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"payouts\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"payouts\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function payoutsSummary7(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"payouts\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"payouts\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function payoutsSummary8(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"payouts\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"payouts\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function payoutsSummary9(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"payouts\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"payouts\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function customersSummary0(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"customers\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"customers\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function customersSummary1(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"customers\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"customers\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function customersSummary2(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"customers\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"customers\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function customersSummary3(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"customers\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"customers\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function customersSummary4(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"customers\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"customers\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function customersSummary5(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"customers\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"customers\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function customersSummary6(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"customers\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"customers\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function customersSummary7(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"customers\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"customers\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function customersSummary8(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"customers\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"customers\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function customersSummary9(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"customers\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"customers\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function productsSummary0(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"products\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"products\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function productsSummary1(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"products\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"products\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function productsSummary2(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"products\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"products\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function productsSummary3(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"products\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"products\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function productsSummary4(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"products\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"products\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function productsSummary5(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"products\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"products\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function productsSummary6(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"products\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"products\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function productsSummary7(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"products\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"products\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function productsSummary8(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"products\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"products\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function productsSummary9(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"products\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"products\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function shipmentsSummary0(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"shipments\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"shipments\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function shipmentsSummary1(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"shipments\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"shipments\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function shipmentsSummary2(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"shipments\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"shipments\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function shipmentsSummary3(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"shipments\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"shipments\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function shipmentsSummary4(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"shipments\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"shipments\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function shipmentsSummary5(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"shipments\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"shipments\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function shipmentsSummary6(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"shipments\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"shipments\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function shipmentsSummary7(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"shipments\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"shipments\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function shipmentsSummary8(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"shipments\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"shipments\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function shipmentsSummary9(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"shipments\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"shipments\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function returnsSummary0(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"returns\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"returns\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function returnsSummary1(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"returns\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"returns\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function returnsSummary2(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"returns\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"returns\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function returnsSummary3(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"returns\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"returns\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function returnsSummary4(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"returns\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"returns\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function returnsSummary5(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"returns\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"returns\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function returnsSummary6(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"returns\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"returns\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function returnsSummary7(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"returns\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"returns\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function returnsSummary8(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"returns\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"returns\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function returnsSummary9(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"returns\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"returns\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function couponsSummary0(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"coupons\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"coupons\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function couponsSummary1(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"coupons\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"coupons\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function couponsSummary2(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"coupons\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"coupons\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function couponsSummary3(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"coupons\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"coupons\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function couponsSummary4(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"coupons\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"coupons\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function couponsSummary5(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"coupons\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"coupons\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function couponsSummary6(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"coupons\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"coupons\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function couponsSummary7(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"coupons\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"coupons\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function couponsSummary8(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"coupons\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"coupons\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function couponsSummary9(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"coupons\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"coupons\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function taxesSummary0(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"taxes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"taxes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function taxesSummary1(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"taxes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"taxes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function taxesSummary2(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"taxes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"taxes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function taxesSummary3(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"taxes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"taxes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function taxesSummary4(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"taxes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"taxes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function taxesSummary5(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"taxes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"taxes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function taxesSummary6(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"taxes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"taxes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function taxesSummary7(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"taxes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"taxes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function taxesSummary8(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"taxes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"taxes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function taxesSummary9(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"taxes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"taxes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function subscriptionsSummary0(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"subscriptions\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"subscriptions\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function subscriptionsSummary1(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"subscriptions\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"subscriptions\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function subscriptionsSummary2(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"subscriptions\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"subscriptions\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function subscriptionsSummary3(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"subscriptions\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"subscriptions\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function subscriptionsSummary4(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"subscriptions\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"subscriptions\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function subscriptionsSummary5(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"subscriptions\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"subscriptions\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function subscriptionsSummary6(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"subscriptions\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"subscriptions\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function subscriptionsSummary7(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"subscriptions\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"subscriptions\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function subscriptionsSummary8(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"subscriptions\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"subscriptions\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function subscriptionsSummary9(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"subscriptions\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"subscriptions\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function disputesSummary0(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"disputes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"disputes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function disputesSummary1(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"disputes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"disputes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function disputesSummary2(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"disputes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"disputes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function disputesSummary3(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"disputes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"disputes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function disputesSummary4(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"disputes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"disputes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function disputesSummary5(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"disputes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"disputes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function disputesSummary6(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"disputes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"disputes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function disputesSummary7(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"disputes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"disputes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function disputesSummary8(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"disputes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"disputes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}\n\nexport function disputesSummary9(rows: Row[], from: Date, to: Date): Summary {\n  const inRange = rows.filter((row) => row.at >= from && row.at < to && row.kind === \"disputes\");\n  const total = inRange.reduce((sum, row) => sum + row.amountCents, 0);\n  return { kind: \"disputes\", count: inRange.length, totalCents: total, averageCents: inRange.length ? Math.round(total / inRange.length) : 0 };\n}"}],"isError":false,"timestamp":1767258210000}}
{"type":"message","id":"a5","parentId":"r4","timestamp":"2026-01-01T09:03:45.000Z","message":{"role":"assistant","content":[{"type":"text","text":"Tests again after the change."},{"type":"toolCall","id":"a5-c0","name":"bash","arguments":{"command":"npm test"}}],"api":"openai-completions","provider":"example","model":"example-model","usage":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"totalTokens":0,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"toolUse","timestamp":1767258225000}}
{"type":"message","id":"r5","parentId":"a5","timestamp":"2026-01-01T09:04:00.000Z","message":{"role":"toolResult","toolCallId":"a5-c0","toolName":"bash","content":[{"type":"text","text":"ok 1 - report orders summary 0\nok 2 - report refunds summary 1\nok 3 - report invoices summary 2\nok 4 - report payouts summary 3\nok 5 - report orders summary 4\nok 6 - report refunds summary 5\nok 7 - report invoices summary 6\nok 8 - report payouts summary 7\nok 9 - report orders summary 8\nok 10 - report refunds summary 9\nok 11 - report invoices summary 10\nok 12 - report payouts summary 11\nok 13 - report orders summary 12\nok 14 - report refunds summary 13\nok 15 - report invoices summary 14\nok 16 - report payouts summary 15\nok 17 - report orders summary 16\nok 18 - report refunds summary 17\nok 19 - report invoices summary 18\nok 20 - report payouts summary 19\nok 21 - report orders summary 20\nok 22 - report refunds summary 21\nok 23 - report invoices summary 22\nok 24 - report payouts summary 23\nok 25 - report orders summary 24\nok 26 - report refunds summary 25\nok 27 - report invoices summary 26\nok 28 - report payouts summary 27\nok 29 - report orders summary 28\nok 30 - report refunds summary 29\nok 31 - report invoices summary 30\nok 32 - report payouts summary 31\nok 33 - report orders summary 32\nok 34 - report refunds summary 33\nok 35 - report invoices summary 34\nok 36 - report payouts summary 35\nok 37 - report orders summary 36\nok 38 - report refunds summary 37\nok 39 - report invoices summary 38\nok 40 - report payouts summary 39\nok 41 - report orders summary 40\nok 42 - report refunds summary 41\nok 43 - report invoices summary 42\nok 44 - report payouts summary 43\nok 45 - report orders summary 44\nok 46 - report refunds summary 45\nok 47 - report invoices summary 46\nok 48 - report payouts summary 47\nok 49 - report orders summary 48\nok 50 - report refunds summary 49\nok 51 - report invoices summary 50\nok 52 - report payouts summary 51\nok 53 - report orders summary 52\nok 54 - report refunds summary 53\nok 55 - report invoices summary 54\nok 56 - report payouts summary 55\nok 57 - report orders summary 56\nok 58 - report refunds summary 57\nok 59 - report invoices summary 58\nok 60 - report payouts summary 59\nok 61 - report orders summary 60\nok 62 - report refunds summary 61\nok 63 - report invoices summary 62\nok 64 - report payouts summary 63\nok 65 - report orders summary 64\nok 66 - report refunds summary 65\nok 67 - report invoices summary 66\nok 68 - report payouts summary 67\nok 69 - report orders summary 68\nok 70 - report refunds summary 69\nok 71 - report invoices summary 70\nok 72 - report payouts summary 71\nok 73 - report orders summary 72\nok 74 - report refunds summary 73\nok 75 - report invoices summary 74\nok 76 - report payouts summary 75\nok 77 - report orders summary 76\nok 78 - report refunds summary 77\nok 79 - report invoices summary 78\nok 80 - report payouts summary 79\nok 81 - report orders summary 80\nok 82 - report refunds summary 81\nok 83 - report invoices summary 82\nok 84 - report payouts summary 83\nok 85 - report orders summary 84\nok 86 - report refunds summary 85\nok 87 - report invoices summary 86\nok 88 - report payouts summary 87\nok 89 - report orders summary 88\nok 90 - report refunds summary 89\nok 91 - report invoices summary 90\nok 92 - report payouts summary 91\nok 93 - report orders summary 92\nok 94 - report refunds summary 93\nok 95 - report invoices summary 94\nok 96 - report payouts summary 95\nok 97 - report orders summary 96\nok 98 - report refunds summary 97\nok 99 - report invoices summary 98\nok 100 - report payouts summary 99\nok 101 - report orders summary 100\nok 102 - report refunds summary 101\nok 103 - report invoices summary 102\nok 104 - report payouts summary 103\nok 105 - report orders summary 104\nok 106 - report refunds summary 105\nok 107 - report invoices summary 106\nok 108 - report payouts summary 107\nok 109 - report orders summary 108\nok 110 - report refunds summary 109\nok 111 - report invoices summary 110\nok 112 - report payouts summary 111\nok 113 - report orders summary 112\nok 114 - report refunds summary 113\nok 115 - report invoices summary 114\nok 116 - report payouts summary 115\nok 117 - report orders summary 116\nok 118 - report refunds summary 117\nok 119 - report invoices summary 118\nok 120 - report payouts summary 119\nok 121 - report orders summary 120\nok 122 - report refunds summary 121\nok 123 - report invoices summary 122\nok 124 - report payouts summary 123\nok 125 - report orders summary 124\nok 126 - report refunds summary 125\nok 127 - report invoices summary 126\nok 128 - report payouts summary 127\nok 129 - report orders summary 128\nok 130 - report refunds summary 129\nok 131 - report invoices summary 130\nok 132 - report payouts summary 131\nok 133 - report orders summary 132\nok 134 - report refunds summary 133\nok 135 - report invoices summary 134\nok 136 - report payouts summary 135\nok 137 - report orders summary 136\nok 138 - report refunds summary 137\nok 139 - report invoices summary 138\nok 140 - report payouts summary 139\nok 141 - report orders summary 140\nok 142 - report refunds summary 141\nok 143 - report invoices summary 142\nok 144 - report payouts summary 143\nok 145 - report orders summary 144\nok 146 - report refunds summary 145\nok 147 - report invoices summary 146\nok 148 - report payouts summary 147\nok 149 - report orders summary 148\nok 150 - report refunds summary 149\nok 151 - report invoices summary 150\nok 152 - report payouts summary 151\nok 153 - report orders summary 152\nok 154 - report refunds summary 153\nok 155 - report invoices summary 154\nok 156 - report payouts summary 155\nok 157 - report orders summary 156\nok 158 - report refunds summary 157\nok 159 - report invoices summary 158\nok 160 - report payouts summary 159\n# tests 161\n# pass 161\n# fail 0\n[exit 0]"}],"isError":false,"timestamp":1767258240000}}
{"type":"message","id":"u3","parentId":"r5","timestamp":"2026-01-01T09:04:15.000Z","message":{"role":"user","content":"Quote fields that contain commas, quotes or newlines, as RFC 4180 says.","timestamp":1767258255000}}
{"type":"message","id":"a6","parentId":"u3","timestamp":"2026-01-01T09:04:30.000Z","message":{"role":"assistant","content":[{"type":"text","text":"Adding the quoting rule and a test for embedded newlines next."}],"api":"openai-completions","provider":"example","model":"example-model","usage":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"totalTokens":0,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"stop","timestamp":1767258270000}}
