{"name":"site_media","title":"Найти или загрузить медиафайл","section":"Контент и оформление","mode":"write","url":"/tools/site_media","blurb":"Управляет файлами сайта, доступными облачными материалами и этапами загрузки.","aliases":"","kind":"Инструмент","examples":[{"label":"Рабочая задача","prompt":"Найди в облаке компании файл обложки, который я указал. Покажи его ID, MIME и ревизию для использования на выбранном сайте.","check":"Управляет файлами сайта, доступными облачными материалами и этапами загрузки."},{"label":"Выбрать режим","prompt":"Для задачи «Найти или загрузить медиафайл» сравни режимы list и limits инструмента site_media. Какой подойдёт в моём случае и какие данные нужно подготовить?","check":"Сопоставить два режима и их аргументы."},{"label":"После сбоя","prompt":"При выполнении «Найти или загрузить медиафайл» связь прервалась после отправки. Для site_media проверь исходный ключ операции и текущее состояние объекта перед решением о повторе.","check":"Сопоставить результат с исходной операцией."}],"inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"siteId":{"type":"string","pattern":"^[A-Za-z0-9_~:@+.-]{1,128}$"},"link_id":{"type":"string","minLength":1},"operation":{"type":"string","enum":["list","limits","cloud_list","plan","prepare","complete","get","preview","download","retire"],"description":"prepare requires filename, contentType, size, sha256 and idempotencyKey; plan requires contentType; complete/get/preview/download/retire require mediaId."},"query":{"type":"string","maxLength":120},"after":{"type":"string","maxLength":128},"limit":{"type":"integer","minimum":1,"maximum":100},"contentType":{"type":"string","enum":["model/gltf-binary","model/gltf+json","model/vnd.usdz+zip","image/png","image/jpeg","image/webp","image/avif","image/gif","image/svg+xml","video/mp4","video/webm","audio/mpeg","audio/wav","audio/ogg","application/pdf","application/zip","application/json","text/plain","text/csv","text/css","text/javascript","text/html","font/woff2","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.presentationml.presentation"]},"optimization":{"type":"object","properties":{"usage":{"default":"inline","type":"string","enum":["hero","banner","gallery","card","product_card","thumbnail","background","inline","video","model","panorama"]},"quality":{"default":"auto","type":"string","enum":["auto","high","original"]},"minDisplayWidth":{"type":"integer","minimum":16,"maximum":3200},"maxDisplayWidth":{"type":"integer","minimum":16,"maximum":3200},"expectedDpr":{"default":2,"type":"number","minimum":1,"maximum":4},"preferredFormats":{"default":["webp"],"minItems":1,"maxItems":2,"type":"array","items":{"type":"string","enum":["webp","avif"]}},"panoramaMaxWidth":{"default":4096,"anyOf":[{"type":"number","const":2048},{"type":"number","const":4096},{"type":"number","const":8192}]},"keepOriginal":{"default":false,"type":"boolean"}},"required":["usage","quality","expectedDpr","preferredFormats","panoramaMaxWidth","keepOriginal"],"additionalProperties":false},"idempotencyKey":{"type":"string","pattern":"^[A-Za-z0-9_-]{8,128}$"},"filename":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9_. -]{0,119}$"},"visibility":{"default":"public","type":"string","enum":["public","private"]},"size":{"type":"integer","minimum":1,"maximum":134217728},"sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"mediaId":{"type":"string","pattern":"^[A-Za-z0-9_~:@+.-]{1,128}$"}},"required":["siteId","operation"],"additionalProperties":false},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"result":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/$defs/__schema0"}}},"required":["result"],"additionalProperties":false,"$defs":{"__schema0":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"$ref":"#/$defs/__schema0"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/$defs/__schema0"}}]}}},"argumentExample":{"operation":"list","siteId":"site_demo"}}