feat: add official game audio generation client

This commit is contained in:
2026-09-21 12:17:32 +08:00
parent d222d17500
commit 09e0ce5cf3
28 changed files with 1835 additions and 31 deletions

View File

@@ -0,0 +1,545 @@
{
"schemaVersion": 2,
"pluginId": "makelore.game-audio",
"contractVersion": 1,
"scope": "project",
"runtime": {
"kind": "platform_hosted",
"protocol": "makelore-hosted.v1"
},
"skills": [
{
"id": "game-audio",
"entry": "../skills/game-audio/SKILL.md",
"grants": [
"game-audio.music",
"game-audio.sound",
"game-audio.control"
]
}
],
"tools": [
{
"name": "game_music_generate",
"label": "生成游戏音乐",
"description": "Generate audio after Token Point confirmation; internally wait and save all outputs to the original project.",
"capabilityId": "game-audio.music",
"operation": "generate",
"roles": [
"parent"
],
"mutation": "write",
"projectWriteLease": false,
"permissions": [
"hosted.game-audio.game-music-generate"
],
"executionMode": "job",
"inputSchema": {
"type": "object",
"additionalProperties": false,
"required": [
"prompt",
"confirmed"
],
"properties": {
"prompt": {
"type": "string",
"minLength": 1,
"maxLength": 4000
},
"confirmed": {
"type": "boolean"
},
"referencePaths": {
"type": "array",
"maxItems": 4,
"items": {
"type": "string",
"minLength": 1,
"maxLength": 1024
}
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": false,
"required": [
"logicalOperationId",
"providerStatus",
"deliveryStatus",
"outputCount",
"files",
"phase",
"projectId"
],
"properties": {
"executionId": {
"type": "string",
"maxLength": 36
},
"logicalOperationId": {
"type": "string",
"minLength": 1,
"maxLength": 128
},
"providerStatus": {
"type": "string",
"minLength": 1,
"maxLength": 32
},
"deliveryStatus": {
"type": "string",
"minLength": 1,
"maxLength": 32
},
"outputCount": {
"type": "integer",
"minimum": 0,
"maximum": 10
},
"files": {
"type": "array",
"maxItems": 10,
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"index",
"path",
"bytes",
"mimeType"
],
"properties": {
"index": {
"type": "integer",
"minimum": 0,
"maximum": 9
},
"path": {
"type": "string",
"minLength": 1,
"maxLength": 1024
},
"bytes": {
"type": "integer",
"minimum": 1,
"maximum": 33554432
},
"mimeType": {
"type": "string",
"minLength": 1,
"maxLength": 40
}
}
}
},
"phase": {
"type": "string",
"minLength": 1,
"maxLength": 32
},
"progressPercent": {
"type": "integer",
"minimum": 0,
"maximum": 100
},
"errorCode": {
"type": "string",
"minLength": 1,
"maxLength": 100
},
"projectId": {
"type": "string",
"minLength": 1,
"maxLength": 128
}
}
}
},
{
"name": "game_music_preview",
"label": "生成音乐短预览",
"description": "Generate audio after Token Point confirmation; internally wait and save all outputs to the original project.",
"capabilityId": "game-audio.music",
"operation": "preview",
"roles": [
"parent"
],
"mutation": "write",
"projectWriteLease": false,
"permissions": [
"hosted.game-audio.game-music-preview"
],
"executionMode": "job",
"inputSchema": {
"type": "object",
"additionalProperties": false,
"required": [
"prompt",
"confirmed"
],
"properties": {
"prompt": {
"type": "string",
"minLength": 1,
"maxLength": 4000
},
"confirmed": {
"type": "boolean"
},
"referencePaths": {
"type": "array",
"maxItems": 4,
"items": {
"type": "string",
"minLength": 1,
"maxLength": 1024
}
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": false,
"required": [
"logicalOperationId",
"providerStatus",
"deliveryStatus",
"outputCount",
"files",
"phase",
"projectId"
],
"properties": {
"executionId": {
"type": "string",
"maxLength": 36
},
"logicalOperationId": {
"type": "string",
"minLength": 1,
"maxLength": 128
},
"providerStatus": {
"type": "string",
"minLength": 1,
"maxLength": 32
},
"deliveryStatus": {
"type": "string",
"minLength": 1,
"maxLength": 32
},
"outputCount": {
"type": "integer",
"minimum": 0,
"maximum": 10
},
"files": {
"type": "array",
"maxItems": 10,
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"index",
"path",
"bytes",
"mimeType"
],
"properties": {
"index": {
"type": "integer",
"minimum": 0,
"maximum": 9
},
"path": {
"type": "string",
"minLength": 1,
"maxLength": 1024
},
"bytes": {
"type": "integer",
"minimum": 1,
"maximum": 33554432
},
"mimeType": {
"type": "string",
"minLength": 1,
"maxLength": 40
}
}
}
},
"phase": {
"type": "string",
"minLength": 1,
"maxLength": 32
},
"progressPercent": {
"type": "integer",
"minimum": 0,
"maximum": 100
},
"errorCode": {
"type": "string",
"minLength": 1,
"maxLength": 100
},
"projectId": {
"type": "string",
"minLength": 1,
"maxLength": 128
}
}
}
},
{
"name": "game_sound_generate",
"label": "生成游戏音效",
"description": "Generate audio after Token Point confirmation; internally wait and save all outputs to the original project.",
"capabilityId": "game-audio.sound",
"operation": "generate",
"roles": [
"parent"
],
"mutation": "write",
"projectWriteLease": false,
"permissions": [
"hosted.game-audio.game-sound-generate"
],
"executionMode": "job",
"inputSchema": {
"type": "object",
"additionalProperties": false,
"required": [
"prompt",
"confirmed"
],
"properties": {
"prompt": {
"type": "string",
"minLength": 1,
"maxLength": 4000
},
"confirmed": {
"type": "boolean"
},
"mode": {
"type": "string",
"minLength": 1,
"maxLength": 16
},
"duration": {
"type": "number",
"minimum": 0.5,
"maximum": 10
},
"count": {
"type": "integer",
"minimum": 1,
"maximum": 10
},
"loop": {
"type": "boolean"
}
}
},
"outputSchema": {
"type": "object",
"additionalProperties": false,
"required": [
"logicalOperationId",
"providerStatus",
"deliveryStatus",
"outputCount",
"files",
"phase",
"projectId"
],
"properties": {
"executionId": {
"type": "string",
"maxLength": 36
},
"logicalOperationId": {
"type": "string",
"minLength": 1,
"maxLength": 128
},
"providerStatus": {
"type": "string",
"minLength": 1,
"maxLength": 32
},
"deliveryStatus": {
"type": "string",
"minLength": 1,
"maxLength": 32
},
"outputCount": {
"type": "integer",
"minimum": 0,
"maximum": 10
},
"files": {
"type": "array",
"maxItems": 10,
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"index",
"path",
"bytes",
"mimeType"
],
"properties": {
"index": {
"type": "integer",
"minimum": 0,
"maximum": 9
},
"path": {
"type": "string",
"minLength": 1,
"maxLength": 1024
},
"bytes": {
"type": "integer",
"minimum": 1,
"maximum": 33554432
},
"mimeType": {
"type": "string",
"minLength": 1,
"maxLength": 40
}
}
}
},
"phase": {
"type": "string",
"minLength": 1,
"maxLength": 32
},
"progressPercent": {
"type": "integer",
"minimum": 0,
"maximum": 100
},
"errorCode": {
"type": "string",
"minLength": 1,
"maxLength": 100
},
"projectId": {
"type": "string",
"minLength": 1,
"maxLength": 128
}
}
}
},
{
"name": "game_audio_cancel",
"label": "取消游戏音频任务",
"description": "Cancel only an existing audio execution when the user requests it.",
"capabilityId": "game-audio.control",
"operation": "cancel",
"roles": [
"parent"
],
"mutation": "write",
"projectWriteLease": false,
"permissions": [
"hosted.game-audio.game-audio-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",
"providerStatus",
"outputCount",
"generationBilling"
],
"properties": {
"executionId": {
"type": "string",
"minLength": 1,
"maxLength": 36
},
"providerStatus": {
"type": "string",
"minLength": 1,
"maxLength": 32
},
"outputCount": {
"type": "integer",
"minimum": 0,
"maximum": 10
},
"generationBilling": {
"type": "object",
"additionalProperties": false,
"required": [
"mode",
"status",
"reserved_points",
"usage_amount",
"unit"
],
"properties": {
"mode": {
"type": "string",
"minLength": 1,
"maxLength": 32
},
"status": {
"type": "string",
"minLength": 1,
"maxLength": 32
},
"reserved_points": {
"type": "string",
"minLength": 1,
"maxLength": 64
},
"actual_points": {
"type": "string",
"maxLength": 64
},
"usage_amount": {
"type": "integer",
"minimum": 0,
"maximum": 200
},
"unit": {
"type": "string",
"minLength": 1,
"maxLength": 32
}
}
}
}
}
}
]
}

View File

@@ -0,0 +1,14 @@
{
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
"name": "makelore.game-audio",
"version": "1.0.0",
"description": "Generate game music, short previews and sound effects, automatically saved to the project.",
"author": {
"name": "MakeLore"
},
"extensions": {
"com.makelore": {
"capabilityManifest": "./com.makelore/capability.json"
}
}
}

View File

@@ -0,0 +1,26 @@
---
name: game-audio
description: 为当前 MakeLore 项目生成背景音乐、音乐短预览或游戏音效时使用;提交前确认 Token Point 费用与自动保存。
---
# 游戏音频生成
1. 确定用途与规格。完整音乐用 `game_music_generate`;只有用户明确要短预览才用
`game_music_preview`。两者独立计费,预览不是免费步骤,也不自动升级生成完整版。
音乐最多使用 4 张用户选定的项目内参考图;不要猜 duration、bpm 或 model。
2. 音效用 `game_sound_generate`single=1 条pack=一组variants=同音效变体。
每条时长支持 0.5 秒或 110 的整数秒pack/variants 默认最多 4 条,上限 10
loop 默认 false。先让用户知道时长、最多条数与循环设置。
3. 提交前说明 Token Point 规则:音乐按任务、音效按每半秒×实际成功条数;
预留按最多条数,未返回部分不自动补生成。引用当前可信价格;没有可靠数值就不报总价。
本次确认同时授权向托管 Meowa 发送提示词/参考图,以及保存全部输出到发起项目。
4. 用户确认后以 confirmed=true 调用对应生成工具一次。Main 内部等待任务、更新进度卡、
顺序下载并保存到 assets/generated/game-audio/<executionId>/。无需轮询或再次询问保存。
5. 只有 deliveryStatus=saved 才报告完成,并链接实际 files 中的项目相对路径供用户点击试听;
不自动播放。区分 providerStatus、deliveryStatus 和 billingpending_review 不等于失败或退款。
6. delivery_failed/needs_reconciliation/submission_unknown 时报告原任务身份与真实状态,
由本机收据恢复原任务。不要为了修复下载或状态不明再次调用生成工具或更换模板重新收费。
只有用户明确要求取消时调用 game_audio_cancel取消返回 succeeded 时仍以实际完成为准。
插件随客户端提供,项目启用后所有父 Agent 可用。只用上述固定工具Provider 凭据、
URL、账户、价格版本和项目身份由 Main/服务端管理,不从对话构造。