Files
Moltbot/src/commands/status.types.ts
Vishal f1e1cc4ee3 feat: surface cached token counts in /status output (openclaw#21248) thanks @vishaltandale00
Verified:
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: vishaltandale00 <9222298+vishaltandale00@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
2026-02-19 21:06:13 -06:00

62 lines
1.4 KiB
TypeScript

import type { ChannelId } from "../channels/plugins/types.js";
export type SessionStatus = {
agentId?: string;
key: string;
kind: "direct" | "group" | "global" | "unknown";
sessionId?: string;
updatedAt: number | null;
age: number | null;
thinkingLevel?: string;
verboseLevel?: string;
reasoningLevel?: string;
elevatedLevel?: string;
systemSent?: boolean;
abortedLastRun?: boolean;
inputTokens?: number;
outputTokens?: number;
totalTokens: number | null;
totalTokensFresh: boolean;
cacheRead?: number;
cacheWrite?: number;
remainingTokens: number | null;
percentUsed: number | null;
model: string | null;
contextTokens: number | null;
flags: string[];
};
export type HeartbeatStatus = {
agentId: string;
enabled: boolean;
every: string;
everyMs: number | null;
};
export type StatusSummary = {
linkChannel?: {
id: ChannelId;
label: string;
linked: boolean;
authAgeMs: number | null;
};
heartbeat: {
defaultAgentId: string;
agents: HeartbeatStatus[];
};
channelSummary: string[];
queuedSystemEvents: string[];
sessions: {
paths: string[];
count: number;
defaults: { model: string | null; contextTokens: number | null };
recent: SessionStatus[];
byAgent: Array<{
agentId: string;
path: string;
count: number;
recent: SessionStatus[];
}>;
};
};