- Java 包 cn.huijing.game→cn.wanxiang.game:126 .java + 15 目录 git mv(保留历史)+ Application scanBasePackages/@MapperScan + yaml type-aliases - SDK HuijingGameSDK→WanxiangGameSDK + postMessage channel huijing-game-sdk→wanxiang-game-sdk(契约 + 前端 host/sdk/inject/bridge) - 契约 contracts/ 同步(sdk-interface.d.ts / runtime.yaml / game-package.schema / $id URL / V3 SQL 注释) - 主 agent 独立验证全绿:后端集成编译+55 单测(cn.wanxiang)、前端 build+/browse 冒烟(WanxiangGameSDK+demo 911 像素+遥测 200)、残留 huijing=0、Flyway 5 迁移 diff-identical、yudao cn.iocoder.yudao 2167 文件未误伤 - 保留 yudao 框架 cn.iocoder.yudao + Maven groupId cn.iocoder.cloud Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
56 lines
2.9 KiB
JSON
56 lines
2.9 KiB
JSON
{
|
||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||
"$id": "https://wanxiang.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/assets;failed 必带 failureReason。",
|
||
"type": "string",
|
||
"enum": ["succeeded", "failed"]
|
||
},
|
||
"traceId": { "type": "string" },
|
||
"templateId": { "description": "最终匹配/使用的模板 ID", "type": "string" },
|
||
"gameConfig": { "description": "生成的可玩配置(注入 GamePackage.gameConfig,runtime 编译前 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"]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|