feat(orchestrator): add recent events API and monitor script

This commit is contained in:
Jason Woltje
2026-02-17 15:44:43 -06:00
parent 3258cd4f4d
commit 4d089cd020
8 changed files with 209 additions and 0 deletions

View File

@@ -13,6 +13,7 @@ import {
ParseUUIDPipe,
Sse,
MessageEvent,
Query,
} from "@nestjs/common";
import { Throttle } from "@nestjs/throttler";
import { Observable } from "rxjs";
@@ -128,6 +129,20 @@ export class AgentsController {
});
}
/**
* Return recent orchestrator events for non-streaming consumers.
*/
@Get("events/recent")
@Throttle({ status: { limit: 200, ttl: 60000 } })
getRecentEvents(@Query("limit") limit?: string): {
events: ReturnType<AgentEventsService["getRecentEvents"]>;
} {
const parsedLimit = Number.parseInt(limit ?? "100", 10);
return {
events: this.eventsService.getRecentEvents(Number.isNaN(parsedLimit) ? 100 : parsedLimit),
};
}
/**
* List all agents
* @returns Array of all agent sessions with their status