Files
toolbox-sdk/schemas/toolbox-app.v1.schema.json
T
zemion bc91659a42
Verify / verify (push) Canceled after 0s
Release Toolbox SDK 0.3.0
2026-09-02 00:58:50 +02:00

328 lines
7.9 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://git.add-ideas.de/lotobo/toolbox-sdk/raw/branch/main/schemas/toolbox-app.v1.schema.json",
"title": "Toolbox application manifest v1",
"type": "object",
"required": [
"schemaVersion",
"id",
"name",
"version",
"description",
"entry",
"icon",
"categories",
"tags",
"integration",
"requirements",
"privacy"
],
"properties": {
"schemaVersion": {
"const": 1
},
"id": {
"type": "string",
"pattern": "^[a-z0-9]+(?:[._-][a-z0-9]+)*$"
},
"name": {
"$ref": "#/$defs/nonEmptyString"
},
"version": {
"$ref": "#/$defs/nonEmptyString"
},
"entry": {
"$ref": "#/$defs/urlReference"
},
"description": {
"type": "string"
},
"icon": {
"$ref": "#/$defs/urlReference"
},
"privacy": {
"type": "object",
"required": ["processing", "fileUploads", "telemetry"],
"properties": {
"processing": {
"enum": ["local", "remote", "mixed"]
},
"fileUploads": {
"type": "boolean"
},
"telemetry": {
"type": "boolean"
},
"label": {
"$ref": "#/$defs/nonEmptyString"
},
"url": {
"$ref": "#/$defs/urlReference"
}
},
"additionalProperties": true
},
"categories": {
"$ref": "#/$defs/stringList"
},
"tags": {
"$ref": "#/$defs/stringList"
},
"integration": {
"type": "object",
"required": ["contextVersion", "launchModes", "embedding"],
"properties": {
"contextVersion": {
"const": 1
},
"launchModes": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": {
"enum": ["navigate", "new-tab"]
}
},
"embedding": {
"enum": ["unsupported", "supported"]
}
},
"additionalProperties": true
},
"requirements": {
"type": "object",
"required": [
"secureContext",
"workers",
"indexedDb",
"crossOriginIsolated"
],
"properties": {
"secureContext": {
"type": "boolean"
},
"workers": {
"type": "boolean"
},
"indexedDb": {
"type": "boolean"
},
"crossOriginIsolated": {
"type": "boolean"
},
"topLevelContext": {
"type": "boolean"
}
},
"additionalProperties": true
},
"io": {
"type": "object",
"required": ["accepts", "produces"],
"properties": {
"accepts": { "$ref": "#/$defs/formats" },
"produces": { "$ref": "#/$defs/formats" }
},
"additionalProperties": true
},
"capabilities": {
"type": "object",
"required": ["required", "optional"],
"properties": {
"required": { "$ref": "#/$defs/identifierList" },
"optional": { "$ref": "#/$defs/identifierList" }
},
"additionalProperties": true
},
"source": {
"type": "object",
"required": ["repository", "license"],
"properties": {
"repository": {
"$ref": "#/$defs/absoluteWebUrl"
},
"license": {
"$ref": "#/$defs/nonEmptyString"
}
},
"additionalProperties": true
},
"actions": {
"type": "array",
"items": {
"type": "object",
"required": ["id", "label", "url"],
"properties": {
"id": {
"type": "string",
"pattern": "^[a-z0-9]+(?:[._-][a-z0-9]+)*$"
},
"label": {
"$ref": "#/$defs/nonEmptyString"
},
"url": {
"$ref": "#/$defs/urlReference"
}
},
"additionalProperties": true
}
},
"assets": {
"type": "array",
"items": {
"$ref": "#/$defs/urlReference"
},
"uniqueItems": true
}
},
"allOf": [
{
"if": {
"required": ["requirements", "capabilities"],
"properties": {
"requirements": {
"type": "object",
"required": ["workers"],
"properties": { "workers": { "const": true } }
}
}
},
"then": {
"properties": {
"capabilities": {
"type": "object",
"required": ["required"],
"properties": {
"required": {
"type": "array",
"contains": { "const": "workers" }
}
}
}
}
}
},
{
"if": {
"required": ["capabilities"],
"properties": {
"capabilities": {
"type": "object",
"required": ["required"],
"properties": {
"required": {
"type": "array",
"contains": { "const": "workers" }
}
}
}
}
},
"then": {
"properties": {
"requirements": {
"type": "object",
"required": ["workers"],
"properties": { "workers": { "const": true } }
}
}
}
}
],
"$defs": {
"urlReference": {
"type": "string",
"allOf": [
{
"$ref": "#/$defs/nonEmptyString"
},
{
"type": "string",
"description": "URL references must not contain C0 control characters or DEL.",
"pattern": "^[^\\u0000-\\u001F\\u007F]*$"
},
{
"type": "string",
"description": "Backslashes are not URL path separators in toolbox documents.",
"pattern": "^[^\\\\]*$"
},
{
"type": "string",
"description": "Explicit schemes are limited to HTTP and HTTPS; relative references remain valid.",
"pattern": "^ *(?:[Hh][Tt][Tt][Pp][Ss]?:|(?!(?:[A-Za-z][A-Za-z0-9+.-]*):))"
},
{
"type": "string",
"description": "An explicit HTTP(S) authority must not be empty.",
"pattern": "^(?! *[Hh][Tt][Tt][Pp][Ss]?:/+(?:[?#]|$))"
},
{
"type": "string",
"description": "HTTP(S) authority references must not contain credentials.",
"pattern": "^ *(?!(?:[Hh][Tt][Tt][Pp]:/*|[Hh][Tt][Tt][Pp][Ss]:/+|/+)[^/?#]*@)"
}
]
},
"absoluteWebUrl": {
"allOf": [
{
"$ref": "#/$defs/urlReference"
},
{
"type": "string",
"description": "Repository URLs must be absolute HTTP(S) URLs.",
"pattern": "^ *[Hh][Tt][Tt][Pp][Ss]?:/*[^\\s/?#]"
},
{
"type": "string",
"description": "Absolute repository URLs must not contain credentials.",
"pattern": "^ *(?![Hh][Tt][Tt][Pp][Ss]?:/*[^/?#]*@)"
}
]
},
"nonEmptyString": {
"type": "string",
"pattern": "\\S"
},
"stringList": {
"type": "array",
"uniqueItems": true,
"items": {
"$ref": "#/$defs/nonEmptyString"
}
},
"identifierList": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "string",
"pattern": "^[a-z0-9]+(?:[._-][a-z0-9]+)*$"
}
},
"formats": {
"type": "array",
"items": {
"type": "object",
"required": ["mediaType", "extensions"],
"properties": {
"mediaType": {
"type": "string",
"pattern": "^(?:\\*|[A-Za-z0-9!#$&^_.+-]+)/(?:\\*|[A-Za-z0-9!#$&^_.+-]+)$"
},
"extensions": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "string",
"pattern": "^\\.[A-Za-z0-9][A-Za-z0-9._+-]*$"
}
},
"label": { "$ref": "#/$defs/nonEmptyString" }
},
"additionalProperties": true
}
}
},
"additionalProperties": true
}