diff --git a/apps/ai-game-creator-shell/src/features/project-workspace/ResourceReferenceInput.tsx b/apps/ai-game-creator-shell/src/features/project-workspace/ResourceReferenceInput.tsx index 14d2febcc..420180c3d 100644 --- a/apps/ai-game-creator-shell/src/features/project-workspace/ResourceReferenceInput.tsx +++ b/apps/ai-game-creator-shell/src/features/project-workspace/ResourceReferenceInput.tsx @@ -80,6 +80,7 @@ import { type ChatComposerDraft, type ChatReference, chatReferenceListKey, + chatReferenceToContentPart, currentIterationVersionAssets, dedupeChatReferences, refreshResourceReference, @@ -202,25 +203,7 @@ function collectDraftParts( if ($isResourceReferenceNode(node)) { textParts.push(`@${node.__reference.label}`); references.push(node.__reference); - content.push( - node.__reference.type === 'resource' - ? { - type: 'agc_resource_reference', - resourceId: node.__reference.resourceId, - } - : { - type: 'agc_runtime_region_reference', - label: node.__reference.label, - runId: node.__reference.runId, - versionId: node.__reference.versionId, - elementTag: node.__reference.elementTag, - elementRole: node.__reference.elementRole, - text: node.__reference.text, - width: node.__reference.width, - height: node.__reference.height, - resourceIds: node.__reference.resourceIds, - }, - ); + content.push(chatReferenceToContentPart(node.__reference)); return; } if ($isElementNode(node)) {