fix(plugins): load official hosted plugins from bundled resources
This commit is contained in:
@@ -0,0 +1,288 @@
|
||||
{
|
||||
"schemaVersion": 2,
|
||||
"pluginId": "makelore.game-resource",
|
||||
"contractVersion": 1,
|
||||
"scope": "project",
|
||||
"runtime": {
|
||||
"kind": "platform_hosted",
|
||||
"protocol": "makelore-hosted.v1"
|
||||
},
|
||||
"skills": [
|
||||
{
|
||||
"id": "game-resource",
|
||||
"entry": "../skills/game-resource/SKILL.md",
|
||||
"grants": [
|
||||
"game-resource.generate",
|
||||
"game-resource.library"
|
||||
]
|
||||
}
|
||||
],
|
||||
"tools": [
|
||||
{
|
||||
"name": "game_resource_templates",
|
||||
"label": "List game resource templates",
|
||||
"description": "List the currently available hosted templates for pixel-art or HD generation.",
|
||||
"capabilityId": "game-resource.generate",
|
||||
"operation": "templates",
|
||||
"roles": ["parent"],
|
||||
"mutation": "read",
|
||||
"projectWriteLease": false,
|
||||
"permissions": ["hosted.game-resource.templates"],
|
||||
"executionMode": "synchronous",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["kind"],
|
||||
"properties": {
|
||||
"kind": {"type": "string", "minLength": 2, "maxLength": 5}
|
||||
}
|
||||
},
|
||||
"outputSchema": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["kind", "templates"],
|
||||
"properties": {
|
||||
"kind": {"type": "string", "minLength": 2, "maxLength": 5},
|
||||
"templates": {
|
||||
"type": "array",
|
||||
"maxItems": 100,
|
||||
"items": {"type": "string", "minLength": 1, "maxLength": 200}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "game_resource_generate",
|
||||
"label": "Generate game resource",
|
||||
"description": "Submit one hosted pixel-art or HD game-resource generation job.",
|
||||
"capabilityId": "game-resource.generate",
|
||||
"operation": "generate",
|
||||
"roles": ["parent"],
|
||||
"mutation": "write",
|
||||
"projectWriteLease": false,
|
||||
"permissions": ["hosted.game-resource.generate"],
|
||||
"executionMode": "job",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["kind", "templateName", "requirement", "confirmed"],
|
||||
"properties": {
|
||||
"kind": {"type": "string", "minLength": 2, "maxLength": 5},
|
||||
"templateName": {"type": "string", "minLength": 1, "maxLength": 200},
|
||||
"templateConfigJson": {"type": "string", "maxLength": 16384},
|
||||
"requirement": {"type": "string", "minLength": 1, "maxLength": 12000},
|
||||
"aspectRatio": {"type": "string", "minLength": 1, "maxLength": 40},
|
||||
"temperature": {"type": "number", "minimum": 0, "maximum": 2},
|
||||
"jobName": {"type": "string", "minLength": 1, "maxLength": 200},
|
||||
"modelName": {"type": "string", "minLength": 1, "maxLength": 200},
|
||||
"resolution": {"type": "string", "minLength": 1, "maxLength": 40},
|
||||
"hdRemoveBgMode": {"type": "string", "minLength": 1, "maxLength": 80},
|
||||
"threadId": {"type": "string", "minLength": 1, "maxLength": 200},
|
||||
"confirmed": {"type": "boolean"},
|
||||
"referencePaths": {
|
||||
"type": "array",
|
||||
"maxItems": 8,
|
||||
"items": {"type": "string", "minLength": 1, "maxLength": 1024}
|
||||
}
|
||||
}
|
||||
},
|
||||
"outputSchema": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["executionId", "status", "outputCount"],
|
||||
"properties": {
|
||||
"executionId": {"type": "string", "minLength": 1, "maxLength": 36},
|
||||
"status": {"type": "string", "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},
|
||||
"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}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"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",
|
||||
"description": "Cancel one non-terminal hosted generation job.",
|
||||
"capabilityId": "game-resource.generate",
|
||||
"operation": "cancel",
|
||||
"roles": ["parent"],
|
||||
"mutation": "write",
|
||||
"projectWriteLease": false,
|
||||
"permissions": ["hosted.game-resource.cancel"],
|
||||
"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},
|
||||
"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}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "game_asset_browser",
|
||||
"label": "Browse game assets",
|
||||
"description": "Open the project game-asset browser for user selection.",
|
||||
"capabilityId": "game-resource.library",
|
||||
"operation": "browse",
|
||||
"roles": ["parent"],
|
||||
"mutation": "read",
|
||||
"projectWriteLease": false,
|
||||
"permissions": ["hosted.game-resource.browse"],
|
||||
"executionMode": "synchronous",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [],
|
||||
"properties": {
|
||||
"invocationId": {"type": "string", "minLength": 1, "maxLength": 200}
|
||||
}
|
||||
},
|
||||
"outputSchema": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["invocationId", "status"],
|
||||
"properties": {
|
||||
"invocationId": {"type": "string", "minLength": 1, "maxLength": 200},
|
||||
"status": {"type": "string", "minLength": 1, "maxLength": 32}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "game_asset_review",
|
||||
"label": "Review game asset",
|
||||
"description": "Open a project game asset for user review and decision.",
|
||||
"capabilityId": "game-resource.library",
|
||||
"operation": "review",
|
||||
"roles": ["parent"],
|
||||
"mutation": "read",
|
||||
"projectWriteLease": false,
|
||||
"permissions": ["hosted.game-resource.review"],
|
||||
"executionMode": "synchronous",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["candidateIds"],
|
||||
"properties": {
|
||||
"candidateIds": {
|
||||
"type": "array",
|
||||
"maxItems": 200,
|
||||
"items": {"type": "string", "minLength": 1, "maxLength": 200}
|
||||
},
|
||||
"invocationId": {"type": "string", "minLength": 1, "maxLength": 200}
|
||||
}
|
||||
},
|
||||
"outputSchema": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["invocationId", "status"],
|
||||
"properties": {
|
||||
"invocationId": {"type": "string", "minLength": 1, "maxLength": 200},
|
||||
"status": {"type": "string", "minLength": 1, "maxLength": 32}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
14
resources/coding-plugins/game-resource/plugin.json
Normal file
14
resources/coding-plugins/game-resource/plugin.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
|
||||
"name": "makelore.game-resource",
|
||||
"version": "1.0.0",
|
||||
"description": "Generate and review game resources through MakeLore's hosted provider",
|
||||
"author": {
|
||||
"name": "MakeLore"
|
||||
},
|
||||
"extensions": {
|
||||
"com.makelore": {
|
||||
"capabilityManifest": "./com.makelore/capability.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
---
|
||||
name: game-resource
|
||||
description: 当用户明确要求为当前 MakeLore 项目生成、查找或审查游戏资源时使用;生成会消耗 Token Point,提交前必须说明并取得用户确认。
|
||||
---
|
||||
|
||||
# MakeLore 游戏资源
|
||||
|
||||
此 Skill 只使用 `makelore.game-resource` 提供的工具。不要请求、保存或展示
|
||||
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`。该工具只创建新文件,不覆盖现有文件。
|
||||
|
||||
## 浏览与审查
|
||||
|
||||
`game_asset_browser` 与 `game_asset_review` 只处理当前项目的本地候选资源和用户
|
||||
确认,不会生成资源,也不会产生新的 Token Point 交易。不得把本地路径当作
|
||||
Provider 地址或通过生成工具上传未获用户同意的文件。
|
||||
|
||||
## 完成标准
|
||||
|
||||
报告必须区分提交、Provider 状态和 Token Point receipt。只引用工具实际返回的
|
||||
execution、status、outputCount 与 billing;不要猜测余额、价格、Provider 成本或
|
||||
输出路径。没有 settled receipt 时不得声称计费已最终完成。
|
||||
Reference in New Issue
Block a user