mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-16 01:21:20 -04:00
remove goal
This commit is contained in:
@@ -43,5 +43,4 @@ Key legend:
|
|||||||
- CHAT keys: `n` nickname, `r` rover_id, `txt` chat text, `rn` rover_now.
|
- CHAT keys: `n` nickname, `r` rover_id, `txt` chat text, `rn` rover_now.
|
||||||
- `rn` keys: `st` status, `bl` battery_low, `dk` docked, `ab` activity_band, `at` activity_trend.
|
- `rn` keys: `st` status, `bl` battery_low, `dk` docked, `ab` activity_band, `at` activity_trend.
|
||||||
- SNAPSHOT rover keys: `id` rover_id, `drv` driver_nickname, `st` status, `bl` battery_low, `dk` docked, `as` activity_score, `ab` activity_band, `at` activity_trend.
|
- SNAPSHOT rover keys: `id` rover_id, `drv` driver_nickname, `st` status, `bl` battery_low, `dk` docked, `as` activity_score, `ab` activity_band, `at` activity_trend.
|
||||||
- `goal` in `SNAPSHOT FINAL` is community goal.
|
|
||||||
- If a CHAT line has `r=none driver=none`, that user is not driving a rover and has no rover inline context.
|
- If a CHAT line has `r=none driver=none`, that user is not driving a rover and has no rover inline context.
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ const roverManager = require('./roverManager');
|
|||||||
const { getActiveDrivers } = require('./turnService');
|
const { getActiveDrivers } = require('./turnService');
|
||||||
const { getNickname } = require('./nicknameService');
|
const { getNickname } = require('./nicknameService');
|
||||||
const { getRecentMessages, sendSystemMessage } = require('./chatService');
|
const { getRecentMessages, sendSystemMessage } = require('./chatService');
|
||||||
const { getCommunityGoal } = require('./communityGoalService');
|
|
||||||
|
|
||||||
const PROMPT_PATH = path.join(__dirname, '..', '..', 'prompts', 'commentary_system.txt');
|
const PROMPT_PATH = path.join(__dirname, '..', '..', 'prompts', 'commentary_system.txt');
|
||||||
const DEFAULT_FREQUENCY_MS = 0;
|
const DEFAULT_FREQUENCY_MS = 0;
|
||||||
@@ -27,7 +26,6 @@ const MAX_CONTEXT_EVENTS = 6;
|
|||||||
const MAX_RUN_HISTORY = 30;
|
const MAX_RUN_HISTORY = 30;
|
||||||
const MAX_ROVER_EVENTS = 400;
|
const MAX_ROVER_EVENTS = 400;
|
||||||
const POST_COOLDOWN_MS = 10000;
|
const POST_COOLDOWN_MS = 10000;
|
||||||
const MAX_GOAL_CONTEXT_CHARS = 220;
|
|
||||||
|
|
||||||
const config = loadConfig();
|
const config = loadConfig();
|
||||||
const commentaryConfig = config.llmCommentary || {};
|
const commentaryConfig = config.llmCommentary || {};
|
||||||
@@ -763,13 +761,8 @@ function buildSnapshot() {
|
|||||||
});
|
});
|
||||||
const hasRecentChat = eventStream.some((event) => event.type === 'chat');
|
const hasRecentChat = eventStream.some((event) => event.type === 'chat');
|
||||||
|
|
||||||
const goal = getCommunityGoal();
|
|
||||||
const goalTextRaw = goal?.text ? String(goal.text).trim() : '';
|
|
||||||
const goalText = goalTextRaw ? goalTextRaw.slice(0, MAX_GOAL_CONTEXT_CHARS) : null;
|
|
||||||
|
|
||||||
const currentSnapshot = {
|
const currentSnapshot = {
|
||||||
rovers,
|
rovers,
|
||||||
community_goal: goalText,
|
|
||||||
};
|
};
|
||||||
if (!hasRecentChat) {
|
if (!hasRecentChat) {
|
||||||
currentSnapshot.chat_recent = chatRecent;
|
currentSnapshot.chat_recent = chatRecent;
|
||||||
@@ -790,16 +783,12 @@ function buildSnapshot() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function refreshFinalSnapshotForSend(snapshot) {
|
function refreshFinalSnapshotForSend(snapshot) {
|
||||||
const goal = getCommunityGoal();
|
|
||||||
const goalTextRaw = goal?.text ? String(goal.text).trim() : '';
|
|
||||||
const goalText = goalTextRaw ? goalTextRaw.slice(0, MAX_GOAL_CONTEXT_CHARS) : null;
|
|
||||||
const { rovers } = buildRoversNow(Date.now());
|
const { rovers } = buildRoversNow(Date.now());
|
||||||
return {
|
return {
|
||||||
...(snapshot || {}),
|
...(snapshot || {}),
|
||||||
current_snapshot: {
|
current_snapshot: {
|
||||||
...(snapshot?.current_snapshot || {}),
|
...(snapshot?.current_snapshot || {}),
|
||||||
rovers,
|
rovers,
|
||||||
community_goal: goalText,
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -918,10 +907,6 @@ function formatSnapshotMessage(event) {
|
|||||||
function formatSnapshotFinalMessage(currentSnapshot = {}) {
|
function formatSnapshotFinalMessage(currentSnapshot = {}) {
|
||||||
const rovers = Array.isArray(currentSnapshot?.rovers) ? currentSnapshot.rovers : [];
|
const rovers = Array.isArray(currentSnapshot?.rovers) ? currentSnapshot.rovers : [];
|
||||||
const lines = ['SNAPSHOT FINAL'];
|
const lines = ['SNAPSHOT FINAL'];
|
||||||
const goalText = currentSnapshot?.community_goal
|
|
||||||
? String(currentSnapshot.community_goal).trim()
|
|
||||||
: '';
|
|
||||||
lines.push(`goal: ${goalText || 'none'}`);
|
|
||||||
rovers.forEach((rover) => {
|
rovers.forEach((rover) => {
|
||||||
lines.push(formatRoverSnapshotLine(rover));
|
lines.push(formatRoverSnapshotLine(rover));
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user