chore: migrate to oxlint and oxfmt

Co-authored-by: Christoph Nakazawa <christoph.pojer@gmail.com>
This commit is contained in:
Peter Steinberger
2026-01-14 14:31:43 +00:00
parent 912ebffc63
commit c379191f80
1480 changed files with 28608 additions and 43547 deletions

View File

@@ -11,10 +11,7 @@ export function resolveFinalAssistantText(params: {
return "(no output)";
}
function extractTextBlocks(
content: unknown,
opts?: { includeThinking?: boolean },
): string {
function extractTextBlocks(content: unknown, opts?: { includeThinking?: boolean }): string {
if (typeof content === "string") return content.trim();
if (!Array.isArray(content)) return "";
const parts: string[] = [];
@@ -52,9 +49,7 @@ export function formatTokens(total?: number | null, context?: number | null) {
typeof total === "number" && context > 0
? Math.min(999, Math.round((total / context) * 100))
: null;
return `tokens ${totalLabel}/${formatTokenCount(context)}${
pct !== null ? ` (${pct}%)` : ""
}`;
return `tokens ${totalLabel}/${formatTokenCount(context)}${pct !== null ? ` (${pct}%)` : ""}`;
}
export function formatContextUsageLine(params: {
@@ -63,18 +58,11 @@ export function formatContextUsageLine(params: {
remaining?: number | null;
percent?: number | null;
}) {
const totalLabel =
typeof params.total === "number" ? formatTokenCount(params.total) : "?";
const ctxLabel =
typeof params.context === "number" ? formatTokenCount(params.context) : "?";
const pct =
typeof params.percent === "number"
? Math.min(999, Math.round(params.percent))
: null;
const totalLabel = typeof params.total === "number" ? formatTokenCount(params.total) : "?";
const ctxLabel = typeof params.context === "number" ? formatTokenCount(params.context) : "?";
const pct = typeof params.percent === "number" ? Math.min(999, Math.round(params.percent)) : null;
const remainingLabel =
typeof params.remaining === "number"
? `${formatTokenCount(params.remaining)} left`
: null;
typeof params.remaining === "number" ? `${formatTokenCount(params.remaining)} left` : null;
const pctLabel = pct !== null ? `${pct}%` : null;
const extra = [remainingLabel, pctLabel].filter(Boolean).join(", ");
return `tokens ${totalLabel}/${ctxLabel}${extra ? ` (${extra})` : ""}`;