@ai-matrx/meet 0.7.79 → 0.7.80

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -4340,6 +4340,7 @@ function fileDownloadPath(fileId) {
4340
4340
  }
4341
4341
 
4342
4342
  // src/core/after.ts
4343
+ import { toDelimited } from "@ai-matrx/kit/delimited";
4343
4344
  import { formatDurationMs } from "@ai-matrx/kit/format";
4344
4345
  function kindOf(person) {
4345
4346
  if (person.isAgent) return "assistant";
@@ -4478,11 +4479,6 @@ function attendanceTotals(rows) {
4478
4479
  averageMs: timed.length === 0 ? null : Math.round(timed.reduce((sum, row) => sum + (row.durationMs ?? 0), 0) / timed.length)
4479
4480
  };
4480
4481
  }
4481
- function csvCell(value) {
4482
- if (value === null) return "";
4483
- const text3 = String(value);
4484
- return /[",\n\r]/.test(text3) ? `"${text3.replace(/"/g, '""')}"` : text3;
4485
- }
4486
4482
  var ATTENDANCE_CSV_HEADER = [
4487
4483
  "Meeting",
4488
4484
  "Meeting started",
@@ -4494,11 +4490,11 @@ var ATTENDANCE_CSV_HEADER = [
4494
4490
  "Admission"
4495
4491
  ];
4496
4492
  function attendanceCsv(reports) {
4497
- const lines = [ATTENDANCE_CSV_HEADER.join(",")];
4498
- for (const { meeting, rows } of reports) {
4499
- for (const row of rows) {
4500
- lines.push(
4501
- [
4493
+ return toDelimited(
4494
+ [
4495
+ ATTENDANCE_CSV_HEADER,
4496
+ ...reports.flatMap(
4497
+ ({ meeting, rows }) => rows.map((row) => [
4502
4498
  meeting.title,
4503
4499
  meeting.startedAt ?? meeting.scheduledFor,
4504
4500
  row.name,
@@ -4507,12 +4503,11 @@ function attendanceCsv(reports) {
4507
4503
  row.leftAt,
4508
4504
  row.durationMs === null ? null : Math.round(row.durationMs / 6e3) / 10,
4509
4505
  row.admission
4510
- ].map(csvCell).join(",")
4511
- );
4512
- }
4513
- }
4514
- return `${lines.join("\r\n")}\r
4515
- `;
4506
+ ])
4507
+ )
4508
+ ],
4509
+ { lineEnding: "\r\n", trailingNewline: true }
4510
+ );
4516
4511
  }
4517
4512
  function recordingOffsetMs(at, recording) {
4518
4513
  if (recording === null || recording.state !== "available") return null;