Merge branch 'feature/29-cron-config' into develop

Implements cron job configuration for Mosaic Stack.

Features:
- CronSchedule model for scheduling recurring commands
- REST API endpoints for CRUD operations
- Scheduler worker that polls for due schedules
- WebSocket notifications when schedules execute
- MoltBot plugin skill definition

Issues:
- #29 Cron job configuration (p1 plugin)
- #115 Cron scheduler worker
- #116 Cron WebSocket notifications

Tests:
- 18 passing tests (cron.service + cron.scheduler)
This commit is contained in:
2026-01-29 23:09:20 -06:00
13 changed files with 908 additions and 1351 deletions

View File

@@ -191,9 +191,16 @@ export class WebSocketGateway implements OnGatewayConnection, OnGatewayDisconnec
}
/**
* @description Get workspace room name for Socket.IO room management.
* @param workspaceId - The workspace identifier.
* @returns The room name in format "workspace:{workspaceId}".
* Emit cron:executed event when a scheduled command fires
*/
emitCronExecuted(workspaceId: string, data: { scheduleId: string; command: string; executedAt: Date }): void {
const room = this.getWorkspaceRoom(workspaceId);
this.server.to(room).emit('cron:executed', data);
this.logger.debug(`Emitted cron:executed to ${room}`);
}
/**
* Get workspace room name
*/
private getWorkspaceRoom(workspaceId: string): string {
return `workspace:${workspaceId}`;