feat(logs): Improve logs streaming and backlog delivery; add CLI filters and ndjson output

This commit is contained in:
2025-08-30 23:26:59 +00:00
parent d8709d8b94
commit b210efde2a
9 changed files with 258 additions and 41 deletions

View File

@@ -139,6 +139,18 @@ export interface GetLogsResponse {
logs: IProcessLog[];
}
// Subscribe and stream backlog logs
export interface LogsSubscribeRequest {
id: ProcessId;
lines?: number; // number of backlog lines
sinceTime?: number; // ms epoch
types?: Array<IProcessLog['type']>;
}
export interface LogsSubscribeResponse {
ok: boolean;
}
// Start all command
export interface StartAllRequest {
// No parameters needed
@@ -274,6 +286,7 @@ export type IpcMethodMap = {
list: { request: ListRequest; response: ListResponse };
describe: { request: DescribeRequest; response: DescribeResponse };
getLogs: { request: GetLogsRequest; response: GetLogsResponse };
'logs:subscribe': { request: LogsSubscribeRequest; response: LogsSubscribeResponse };
startAll: { request: StartAllRequest; response: StartAllResponse };
stopAll: { request: StopAllRequest; response: StopAllResponse };
restartAll: { request: RestartAllRequest; response: RestartAllResponse };