mirror of
https://github.com/kolbytn/mindcraft.git
synced 2025-09-05 13:53:12 +02:00
Update modes.js
This commit is contained in:
parent
6d350f1c1d
commit
e1a47ce7c9
1 changed files with 4 additions and 4 deletions
|
@ -277,7 +277,7 @@ const modes_list = [
|
||||||
];
|
];
|
||||||
|
|
||||||
async function execute(mode, agent, func, timeout=-1) {
|
async function execute(mode, agent, func, timeout=-1) {
|
||||||
if (agent.self_prompter.on)
|
if (agent.self_prompter.isActive())
|
||||||
agent.self_prompter.stopLoop();
|
agent.self_prompter.stopLoop();
|
||||||
let interrupted_action = agent.actions.currentActionLabel;
|
let interrupted_action = agent.actions.currentActionLabel;
|
||||||
mode.active = true;
|
mode.active = true;
|
||||||
|
@ -290,7 +290,7 @@ async function execute(mode, agent, func, timeout=-1) {
|
||||||
let should_reprompt =
|
let should_reprompt =
|
||||||
interrupted_action && // it interrupted a previous action
|
interrupted_action && // it interrupted a previous action
|
||||||
!agent.actions.resume_func && // there is no resume function
|
!agent.actions.resume_func && // there is no resume function
|
||||||
!agent.self_prompter.on && // self prompting is not on
|
!agent.self_prompter.isActive() && // self prompting is not on
|
||||||
!code_return.interrupted; // this mode action was not interrupted by something else
|
!code_return.interrupted; // this mode action was not interrupted by something else
|
||||||
|
|
||||||
if (should_reprompt) {
|
if (should_reprompt) {
|
||||||
|
@ -311,9 +311,9 @@ for (let mode of modes_list) {
|
||||||
class ModeController {
|
class ModeController {
|
||||||
/*
|
/*
|
||||||
SECURITY WARNING:
|
SECURITY WARNING:
|
||||||
ModesController must be isolated. Do not store references to external objects like `agent`.
|
ModesController must be reference isolated. Do not store references to external objects like `agent`.
|
||||||
This object is accessible by LLM generated code, so any stored references are also accessible.
|
This object is accessible by LLM generated code, so any stored references are also accessible.
|
||||||
This can be used to expose sensitive information by malicious human prompters.
|
This can be used to expose sensitive information by malicious prompters.
|
||||||
*/
|
*/
|
||||||
constructor() {
|
constructor() {
|
||||||
this.behavior_log = '';
|
this.behavior_log = '';
|
||||||
|
|
Loading…
Add table
Reference in a new issue