Add plugin lifecycle contracts
API checks / checks (push) Canceled after 0s
API dependency and security checks / audit (push) Canceled after 0s

This commit is contained in:
2026-10-25 06:01:09 +01:00
parent c96e61e526
commit ee7b4c5404
5 changed files with 67 additions and 0 deletions
+4
View File
@@ -31,3 +31,7 @@ Destructive backup recovery uses the explicit `backup-restore-request.json`
and `backup-restore-response.json` contracts; test fixtures contain no real and `backup-restore-response.json` contracts; test fixtures contain no real
database paths or credentials. database paths or credentials.
The authenticated WebAssembly plugin lifecycle uses the manifest, install,
and installed-response contracts. Fixtures contain only synthetic package
metadata and no executable module or secret.
+12
View File
@@ -0,0 +1,12 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://trixie.local/contracts/v1/plugin-install-request.json",
"title": "Plugin install request",
"type": "object",
"required": ["manifest", "wasm_base64"],
"properties": {
"manifest": { "$ref": "plugin-manifest.json" },
"wasm_base64": { "type": "string", "minLength": 1, "maxLength": 5592406 }
},
"additionalProperties": false
}
@@ -0,0 +1,18 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://trixie.local/contracts/v1/plugin-installed-response.json",
"title": "Installed plugin response",
"type": "object",
"required": ["id", "plugin_id", "name", "version", "manifest", "enabled", "installed_at", "updated_at"],
"properties": {
"id": { "type": "string", "format": "uuid" },
"plugin_id": { "type": "string" },
"name": { "type": "string" },
"version": { "type": "string" },
"manifest": { "$ref": "plugin-manifest.json" },
"enabled": { "type": "boolean" },
"installed_at": { "type": "string" },
"updated_at": { "type": "string" }
},
"additionalProperties": false
}
+16
View File
@@ -0,0 +1,16 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://trixie.local/contracts/v1/plugin-manifest.json",
"title": "Trixie WebAssembly plugin manifest",
"type": "object",
"required": ["id", "name", "version", "api_version", "permissions", "entrypoint"],
"properties": {
"id": { "type": "string", "pattern": "^[a-z0-9.-]+$", "maxLength": 64 },
"name": { "type": "string", "minLength": 1, "maxLength": 128 },
"version": { "type": "string", "minLength": 1, "maxLength": 64 },
"api_version": { "type": "string", "maxLength": 32 },
"permissions": { "type": "array", "maxItems": 16, "items": { "enum": ["chat.read", "chat.send", "overlay.emit", "twitch.read", "twitch.manage"] } },
"entrypoint": { "type": "string", "minLength": 1, "maxLength": 64 }
},
"additionalProperties": false
}
@@ -0,0 +1,17 @@
{
"id": "00000000-0000-4000-8000-000000000001",
"plugin_id": "example.plugin",
"name": "Example",
"version": "1.0.0",
"manifest": {
"id": "example.plugin",
"name": "Example",
"version": "1.0.0",
"api_version": "v1",
"permissions": ["chat.read"],
"entrypoint": "trixie_start"
},
"enabled": true,
"installed_at": "2026-10-25T00:00:00Z",
"updated_at": "2026-10-25T00:00:00Z"
}