feat: Enhance team messaging system with new operations and data handling

- Added support for new message type 'state_update' in TeamMessageType.
- Updated TeamMessageFeed component to handle both legacy and new reference formats.
- Modified CLI options to clarify usage and added new commands for broadcasting messages and retrieving role states.
- Implemented new command 'get_state' to read role state from meta.json.
- Enhanced team message logging to auto-generate summaries and handle structured data.
- Improved backward compatibility by enriching team metadata from legacy files.
- Refactored message handling functions to streamline operations and improve clarity.
This commit is contained in:
catlog22
2026-03-03 16:11:57 +08:00
parent 628578b2bb
commit a7ed0365f7
7 changed files with 409 additions and 269 deletions

View File

@@ -432,13 +432,14 @@ export async function handleTeamRoutes(ctx: RouteContext): Promise<boolean> {
const sessionDir = getSessionDir(artifactsTeamName, root);
if (!existsSync(sessionDir)) {
// Check if it's a legacy team with session_id
// Check if it's a legacy team with session_id in meta
const meta = getEffectiveTeamMeta(artifactsTeamName);
if (meta.session_id) {
const legacySessionId = (meta as Record<string, unknown>).session_id as string | undefined;
if (legacySessionId) {
// Legacy team with session_id - redirect to session directory
const legacySessionDir = getSessionDir(meta.session_id, root);
const legacySessionDir = getSessionDir(legacySessionId, root);
if (existsSync(legacySessionDir)) {
serveArtifacts(legacySessionDir, meta.session_id, meta, artifactPath, res);
serveArtifacts(legacySessionDir, legacySessionId, meta, artifactPath, res);
return true;
}
}