chore: fix lint and typing

This commit is contained in:
Peter Steinberger
2026-01-10 18:58:21 +01:00
parent c0a010335b
commit b977ae19af
9 changed files with 27 additions and 28 deletions

View File

@@ -1,11 +1,11 @@
import { describe, expect, it } from "vitest";
import { CURRENT_MESSAGE_MARKER } from "./mentions.js";
import {
HISTORY_CONTEXT_MARKER,
appendHistoryEntry,
buildHistoryContext,
buildHistoryContextFromEntries,
HISTORY_CONTEXT_MARKER,
} from "./history.js";
import { CURRENT_MESSAGE_MARKER } from "./mentions.js";
describe("history helpers", () => {
it("returns current message when history is empty", () => {

View File

@@ -51,9 +51,8 @@ export function buildHistoryContextFromEntries(params: {
excludeLast?: boolean;
}): string {
const lineBreak = params.lineBreak ?? "\n";
const entries = params.excludeLast === false
? params.entries
: params.entries.slice(0, -1);
const entries =
params.excludeLast === false ? params.entries : params.entries.slice(0, -1);
if (entries.length === 0) return params.currentMessage;
const historyText = entries.map(params.formatEntry).join(lineBreak);
return buildHistoryContext({