feat: add files tool result

This commit is contained in:
2026-09-12 14:43:33 +05:00
parent 4826fc6ad8
commit ee5f660572
2 changed files with 19 additions and 2 deletions
+2
View File
@@ -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[] = [
+17 -2
View File
@@ -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`, схема —