mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 18:00:54 +00:00
docs(types): mark remaining deprecated aliases
This commit is contained in:
@@ -37,11 +37,15 @@ type DiffsPluginConfig = {
|
||||
fileQuality?: DiffImageQualityPreset;
|
||||
fileScale?: number;
|
||||
fileMaxWidth?: number;
|
||||
/** @deprecated Use fileFormat. */
|
||||
format?: DiffOutputFormat;
|
||||
// Backward-compatible aliases retained for existing configs.
|
||||
/** @deprecated Use fileFormat. */
|
||||
imageFormat?: DiffOutputFormat;
|
||||
/** @deprecated Use fileQuality. */
|
||||
imageQuality?: DiffImageQualityPreset;
|
||||
/** @deprecated Use fileScale. */
|
||||
imageScale?: number;
|
||||
/** @deprecated Use fileMaxWidth. */
|
||||
imageMaxWidth?: number;
|
||||
mode?: DiffMode;
|
||||
};
|
||||
@@ -142,17 +146,28 @@ const DiffsPluginJsonSchemaSource = z.strictObject({
|
||||
.enum(DIFF_OUTPUT_FORMATS)
|
||||
.default(DEFAULT_DIFFS_TOOL_DEFAULTS.fileFormat)
|
||||
.optional(),
|
||||
format: z.enum(DIFF_OUTPUT_FORMATS).optional(),
|
||||
format: z.enum(DIFF_OUTPUT_FORMATS).optional().describe("Deprecated alias for fileFormat."),
|
||||
fileQuality: z
|
||||
.enum(DIFF_IMAGE_QUALITY_PRESETS)
|
||||
.default(DEFAULT_DIFFS_TOOL_DEFAULTS.fileQuality)
|
||||
.optional(),
|
||||
fileScale: z.number().min(1).max(4).optional(),
|
||||
fileMaxWidth: z.number().min(640).max(2400).optional(),
|
||||
imageFormat: z.enum(DIFF_OUTPUT_FORMATS).optional(),
|
||||
imageQuality: z.enum(DIFF_IMAGE_QUALITY_PRESETS).optional(),
|
||||
imageScale: z.number().min(1).max(4).optional(),
|
||||
imageMaxWidth: z.number().min(640).max(2400).optional(),
|
||||
imageFormat: z
|
||||
.enum(DIFF_OUTPUT_FORMATS)
|
||||
.optional()
|
||||
.describe("Deprecated alias for fileFormat."),
|
||||
imageQuality: z
|
||||
.enum(DIFF_IMAGE_QUALITY_PRESETS)
|
||||
.optional()
|
||||
.describe("Deprecated alias for fileQuality."),
|
||||
imageScale: z.number().min(1).max(4).optional().describe("Deprecated alias for fileScale."),
|
||||
imageMaxWidth: z
|
||||
.number()
|
||||
.min(640)
|
||||
.max(2400)
|
||||
.optional()
|
||||
.describe("Deprecated alias for fileMaxWidth."),
|
||||
mode: z.enum(DIFF_MODES).default(DEFAULT_DIFFS_TOOL_DEFAULTS.mode).optional(),
|
||||
})
|
||||
.optional(),
|
||||
|
||||
@@ -34,11 +34,16 @@ const MAX_TITLE_BYTES = 1_024;
|
||||
const MAX_PATH_BYTES = 2_048;
|
||||
const MAX_LANG_BYTES = 128;
|
||||
|
||||
function stringEnum<T extends readonly string[]>(values: T, description: string) {
|
||||
function stringEnum<T extends readonly string[]>(
|
||||
values: T,
|
||||
description: string,
|
||||
options: { deprecated?: boolean } = {},
|
||||
) {
|
||||
return Type.Unsafe<T[number]>({
|
||||
type: "string",
|
||||
enum: [...values],
|
||||
description,
|
||||
...options,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -98,14 +103,21 @@ const DiffsToolSchema = Type.Object(
|
||||
),
|
||||
/** @deprecated Use fileQuality. */
|
||||
imageQuality: Type.Optional(
|
||||
stringEnum(DIFF_IMAGE_QUALITY_PRESETS, "Deprecated alias for fileQuality."),
|
||||
stringEnum(DIFF_IMAGE_QUALITY_PRESETS, "Deprecated alias for fileQuality.", {
|
||||
deprecated: true,
|
||||
}),
|
||||
),
|
||||
/** @deprecated Use fileFormat. */
|
||||
imageFormat: Type.Optional(stringEnum(DIFF_OUTPUT_FORMATS, "Deprecated alias for fileFormat.")),
|
||||
imageFormat: Type.Optional(
|
||||
stringEnum(DIFF_OUTPUT_FORMATS, "Deprecated alias for fileFormat.", {
|
||||
deprecated: true,
|
||||
}),
|
||||
),
|
||||
/** @deprecated Use fileScale. */
|
||||
imageScale: Type.Optional(
|
||||
Type.Number({
|
||||
description: "Deprecated alias for fileScale.",
|
||||
deprecated: true,
|
||||
minimum: 1,
|
||||
maximum: 4,
|
||||
}),
|
||||
@@ -114,6 +126,7 @@ const DiffsToolSchema = Type.Object(
|
||||
imageMaxWidth: Type.Optional(
|
||||
Type.Number({
|
||||
description: "Deprecated alias for fileMaxWidth.",
|
||||
deprecated: true,
|
||||
minimum: 640,
|
||||
maximum: 2400,
|
||||
}),
|
||||
@@ -140,7 +153,7 @@ const DiffsToolSchema = Type.Object(
|
||||
|
||||
type DiffsToolParams = Static<typeof DiffsToolSchema>;
|
||||
type DiffsToolRawParams = DiffsToolParams & {
|
||||
// Keep backward compatibility for direct calls that still pass `format`.
|
||||
/** @deprecated Use fileFormat. */
|
||||
format?: DiffOutputFormat;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user