feat: retro Claude ekip konsolunu kur

This commit is contained in:
2026-03-16 23:38:15 +03:00
parent 9294028fb2
commit 68d5c2afea
32 changed files with 5207 additions and 0 deletions

40
server/logService.js Normal file
View File

@@ -0,0 +1,40 @@
export class LogService {
constructor(limit = 400, logger = console) {
this.limit = limit;
this.logger = logger;
this.entries = [];
}
createEntry(type, message, meta = {}) {
return {
id: `${Date.now()}_${Math.random().toString(36).slice(2, 8)}`,
type,
message,
meta,
ts: new Date().toISOString()
};
}
push(type, message, meta = {}) {
const entry = this.createEntry(type, message, meta);
this.entries.push(entry);
if (this.entries.length > this.limit) {
this.entries.splice(0, this.entries.length - this.limit);
}
if (this.logger && type !== "output") {
this.logger.info(`[${entry.type}] ${entry.message}`);
}
return entry;
}
snapshot() {
return [...this.entries];
}
clear() {
this.entries = [];
}
}