feat: integrate automatic game resource delivery

This commit is contained in:
2026-09-06 09:50:49 +08:00
parent f721966f3c
commit 4df4bc9624
20 changed files with 1667 additions and 191 deletions

View File

@@ -54,7 +54,7 @@
{
"name": "game_resource_generate",
"label": "Generate game resource",
"description": "Submit one hosted pixel-art or HD game-resource generation job.",
"description": "Generate one hosted pixel-art or HD game resource and automatically save every output into the current project.",
"capabilityId": "game-resource.generate",
"operation": "generate",
"roles": ["parent"],
@@ -89,93 +89,30 @@
"outputSchema": {
"type": "object",
"additionalProperties": false,
"required": ["executionId", "status", "outputCount"],
"required": ["executionId", "providerStatus", "deliveryStatus", "outputCount", "files"],
"properties": {
"executionId": {"type": "string", "minLength": 1, "maxLength": 36},
"status": {"type": "string", "maxLength": 32},
"providerStatus": {"type": "string", "minLength": 1, "maxLength": 32},
"deliveryStatus": {"type": "string", "minLength": 1, "maxLength": 32},
"outputCount": {"type": "integer", "minimum": 0, "maximum": 100},
"pollIntervalSeconds": {"type": "integer", "minimum": 1, "maximum": 300},
"errorCode": {"type": "string", "minLength": 1, "maxLength": 128}
}
}
},
{
"name": "game_resource_status",
"label": "Game resource status",
"description": "Read and refresh one hosted game-resource generation job.",
"capabilityId": "game-resource.generate",
"operation": "status",
"roles": ["parent"],
"mutation": "read",
"projectWriteLease": false,
"permissions": ["hosted.game-resource.status"],
"executionMode": "synchronous",
"inputSchema": {
"type": "object",
"additionalProperties": false,
"required": ["executionId"],
"properties": {
"executionId": {"type": "string", "minLength": 1, "maxLength": 36}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": false,
"required": ["executionId", "status", "outputCount", "generationBilling"],
"properties": {
"executionId": {"type": "string", "minLength": 1, "maxLength": 36},
"status": {"type": "string", "minLength": 1, "maxLength": 32},
"outputCount": {"type": "integer", "minimum": 0, "maximum": 100},
"pollIntervalSeconds": {"type": "integer", "minimum": 1, "maximum": 300},
"phase": {"type": "string", "minLength": 1, "maxLength": 32},
"errorCode": {"type": "string", "minLength": 1, "maxLength": 128},
"generationBilling": {
"type": "object",
"additionalProperties": false,
"required": ["mode", "status", "reserved_points", "usage_amount", "unit"],
"properties": {
"mode": {"type": "string", "minLength": 1, "maxLength": 32},
"status": {"type": "string", "maxLength": 32},
"reserved_points": {"type": "string", "maxLength": 32},
"actual_points": {"type": "string", "maxLength": 32},
"usage_amount": {"type": "integer", "minimum": 0, "maximum": 1},
"unit": {"type": "string", "minLength": 1, "maxLength": 32}
"files": {
"type": "array",
"maxItems": 100,
"items": {
"type": "object",
"additionalProperties": false,
"required": ["path", "bytes"],
"properties": {
"path": {"type": "string", "minLength": 1, "maxLength": 1024},
"bytes": {"type": "integer", "minimum": 1, "maximum": 33554432}
}
}
}
}
}
},
{
"name": "game_resource_save_output",
"label": "Save generated game resource",
"description": "Save one completed hosted output into a new file inside the current project.",
"capabilityId": "game-resource.library",
"operation": "save_output",
"roles": ["parent"],
"mutation": "write",
"projectWriteLease": true,
"permissions": ["hosted.game-resource.save-output"],
"executionMode": "synchronous",
"inputSchema": {
"type": "object",
"additionalProperties": false,
"required": ["executionId", "relativePath", "confirmed"],
"properties": {
"executionId": {"type": "string", "minLength": 1, "maxLength": 36},
"outputIndex": {"type": "integer", "minimum": 0, "maximum": 99},
"relativePath": {"type": "string", "minLength": 1, "maxLength": 1024},
"confirmed": {"type": "boolean"}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": false,
"required": ["savedPath", "bytes"],
"properties": {
"savedPath": {"type": "string", "minLength": 1, "maxLength": 1024},
"bytes": {"type": "integer", "minimum": 1, "maximum": 33554432}
}
}
},
{
"name": "game_resource_cancel",
"label": "Cancel game resource",