diff --git a/packages/khbuild_assistant_prep/src/agents/step2.test.ts b/packages/khbuild_assistant_prep/src/agents/step2.test.ts new file mode 100644 index 0000000..17f858e --- /dev/null +++ b/packages/khbuild_assistant_prep/src/agents/step2.test.ts @@ -0,0 +1,11 @@ +import { describe, expect, it } from "vitest"; +import { formatPackage } from "./step2.js"; + +describe("formatPackage: вход (7)", () => { + it("текст последнего напоминания не искажается (буквы s и пробелы сохраняются, переводы строк схлопываются)", () => { + const text = formatPackage([ + { input_no: 7, jt_task_id: "T1", payload: { reminders: 2, last_reminded_at: "2026-12-04", last_reminder_text: "Thanks, Arthur.\n\nMeasured against the seawall; decision pending" } }, + ] as never); + expect(text).toContain("«Thanks, Arthur. Measured against the seawall; decision pending»"); + }); +}); diff --git a/packages/khbuild_assistant_prep/src/agents/step2.ts b/packages/khbuild_assistant_prep/src/agents/step2.ts index 8a898d9..595fec7 100644 --- a/packages/khbuild_assistant_prep/src/agents/step2.ts +++ b/packages/khbuild_assistant_prep/src/agents/step2.ts @@ -39,7 +39,7 @@ export function formatPackage(rows: PackageRow[]): string { for (const r of items) { if (no === 7) { const p = r.payload ?? {}; - out.push(`- задача ${r.jt_task_id ?? "(без задачи)"}: напоминаний ${p.reminders ?? "?"}, последнее ${p.last_reminded_at ?? "?"}, ответ: ${p.last_reply_outcome ?? "-"} ${p.last_reply_summary ?? ""}${p.last_reminder_text ? ` | текст последнего напоминания: «${String(p.last_reminder_text).replace(/s+/g, " ")}»` : ""}`.trim()); + out.push(`- задача ${r.jt_task_id ?? "(без задачи)"}: напоминаний ${p.reminders ?? "?"}, последнее ${p.last_reminded_at ?? "?"}, ответ: ${p.last_reply_outcome ?? "-"} ${p.last_reply_summary ?? ""}${p.last_reminder_text ? ` | текст последнего напоминания: «${String(p.last_reminder_text).replace(/\s+/g, " ")}»` : ""}`.trim()); continue; } const dates = r.start_date || r.end_date ? ` | ${r.start_date ?? "?"} .. ${r.end_date ?? "?"}` : "";