diff --git a/apps/ai-game-creator-shell/src/App.tsx b/apps/ai-game-creator-shell/src/App.tsx index 71e9745fa..539af1977 100644 --- a/apps/ai-game-creator-shell/src/App.tsx +++ b/apps/ai-game-creator-shell/src/App.tsx @@ -3123,6 +3123,14 @@ function commandDraftFromAgentRunTrace(trace: GameCreationAgentRunTrace) { ); } +function readableArtifactPathFromAgentRunTrace( + trace: GameCreationAgentRunTrace, +) { + return trace.artifacts.find((artifact) => + isSafeProjectRelativePath(artifact.path), + )?.path; +} + function localAgentConversationReceipt(agent: AgentStatusCard) { return `已记录给 ${agent.title}。下一次生成会把这条对话作为该 agent 的上下文读取。`; } @@ -3256,9 +3264,16 @@ export function summarizeAgentRunTrace(trace: GameCreationAgentRunTrace) { } function summarizeAgentRunCompletionForChat(trace: GameCreationAgentRunTrace) { + const suggestedCommand = commandDraftFromAgentRunTrace(trace); + const readableArtifactPath = readableArtifactPathFromAgentRunTrace(trace); + const artifactReadCommand = readableArtifactPath + ? `/read ${readableArtifactPath}` + : undefined; return { text: `${summarizeAgentRunTrace(trace)}\n完整 trace:/trace`, - draftCommand: commandDraftFromAgentRunTrace(trace) ?? undefined, + draftCommand: suggestedCommand ?? artifactReadCommand, + draftCommandLabel: + suggestedCommand || !artifactReadCommand ? undefined : '读取首个产物', }; } @@ -9487,6 +9502,22 @@ export function App() { > 记到黑板 + + + + ))} @@ -9817,6 +9868,33 @@ export function App() { > 继续 + + +