
























@@ -1,3 +1,6 @@
1+// Small value formatters for status overview rows.
2+// These helpers keep terse row text consistent between compact and full status reports.
3+14type AgentStatusLike = {
25bootstrapPendingCount: number;
36totalSessions: number;
@@ -26,11 +29,13 @@ function countActiveStatusAgents(params: {
2629activeThresholdMs?: number;
2730}) {
2831const activeThresholdMs = params.activeThresholdMs ?? 10 * 60_000;
32+// "Active" means a recent session update, not merely a configured agent.
2933return params.agentStatus.agents.filter(
3034(agent) => agent.lastActiveAgeMs != null && agent.lastActiveAgeMs <= activeThresholdMs,
3135).length;
3236}
333738+/** Formats the status-all agents overview cell. */
3439export function buildStatusAllAgentsValue(params: {
3540agentStatus: AgentStatusLike;
3641activeThresholdMs?: number;
@@ -39,16 +44,19 @@ export function buildStatusAllAgentsValue(params: {
3944return `${params.agentStatus.agents.length} total · ${params.agentStatus.bootstrapPendingCount} bootstrapping · ${activeAgents} active · ${params.agentStatus.totalSessions} sessions`;
4045}
414647+/** Formats the secrets diagnostics count for overview output. */
4248export function buildStatusSecretsValue(count: number) {
4349return count > 0 ? `${count} diagnostic${count === 1 ? "" : "s"}` : "none";
4450}
455152+/** Formats queued system-event count for overview output. */
4653export function buildStatusEventsValue(params: { queuedSystemEvents: string[] }) {
4754return params.queuedSystemEvents.length > 0
4855 ? `${params.queuedSystemEvents.length} queued`
4956 : "none";
5057}
515859+/** Formats whether deep probe data was collected. */
5260export function buildStatusProbesValue(params: {
5361health?: unknown;
5462ok: (value: string) => string;
@@ -57,6 +65,7 @@ export function buildStatusProbesValue(params: {
5765return params.health ? params.ok("enabled") : params.muted("skipped (use --deep)");
5866}
596768+/** Formats plugin compatibility notices as a compact count by notice and plugin. */
6069export function buildStatusPluginCompatibilityValue(params: {
6170notices: PluginCompatibilityNoticeLike[];
6271ok: (value: string) => string;
@@ -73,6 +82,7 @@ export function buildStatusPluginCompatibilityValue(params: {
7382);
7483}
758485+/** Formats active session count, default model/context, and backing store summary. */
7686export function buildStatusSessionsOverviewValue(params: {
7787sessions: SummarySessionsLike;
7888formatKTokens: (value: number) => string;
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。