games-development-ai/contracts/dify-workflow-io.json
zizi c4e2d73300 feat(backend): Wave1 后端脊柱 5 模块 + 8 类契约 + yudao-cloud fork 接线
- game-cloud:yudao-cloud fork(裁剪至 system/infra)+ 5 业务模块 project/aigc/runtime/feed/telemetry
- 黄金模块 game-module-project + 克隆 4 脊柱模块;46 单测绿 + 41 模块集成编译绿
- contracts/:8 类契约锁定(5 API YAML + sdk-interface.d.ts + game-package.schema + events 等)
- yudao-server 接线:全局组件扫描 + @MapperScan + Flyway V1-V5(baseline-version=0)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 09:10:05 +00:00

56 lines
2.9 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://huijing.ai/contracts/dify-workflow-io.json",
"title": "DifyWorkflowIO",
"description": "契约 #6 Dify workflow 输入/输出owner=WS2。aigc Java 壳 ↔ Dify 的对接面。Dify 6 节点安全检测→意图解析→模板匹配→GameConfig生成+Schema校验→调OpenGame/ComfyUI→质量评估。LLM 节点 prompt 用 {{registry:id@ver}} 引用 Prompt Registry契约#8。",
"type": "object",
"required": ["input", "output"],
"additionalProperties": false,
"properties": {
"input": {
"description": "Java 壳 → Dify 的工作流输入",
"type": "object",
"required": ["prompt", "traceId"],
"additionalProperties": false,
"properties": {
"prompt": { "description": "创作者自然语言 Prompt", "type": "string", "minLength": 1 },
"templateId": { "description": "指定模板 ID可空空则由意图解析+模板匹配节点决定)", "type": "string" },
"userId": { "description": "创作者 ID限频/审计)", "type": "string" },
"traceId": { "description": "贯穿全链路 trace_id", "type": "string" },
"attachments": {
"description": "附件驱动创作上下文(图片/参考,可空)",
"type": "array",
"items": { "type": "object", "properties": { "type": { "type": "string" }, "url": { "type": "string", "format": "uri" } } }
}
}
},
"output": {
"description": "Dify → Java 壳 的工作流输出。status 驱动 aigc 生成任务状态机。",
"type": "object",
"required": ["status", "traceId"],
"additionalProperties": false,
"properties": {
"status": {
"description": "生成结果状态。succeeded 必带 gameConfig/assetsfailed 必带 failureReason。",
"type": "string",
"enum": ["succeeded", "failed"]
},
"traceId": { "type": "string" },
"templateId": { "description": "最终匹配/使用的模板 ID", "type": "string" },
"gameConfig": { "description": "生成的可玩配置(注入 GamePackage.gameConfigruntime 编译前 Schema 校验)", "type": "object" },
"assets": {
"description": "ComfyUI 等生成的资源引用(合入 GamePackage.assets",
"type": "array",
"items": { "type": "object", "properties": { "type": { "type": "string" }, "url": { "type": "string", "format": "uri" } } }
},
"qualityScore": { "description": "质量评估节点输出0-1质量门禁参考", "type": "number", "minimum": 0, "maximum": 1 },
"failureReason": {
"description": "失败原因分类status=failed 必填,映射用户可读提示)",
"type": "string",
"enum": ["unsafe_prompt", "intent_unclear", "no_template_match", "config_invalid", "llm_error", "timeout", "asset_gen_failed"]
}
}
}
}
}