diff --git a/public/scripts/extensions/objective/index.js b/public/scripts/extensions/objective/index.js
index 3485da1ec..781fdb98c 100644
--- a/public/scripts/extensions/objective/index.js
+++ b/public/scripts/extensions/objective/index.js
@@ -1,4 +1,4 @@
-import { chat_metadata } from "../../../script.js";
+import { chat_metadata, callPopup, saveSettingsDebounced } from "../../../script.js";
import { getContext, extension_settings, saveMetadataDebounced } from "../../extensions.js";
import {
substituteParams,
@@ -18,30 +18,30 @@ let currentTask = null
let checkCounter = 0
-const objectivePrompts = {
+const defaultPrompts = {
"createTask": `Pause your roleplay and generate a list of tasks to complete an objective. Your next response must be formatted as a numbered list of plain text entries. Do not include anything but the numbered list. The list must be prioritized in the order that tasks must be completed.
- The objective that you must make a numbered task list for is: [{{objective}}].
- The tasks created should take into account the character traits of {{char}}. These tasks may or may not involve {{user}} directly. Be sure to include the objective as the final task.
+The objective that you must make a numbered task list for is: [{{objective}}].
+The tasks created should take into account the character traits of {{char}}. These tasks may or may not involve {{user}} directly. Be sure to include the objective as the final task.
- Given an example objective of 'Make me a four course dinner', here is an example output:
- 1. Determine what the courses will be
- 2. Find recipes for each course
- 3. Go shopping for supplies with {{user}}
- 4. Cook the food
- 5. Get {{user}} to set the table
- 6. Serve the food
- 7. Enjoy eating the meal with {{user}}
+Given an example objective of 'Make me a four course dinner', here is an example output:
+1. Determine what the courses will be
+2. Find recipes for each course
+3. Go shopping for supplies with {{user}}
+4. Cook the food
+5. Get {{user}} to set the table
+6. Serve the food
+7. Enjoy eating the meal with {{user}}
`,
"checkTaskCompleted": `Pause your roleplay. Determine if this task is completed: [{{task}}].
- To do this, examine the most recent messages. Your response must only contain either true or false, nothing other words.
- Example output:
- true
- `
+To do this, examine the most recent messages. Your response must only contain either true or false, nothing other words.
+Example output:
+true
+ `,
+ 'currentTask':`Your current task is [{{task}}]. Balance existing roleplay with completing this task.`
}
-const extensionPrompt = "Your current task is [{{task}}]. Balance existing roleplay with completing this task."
-
+let objectivePrompts = defaultPrompts
//###############################//
//# Task Management #//
@@ -80,7 +80,7 @@ function deleteTask(taskId){
// Call Quiet Generate to create task list using character context, then convert to tasks. Should not be called much.
async function generateTasks() {
- const prompt = substituteParams(objectivePrompts["createTask"].replace(/{{objective}}/gi, globalObjective));
+ const prompt = substituteParams(objectivePrompts.createTask.replace(/{{objective}}/gi, globalObjective));
console.log(`Generating tasks for objective with prompt`)
toastr.info('Generating tasks for objective', 'Please wait...');
const taskResponse = await generateQuietPrompt(prompt)
@@ -108,7 +108,7 @@ async function checkTaskCompleted() {
}
checkCounter = $('#objective-check-frequency').val()
- const prompt = substituteParams(objectivePrompts["checkTaskCompleted"].replace(/{{task}}/gi, currentTask.description));
+ const prompt = substituteParams(objectivePrompts.checkTaskCompleted.replace(/{{task}}/gi, currentTask.description));
const taskResponse = (await generateQuietPrompt(prompt)).toLowerCase()
// Check response if task complete
@@ -142,7 +142,9 @@ function setCurrentTask(taskId = null) {
// Now update the extension prompt
if (description) {
- const extensionPromptText = extensionPrompt.replace(/{{task}}/gi, description);
+ const extensionPromptText = objectivePrompts.currentTask.replace(/{{task}}/gi, description);
+ $('.objective-task').css({'border-color':'','border-width':''}) // Clear highlights
+ currentTask.descriptionSpan.css({'border-color':'yellow','border-width':'2px'}); // Highlight current task
context.setExtensionPrompt(MODULE_NAME, extensionPromptText, 1, $('#objective-chat-depth').val());
console.info(`Current task in context.extensionPrompts.Objective is ${JSON.stringify(context.extensionPrompts.Objective)}`);
} else {
@@ -206,7 +208,7 @@ class ObjectiveTask {
const template = `