chore: migrate to oxlint and oxfmt
Co-authored-by: Christoph Nakazawa <christoph.pojer@gmail.com>
This commit is contained in:
@@ -19,9 +19,7 @@ export function formatStatusSummary(summary: GatewayStatusSummary) {
|
||||
lines.push(`${linkLabel}: ${linked ? "linked" : "not linked"}${authAge}`);
|
||||
}
|
||||
|
||||
const providerSummary = Array.isArray(summary.providerSummary)
|
||||
? summary.providerSummary
|
||||
: [];
|
||||
const providerSummary = Array.isArray(summary.providerSummary) ? summary.providerSummary : [];
|
||||
if (providerSummary.length > 0) {
|
||||
lines.push("");
|
||||
lines.push("System:");
|
||||
@@ -49,14 +47,11 @@ export function formatStatusSummary(summary: GatewayStatusSummary) {
|
||||
const sessionCount = summary.sessions?.count ?? 0;
|
||||
lines.push(`Active sessions: ${sessionCount}`);
|
||||
|
||||
const recent = Array.isArray(summary.sessions?.recent)
|
||||
? summary.sessions?.recent
|
||||
: [];
|
||||
const recent = Array.isArray(summary.sessions?.recent) ? summary.sessions?.recent : [];
|
||||
if (recent.length > 0) {
|
||||
lines.push("Recent sessions:");
|
||||
for (const entry of recent) {
|
||||
const ageLabel =
|
||||
typeof entry.age === "number" ? formatAge(entry.age) : "no activity";
|
||||
const ageLabel = typeof entry.age === "number" ? formatAge(entry.age) : "no activity";
|
||||
const model = entry.model ?? "unknown";
|
||||
const usage = formatContextUsageLine({
|
||||
total: entry.totalTokens ?? null,
|
||||
@@ -64,18 +59,14 @@ export function formatStatusSummary(summary: GatewayStatusSummary) {
|
||||
remaining: entry.remainingTokens ?? null,
|
||||
percent: entry.percentUsed ?? null,
|
||||
});
|
||||
const flags = entry.flags?.length
|
||||
? ` | flags: ${entry.flags.join(", ")}`
|
||||
: "";
|
||||
const flags = entry.flags?.length ? ` | flags: ${entry.flags.join(", ")}` : "";
|
||||
lines.push(
|
||||
`- ${entry.key}${entry.kind ? ` [${entry.kind}]` : ""} | ${ageLabel} | model ${model} | ${usage}${flags}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const queued = Array.isArray(summary.queuedSystemEvents)
|
||||
? summary.queuedSystemEvents
|
||||
: [];
|
||||
const queued = Array.isArray(summary.queuedSystemEvents) ? summary.queuedSystemEvents : [];
|
||||
if (queued.length > 0) {
|
||||
const preview = queued.slice(0, 3).join(" | ");
|
||||
lines.push(`Queued system events (${queued.length}): ${preview}`);
|
||||
|
||||
Reference in New Issue
Block a user