removed modes_map

This commit is contained in:
MaxRobinsonTheGreat 2024-11-18 23:29:49 -06:00
parent ca16dbc8f7
commit c3aa7ae190

View file

@ -268,6 +268,10 @@ async function execute(mode, agent, func, timeout=-1) {
}
let _agent = null;
const modes_map = {};
for (let mode of modes_list) {
modes_map[mode.name] = mode;
}
class ModeController {
/*
@ -277,31 +281,27 @@ class ModeController {
This can be used to expose sensitive information by malicious human prompters.
*/
constructor() {
this.modes_map = {};
this.behavior_log = '';
for (let mode of modes_list) {
this.modes_map[mode.name] = mode;
}
}
exists(mode_name) {
return this.modes_map[mode_name] != null;
return modes_map[mode_name] != null;
}
setOn(mode_name, on) {
this.modes_map[mode_name].on = on;
modes_map[mode_name].on = on;
}
isOn(mode_name) {
return this.modes_map[mode_name].on;
return modes_map[mode_name].on;
}
pause(mode_name) {
this.modes_map[mode_name].paused = true;
modes_map[mode_name].paused = true;
}
unpause(mode_name) {
this.modes_map[mode_name].paused = false;
modes_map[mode_name].paused = false;
}
unPauseAll() {