mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-13 21:50:45 +00:00
Merged via squash.
Prepared head SHA: 3d6ee85993
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
25 lines
763 B
TypeScript
25 lines
763 B
TypeScript
import {
|
|
getDiagnosticStabilitySnapshot,
|
|
normalizeDiagnosticStabilityQuery,
|
|
} from "../../logging/diagnostic-stability.js";
|
|
import { ErrorCodes, errorShape } from "../protocol/index.js";
|
|
import type { GatewayRequestHandlers } from "./types.js";
|
|
|
|
export const diagnosticsHandlers: GatewayRequestHandlers = {
|
|
"diagnostics.stability": async ({ params, respond }) => {
|
|
try {
|
|
const query = normalizeDiagnosticStabilityQuery(params);
|
|
respond(true, getDiagnosticStabilitySnapshot(query), undefined);
|
|
} catch (err) {
|
|
respond(
|
|
false,
|
|
undefined,
|
|
errorShape(
|
|
ErrorCodes.INVALID_REQUEST,
|
|
err instanceof Error ? err.message : "invalid diagnostics.stability params",
|
|
),
|
|
);
|
|
}
|
|
},
|
|
};
|