From e26ffa849e7ad8cb12f5f9223692ccf5cf0876e7 Mon Sep 17 00:00:00 2001 From: Pedram Amini Date: Tue, 23 Dec 2025 20:43:22 -0600 Subject: [PATCH] ## CHANGES MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Added group chat shared folder path into participant requests for context 🗂️ - Exported `getGroupChatDir` so router can resolve chat directories cleanly 🔓 - Updated participant prompt with explicit shared-folder read/write permissions ✍️ - Clarified shared folder use for chat logs and participant file exchange 🔄 --- src/main/group-chat/group-chat-router.ts | 6 +++++- src/main/group-chat/group-chat-storage.ts | 2 +- src/prompts/group-chat-participant-request.md | 7 +++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/main/group-chat/group-chat-router.ts b/src/main/group-chat/group-chat-router.ts index 0bdac435..b6b6541a 100644 --- a/src/main/group-chat/group-chat-router.ts +++ b/src/main/group-chat/group-chat-router.ts @@ -8,7 +8,7 @@ * - Participants -> Moderator */ -import { GroupChatParticipant, loadGroupChat, updateParticipant, addGroupChatHistoryEntry, extractFirstSentence } from './group-chat-storage'; +import { GroupChatParticipant, loadGroupChat, updateParticipant, addGroupChatHistoryEntry, extractFirstSentence, getGroupChatDir } from './group-chat-storage'; import { appendToLog, readLog } from './group-chat-log'; import { type GroupChatMessage, mentionMatches } from '../../shared/group-chat-types'; import { @@ -647,10 +647,14 @@ export async function routeModeratorResponse( ? ' Remember: READ-ONLY mode is active, do not modify any files.' : ' If you need to perform any actions, do so and report your findings.'; + // Get the group chat folder path for file access permissions + const groupChatFolder = getGroupChatDir(groupChatId); + const participantPrompt = groupChatParticipantRequestPrompt .replace(/\{\{PARTICIPANT_NAME\}\}/g, participantName) .replace(/\{\{GROUP_CHAT_NAME\}\}/g, updatedChat.name) .replace(/\{\{READ_ONLY_NOTE\}\}/g, readOnlyNote) + .replace(/\{\{GROUP_CHAT_FOLDER\}\}/g, groupChatFolder) .replace(/\{\{HISTORY_CONTEXT\}\}/g, historyContext) .replace(/\{\{READ_ONLY_LABEL\}\}/g, readOnlyLabel) .replace(/\{\{MESSAGE\}\}/g, message) diff --git a/src/main/group-chat/group-chat-storage.ts b/src/main/group-chat/group-chat-storage.ts index 7621c3ff..a4913295 100644 --- a/src/main/group-chat/group-chat-storage.ts +++ b/src/main/group-chat/group-chat-storage.ts @@ -106,7 +106,7 @@ export function getGroupChatsDir(): string { /** * Get the directory path for a specific group chat */ -function getGroupChatDir(id: string): string { +export function getGroupChatDir(id: string): string { return path.join(getGroupChatsDir(), id); } diff --git a/src/prompts/group-chat-participant-request.md b/src/prompts/group-chat-participant-request.md index 4d3bdec2..cd73be0b 100644 --- a/src/prompts/group-chat-participant-request.md +++ b/src/prompts/group-chat-participant-request.md @@ -6,6 +6,13 @@ Respond to the moderator's request below. Your response will be shared with the **IMPORTANT RESPONSE FORMAT:** Your response MUST begin with a single-sentence summary of what you accomplished or are reporting. This first sentence will be extracted for the group chat history. Keep it concise and action-oriented. +## File Access +You have permission to read and write files in: +- Your configured working directory (your project folder) +- The group chat shared folder: {{GROUP_CHAT_FOLDER}} + +The shared folder contains chat logs and can be used for collaborative file exchange between participants. + ## Recent Chat History: {{HISTORY_CONTEXT}}