style: format repository

This commit is contained in:
Peter Steinberger
2026-04-26 05:47:05 +01:00
parent 6a67f65568
commit 27aedcfd56
397 changed files with 4106 additions and 4517 deletions

View File

@@ -2,18 +2,11 @@ import AjvPkg, { type ValidateFunction } from "ajv";
import dynamicToolCallParamsSchema from "./protocol-generated/json/DynamicToolCallParams.json" with { type: "json" };
import errorNotificationSchema from "./protocol-generated/json/v2/ErrorNotification.json" with { type: "json" };
import modelListResponseSchema from "./protocol-generated/json/v2/ModelListResponse.json" with { type: "json" };
import threadResumeResponseSchema from "./protocol-generated/json/v2/ThreadResumeResponse.json" with {
type: "json",
};
import threadStartResponseSchema from "./protocol-generated/json/v2/ThreadStartResponse.json" with {
type: "json",
};
import turnCompletedNotificationSchema from "./protocol-generated/json/v2/TurnCompletedNotification.json" with {
type: "json",
};
import turnStartResponseSchema from "./protocol-generated/json/v2/TurnStartResponse.json" with {
type: "json",
};
import threadResumeResponseSchema from "./protocol-generated/json/v2/ThreadResumeResponse.json" with { type: "json" };
import threadStartResponseSchema from "./protocol-generated/json/v2/ThreadStartResponse.json" with { type: "json" };
import turnCompletedNotificationSchema from "./protocol-generated/json/v2/TurnCompletedNotification.json" with { type: "json" };
import turnStartResponseSchema from "./protocol-generated/json/v2/TurnStartResponse.json" with { type: "json" };
import type { v2 } from "./protocol-generated/typescript/index.js";
import type {
CodexDynamicToolCallParams,
CodexThreadResumeResponse,
@@ -21,7 +14,6 @@ import type {
CodexTurn,
CodexTurnStartResponse,
} from "./protocol.js";
import type { v2 } from "./protocol-generated/typescript/index.js";
type AjvInstance = import("ajv").default;
@@ -38,8 +30,9 @@ const validateDynamicToolCallParams = ajv.compile<CodexDynamicToolCallParams>(
);
const validateErrorNotification = ajv.compile<v2.ErrorNotification>(errorNotificationSchema);
const validateModelListResponse = ajv.compile<v2.ModelListResponse>(modelListResponseSchema);
const validateThreadResumeResponse =
ajv.compile<CodexThreadResumeResponse>(threadResumeResponseSchema);
const validateThreadResumeResponse = ajv.compile<CodexThreadResumeResponse>(
threadResumeResponseSchema,
);
const validateThreadStartResponse =
ajv.compile<CodexThreadStartResponse>(threadStartResponseSchema);
const validateTurnCompletedNotification = ajv.compile<v2.TurnCompletedNotification>(
@@ -85,14 +78,13 @@ export function readCodexTurn(value: unknown): CodexTurn | undefined {
export function readCodexTurnCompletedNotification(
value: unknown,
): v2.TurnCompletedNotification | undefined {
return readCodexShape(validateTurnCompletedNotification, normalizeTurnCompletedNotification(value));
return readCodexShape(
validateTurnCompletedNotification,
normalizeTurnCompletedNotification(value),
);
}
function assertCodexShape<T>(
validate: ValidateFunction<T>,
value: unknown,
label: string,
): T {
function assertCodexShape<T>(validate: ValidateFunction<T>, value: unknown, label: string): T {
if (validate(value)) {
return value;
}