diff --git a/apps/ai-game-creator-shell/src/view/project-development/chat/DirectProjectChatView.tsx b/apps/ai-game-creator-shell/src/view/project-development/chat/DirectProjectChatView.tsx index 68b2e4cee..d8720c944 100644 --- a/apps/ai-game-creator-shell/src/view/project-development/chat/DirectProjectChatView.tsx +++ b/apps/ai-game-creator-shell/src/view/project-development/chat/DirectProjectChatView.tsx @@ -67,17 +67,17 @@ export type DirectProjectChatViewProps = { projectPath: string | null; /** 入口带进来的首轮需求;未提供时不自动发送任何回合。 */ initialTurn?: DirectProjectInitialTurn | null; - /** 项目对话读权限门:策略要求确认时由工作台壳入队,聊天不重复判定权限。 */ - ensureConversationReadAllowed?: DirectProjectConversationReadGate; - /** 项目对话写权限门:只在发起回合时检查。 */ - ensureConversationWriteAllowed?: DirectProjectConversationWriteGate; + /** + * 项目对话读权限门:策略要求确认时由工作台壳入队,聊天不重复判定权限。 + * 必填:这道门是聊天发起读取/回合的授权判据,缺省放行等于绕过工作台壳的权限判定。 + */ + ensureConversationReadAllowed: DirectProjectConversationReadGate; + /** 项目对话写权限门:只在发起回合时检查;同样必填,缺省会让未传入的调用方静默跳过授权。 */ + ensureConversationWriteAllowed: DirectProjectConversationWriteGate; /** 工作台壳把运行/预览这类动作结果交给聊天的出口。 */ ref?: Ref; }; -const ALLOW_CONVERSATION_ACCESS: DirectProjectConversationReadGate = async () => - true; - /** 首轮那条本地用户消息展示入口原话:附件与引用仍按 canonical content 进入回合。 */ function directInitialTurnText(content: readonly DirectCodexUserContentPart[]) { return content @@ -90,8 +90,8 @@ function directInitialTurnText(content: readonly DirectCodexUserContentPart[]) { export function DirectProjectChatView({ projectPath, initialTurn = null, - ensureConversationReadAllowed = ALLOW_CONVERSATION_ACCESS, - ensureConversationWriteAllowed = ALLOW_CONVERSATION_ACCESS, + ensureConversationReadAllowed, + ensureConversationWriteAllowed, ref, }: DirectProjectChatViewProps) { const { assets, projectId, refresh, versions } =