promp and clear command

This commit is contained in:
legop3
2026-05-19 23:19:49 -04:00
parent 1e5f282a6a
commit 2da58920c4
4 changed files with 66 additions and 9 deletions
+2 -1
View File
@@ -1,7 +1,7 @@
// Chat Service Orchestrator
// Purpose: Composes chat submodules into the public service API and boots socket/event wiring.
// Scope: Keeps external chat contracts stable while delegating logic to focused modules.
const { history } = require('./state');
const { history, clearHistory } = require('./state');
const { normalizeUserText } = require('./contentFilters');
const { buildMessage, buildTypingPayload } = require('./contextBuilders');
const { broadcastMessage, getRecentMessages } = require('./broadcast');
@@ -37,4 +37,5 @@ module.exports = {
buildTypingPayload,
sendSystemMessage,
getRecentMessages,
clearHistory,
};
+7
View File
@@ -40,6 +40,12 @@ function setLastAccessNoticeAt(ts) {
lastAccessNoticeAt = ts;
}
function clearHistory() {
history.length = 0;
lastMessageBySocket.clear();
typingBySocket.clear();
}
module.exports = {
rateBuckets,
history,
@@ -50,4 +56,5 @@ module.exports = {
getRecentMessages,
getLastAccessNoticeAt,
setLastAccessNoticeAt,
clearHistory,
};