外置智能体协作编排与节点目录
由 Prompt Bundle manifest 统一驱动 section、composition、变体和 role overlay 由构建脚本生成 Supervisor 与六组专业 Agent 的静态节点目录 构建期失败关闭校验路径、引用、selector、alias 与 seed DAG 一致性 补充平台、Editor、Provider 请求、节点快照和非法 manifest 回归 同步 Runtime 技术方案与项目决策记录
This commit is contained in:
@@ -9,6 +9,9 @@ default = []
|
||||
game-chat-release = []
|
||||
|
||||
[build-dependencies]
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
serde_json = "1"
|
||||
shared-contracts = { path = "../../../server-rs/crates/shared-contracts", default-features = false }
|
||||
tauri-build = { version = "2.6.2", features = [] }
|
||||
|
||||
[dependencies]
|
||||
|
||||
@@ -1,3 +1,68 @@
|
||||
#[path = "build_support/runtime_prompt_bundle.rs"]
|
||||
mod runtime_prompt_bundle;
|
||||
|
||||
use std::collections::BTreeSet;
|
||||
use std::env;
|
||||
use std::fs;
|
||||
use std::path::PathBuf;
|
||||
|
||||
fn seed_task_group_id(
|
||||
group: &shared_contracts::game_creation_app::GameCreationAppAgentGroup,
|
||||
) -> &'static str {
|
||||
use shared_contracts::game_creation_app::GameCreationAppAgentGroup;
|
||||
match group {
|
||||
GameCreationAppAgentGroup::Design => "design",
|
||||
GameCreationAppAgentGroup::Art => "art",
|
||||
GameCreationAppAgentGroup::Code => "code",
|
||||
GameCreationAppAgentGroup::Balance => "balance",
|
||||
GameCreationAppAgentGroup::Audio => "audio",
|
||||
GameCreationAppAgentGroup::Publishing => "publishing",
|
||||
}
|
||||
}
|
||||
|
||||
fn validate_seed_task_catalog(compiled: &runtime_prompt_bundle::CompiledPromptBundle) {
|
||||
let actual = compiled
|
||||
.specialist_nodes
|
||||
.iter()
|
||||
.map(|node| {
|
||||
(
|
||||
node.task_id.clone(),
|
||||
node.group_id.clone(),
|
||||
node.role.clone(),
|
||||
)
|
||||
})
|
||||
.collect::<BTreeSet<_>>();
|
||||
let expected = shared_contracts::game_creation_app::new_game_creation_app_seed_tasks()
|
||||
.into_iter()
|
||||
.map(|task| {
|
||||
(
|
||||
task.id,
|
||||
seed_task_group_id(&task.group).to_string(),
|
||||
task.role,
|
||||
)
|
||||
})
|
||||
.collect::<BTreeSet<_>>();
|
||||
if actual != expected {
|
||||
panic!(
|
||||
"Prompt Bundle agentCatalog 与正式 seed DAG 的 taskId/group/role 不一致\nactual={actual:#?}\nexpected={expected:#?}"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let manifest_dir = PathBuf::from(
|
||||
env::var_os("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR must be available"),
|
||||
);
|
||||
let manifest_path = manifest_dir.join("prompts/runtime/manifest.json");
|
||||
let compiled = runtime_prompt_bundle::compile_manifest(&manifest_path)
|
||||
.unwrap_or_else(|error| panic!("Prompt Bundle 编译失败:{error}"));
|
||||
validate_seed_task_catalog(&compiled);
|
||||
for dependency in &compiled.dependencies {
|
||||
println!("cargo:rerun-if-changed={}", dependency.display());
|
||||
}
|
||||
let output_path = PathBuf::from(env::var_os("OUT_DIR").expect("OUT_DIR must be available"))
|
||||
.join("agent_runtime_prompt_bundle.rs");
|
||||
fs::write(&output_path, compiled.rust_source)
|
||||
.unwrap_or_else(|error| panic!("写入 Prompt Bundle 生成代码失败:{error}"));
|
||||
tauri_build::build()
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,21 +1,231 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"id": "genarrative.agent-runtime",
|
||||
"version": "2026-08-03.4",
|
||||
"version": "2026-08-04.1",
|
||||
"sections": {
|
||||
"common": "common.md",
|
||||
"isolatedAgentContract": "isolated-agent-contract.md",
|
||||
"platformDefault": "platform/default.md",
|
||||
"platformLinux": "platform/linux.md",
|
||||
"roles": {
|
||||
"codePrototypeGameChat": "roles/code-prototype-game-chat.md"
|
||||
"codePrototypeGameChat": "roles/code-prototype-game-chat.md",
|
||||
"supervisorIntro": "supervisor/intro.md",
|
||||
"supervisorVisualWithoutEditor": "supervisor/visual-contract-without-editor.md",
|
||||
"supervisorVisualWithEditor": "supervisor/visual-contract-with-editor.md",
|
||||
"supervisorPlaybook": "supervisor/playbook.md",
|
||||
"supervisorClaimGate": "supervisor/claim-gate.md",
|
||||
"supervisorRepair": "supervisor/repair.md"
|
||||
},
|
||||
"compositions": {
|
||||
"runtime": [
|
||||
"$header",
|
||||
"common",
|
||||
"$isolatedAgentTemplates",
|
||||
"isolatedAgentContract",
|
||||
"$platform"
|
||||
],
|
||||
"supervisor": [
|
||||
"$base",
|
||||
"supervisorIntro",
|
||||
"$visualContract",
|
||||
"supervisorPlaybook",
|
||||
"supervisorClaimGate",
|
||||
"supervisorRepair"
|
||||
]
|
||||
},
|
||||
"variants": {
|
||||
"platform": {
|
||||
"default": "platformDefault",
|
||||
"linux": "platformLinux"
|
||||
},
|
||||
"supervisor": {
|
||||
"intro": "supervisor/intro.md",
|
||||
"visualContractWithoutEditor": "supervisor/visual-contract-without-editor.md",
|
||||
"visualContractWithEditor": "supervisor/visual-contract-with-editor.md",
|
||||
"playbook": "supervisor/playbook.md",
|
||||
"claimGate": "supervisor/claim-gate.md",
|
||||
"repair": "supervisor/repair.md"
|
||||
"visualContract": {
|
||||
"editorConfigured": "supervisorVisualWithEditor",
|
||||
"editorUnavailable": "supervisorVisualWithoutEditor"
|
||||
}
|
||||
},
|
||||
"roleOverlays": [
|
||||
{
|
||||
"agentId": "code-prototype",
|
||||
"rootSource": "project-supervisor-game-chat",
|
||||
"sections": ["codePrototypeGameChat"]
|
||||
}
|
||||
],
|
||||
"agentCatalog": {
|
||||
"supervisor": {
|
||||
"id": "supervisor",
|
||||
"label": "项目总控",
|
||||
"role": "Project Supervisor",
|
||||
"briefPathName": "project-supervisor.md",
|
||||
"roles": [
|
||||
{
|
||||
"id": "project-supervisor",
|
||||
"role": "Project Supervisor",
|
||||
"taskId": "project-supervisor",
|
||||
"toolId": "agent.runtime.project-supervisor",
|
||||
"briefPathName": "project-supervisor.md"
|
||||
}
|
||||
]
|
||||
},
|
||||
"groups": [
|
||||
{
|
||||
"id": "design",
|
||||
"label": "策划组",
|
||||
"role": "Director + Gameplay",
|
||||
"briefPathName": "design.md",
|
||||
"roles": [
|
||||
{
|
||||
"id": "director",
|
||||
"role": "Director",
|
||||
"taskId": "design-director",
|
||||
"toolId": "agent.role.brief.design.director",
|
||||
"briefPathName": "director.md"
|
||||
},
|
||||
{
|
||||
"id": "gameplay",
|
||||
"role": "Gameplay",
|
||||
"taskId": "design-foundation",
|
||||
"toolId": "agent.role.brief.design.gameplay",
|
||||
"briefPathName": "gameplay.md"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "balance",
|
||||
"label": "数值组",
|
||||
"role": "Director + Difficulty",
|
||||
"briefPathName": "balance.md",
|
||||
"roles": [
|
||||
{
|
||||
"id": "director",
|
||||
"role": "Director",
|
||||
"taskId": "balance-director",
|
||||
"toolId": "agent.role.brief.balance.director",
|
||||
"briefPathName": "director.md"
|
||||
},
|
||||
{
|
||||
"id": "difficulty",
|
||||
"role": "Difficulty",
|
||||
"taskId": "balance-seed",
|
||||
"toolId": "agent.role.brief.balance.difficulty",
|
||||
"briefPathName": "difficulty.md"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "art",
|
||||
"label": "美术组",
|
||||
"role": "Director + Asset + Polish",
|
||||
"briefPathName": "art.md",
|
||||
"roles": [
|
||||
{
|
||||
"id": "director",
|
||||
"role": "Director",
|
||||
"taskId": "art-director",
|
||||
"toolId": "agent.role.brief.art.director",
|
||||
"briefPathName": "director.md"
|
||||
},
|
||||
{
|
||||
"id": "asset",
|
||||
"role": "Asset",
|
||||
"taskId": "art-asset-plan",
|
||||
"toolId": "agent.role.brief.art.asset",
|
||||
"briefPathName": "asset.md"
|
||||
},
|
||||
{
|
||||
"id": "polish",
|
||||
"role": "Polish",
|
||||
"taskId": "art-polish",
|
||||
"toolId": "agent.role.brief.art.polish",
|
||||
"briefPathName": "polish.md"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "audio",
|
||||
"label": "音乐组",
|
||||
"role": "Director + SFX",
|
||||
"briefPathName": "audio.md",
|
||||
"roles": [
|
||||
{
|
||||
"id": "director",
|
||||
"role": "Director",
|
||||
"taskId": "audio-director",
|
||||
"toolId": "agent.role.brief.audio.director",
|
||||
"briefPathName": "director.md"
|
||||
},
|
||||
{
|
||||
"id": "sfx",
|
||||
"role": "SFX",
|
||||
"taskId": "audio-asset-plan",
|
||||
"toolId": "agent.role.brief.audio.sfx",
|
||||
"briefPathName": "sfx.md"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "code",
|
||||
"label": "程序组",
|
||||
"role": "Director + Code + Review + Preview + Playtest",
|
||||
"briefPathName": "code.md",
|
||||
"roles": [
|
||||
{
|
||||
"id": "director",
|
||||
"role": "Director",
|
||||
"taskId": "code-director",
|
||||
"toolId": "agent.role.brief.code.director",
|
||||
"briefPathName": "director.md"
|
||||
},
|
||||
{
|
||||
"id": "code",
|
||||
"role": "Code",
|
||||
"taskId": "code-prototype",
|
||||
"toolId": "agent.role.brief.code.code",
|
||||
"briefPathName": "code.md"
|
||||
},
|
||||
{
|
||||
"id": "review",
|
||||
"role": "Review",
|
||||
"taskId": "quality-review",
|
||||
"toolId": "agent.role.brief.code.review",
|
||||
"briefPathName": "review.md"
|
||||
},
|
||||
{
|
||||
"id": "preview",
|
||||
"role": "Preview",
|
||||
"taskId": "preview-readiness",
|
||||
"toolId": "agent.role.brief.code.preview",
|
||||
"briefPathName": "preview.md"
|
||||
},
|
||||
{
|
||||
"id": "playtest",
|
||||
"role": "Playtest",
|
||||
"taskId": "preview-playtest",
|
||||
"toolId": "agent.role.brief.code.playtest",
|
||||
"briefPathName": "playtest.md"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "publishing",
|
||||
"label": "运营组",
|
||||
"role": "Director + Publish",
|
||||
"briefPathName": "publishing.md",
|
||||
"roles": [
|
||||
{
|
||||
"id": "director",
|
||||
"role": "Director",
|
||||
"taskId": "publish-strategy",
|
||||
"toolId": "agent.role.brief.publishing.director",
|
||||
"briefPathName": "director.md"
|
||||
},
|
||||
{
|
||||
"id": "publish",
|
||||
"role": "Publish",
|
||||
"taskId": "publish-package",
|
||||
"toolId": "agent.role.brief.publishing.publish",
|
||||
"briefPathName": "publish.md"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+113
-37
@@ -3,18 +3,6 @@ use crate::mcp::GAME_CREATOR_MCP_CALL_TOOL;
|
||||
|
||||
const AGENT_RUNTIME_COMPLETION_BLOCKER_TOOL_PLAN_PROTOCOL: &str = "通用完成阻断规则:如果最新 observation 的 tool 为 runtime.autonomous_completion 且 status 为 blocked,本轮禁止调用 respond_to_user;必须先读取该 observation.detail 的 nextRequiredAction,并据此调用合适的读取、修复和验证工具。只有完成要求的动作、取得后续可信 observation 且完成门禁不再阻断后,才能给最终回复;不得反复提交 final response,也不得按项目正文硬编码某一种 blocker 的处理方式。";
|
||||
|
||||
const GAME_CHAT_CODE_PROTOTYPE_FAST_PATH_PROMPT: &str =
|
||||
include_str!("../../../prompts/runtime/roles/code-prototype-game-chat.md");
|
||||
|
||||
fn game_chat_fast_path_prompt_for_root_source(
|
||||
agent_id: &str,
|
||||
root_source: &str,
|
||||
) -> Option<&'static str> {
|
||||
(agent_id.trim() == "code-prototype"
|
||||
&& root_source.trim() == AGENT_RUNTIME_SUPERVISOR_GAME_CHAT_SOURCE)
|
||||
.then_some(GAME_CHAT_CODE_PROTOTYPE_FAST_PATH_PROMPT)
|
||||
}
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
fn provider_command_exec_contract() -> &'static str {
|
||||
"command.exec 使用 {\"program\":\"受信任 PATH 中的裸可执行名\",\"args\":[\"逐项 argv\"],\"cwd\":\"可选项目内相对目录\",\"timeoutSeconds\":120};Linux 命令固定运行在 bubblewrap workspace-write、network-disabled 沙箱内,允许 bash -lc、管道、重定向和项目脚本,但不接受环境变量、宿主 executable 路径、mount 或网络策略输入"
|
||||
@@ -214,11 +202,13 @@ pub(in crate::agent) fn build_game_creator_agent_background_tool_plan_request(
|
||||
}
|
||||
if autonomous_game_build {
|
||||
let root_source = agent_runtime_root_source_at(root, agent_id, run_id)?;
|
||||
if let Some(fast_path_prompt) =
|
||||
game_chat_fast_path_prompt_for_root_source(agent_id, &root_source)
|
||||
{
|
||||
let role_overlay = game_creator_agent_runtime_role_overlay_prompt(
|
||||
agent_id.trim(),
|
||||
Some(root_source.trim()),
|
||||
);
|
||||
if !role_overlay.is_empty() {
|
||||
system_prompt.push_str("\n\n");
|
||||
system_prompt.push_str(fast_path_prompt);
|
||||
system_prompt.push_str(&role_overlay);
|
||||
}
|
||||
}
|
||||
let mut request = LlmRunRequest::new(vec![
|
||||
@@ -431,7 +421,7 @@ mod tests {
|
||||
use super::{
|
||||
agent_runtime_root_source_at, bind_game_creator_agent_runtime_run_profile_at,
|
||||
build_game_creator_agent_background_tool_plan_request,
|
||||
game_chat_fast_path_prompt_for_root_source, game_creator_agent_context_preload_notice,
|
||||
game_creator_agent_context_preload_notice, game_creator_agent_runtime_role_overlay_prompt,
|
||||
init_local_game_project_at, provider_command_exec_contract,
|
||||
provider_command_start_contract, start_game_creator_agent_runtime_task_at,
|
||||
AgentRuntimeTaskLink, GameCreatorMcpCatalog, GameCreatorMcpCatalogTool,
|
||||
@@ -459,6 +449,69 @@ mod tests {
|
||||
.collect()
|
||||
}
|
||||
|
||||
fn build_request_system_prompt_for_root_source(
|
||||
agent_id: &str,
|
||||
root_source: &str,
|
||||
suffix: &str,
|
||||
) -> String {
|
||||
let temporary = tempfile::tempdir().expect("temporary project root");
|
||||
let root = temporary.path().join("project");
|
||||
init_local_game_project_at(&root, &format!("overlay-{suffix}"), "role overlay test")
|
||||
.expect("project init");
|
||||
let parent_run_id = format!("overlay-parent-{suffix}");
|
||||
let parent = bind_game_creator_agent_runtime_run_profile_at(
|
||||
&root,
|
||||
GAME_CREATOR_PROJECT_SUPERVISOR_AGENT_ID,
|
||||
&parent_run_id,
|
||||
root_source,
|
||||
Some(AGENT_RUNTIME_RUN_PROFILE_AUTONOMOUS_GAME_BUILD),
|
||||
None,
|
||||
)
|
||||
.expect("bind parent profile");
|
||||
let child_run_id = format!("overlay-child-{suffix}");
|
||||
let child_link = AgentRuntimeTaskLink {
|
||||
parent_agent_id: Some(parent.agent_id),
|
||||
parent_run_id: Some(parent.run_id),
|
||||
delegation_id: Some(format!("overlay-delegation-{suffix}")),
|
||||
};
|
||||
bind_game_creator_agent_runtime_run_profile_at(
|
||||
&root,
|
||||
agent_id,
|
||||
&child_run_id,
|
||||
"agent-ready-task-scheduler",
|
||||
None,
|
||||
Some(&child_link),
|
||||
)
|
||||
.expect("bind child profile");
|
||||
let state = start_game_creator_agent_runtime_task_at(
|
||||
&root,
|
||||
agent_id,
|
||||
"核对 role overlay",
|
||||
&child_run_id,
|
||||
"agent-ready-task-scheduler",
|
||||
"构建 planning request",
|
||||
vec!["核对 overlay".to_string()],
|
||||
)
|
||||
.expect("start child task");
|
||||
let catalog = GameCreatorMcpCatalog {
|
||||
fingerprint: String::new(),
|
||||
servers: Vec::new(),
|
||||
tools: Vec::new(),
|
||||
};
|
||||
let (_, _, request, _) = build_game_creator_agent_background_tool_plan_request(
|
||||
&root,
|
||||
agent_id,
|
||||
&state.session_id,
|
||||
&state.run_id,
|
||||
&state.current_task,
|
||||
&[],
|
||||
0,
|
||||
&catalog,
|
||||
)
|
||||
.expect("build child request");
|
||||
request.messages[0].content.clone()
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn context_preload_notice_matches_agent_context() {
|
||||
assert_eq!(
|
||||
@@ -745,11 +798,10 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn game_chat_fast_path_prompt_protects_existing_game_and_requires_cropped_spritesheet_use() {
|
||||
let prompt = game_chat_fast_path_prompt_for_root_source(
|
||||
let prompt = game_creator_agent_runtime_role_overlay_prompt(
|
||||
"code-prototype",
|
||||
AGENT_RUNTIME_SUPERVISOR_GAME_CHAT_SOURCE,
|
||||
)
|
||||
.expect("game-chat code fast path prompt");
|
||||
Some(AGENT_RUNTIME_SUPERVISOR_GAME_CHAT_SOURCE),
|
||||
);
|
||||
|
||||
assert!(prompt.contains("素材完整快车道"));
|
||||
assert!(prompt.contains("第一步必须调用 file.read(path=game/index.html)"));
|
||||
@@ -767,26 +819,50 @@ mod tests {
|
||||
assert!(prompt.contains("不得猜测整张图集是等分网格"));
|
||||
assert!(prompt.contains("不得以纯代码几何替代核心实体"));
|
||||
assert!(prompt.contains("四类切片或其可见使用任一缺失时不得交付"));
|
||||
assert!(game_chat_fast_path_prompt_for_root_source(
|
||||
assert!(game_creator_agent_runtime_role_overlay_prompt(
|
||||
"quality-review",
|
||||
AGENT_RUNTIME_SUPERVISOR_GAME_CHAT_SOURCE,
|
||||
Some(AGENT_RUNTIME_SUPERVISOR_GAME_CHAT_SOURCE),
|
||||
)
|
||||
.is_none());
|
||||
assert!(game_chat_fast_path_prompt_for_root_source(
|
||||
.is_empty());
|
||||
assert!(game_creator_agent_runtime_role_overlay_prompt(
|
||||
"code-prototype",
|
||||
Some(AGENT_RUNTIME_SUPERVISOR_CLI_SOURCE),
|
||||
)
|
||||
.is_empty());
|
||||
assert!(game_creator_agent_runtime_role_overlay_prompt(
|
||||
"code-prototype",
|
||||
Some(AGENT_RUNTIME_SUPERVISOR_GUI_SOURCE),
|
||||
)
|
||||
.is_empty());
|
||||
assert!(game_creator_agent_runtime_role_overlay_prompt(
|
||||
"code-prototype",
|
||||
Some("agent-background-task"),
|
||||
)
|
||||
.is_empty());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn provider_request_applies_manifest_role_overlay_once_only_to_the_matching_child() {
|
||||
let _config_guard = crate::tests::write_test_local_config("{}".to_string());
|
||||
let matching = build_request_system_prompt_for_root_source(
|
||||
"code-prototype",
|
||||
AGENT_RUNTIME_SUPERVISOR_GAME_CHAT_SOURCE,
|
||||
"matching",
|
||||
);
|
||||
let other_source = build_request_system_prompt_for_root_source(
|
||||
"code-prototype",
|
||||
AGENT_RUNTIME_SUPERVISOR_CLI_SOURCE,
|
||||
)
|
||||
.is_none());
|
||||
assert!(game_chat_fast_path_prompt_for_root_source(
|
||||
"code-prototype",
|
||||
AGENT_RUNTIME_SUPERVISOR_GUI_SOURCE,
|
||||
)
|
||||
.is_none());
|
||||
assert!(game_chat_fast_path_prompt_for_root_source(
|
||||
"code-prototype",
|
||||
"agent-background-task",
|
||||
)
|
||||
.is_none());
|
||||
"other-source",
|
||||
);
|
||||
let other_agent = build_request_system_prompt_for_root_source(
|
||||
"quality-review",
|
||||
AGENT_RUNTIME_SUPERVISOR_GAME_CHAT_SOURCE,
|
||||
"other-agent",
|
||||
);
|
||||
|
||||
assert_eq!(matching.matches("素材完整快车道").count(), 1);
|
||||
assert_eq!(other_source.matches("素材完整快车道").count(), 0);
|
||||
assert_eq!(other_agent.matches("素材完整快车道").count(), 0);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -4,7 +4,7 @@ use agent_runtime_core::{AgentCatalog, AgentDescriptor, RunProfileCatalog, RunPr
|
||||
fn build_game_creator_runtime_agent_catalog() -> Result<AgentCatalog, String> {
|
||||
let mut agents = vec![AgentDescriptor::try_new(
|
||||
GAME_CREATOR_PROJECT_SUPERVISOR_AGENT_ID,
|
||||
"supervisor",
|
||||
PROJECT_SUPERVISOR_AGENT_DEFINITION.id,
|
||||
std::iter::empty::<&str>(),
|
||||
)
|
||||
.and_then(|agent| {
|
||||
@@ -109,7 +109,7 @@ mod tests {
|
||||
catalog
|
||||
.get(GAME_CREATOR_PROJECT_SUPERVISOR_AGENT_ID)
|
||||
.map(AgentDescriptor::role),
|
||||
Some("supervisor")
|
||||
Some(PROJECT_SUPERVISOR_AGENT_DEFINITION.id)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1306,200 +1306,9 @@ struct AgentGroupDefinition {
|
||||
roles: &'static [AgentRoleDefinition],
|
||||
}
|
||||
|
||||
pub(crate) const GAME_CREATOR_PROJECT_SUPERVISOR_AGENT_ID: &str = "project-supervisor";
|
||||
include!(concat!(env!("OUT_DIR"), "/agent_runtime_prompt_bundle.rs"));
|
||||
|
||||
const GAME_CREATOR_LEGACY_CHAT_AGENT_CONFIG_ID: &str = "chat";
|
||||
const GAME_CREATOR_PROJECT_SUPERVISOR_MEMORY_PATH: &str = "memory/agents/project-supervisor.md";
|
||||
|
||||
static PROJECT_SUPERVISOR_AGENT_ROLES: [AgentRoleDefinition; 1] = [AgentRoleDefinition {
|
||||
id: "project-supervisor",
|
||||
role: "Project Supervisor",
|
||||
task_id: GAME_CREATOR_PROJECT_SUPERVISOR_AGENT_ID,
|
||||
tool_id: "agent.runtime.project-supervisor",
|
||||
brief_path_name: "project-supervisor.md",
|
||||
}];
|
||||
|
||||
static PROJECT_SUPERVISOR_AGENT_DEFINITION: AgentGroupDefinition = AgentGroupDefinition {
|
||||
id: "supervisor",
|
||||
label: "项目总控",
|
||||
role: "Project Supervisor",
|
||||
brief_path_name: "project-supervisor.md",
|
||||
roles: &PROJECT_SUPERVISOR_AGENT_ROLES,
|
||||
};
|
||||
|
||||
static DESIGN_AGENT_ROLES: [AgentRoleDefinition; 2] = [
|
||||
AgentRoleDefinition {
|
||||
id: "director",
|
||||
role: "Director",
|
||||
task_id: "design-director",
|
||||
tool_id: "agent.role.brief.design.director",
|
||||
brief_path_name: "director.md",
|
||||
},
|
||||
AgentRoleDefinition {
|
||||
id: "gameplay",
|
||||
role: "Gameplay",
|
||||
task_id: "design-foundation",
|
||||
tool_id: "agent.role.brief.design.gameplay",
|
||||
brief_path_name: "gameplay.md",
|
||||
},
|
||||
];
|
||||
|
||||
static BALANCE_AGENT_ROLES: [AgentRoleDefinition; 2] = [
|
||||
AgentRoleDefinition {
|
||||
id: "director",
|
||||
role: "Director",
|
||||
task_id: "balance-director",
|
||||
tool_id: "agent.role.brief.balance.director",
|
||||
brief_path_name: "director.md",
|
||||
},
|
||||
AgentRoleDefinition {
|
||||
id: "difficulty",
|
||||
role: "Difficulty",
|
||||
task_id: "balance-seed",
|
||||
tool_id: "agent.role.brief.balance.difficulty",
|
||||
brief_path_name: "difficulty.md",
|
||||
},
|
||||
];
|
||||
|
||||
static ART_AGENT_ROLES: [AgentRoleDefinition; 3] = [
|
||||
AgentRoleDefinition {
|
||||
id: "director",
|
||||
role: "Director",
|
||||
task_id: "art-director",
|
||||
tool_id: "agent.role.brief.art.director",
|
||||
brief_path_name: "director.md",
|
||||
},
|
||||
AgentRoleDefinition {
|
||||
id: "asset",
|
||||
role: "Asset",
|
||||
task_id: "art-asset-plan",
|
||||
tool_id: "agent.role.brief.art.asset",
|
||||
brief_path_name: "asset.md",
|
||||
},
|
||||
AgentRoleDefinition {
|
||||
id: "polish",
|
||||
role: "Polish",
|
||||
task_id: "art-polish",
|
||||
tool_id: "agent.role.brief.art.polish",
|
||||
brief_path_name: "polish.md",
|
||||
},
|
||||
];
|
||||
|
||||
static AUDIO_AGENT_ROLES: [AgentRoleDefinition; 2] = [
|
||||
AgentRoleDefinition {
|
||||
id: "director",
|
||||
role: "Director",
|
||||
task_id: "audio-director",
|
||||
tool_id: "agent.role.brief.audio.director",
|
||||
brief_path_name: "director.md",
|
||||
},
|
||||
AgentRoleDefinition {
|
||||
id: "sfx",
|
||||
role: "SFX",
|
||||
task_id: "audio-asset-plan",
|
||||
tool_id: "agent.role.brief.audio.sfx",
|
||||
brief_path_name: "sfx.md",
|
||||
},
|
||||
];
|
||||
|
||||
static CODE_AGENT_ROLES: [AgentRoleDefinition; 5] = [
|
||||
AgentRoleDefinition {
|
||||
id: "director",
|
||||
role: "Director",
|
||||
task_id: "code-director",
|
||||
tool_id: "agent.role.brief.code.director",
|
||||
brief_path_name: "director.md",
|
||||
},
|
||||
AgentRoleDefinition {
|
||||
id: "code",
|
||||
role: "Code",
|
||||
task_id: "code-prototype",
|
||||
tool_id: "agent.role.brief.code.code",
|
||||
brief_path_name: "code.md",
|
||||
},
|
||||
AgentRoleDefinition {
|
||||
id: "review",
|
||||
role: "Review",
|
||||
task_id: "quality-review",
|
||||
tool_id: "agent.role.brief.code.review",
|
||||
brief_path_name: "review.md",
|
||||
},
|
||||
AgentRoleDefinition {
|
||||
id: "preview",
|
||||
role: "Preview",
|
||||
task_id: "preview-readiness",
|
||||
tool_id: "agent.role.brief.code.preview",
|
||||
brief_path_name: "preview.md",
|
||||
},
|
||||
AgentRoleDefinition {
|
||||
id: "playtest",
|
||||
role: "Playtest",
|
||||
task_id: "preview-playtest",
|
||||
tool_id: "agent.role.brief.code.playtest",
|
||||
brief_path_name: "playtest.md",
|
||||
},
|
||||
];
|
||||
|
||||
static PUBLISHING_AGENT_ROLES: [AgentRoleDefinition; 2] = [
|
||||
AgentRoleDefinition {
|
||||
id: "director",
|
||||
role: "Director",
|
||||
task_id: "publish-strategy",
|
||||
tool_id: "agent.role.brief.publishing.director",
|
||||
brief_path_name: "director.md",
|
||||
},
|
||||
AgentRoleDefinition {
|
||||
id: "publish",
|
||||
role: "Publish",
|
||||
task_id: "publish-package",
|
||||
tool_id: "agent.role.brief.publishing.publish",
|
||||
brief_path_name: "publish.md",
|
||||
},
|
||||
];
|
||||
|
||||
const GAME_CREATOR_AGENT_GROUP_DEFINITIONS: [AgentGroupDefinition; 6] = [
|
||||
AgentGroupDefinition {
|
||||
id: "design",
|
||||
label: "策划组",
|
||||
role: "Director + Gameplay",
|
||||
brief_path_name: "design.md",
|
||||
roles: &DESIGN_AGENT_ROLES,
|
||||
},
|
||||
AgentGroupDefinition {
|
||||
id: "balance",
|
||||
label: "数值组",
|
||||
role: "Director + Difficulty",
|
||||
brief_path_name: "balance.md",
|
||||
roles: &BALANCE_AGENT_ROLES,
|
||||
},
|
||||
AgentGroupDefinition {
|
||||
id: "art",
|
||||
label: "美术组",
|
||||
role: "Director + Asset + Polish",
|
||||
brief_path_name: "art.md",
|
||||
roles: &ART_AGENT_ROLES,
|
||||
},
|
||||
AgentGroupDefinition {
|
||||
id: "audio",
|
||||
label: "音乐组",
|
||||
role: "Director + SFX",
|
||||
brief_path_name: "audio.md",
|
||||
roles: &AUDIO_AGENT_ROLES,
|
||||
},
|
||||
AgentGroupDefinition {
|
||||
id: "code",
|
||||
label: "程序组",
|
||||
role: "Director + Code + Review + Preview + Playtest",
|
||||
brief_path_name: "code.md",
|
||||
roles: &CODE_AGENT_ROLES,
|
||||
},
|
||||
AgentGroupDefinition {
|
||||
id: "publishing",
|
||||
label: "运营组",
|
||||
role: "Director + Publish",
|
||||
brief_path_name: "publishing.md",
|
||||
roles: &PUBLISHING_AGENT_ROLES,
|
||||
},
|
||||
];
|
||||
|
||||
struct GameCreatorLlmAgentStatusDefinition {
|
||||
agent_id: String,
|
||||
@@ -1510,7 +1319,7 @@ fn game_creator_llm_agent_status_definitions() -> Vec<GameCreatorLlmAgentStatusD
|
||||
let mut agents = vec 为编码级事实源。它补充仓库启动上下文、同一发布二进制独立 Runner、受限本地预览浏览器验证、动态隔离子 Agent 和真实 Provider 全链路验收;本文件中“进程内 tokio task”“首轮不预加载项目内容”和“不创建动态执行实例”的旧口径由 V1.1 明确替代,未涉及能力继续沿用本文件。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user