feat: integrate automatic game resource delivery
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -12,15 +12,18 @@ Meowa 凭据、Provider URL、Provider job ID,也不要直接访问第三方
|
||||
|
||||
1. 先确认资源用途、像素或高清类型、画面要求、比例和实际需要的参考图;用
|
||||
`game_resource_templates` 获取当前可用模板,不要猜模板名。
|
||||
2. 明确告诉用户生成按 Token Point 用量计费,并等待用户确认本次具体生成请求。
|
||||
3. 确认后只调用一次 `game_resource_generate`。结果不确定、超时或
|
||||
`pending_review` 时不得换 logical operation 重试;报告状态并使用原
|
||||
`executionId` 查询。
|
||||
4. 用 `game_resource_status` 查询同一个 execution,直到 succeeded、failed、
|
||||
cancelled 或 pending_review。轮询间隔遵守返回的 `pollIntervalSeconds`。
|
||||
5. 只有用户明确要求取消时才调用 `game_resource_cancel`。
|
||||
6. succeeded 后,只有用户明确给出项目内目标路径并确认保存时,才调用
|
||||
`game_resource_save_output`。该工具只创建新文件,不覆盖现有文件。
|
||||
2. 明确告诉用户生成按 Token Point 用量计费;本次确认同时授权生成完成后自动
|
||||
保存全部输出到当前项目,不再另行询问路径或保存确认。
|
||||
3. 确认后只调用一次 `game_resource_generate`。该工具会在 MakeLore 内部提交、
|
||||
轮询、下载并把全部输出自动保存到当前项目。不要自行轮询,也不要为同一请求
|
||||
再调用生成工具。
|
||||
4. 只有用户明确要求取消,且已有 execution ID 时,才调用
|
||||
`game_resource_cancel`。
|
||||
5. `deliveryStatus=saved` 时,向用户报告工具返回的项目相对路径。
|
||||
`deliveryStatus=delivery_failed` 时,说明 Provider 可能已成功且计费可能已完成,
|
||||
MakeLore 会从本地收据继续交付;不得重新生成或要求用户再次确认。
|
||||
6. `pending_review` 或 `submission_unknown` 时只报告现状,不得换 logical operation
|
||||
重试,也不得声称已经保存。
|
||||
|
||||
## 浏览与审查
|
||||
|
||||
@@ -30,6 +33,7 @@ Provider 地址或通过生成工具上传未获用户同意的文件。
|
||||
|
||||
## 完成标准
|
||||
|
||||
报告必须区分提交、Provider 状态和 Token Point receipt。只引用工具实际返回的
|
||||
execution、status、outputCount 与 billing;不要猜测余额、价格、Provider 成本或
|
||||
输出路径。没有 settled receipt 时不得声称计费已最终完成。
|
||||
报告必须区分 Provider 状态、自动交付状态和 Token Point receipt。只引用工具实际
|
||||
返回的 execution、providerStatus、deliveryStatus、files 与 billing;不要猜测余额、
|
||||
价格、Provider 成本或输出路径。没有 `deliveryStatus=saved` 时不得声称文件已经写入
|
||||
项目;没有 settled receipt 时不得声称计费已最终完成。
|
||||
|
||||
Reference in New Issue
Block a user