mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 13:44:32 +00:00
chore: migrate to oxlint and oxfmt
Co-authored-by: Christoph Nakazawa <christoph.pojer@gmail.com>
This commit is contained in:
@@ -47,10 +47,8 @@ export async function getAgentLocalStatuses(): Promise<{
|
||||
}
|
||||
})();
|
||||
|
||||
const bootstrapPath =
|
||||
workspaceDir != null ? path.join(workspaceDir, "BOOTSTRAP.md") : null;
|
||||
const bootstrapPending =
|
||||
bootstrapPath != null ? await fileExists(bootstrapPath) : null;
|
||||
const bootstrapPath = workspaceDir != null ? path.join(workspaceDir, "BOOTSTRAP.md") : null;
|
||||
const bootstrapPending = bootstrapPath != null ? await fileExists(bootstrapPath) : null;
|
||||
|
||||
const sessionsPath = resolveStorePath(cfg.session?.store, { agentId });
|
||||
const store = (() => {
|
||||
@@ -64,14 +62,9 @@ export async function getAgentLocalStatuses(): Promise<{
|
||||
.filter(([key]) => key !== "global" && key !== "unknown")
|
||||
.map(([, entry]) => entry);
|
||||
const sessionsCount = sessions.length;
|
||||
const lastUpdatedAt = sessions.reduce(
|
||||
(max, e) => Math.max(max, e?.updatedAt ?? 0),
|
||||
0,
|
||||
);
|
||||
const lastUpdatedAt = sessions.reduce((max, e) => Math.max(max, e?.updatedAt ?? 0), 0);
|
||||
const resolvedLastUpdatedAt = lastUpdatedAt > 0 ? lastUpdatedAt : null;
|
||||
const lastActiveAgeMs = resolvedLastUpdatedAt
|
||||
? now - resolvedLastUpdatedAt
|
||||
: null;
|
||||
const lastActiveAgeMs = resolvedLastUpdatedAt ? now - resolvedLastUpdatedAt : null;
|
||||
|
||||
statuses.push({
|
||||
id: agentId,
|
||||
@@ -86,10 +79,7 @@ export async function getAgentLocalStatuses(): Promise<{
|
||||
}
|
||||
|
||||
const totalSessions = statuses.reduce((sum, s) => sum + s.sessionsCount, 0);
|
||||
const bootstrapPendingCount = statuses.reduce(
|
||||
(sum, s) => sum + (s.bootstrapPending ? 1 : 0),
|
||||
0,
|
||||
);
|
||||
const bootstrapPendingCount = statuses.reduce((sum, s) => sum + (s.bootstrapPending ? 1 : 0), 0);
|
||||
return {
|
||||
defaultId: agentList.defaultId,
|
||||
agents: statuses,
|
||||
|
||||
Reference in New Issue
Block a user