## CHANGES

- 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 🔄
This commit is contained in:
Pedram Amini
2025-12-23 20:43:22 -06:00
parent 97cdfc88f2
commit e26ffa849e
3 changed files with 13 additions and 2 deletions

View File

@@ -8,7 +8,7 @@
* - Participants -> Moderator * - 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 { appendToLog, readLog } from './group-chat-log';
import { type GroupChatMessage, mentionMatches } from '../../shared/group-chat-types'; import { type GroupChatMessage, mentionMatches } from '../../shared/group-chat-types';
import { import {
@@ -647,10 +647,14 @@ export async function routeModeratorResponse(
? ' Remember: READ-ONLY mode is active, do not modify any files.' ? ' Remember: READ-ONLY mode is active, do not modify any files.'
: ' If you need to perform any actions, do so and report your findings.'; : ' 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 const participantPrompt = groupChatParticipantRequestPrompt
.replace(/\{\{PARTICIPANT_NAME\}\}/g, participantName) .replace(/\{\{PARTICIPANT_NAME\}\}/g, participantName)
.replace(/\{\{GROUP_CHAT_NAME\}\}/g, updatedChat.name) .replace(/\{\{GROUP_CHAT_NAME\}\}/g, updatedChat.name)
.replace(/\{\{READ_ONLY_NOTE\}\}/g, readOnlyNote) .replace(/\{\{READ_ONLY_NOTE\}\}/g, readOnlyNote)
.replace(/\{\{GROUP_CHAT_FOLDER\}\}/g, groupChatFolder)
.replace(/\{\{HISTORY_CONTEXT\}\}/g, historyContext) .replace(/\{\{HISTORY_CONTEXT\}\}/g, historyContext)
.replace(/\{\{READ_ONLY_LABEL\}\}/g, readOnlyLabel) .replace(/\{\{READ_ONLY_LABEL\}\}/g, readOnlyLabel)
.replace(/\{\{MESSAGE\}\}/g, message) .replace(/\{\{MESSAGE\}\}/g, message)

View File

@@ -106,7 +106,7 @@ export function getGroupChatsDir(): string {
/** /**
* Get the directory path for a specific group chat * 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); return path.join(getGroupChatsDir(), id);
} }

View File

@@ -6,6 +6,13 @@ Respond to the moderator's request below. Your response will be shared with the
**IMPORTANT RESPONSE FORMAT:** **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. 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: ## Recent Chat History:
{{HISTORY_CONTEXT}} {{HISTORY_CONTEXT}}