Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion src/agent/library/full_state.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,24 @@ export function getFullState(agent) {
const leggings = bot.inventory.slots[7];
const boots = bot.inventory.slots[8];

// Richer activity than a bare "Idle": a bot counts as idle (no action executing) even while
// chatting, deciding its next move, or stopped. Surface those so the dashboard is meaningful.
let activity;
if (!agent.isIdle()) {
activity = { current: agent.actions.currentActionLabel || 'Acting', kind: 'acting' };
} else if (convoManager.inConversation()) {
const who = convoManager.activeConversation?.name;
activity = { current: who ? `Chatting with ${who}` : 'Chatting', kind: 'chatting' };
} else if (agent.self_prompter.isStopped()) {
activity = { current: 'Stopped', kind: 'stopped' }; // self-prompter OFF: won't act on its own
} else if (agent.self_prompter.isPaused()) {
activity = { current: 'Chatting', kind: 'chatting' };
} else if (agent.self_prompter.isActive()) {
activity = { current: 'Thinking', kind: 'thinking' }; // self-prompting between actions
} else {
activity = { current: 'Idle', kind: 'idle' };
}

const state = {
name: agent.name,
gameplay: {
Expand All @@ -54,7 +72,8 @@ export function getFullState(agent) {
timeLabel
},
action: {
current: agent.isIdle() ? 'Idle' : agent.actions.currentActionLabel,
current: activity.current,
kind: activity.kind,
isIdle: agent.isIdle()
},
surroundings: {
Expand Down
2 changes: 2 additions & 0 deletions src/mindcraft/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,8 @@ <h2 id="agentSettingsTitle" style="margin:0;">Agent Settings</h2>
}
if (actionEl && st.action) {
actionEl.textContent = `${st.action.current || 'Idle'}`;
const _statusColors = { acting: '#4CAF50', chatting: '#42a5f5', thinking: '#9e9e9e', stopped: '#f44336', idle: '#888' };
actionEl.style.color = _statusColors[st.action.kind] || '';
}
if (invGrid && st.inventory?.counts) {
const counts = st.inventory.counts;
Expand Down