import { in as errorShape, rn as ErrorCodes } from "./schema-DS_xImy7.js";
import { ct as validateModelsListParams, t as formatValidationErrors } from "./src-B6kXsJ7D.js";
import { t as buildModelsListResult } from "./models-list-result-BMOpGRar.js";
//#region src/gateway/server-methods/models.ts
const modelsHandlers = { "models.list": async ({ params, respond, context }) => {
	if (!validateModelsListParams(params)) {
		respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, `invalid models.list params: ${formatValidationErrors(validateModelsListParams.errors)}`));
		return;
	}
	try {
		respond(true, await buildModelsListResult({
			context,
			params
		}), void 0);
	} catch (err) {
		respond(false, void 0, errorShape(ErrorCodes.UNAVAILABLE, String(err)));
	}
} };
//#endregion
export { buildModelsListResult, modelsHandlers };
