Files
Calcium-Ion 944464420b feat(plugin): 插件渠道可按渠道开关提供商插件的路由 (#8482)
同一个提供商插件绑到多个类型 61 渠道时,各渠道的路由完全相同,无法只在部分渠道上
开启某条转换路由。#8478 用 enabled_by 指向 channelConfig 里的 boolean 字段,已回退;
这里改为由渠道直接保存路由开关,插件不用为每条路由声明配置字段。

- meta.relay 的路由新增 default_enabled(默认 true),写 false 的路由新渠道默认不提供;
  管理路由(/v1/models、余额)始终开启,不能写 false。
- 渠道的 other_settings.plugin_routes 保存路由开关,键为 incoming_path,
  带 models 时追加 "|" 和逗号连接的模型名;保存时只保留与默认值不同的项,
  不认识的键丢弃。
- 选渠道、Responses WebSocket 判断、转发、提供商适配器绑定路由、渠道测试选端点、
  上游模型列表和定价端点都只看对该渠道开启的路由;同一路径的其他路由照常匹配。
- 插件选项接口返回 relayRoutes;渠道编辑「路由与映射」页签顶部列出插件路由,
  每条一个开关,补齐七种语言词条。
- pluginkit/v1.md、v1.d.ts、v1.schema.json 补充 default_enabled 与 plugin_routes。

Refs #8466
2026-11-27 23:25:50 +08:00

300 lines
27 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/QuantumNous/new-api/pluginkit/v1.schema.json",
"title": "new-api Task Plugin v1 manifest",
"type": "object",
"additionalProperties": false,
"required": ["apiVersion", "key", "name", "version", "author"],
"properties": {
"sortPriority": {"type": "integer", "minimum": -2147483648, "maximum": 2147483647, "default": 0},
"website": {"oneOf": [{"const": ""}, {"type": "string", "format": "uri", "pattern": "^[Hh][Tt][Tt][Pp][Ss]://[^/@?#\\s]+(?:[/?#]|$)"}], "description": "Absolute HTTPS URL with a valid ASCII hostname (use punycode for internationalized domains) and no credentials; validated by the host."},
"apiVersion": {"const": 1}, "key": {"type": "string"}, "name": {"allOf": [{"$ref": "#/$defs/localizedText"}, {"if": {"type": "object"}, "then": {"additionalProperties": {"maxLength": 128}}}]}, "icon": {"type": "string", "maxLength": 128}, "description": {"$ref": "#/$defs/localizedText"}, "version": {"type": "string"},
"author": {"type": "object", "required": ["name"], "additionalProperties": false, "properties": {"name": {"type": "string"}, "url": {"type": "string", "format": "uri"}}},
"baseUrl": {"type": "string", "format": "uri", "pattern": "^https?://", "maxLength": 191},
"channelTypes": {"type": "array", "uniqueItems": true, "items": {"type": "integer", "minimum": 1}, "description": "new-api built-in channel type numbers; other hosts ignore them."}, "models": {"type": "array", "minItems": 1, "uniqueItems": true, "items": {"type": "string", "minLength": 1}},
"fetchMode": {"enum": ["per_task", "batch"]}, "allowedHosts": {"type": "array", "uniqueItems": true, "items": {"type": "string"}},
"upstreams": {"type": "array", "uniqueItems": true, "items": {"$ref": "#/$defs/upstreamKind"}, "description": "Upstream kinds the driver addresses. vendor is implied; new_api makes the plugin bindable to type-60 New API channels."},
"protocols": {"type": "array", "uniqueItems": true, "items": {"oneOf": [
{"enum": ["openai_video", "openai_image"]},
{"type": "object", "additionalProperties": false, "required": ["name", "supports"], "properties": {"name": {"const": "openai_responses"}, "supports": {"type": "array", "minItems": 1, "uniqueItems": true, "items": {"enum": ["stream", "sync", "background"]}}, "models": {"type": "array", "minItems": 1, "uniqueItems": true, "items": {"type": "string", "minLength": 1}}}},
{"type": "object", "additionalProperties": false, "required": ["name"], "properties": {"name": {"enum": ["openai_video", "openai_image"]}, "models": {"type": "array", "minItems": 1, "uniqueItems": true, "items": {"type": "string", "minLength": 1}}}}
]}},
"submitResponseTypes": {"type": "array", "minItems": 1, "uniqueItems": true, "items": {"enum": ["json", "sse"]}},
"requiredCapabilities": {"type": "array", "uniqueItems": true, "items": {"enum": ["json-clone@1", "submit-sse-delta@1", "json-order@1", "duration-auto@1"]}},
"routes": {"type": "array", "items": {"$ref": "#/$defs/route"}}, "usageSchema": {"type": "object", "additionalProperties": {"$ref": "#/$defs/usageField"}}, "usageExamples": {"type": "array", "items": {"type": "object", "additionalProperties": false, "required": ["label", "facts"], "properties": {"label": {"type": "string"}, "facts": {"type": "object"}}}}, "usageProfiles": {"type": "array", "items": {"$ref": "#/$defs/usageProfile"}}, "auth": {},
"relay": {"type": "array", "items": {"$ref": "#/$defs/relayRoute"}, "description": "The provider part: routes a type-61 channel bound to the plugin relays. A plugin without an exported buildSubmitRequest needs it or an exported stage hook, and must not declare the task fields; the host checks this at load."},
"configSchema": {"$ref": "#/$defs/configSchema"},
"channelConfig": {"$ref": "#/$defs/configSchema", "description": "The settings of each type-61 channel bound to the plugin, in the configSchema format: stored in the channel settings as plugin_config and read by the hooks as ctx.config with the defaults applied. A format url field is an upstream address (absolute http(s), ASCII host, no credentials, query or fragment, trailing slash stripped) that a relay upstream_path can start with as {config.<name>}; an object field may hold a value per model in additionalProperties. Only a plugin with a task part or relay routes may declare it; the host checks this at load."},
"keyHint": {"allOf": [{"$ref": "#/$defs/localizedText"}, {"if": {"type": "string"}, "then": {"maxLength": 256}, "else": {"additionalProperties": {"maxLength": 256}}}], "description": "The hint and example of the channel key field, such as AccessKey|SecretKey. Only a plugin with a task part or relay routes may declare it."},
"optional": {"type": "boolean", "description": "A request skips a failed instance of the plugin instead of stopping with 500 request_plugin_failed. Only a plugin with a request processing part may declare it; the host checks this at load, as for configSchema."},
"scope": {"type": "object", "additionalProperties": false, "minProperties": 1, "properties": {"models": {"type": "array", "maxItems": 100, "uniqueItems": true, "items": {"type": "string", "minLength": 1, "maxLength": 128}}, "channelTypes": {"type": "array", "maxItems": 64, "uniqueItems": true, "items": {"type": "integer", "minimum": 1}}}, "anyOf": [{"required": ["models"], "properties": {"models": {"minItems": 1}}}, {"required": ["channelTypes"], "properties": {"channelTypes": {"minItems": 1}}}], "description": "The requests the plugin is made for: its models (matched like an instance's models) and the new-api channel types its requests go through; an empty or missing list leaves that side open, but one of them must be listed. An administrator confirms it once; the instance then runs on every request it holds, new channels included. Only a plugin with a request processing part may declare it; the host checks this at load."},
"samples": {"type": "array", "maxItems": 8, "items": {"$ref": "#/$defs/sample"}, "description": "Requests the request plugin settings offer to try the plugin with, text only. At most 3 with the same lang; those without lang count as one value. Only a plugin with a request processing part may declare it. The host also refuses media and links in body and reply at load: see Samples in v1.md."}
},
"anyOf": [
{"required": ["models", "fetchMode"]},
{"required": ["relay"], "properties": {"relay": {"minItems": 1}}},
{"not": {"anyOf": [{"required": ["fetchMode"]}, {"required": ["relay"]}]}, "description": "A request processing part alone, which the host reads from the exported stage hooks."}
],
"allOf": [{"if": {"required": ["requiredCapabilities"], "properties": {"requiredCapabilities": {"contains": {"const": "submit-sse-delta@1"}}}}, "then": {"required": ["submitResponseTypes"], "properties": {"submitResponseTypes": {"contains": {"const": "sse"}}}}}],
"$defs": {
"sample": {
"type": "object", "additionalProperties": false, "required": ["name", "format", "body"],
"properties": {
"name": {"allOf": [{"$ref": "#/$defs/localizedText"}, {"if": {"type": "object"}, "then": {"additionalProperties": {"maxLength": 64}}, "else": {"maxLength": 64}}]},
"lang": {"type": "string", "pattern": "^[a-z]{2,3}$", "description": "Base language of the text, such as en or zh; absent for any language."},
"format": {"enum": ["openai", "openai_responses", "claude", "gemini"], "description": "A protocol name; see Protocol names in v1.md."},
"body": {"type": "object", "description": "A request body in format, at most 16 KB as JSON. \"[sample-image]\" as a whole element of a content or parts array stands for an image the settings supply."},
"reply": {"type": "string", "minLength": 1, "description": "An answer text of at most 4 KB, for trying a reply hook."}
}
},
"configSchema": {
"type": "object", "additionalProperties": false, "required": ["type", "properties"],
"properties": {
"type": {"const": "object"},
"properties": {"type": "object", "additionalProperties": {"$ref": "#/$defs/configField"}},
"required": {"type": "array", "uniqueItems": true, "items": {"type": "string"}}
},
"description": "The schema of a request processing instance's config. The host also requires an exported stage hook, nesting of at most 4 levels, members that apply to each field's type, and valid defaults and examples."
},
"configField": {
"type": "object", "additionalProperties": false, "required": ["type", "title"],
"properties": {
"type": {"enum": ["string", "number", "integer", "boolean", "array", "object"]},
"title": {"$ref": "#/$defs/usageLabel"},
"description": {"allOf": [{"$ref": "#/$defs/localizedText"}, {"if": {"type": "string"}, "then": {"maxLength": 512}, "else": {"additionalProperties": {"maxLength": 512}}}]},
"default": true,
"examples": {"type": "array"},
"enum": {"type": "array", "minItems": 1, "uniqueItems": true, "items": {"type": ["string", "number"]}},
"enumTitles": {"type": "array", "items": {"$ref": "#/$defs/usageLabel"}},
"minimum": {"type": "number"}, "maximum": {"type": "number"},
"unit": {"enum": ["byte", "pixel", "character", "second"], "description": "A form hint for a number or integer field: byte values get a KB/MB choice (1000-based, stored in bytes), the others a suffix."},
"minLength": {"type": "integer", "minimum": 0}, "maxLength": {"type": "integer", "minimum": 0},
"pattern": {"type": "string", "description": "An RE2 regular expression."},
"format": {"enum": ["textarea", "regex", "url", "password", "keywords", "json"], "description": "textarea, regex, url, password and keywords for a string, json for an object. All are form hints except url and keywords: a non-empty url value must be an absolute http(s) URL without credentials or fragment, and its host is one utils.fetch may address in ingress, egress, reply and report. password marks a secret the form hides. keywords, on a property of the schema itself only, is a list with one keyword per line that hooks read as {count, longest} and match with utils.keywords."},
"items": {"$ref": "#/$defs/configField"},
"minItems": {"type": "integer", "minimum": 0}, "maxItems": {"type": "integer", "minimum": 0}, "uniqueItems": {"type": "boolean"},
"properties": {"type": "object", "additionalProperties": {"$ref": "#/$defs/configField"}},
"required": {"type": "array", "uniqueItems": true, "items": {"type": "string"}},
"additionalProperties": {"$ref": "#/$defs/configField", "description": "meta.channelConfig only, on an object field without properties: a value per model, keyed by model name. The host also requires a string, number, integer or boolean field without default or visibleWhen."},
"visibleWhen": {
"type": "object", "minProperties": 1,
"additionalProperties": {"oneOf": [{"type": ["string", "number", "boolean"]}, {"type": "array", "minItems": 1, "uniqueItems": true, "items": {"type": ["string", "number", "boolean"]}}]},
"description": "A form hint on a property, not on the schema or an items field: the form shows the property while every named sibling holds one of the listed values. The host also requires each key to name another property of the same object, of type string, number, integer or boolean, and each value to be valid for it; API responses always write lists."
}
},
"allOf": [{"if": {"required": ["enumTitles"]}, "then": {"required": ["enum"]}}, {"if": {"required": ["unit"]}, "then": {"properties": {"type": {"enum": ["number", "integer"]}}}}],
"description": "One field of an instance config. unit, visibleWhen and every format but url are form hints that never change the check, the defaults or the config. The form shows a slider for an integer field whose minimum and maximum are both set and at most 100 apart."
},
"jsonChange": {
"type": "object", "additionalProperties": false, "required": ["op", "path", "value"],
"properties": {
"op": {"enum": ["set", "append", "appendText"]},
"path": {"type": "array", "maxItems": 32, "items": {"oneOf": [{"type": "string"}, {"type": "integer", "minimum": 0}]}},
"value": true
},
"allOf": [{"if": {"properties": {"op": {"const": "appendText"}}}, "then": {"properties": {"value": {"type": "string"}}}}]
},
"submitEventDeltaResult": {
"type": "object", "additionalProperties": false, "required": ["changes", "state", "done"],
"properties": {
"changes": {"type": "array", "maxItems": 256, "items": {"$ref": "#/$defs/jsonChange"}},
"state": true,
"done": {"type": "boolean"}
}
},
"usageProfile": {
"type": "object",
"additionalProperties": false,
"required": ["models", "schema"],
"properties": {
"models": {"type": "array", "minItems": 1, "uniqueItems": true, "items": {"type": "string", "minLength": 1}},
"schema": {"type": "object", "additionalProperties": {"$ref": "#/$defs/usageField"}},
"examples": {"type": "array", "maxItems": 16, "items": {"$ref": "#/properties/usageExamples/items"}}
},
"description": "Complete usage metadata for declared models. The host validates model membership, unique profile ownership and examples, including required token-unit examples."
},
"usageField": {
"type": "object",
"additionalProperties": false,
"properties": {
"type": {"enum": ["number", "boolean"]},
"unit": {"enum": ["second", "count", "token", "credit"]},
"unitLabel": {"$ref": "#/$defs/usageLabel", "description": "Optional localized display unit for number fields with count unit. Does not change usage quantities or billing."},
"enum": {"type": "array", "minItems": 1, "uniqueItems": true, "items": {"type": "string"}},
"description": {"$ref": "#/$defs/usageLabel"},
"enumLabels": {
"type": "object",
"additionalProperties": {"$ref": "#/$defs/usageLabel"},
"description": "Optional display names keyed by declared enum values; the host validates membership. Missing entries display the original value."
}
},
"allOf": [{"if": {"required": ["unitLabel"]}, "then": {"required": ["type", "unit"], "properties": {"type": {"const": "number"}, "unit": {"const": "count"}}}}],
"oneOf": [
{"required": ["enum"], "not": {"anyOf": [{"required": ["type"]}, {"required": ["unit"]}]}},
{"required": ["type", "unit"], "properties": {"type": {"const": "number"}}, "not": {"anyOf": [{"required": ["enum"]}, {"required": ["enumLabels"]}]}},
{"required": ["type"], "properties": {"type": {"const": "boolean"}}, "not": {"anyOf": [{"required": ["unit"]}, {"required": ["enum"]}, {"required": ["enumLabels"]}]}}
]
},
"usageLabel": {
"allOf": [
{"$ref": "#/$defs/localizedText"},
{"if": {"type": "string"}, "then": {"maxLength": 256}, "else": {"additionalProperties": {"maxLength": 256}}}
]
},
"localizedText": {
"oneOf": [
{"type": "string", "minLength": 1},
{
"type": "object",
"required": ["en"],
"maxProperties": 16,
"propertyNames": {"pattern": "^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$"},
"additionalProperties": {"type": "string", "minLength": 1}
}
]
},
"filePlaceholder": {
"type": "object",
"additionalProperties": false,
"required": ["__fileRef", "encoding"],
"properties": {
"__fileRef": {"type": "string", "minLength": 1},
"encoding": {"enum": ["base64", "dataUrl"]},
"mimeType": {"type": "string", "minLength": 1},
"maxBytes": {"type": "integer", "exclusiveMinimum": 0}
}
},
"route": {"type": "object", "additionalProperties": false, "required": ["method", "path", "type", "render"], "properties": {"method": {"enum": ["GET", "POST", "PUT", "PATCH", "DELETE"]}, "path": {"type": "string", "pattern": "^/"}, "type": {"enum": ["submit", "query", "dynamic"]}, "action": {"type": "string"}, "taskIdParam": {"type": "string"}, "retainResult": {"type": "boolean"}, "decode": {"type": "string"}, "render": {"type": "string"}, "models": {"type": "array", "minItems": 1, "uniqueItems": true, "items": {"type": "string", "minLength": 1}}}, "allOf": [{"if": {"properties": {"type": {"const": "query"}}}, "then": {"allOf": [{"not": {"required": ["decode"]}}, {"not": {"required": ["models"]}}, {"not": {"required": ["retainResult"]}}]}}, {"if": {"properties": {"type": {"enum": ["submit", "dynamic"]}}}, "then": {"required": ["decode"]}}]},
"relayRoute": {
"type": "object",
"additionalProperties": false,
"required": ["incoming_path", "upstream_path"],
"properties": {
"incoming_path": {"type": "string", "pattern": "^/"},
"upstream_path": {"type": "string", "minLength": 1},
"converter": {"enum": ["none", "openai_chat_completions_to_anthropic_messages", "openai_chat_completions_to_openai_responses", "openai_chat_completions_to_gemini_generate_content", "openai_responses_to_openai_chat_completions", "openai_responses_to_gemini_generate_content", "openai_responses_to_claude_messages", "anthropic_messages_to_openai_chat_completions", "claude_messages_to_openai_responses", "gemini_generate_content_to_openai_chat_completions", "gemini_generate_content_to_openai_responses", "jina_rerank_to_sglang", "plugin", "openai_chat_completions_to_anthropic_messages+plugin", "openai_chat_completions_to_openai_responses+plugin", "openai_chat_completions_to_gemini_generate_content+plugin", "openai_responses_to_openai_chat_completions+plugin", "openai_responses_to_gemini_generate_content+plugin", "openai_responses_to_claude_messages+plugin", "anthropic_messages_to_openai_chat_completions+plugin", "claude_messages_to_openai_responses+plugin", "gemini_generate_content_to_openai_chat_completions+plugin", "gemini_generate_content_to_openai_responses+plugin", "jina_rerank_to_sglang+plugin"], "description": "none (default), a relaykit converter ID, plugin for the plugin's convert hooks, or <converter>+plugin for that converter's upstream protocol converted by the hooks. See Relay routes in v1.md for the incoming_path each converter accepts."},
"models": {"type": "array", "items": {"type": "string"}},
"auth": {
"type": "object",
"additionalProperties": false,
"required": ["type"],
"properties": {"type": {"enum": ["none", "header", "query"]}, "name": {"type": "string"}, "value": {"type": "string"}}
},
"pass_through_body_enabled": {"type": "boolean"},
"default_enabled": {"type": "boolean", "default": true, "description": "Whether a channel serves the route before an administrator switches it on the channel. Not false on /v1/models or /v1/dashboard/billing/credit_grants."}
},
"description": "The keys of an Advanced Custom channel route, plus default_enabled; the host applies the same validation rules."
},
"upstreamKind": {"enum": ["vendor", "new_api"]},
"upstreamContext": {
"type": "object",
"additionalProperties": false,
"required": ["kind"],
"properties": {"kind": {"$ref": "#/$defs/upstreamKind"}},
"description": "Host-injected on every driver hook context; new_api means the executing channel is a type-60 New API channel with Bearer credentials already applied."
},
"taskQueryContext": {
"type": "object",
"additionalProperties": false,
"required": ["taskId", "publicTaskId", "action", "model", "upstreamModel", "baseUrl", "authHeader", "upstream", "data", "state"],
"properties": {
"taskId": {"type": "string"},
"publicTaskId": {"type": "string"},
"action": {"type": "string"},
"model": {"type": "string"},
"upstreamModel": {"type": "string"},
"baseUrl": {"type": "string"},
"apiKey": {"type": "string"},
"authHeader": {"type": "string"},
"auth": true,
"credential": true,
"upstream": {"$ref": "#/$defs/upstreamContext"},
"data": true,
"state": true
}
},
"batchQueryContext": {
"type": "object",
"additionalProperties": false,
"required": ["baseUrl", "authHeader", "upstream", "tasks"],
"properties": {
"baseUrl": {"type": "string"},
"apiKey": {"type": "string"},
"authHeader": {"type": "string"},
"auth": true,
"credential": true,
"upstream": {"$ref": "#/$defs/upstreamContext"},
"tasks": {"type": "array", "items": {"$ref": "#/$defs/taskQueryContext"}}
}
},
"hookHTTPResponse": {
"type": "object",
"additionalProperties": false,
"required": ["status", "headers"],
"properties": {
"status": {"type": "integer"},
"headers": {"type": "object", "additionalProperties": {"type": "string"}}
}
},
"transformResult": {
"oneOf": [
{"type": "object", "additionalProperties": false, "required": ["action"], "properties": {
"action": {"const": "continue"},
"effects": {"type": "array", "maxItems": 32, "items": {"$ref": "#/$defs/transformEffect"}},
"findings": {"type": "array", "maxItems": 64, "items": {"type": "object", "additionalProperties": false, "required": ["rule", "count"], "properties": {"rule": {"type": "string", "minLength": 1, "maxLength": 256}, "category": {"type": "string", "maxLength": 256}, "path": {"type": "string", "maxLength": 256}, "count": {"type": "integer", "minimum": 0}}}},
"notice": {"$ref": "#/$defs/transformNotice"}
}},
{"type": "object", "additionalProperties": false, "required": ["action", "code"], "properties": {
"action": {"const": "reject"},
"code": {"type": "string", "pattern": "^[a-z0-9_.-]{1,64}$"},
"message": {"type": "string", "maxLength": 256},
"ruleId": {"type": "string", "maxLength": 256},
"findings": {"type": "array", "maxItems": 64, "items": {"type": "object", "additionalProperties": false, "required": ["rule", "count"], "properties": {"rule": {"type": "string", "minLength": 1, "maxLength": 256}, "category": {"type": "string", "maxLength": 256}, "path": {"type": "string", "maxLength": 256}, "count": {"type": "integer", "minimum": 0}}}},
"notice": {"$ref": "#/$defs/transformNotice"}
}}
],
"description": "The result of a stage hook (ingress, request, outbound, egress)."
},
"replyResult": {
"oneOf": [
{"type": "object", "additionalProperties": false, "required": ["action"], "properties": {
"action": {"const": "continue"},
"mask": {"type": "array", "maxItems": 1024, "items": {"type": "object", "additionalProperties": false, "required": ["index", "start", "end"], "properties": {"index": {"type": "integer"}, "start": {"type": "integer", "minimum": 0}, "end": {"type": "integer", "minimum": 1}, "category": {"type": "string", "maxLength": 256}}}},
"hold": {"type": "integer", "minimum": 0, "maximum": 8192, "default": 0},
"findings": {"type": "array", "maxItems": 64, "items": {"type": "object", "additionalProperties": false, "required": ["rule", "count"], "properties": {"rule": {"type": "string", "minLength": 1, "maxLength": 256}, "category": {"type": "string", "maxLength": 256}, "path": {"type": "string", "maxLength": 256}, "count": {"type": "integer", "minimum": 0}}}},
"notice": {"$ref": "#/$defs/transformNotice"}
}},
{"type": "object", "additionalProperties": false, "required": ["action"], "properties": {
"action": {"const": "pass"}
}},
{"type": "object", "additionalProperties": false, "required": ["action", "code"], "properties": {
"action": {"const": "stop"},
"code": {"type": "string", "pattern": "^[a-z0-9_.-]{1,64}$"},
"message": {"type": "string", "maxLength": 256},
"findings": {"type": "array", "maxItems": 64, "items": {"type": "object", "additionalProperties": false, "required": ["rule", "count"], "properties": {"rule": {"type": "string", "minLength": 1, "maxLength": 256}, "category": {"type": "string", "maxLength": 256}, "path": {"type": "string", "maxLength": 256}, "count": {"type": "integer", "minimum": 0}}}},
"notice": {"$ref": "#/$defs/transformNotice"}
}}
],
"description": "The result of the reply hook. A mask names an output of the call and a span of its text in UTF-16 code units, start < end <= text.length; each span becomes ***. The host checks the spans at the call. pass lets the rest of the answer through without further calls."
},
"transformNotice": {
"oneOf": [
{"type": "string", "minLength": 1, "maxLength": 200},
{"type": "object", "required": ["en"], "maxProperties": 8, "additionalProperties": {"type": "string", "minLength": 1, "maxLength": 200}}
],
"description": "Plain explanation for the user of what the plugin did; the user's log shows it as it is."
},
"transformEffect": {
"oneOf": [
{"type": "object", "additionalProperties": false, "required": ["type", "ops"], "description": "On a form body (req.form true), only replace operations that set an existing text field to a string.", "properties": {"type": {"const": "json.patch"}, "ops": {"type": "array", "items": {"type": "object", "required": ["op", "path"], "properties": {"op": {"enum": ["add", "remove", "replace", "move", "copy", "test"]}, "path": {"type": "string"}, "from": {"type": "string"}, "value": true}}}}},
{"type": "object", "additionalProperties": false, "required": ["type"], "properties": {"type": {"const": "header.patch"}, "set": {"type": "object", "additionalProperties": {"type": "string"}}, "remove": {"type": "array", "items": {"type": "string"}}}},
{"type": "object", "additionalProperties": false, "required": ["type", "effort"], "properties": {"type": {"const": "reasoning.set"}, "effort": {"enum": ["none", "minimal", "low", "medium", "high", "xhigh", "max"]}, "override": {"type": "boolean"}}},
{"type": "object", "additionalProperties": false, "required": ["type", "media", "format"], "properties": {"type": {"const": "media.reencode"}, "media": {"type": "integer", "minimum": 0}, "format": {"enum": ["auto", "jpeg", "png", "webp"]}, "quality": {"type": "integer", "minimum": 1, "maximum": 100}, "maxSide": {"type": "integer", "minimum": 16, "maximum": 16384}},
"if": {"properties": {"format": {"const": "webp"}}}, "then": {"not": {"required": ["quality"]}}},
{"type": "object", "additionalProperties": false, "required": ["type", "media", "text"], "description": "Replaces the text of a rewritable text file; on any other file of the call, or a text file read in part, it changes nothing.", "properties": {"type": {"const": "media.text"}, "media": {"type": "integer", "minimum": 0}, "text": {"type": "string"}}}
],
"description": "ingress: json.patch, keeping model and stream, and media.text. request: reasoning.set. outbound: json.patch (keeping the billing members), header.patch, media.reencode (webp is lossless WebP) and media.text. egress: none."
}
}
}