{"name":"site_source_patch","title":"Исправить текст страницы в черновике","section":"Исходники и публикация","mode":"write","url":"/tools/site_source_patch","blurb":"Применяет точечные правки с проверкой контрольных сумм и создаёт новую версию.","aliases":"исправить заголовок|изменить текст|заменить заголовок|правка страницы|исправить страницу","kind":"Инструмент","examples":[{"label":"Рабочая задача","prompt":"В черновике на странице контактов замени заголовок «Связь» на «Контакты». Прочитай файл и его хеш, измени только заголовок и верни новую черновую версию.","check":"Применяет точечные правки с проверкой контрольных сумм и создаёт новую версию."},{"label":"Только один файл","prompt":"В выбранном черновике исправь опечатку «Конткаты» на «Контакты» в заголовке. Покажи изменённый путь и новую версию.","check":"Один путь и новая версия."},{"label":"Конфликт хеша","prompt":"После чтения HTML другой редактор сохранил изменения. Перечитай новую версию и покажи, можно ли ещё применить согласованную замену.","check":"Сравнение актуального текста."}],"inputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"siteId":{"type":"string","pattern":"^[A-Za-z0-9_~:@+.-]{1,128}$"},"expectedRevision":{"type":"integer","minimum":0,"maximum":9007199254740991},"idempotencyKey":{"type":"string","pattern":"^[A-Za-z0-9_-]{8,128}$"},"parentVersionId":{"type":"string","pattern":"^[A-Za-z0-9_~:@+.-]{1,128}$"},"expectedSourceSha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"patches":{"minItems":1,"maxItems":50,"type":"array","items":{"oneOf":[{"type":"object","properties":{"path":{"type":"string","minLength":1,"maxLength":240},"operation":{"type":"string","const":"upsert"},"content":{"type":"string","maxLength":2097152},"expectedSha256":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["path","operation","content"],"additionalProperties":false},{"type":"object","properties":{"path":{"type":"string","minLength":1,"maxLength":240},"operation":{"type":"string","const":"replace"},"expectedSha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"replacements":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"find":{"type":"string","minLength":1,"maxLength":262144},"replace":{"type":"string","maxLength":2097152},"all":{"default":false,"type":"boolean"},"expectedCount":{"default":1,"type":"integer","minimum":1,"maximum":100}},"required":["find","replace","all","expectedCount"],"additionalProperties":false}}},"required":["path","operation","expectedSha256","replacements"],"additionalProperties":false},{"type":"object","properties":{"path":{"type":"string","minLength":1,"maxLength":240},"operation":{"type":"string","const":"delete"},"expectedSha256":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["path","operation","expectedSha256"],"additionalProperties":false}]}},"displayContext":{"type":"object","properties":{"mode":{"type":"string","enum":["shared","web","app"]},"platform":{"type":"string","enum":["ios","android"]}},"required":["mode"],"additionalProperties":false}},"required":["siteId","expectedRevision","idempotencyKey","parentVersionId","expectedSourceSha256","patches"],"additionalProperties":false},"outputSchema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"version":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/$defs/__schema0"}},"revision":{"type":"integer","minimum":0,"maximum":9007199254740991},"sourceSha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"changes":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"operation":{"type":"string","enum":["upsert","replace","delete"]},"beforeSha256":{"anyOf":[{"type":"string","pattern":"^[a-f0-9]{64}$"},{"type":"null"}]},"afterSha256":{"anyOf":[{"type":"string","pattern":"^[a-f0-9]{64}$"},{"type":"null"}]}},"required":["path","operation","beforeSha256","afterSha256"],"additionalProperties":false}}},"required":["version","revision","sourceSha256","changes"],"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"}}]}}}}