mirror of
https://github.com/Ku6epXBOCTuK/easy-png-tools.git
synced 2026-09-14 13:36:36 +00:00
feat: add files tool result
This commit is contained in:
@@ -23,6 +23,8 @@ export type {
|
|||||||
ToolContext,
|
ToolContext,
|
||||||
ToolEntry,
|
ToolEntry,
|
||||||
ToolResult,
|
ToolResult,
|
||||||
|
ToolImageFile,
|
||||||
|
FileResult,
|
||||||
} from "./types";
|
} from "./types";
|
||||||
|
|
||||||
export const TOOLS: ToolEntry[] = [
|
export const TOOLS: ToolEntry[] = [
|
||||||
|
|||||||
@@ -19,11 +19,15 @@ export const INPUT_MODES = {
|
|||||||
} as const;
|
} as const;
|
||||||
export type InputMode = (typeof INPUT_MODES)[keyof typeof INPUT_MODES];
|
export type InputMode = (typeof INPUT_MODES)[keyof typeof INPUT_MODES];
|
||||||
|
|
||||||
/** Тип результата: картинка (по умолчанию), большой текст или короткий вердикт. */
|
/**
|
||||||
|
* Тип результата: картинка (по умолчанию), большой текст, короткий вердикт
|
||||||
|
* или набор файлов (1 → many, скачивается zip-архивом).
|
||||||
|
*/
|
||||||
export const RESULT_KINDS = {
|
export const RESULT_KINDS = {
|
||||||
image: "image",
|
image: "image",
|
||||||
text: "text",
|
text: "text",
|
||||||
verdict: "verdict",
|
verdict: "verdict",
|
||||||
|
files: "files",
|
||||||
} as const;
|
} as const;
|
||||||
export type ResultKind = (typeof RESULT_KINDS)[keyof typeof RESULT_KINDS];
|
export type ResultKind = (typeof RESULT_KINDS)[keyof typeof RESULT_KINDS];
|
||||||
|
|
||||||
@@ -34,7 +38,18 @@ export interface ToolContext<P> {
|
|||||||
text?: string;
|
text?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ToolResult = PixelImage | string;
|
/** Один файл мультифайлового результата (1 → many). */
|
||||||
|
export interface ToolImageFile {
|
||||||
|
name: string;
|
||||||
|
image: PixelImage;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Результат-набор файлов; скачивается zip-архивом. */
|
||||||
|
export interface FileResult {
|
||||||
|
files: ToolImageFile[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export type ToolResult = PixelImage | string | FileResult;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Инструмент нового registry: полностью типизирован на `Params`, схема —
|
* Инструмент нового registry: полностью типизирован на `Params`, схема —
|
||||||
|
|||||||
Reference in New Issue
Block a user