Skip to content

Agent Zero AI framework

memory dashboard editing

frdel062aff7b556e
diff --git a/python/api/memory_dashboard.py b/python/api/memory_dashboard.py
index 3ade90d82..71d29f89d 100644
--- a/python/api/memory_dashboard.py
+++ b/python/api/memory_dashboard.py
@@ -2,6 +2,7 @@ from python.helpers.api import ApiHandler, Request, Response
from python.helpers.memory import Memory
from python.helpers import files
from models import ModelConfig, ModelType
+from langchain_core.documents import Document
class MemoryDashboard(ApiHandler):
@@ -12,13 +13,15 @@ class MemoryDashboard(ApiHandler):
if action == "get_memory_subdirs":
return await self._get_memory_subdirs()
elif action == "get_current_memory_subdir":
- return await self._get_current_memory_subdir(request)
+ return await self._get_current_memory_subdir(input)
elif action == "search":
return await self._search_memories(input)
elif action == "delete":
return await self._delete_memory(input)
elif action == "bulk_delete":
return await self._bulk_delete_memories(input)
+ elif action == "update":
+ return await self._update_memory(input)
else:
return {
"success": False,
@@ -101,11 +104,11 @@ class MemoryDashboard(ApiHandler):
"error": f"Failed to bulk delete memories: {str(e)}",
}
- async def _get_current_memory_subdir(self, request: Request) -> dict:
+ async def _get_current_memory_subdir(self, input: dict) -> dict:
"""Get the current memory subdirectory from the active context."""
try:
# Try to get the context from the request
- context_id = getattr(request, "context_id", None)
+ context_id = input.get("context_id", None)
if not context_id:
# Fallback to default if no context available
return {"success": True, "memory_subdir": "default"}
@@ -192,27 +195,7 @@ class MemoryDashboard(ApiHandler):
memories = memories[:limit]
# Format memories for the dashboard
- formatted_memories: list[dict] = []
- for m in memories:
- metadata = m.metadata
-
- # Extract key information
- memory_data = {
- "id": metadata.get("id", "unknown"),
- "area": metadata.get("area", "unknown"),
- "timestamp": metadata.get("timestamp", "unknown"),
- "content_preview": m.page_content[:200]
- + ("..." if len(m.page_content) > 200 else ""),
- "content_full": m.page_content,
- "knowledge_source": metadata.get("knowledge_source", False),
- "source_file": metadata.get("source_file", ""),
- "file_type": metadata.get("file_type", ""),
- "consolidation_action": metadata.get("consolidation_action", ""),
- "tags": metadata.get("tags", []),
- "metadata": metadata, # Include full metadata for advanced users
- }
-
- formatted_memories.append(memory_data)
+ formatted_memories = [self._format_memory_for_dashboard(m) for m in memories]
# Get summary statistics
total_memories = len(formatted_memories)
@@ -238,3 +221,44 @@ class MemoryDashboard(ApiHandler):
except Exception as e:
return {"success": False, "error": str(e), "memories": [], "total_count": 0}
+
+ def _format_memory_for_dashboard(self, m: Document) -> dict:
+ """Format a memory document for the dashboard."""
+ metadata = m.metadata
+ return {
+ "id": metadata.get("id", "unknown"),
+ "area": metadata.get("area", "unknown"),
+ "timestamp": metadata.get("timestamp", "unknown"),
+ "content_preview": m.page_content[:200]
+ + ("..." if len(m.page_content) > 200 else ""),
+ "content_full": m.page_content,
+ "knowledge_source": metadata.get("knowledge_source", False),
+ "source_file": metadata.get("source_file", ""),
+ "file_type": metadata.get("file_type", ""),
+ "consolidation_action": metadata.get("consolidation_action", ""),
+ "tags": metadata.get("tags", []),
+ "metadata": metadata, # Include full metadata for advanced users
+ }
+
+ async def _update_memory(self, input: dict) -> dict:
+ try:
+ memory_subdir = input.get("memory_subdir")
+ original = input.get("original")
+ edited = input.get("edited")
+
+ if not memory_subdir or not original or not edited:
+ return {"success": False, "error": "Missing required parameters"}
+
+ doc = Document(
+ page_content=edited["content_full"],
+ metadata=edited["metadata"],
+ )
+
+ memory = await Memory.get_by_subdir(memory_subdir, preload_knowledge=False)
+ id = (await memory.update_documents([doc]))[0]
+ doc = memory.get_document_by_id(id)
+ formatted_doc = self._format_memory_for_dashboard(doc) if doc else None
+
+ return {"success": formatted_doc is not None, "memory": formatted_doc}
+ except Exception as e:
+ return {"success": False, "error": str(e), "memory": None}
diff --git a/python/helpers/memory.py b/python/helpers/memory.py
index d3f9282dd..9e7fb5eb4 100644
--- a/python/helpers/memory.py
+++ b/python/helpers/memory.py
@@ -89,9 +89,14 @@ class Memory:
)
@staticmethod
- async def get_by_subdir(memory_subdir: str, log_item: LogItem | None = None, preload_knowledge: bool = True):
+ async def get_by_subdir(
+ memory_subdir: str,
+ log_item: LogItem | None = None,
+ preload_knowledge: bool = True,
+ ):
if not Memory.index.get(memory_subdir):
import initialize
+
agent_config = initialize.initialize_agent()
model_config = agent_config.embeddings_model
db, _created = Memory.initialize(
@@ -312,6 +317,9 @@ class Memory:
return index
+ def get_document_by_id(self, id: str) -> Document | None:
+ return self.db.get_by_ids(id)[0]
+
async def search_similarity_threshold(
self, query: str, limit: int, threshold: float, filter: str = ""
):
@@ -392,15 +400,21 @@ class Memory:
self._save_db() # persist
return ids
+ async def update_documents(self, docs: list[Document]):
+ ids = [doc.metadata["id"] for doc in docs]
+ await self.db.adelete(ids=ids) # delete originals
+ ins = await self.db.aadd_documents(documents=docs, ids=ids) # add updated
+ self._save_db() # persist
+ return ins
+
def _save_db(self):
Memory._save_db_file(self.db, self.memory_subdir)
def _generate_doc_id(self):
while True:
- doc_id = guids.generate_id(10) # random ID
- if not self.db.get_by_ids(doc_id): # check if exists
+ doc_id = guids.generate_id(10) # random ID
+ if not self.db.get_by_ids(doc_id): # check if exists
return doc_id
-
@staticmethod
def _save_db_file(db: MyFaiss, memory_subdir: str):
diff --git a/webui/components/settings/memory/memory-dashboard-store.js b/webui/components/settings/memory/memory-dashboard-store.js
index 4217601ad..f72bbe914 100644
--- a/webui/components/settings/memory/memory-dashboard-store.js
+++ b/webui/components/settings/memory/memory-dashboard-store.js
@@ -26,13 +26,15 @@ const memoryDashboardStore = {
// Memory subdirectories
memorySubdirs: [],
selectedMemorySubdir: "default",
- memoryInitialized: {}, // Track which subdirs have been initialized
+ memoryInitialized: {}, // Track which subdirs have been initialized
// Search and filters
searchQuery: "",
areaFilter: "",
- threshold: parseFloat(localStorage.getItem('memoryDashboard_threshold') || '0.6'),
- limit: parseInt(localStorage.getItem('memoryDashboard_limit') || '1000'),
+ threshold: parseFloat(
+ localStorage.getItem("memoryDashboard_threshold") || "0.6"
+ ),
+ limit: parseInt(localStorage.getItem("memoryDashboard_limit") || "1000"),
// Stats
totalCount: 0,
@@ -43,40 +45,55 @@ const memoryDashboardStore = {
// Memory detail modal (standard modal approach)
detailMemory: null,
+ editMode: false,
+ editMemoryBackup: null,
// Polling
pollingInterval: null,
pollingEnabled: false,
- init(){
+ async openModal() {
+ await openModal("settings/memory/memory-dashboard.html");
+ },
+
+ init() {
this.initialize();
},
+ async onOpen() {
+ await this.getCurrentMemorySubdir();
+ await this.loadMemorySubdirs();
+ await this.searchMemories();
+ // Start polling for live updates as soon as dashboard is open
+ this.startPolling();
+ },
+
async initialize() {
// Reset state when opening (but keep directory from context)
this.currentPage = 1;
this.searchQuery = "";
this.areaFilter = "";
- // Get current memory subdirectory from application context
- await this.getCurrentMemorySubdir();
+ // // Get current memory subdirectory from application context
+ // await this.getCurrentMemorySubdir();
- await this.loadMemorySubdirs();
+ // await this.loadMemorySubdirs();
- // Automatically search with selected subdirectory
- if (this.selectedMemorySubdir) {
- await this.searchMemories();
- }
+ // // Automatically search with selected subdirectory
+ // if (this.selectedMemorySubdir) {
+ // await this.searchMemories();
+ // }
- // Start polling for live updates as soon as dashboard is open
- this.startPolling();
+ // // Start polling for live updates as soon as dashboard is open
+ // this.startPolling();
},
async getCurrentMemorySubdir() {
try {
// Try to get current memory subdirectory from the backend
const response = await API.callJsonApi("memory_dashboard", {
- action: "get_current_memory_subdir"
+ action: "get_current_memory_subdir",
+ context_id: getContext(),
});
if (response.success && response.memory_subdir) {
@@ -97,14 +114,14 @@ const memoryDashboardStore = {
try {
const response = await API.callJsonApi("memory_dashboard", {
- action: "get_memory_subdirs"
+ action: "get_memory_subdirs",
});
- if (response.success) {
+ if (response.success) {
let subdirs = response.subdirs || ["default"];
// Sort alphabetically but ensure "default" is always first
- subdirs = subdirs.filter(dir => dir !== "default").sort();
+ subdirs = subdirs.filter((dir) => dir !== "default").sort();
if (response.subdirs && response.subdirs.includes("default")) {
subdirs.unshift("default");
} else {
@@ -137,8 +154,11 @@ const memoryDashboardStore = {
async searchMemories(silent = false) {
// Save limit to localStorage for persistence
- localStorage.setItem('memoryDashboard_limit', this.limit.toString());
- localStorage.setItem('memoryDashboard_threshold', this.threshold.toString());
+ localStorage.setItem("memoryDashboard_limit", this.limit.toString());
+ localStorage.setItem(
+ "memoryDashboard_threshold",
+ this.threshold.toString()
+ );
if (!silent) {
this.loading = true;
@@ -158,15 +178,15 @@ const memoryDashboardStore = {
area: this.areaFilter,
search: this.searchQuery,
limit: this.limit,
- threshold: this.threshold
+ threshold: this.threshold,
});
- if (response.success) {
+ if (response.success) {
// Preserve existing selections when updating memories during polling
const existingSelections = {};
if (silent && this.memories) {
// Build a map of existing selections by memory ID
- this.memories.forEach(memory => {
+ this.memories.forEach((memory) => {
if (memory.selected) {
existingSelections[memory.id] = true;
}
@@ -174,9 +194,9 @@ const memoryDashboardStore = {
}
// Add selected property to each memory item for mass selection
- this.memories = (response.memories || []).map(memory => ({
+ this.memories = (response.memories || []).map((memory) => ({
...memory,
- selected: existingSelections[memory.id] || false
+ selected: existingSelections[memory.id] || false,
}));
this.totalCount = response.total_count || 0;
this.totalDbCount = response.total_db_count || 0;
@@ -268,7 +288,7 @@ const memoryDashboardStore = {
// Mass selection
get selectedMemories() {
- return this.memories.filter(memory => memory.selected);
+ return this.memories.filter((memory) => memory.selected);
},
get selectedCount() {
@@ -276,24 +296,25 @@ const memoryDashboardStore = {
},
get allSelected() {
- return this.memories.length > 0 && this.memories.every(memory => memory.selected);
+ return (
+ this.memories.length > 0 &&
+ this.memories.every((memory) => memory.selected)
+ );
},
get someSelected() {
- return this.memories.some(memory => memory.selected);
+ return this.memories.some((memory) => memory.selected);
},
toggleSelectAll() {
const shouldSelectAll = !this.allSelected;
- this.memories.forEach(memory => {
+ this.memories.forEach((memory) => {
memory.selected = shouldSelectAll;
});
},
-
-
clearSelection() {
- this.memories.forEach(memory => {
+ this.memories.forEach((memory) => {
memory.selected = false;
});
},
@@ -311,17 +332,23 @@ const memoryDashboardStore = {
const response = await API.callJsonApi("memory_dashboard", {
action: "bulk_delete",
memory_subdir: this.selectedMemorySubdir,
- memory_ids: selectedMemories.map(memory => memory.id)
+ memory_ids: selectedMemories.map((memory) => memory.id),
});
if (response.success) {
- justToast(`Successfully deleted ${selectedMemories.length} memories`, "success");
+ justToast(
+ `Successfully deleted ${selectedMemories.length} memories`,
+ "success"
+ );
// Let polling refresh the data instead of manual manipulation
// Trigger an immediate refresh to get updated state from backend
await this.searchMemories(true); // silent refresh
} else {
- justToast(response.error || "Failed to delete selected memories", "error");
+ justToast(
+ response.error || "Failed to delete selected memories",
+ "error"
+ );
}
} catch (error) {
justToast(error.message || "Failed to delete selected memories", "error");
@@ -335,15 +362,22 @@ const memoryDashboardStore = {
let formatted = `=== Memory ID: ${memory.id} ===
Area: ${memory.area}
Timestamp: ${this.formatTimestamp(memory.timestamp)}
-Source: ${memory.knowledge_source ? 'Knowledge' : 'Conversation'}
-${memory.source_file ? `File: ${memory.source_file}` : ''}
-${memory.tags && memory.tags.length > 0 ? `Tags: ${memory.tags.join(', ')}` : ''}`;
+Source: ${memory.knowledge_source ? "Knowledge" : "Conversation"}
+${memory.source_file ? `File: ${memory.source_file}` : ""}
+${
+ memory.tags && memory.tags.length > 0 ? `Tags: ${memory.tags.join(", ")}` : ""
+}`;
// Add custom metadata if present
- if (memory.metadata && typeof memory.metadata === 'object' && Object.keys(memory.metadata).length > 0) {
- formatted += '\n\nMetadata:';
+ if (
+ memory.metadata &&
+ typeof memory.metadata === "object" &&
+ Object.keys(memory.metadata).length > 0
+ ) {
+ formatted += "\n\nMetadata:";
for (const [key, value] of Object.entries(memory.metadata)) {
- const displayValue = typeof value === 'object' ? JSON.stringify(value, null, 2) : value;
+ const displayValue =
+ typeof value === "object" ? JSON.stringify(value, null, 2) : value;
formatted += `\n${key}: ${displayValue}`;
}
}
@@ -359,10 +393,15 @@ ${memory.content_full}
const selectedMemories = this.selectedMemories;
if (selectedMemories.length === 0) return;
- const content = selectedMemories.map(memory => this.formatMemoryForCopy(memory)).join('\n');
+ const content = selectedMemories
+ .map((memory) => this.formatMemoryForCopy(memory))
+ .join("\n");
this.copyToClipboard(content);
- justToast(`Copied ${selectedMemories.length} memories with metadata to clipboard`, "success");
+ justToast(
+ `Copied ${selectedMemories.length} memories with metadata to clipboard`,
+ "success"
+ );
},
bulkExportMemories() {
@@ -373,7 +412,7 @@ ${memory.content_full}
export_timestamp: new Date().toISOString(),
memory_subdir: this.selectedMemorySubdir,
total_memories: selectedMemories.length,
- memories: selectedMemories.map(memory => ({
+ memories: selectedMemories.map((memory) => ({
id: memory.id,
area: memory.area,
timestamp: memory.timestamp,
@@ -381,18 +420,18 @@ ${memory.content_full}
tags: memory.tags || [],
knowledge_source: memory.knowledge_source,
source_file: memory.source_file || null,
- metadata: memory.metadata || {}
- }))
+ metadata: memory.metadata || {},
+ })),
};
const jsonString = JSON.stringify(exportData, null, 2);
- const blob = new Blob([jsonString], { type: 'application/json' });
+ const blob = new Blob([jsonString], { type: "application/json" });
const url = URL.createObjectURL(blob);
- const timestamp = new Date().toISOString().split('T')[0];
+ const timestamp = new Date().toISOString().split("T")[0];
const filename = `memories_${this.selectedMemorySubdir}_selected_${selectedMemories.length}_${timestamp}.json`;
- const a = document.createElement('a');
+ const a = document.createElement("a");
a.href = url;
a.download = filename;
document.body.appendChild(a);
@@ -400,12 +439,17 @@ ${memory.content_full}
document.body.removeChild(a);
URL.revokeObjectURL(url);
- justToast(`Exported ${selectedMemories.length} selected memories to ${filename}`, "success");
+ justToast(
+ `Exported ${selectedMemories.length} selected memories to ${filename}`,
+ "success"
+ );
},
// Memory detail modal (standard approach)
showMemoryDetails(memory) {
this.detailMemory = memory;
+ this.editMode = false;
+ this.editMemoryBackup = null;
// Use global modal system
openModal("settings/memory/memory-detail-modal.html");
},
@@ -427,25 +471,33 @@ ${memory.content_full}
if (compact) {
// For table display: MM/DD HH:mm
- return date.toLocaleDateString("en-US", {
- month: "2-digit",
- day: "2-digit",
- }) + " " + date.toLocaleTimeString("en-US", {
- hour12: false,
- hour: "2-digit",
- minute: "2-digit"
- });
+ return (
+ date.toLocaleDateString("en-US", {
+ month: "2-digit",
+ day: "2-digit",
+ }) +
+ " " +
+ date.toLocaleTimeString("en-US", {
+ hour12: false,
+ hour: "2-digit",
+ minute: "2-digit",
+ })
+ );
} else {
// For details: Full format
- return date.toLocaleDateString("en-US", {
- year: "numeric",
- month: "long",
- day: "numeric",
- }) + " at " + date.toLocaleTimeString("en-US", {
- hour12: true,
- hour: "numeric",
- minute: "2-digit"
- });
+ return (
+ date.toLocaleDateString("en-US", {
+ year: "numeric",
+ month: "long",
+ day: "numeric",
+ }) +
+ " at " +
+ date.toLocaleTimeString("en-US", {
+ hour12: true,
+ hour: "numeric",
+ minute: "2-digit",
+ })
+ );
}
},
@@ -456,22 +508,25 @@ ${memory.content_full}
getAreaColor(area) {
const colors = {
- "main": "#3b82f6",
- "fragments": "#10b981",
- "solutions": "#8b5cf6",
- "instruments": "#f59e0b"
+ main: "#3b82f6",
+ fragments: "#10b981",
+ solutions: "#8b5cf6",
+ instruments: "#f59e0b",
};
return colors[area] || "#6c757d";
},
copyToClipboard(text) {
if (navigator.clipboard && window.isSecureContext) {
- navigator.clipboard.writeText(text).then(() => {
- justToast("Copied to clipboard!", "success");
- }).catch(err => {
- console.error("Clipboard copy failed:", err);
- this.fallbackCopyToClipboard(text);
- });
+ navigator.clipboard
+ .writeText(text)
+ .then(() => {
+ justToast("Copied to clipboard!", "success");
+ })
+ .catch((err) => {
+ console.error("Clipboard copy failed:", err);
+ this.fallbackCopyToClipboard(text);
+ });
} else {
this.fallbackCopyToClipboard(text);
}
@@ -487,7 +542,7 @@ ${memory.content_full}
textArea.focus();
textArea.select();
try {
- document.execCommand('copy');
+ document.execCommand("copy");
justToast("Copied to clipboard!", "success");
} catch (err) {
console.error("Fallback clipboard copy failed:", err);
@@ -496,19 +551,24 @@ ${memory.content_full}
document.body.removeChild(textArea);
},
- async deleteMemory(memory) {
- if (!confirm(`Are you sure you want to delete this memory from ${memory.area}?`)) {
+ async deleteMemory(memory) {
+ if (
+ !confirm(
+ `Are you sure you want to delete this memory from ${memory.area}?`
+ )
+ ) {
return;
}
try {
// Check if this is the memory currently being viewed in detail modal
- const isViewingThisMemory = this.detailMemory && this.detailMemory.id === memory.id;
+ const isViewingThisMemory =
+ this.detailMemory && this.detailMemory.id === memory.id;
const response = await API.callJsonApi("memory_dashboard", {
action: "delete",
memory_subdir: this.selectedMemorySubdir,
- memory_id: memory.id
+ memory_id: memory.id,
});
if (response.success) {
@@ -545,22 +605,24 @@ ${memory.content_full}
total_memories: this.memories.length,
search_query: this.searchQuery,
area_filter: this.areaFilter,
- memories: this.memories.map(memory => ({
+ memories: this.memories.map((memory) => ({
id: memory.id,
area: memory.area,
timestamp: memory.timestamp,
content: memory.content_full,
- metadata: memory.metadata
- }))
+ metadata: memory.metadata,
+ })),
};
const blob = new Blob([JSON.stringify(exportData, null, 2)], {
- type: 'application/json'
+ type: "application/json",
});
const url = URL.createObjectURL(blob);
- const a = document.createElement('a');
+ const a = document.createElement("a");
a.href = url;
- a.download = `memory-export-${this.selectedMemorySubdir}-${new Date().toISOString().split('T')[0]}.json`;
+ a.download = `memory-export-${this.selectedMemorySubdir}-${
+ new Date().toISOString().split("T")[0]
+ }.json`;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
@@ -573,7 +635,7 @@ ${memory.content_full}
}
},
- startPolling() {
+ startPolling() {
if (!this.pollingEnabled || this.pollingInterval) {
return; // Already polling or disabled
}
@@ -605,9 +667,43 @@ ${memory.content_full}
this.areasCount = {};
this.message = null;
this.currentPage = 1;
+ this.editMemoryBackup;
+ },
+
+ enableEditMode() {
+ this.editMode = true;
+ this.editMemoryBackup = JSON.stringify(this.detailMemory); // store backup
},
+ cancelEditMode() {
+ this.editMode = false;
+ this.detailMemory = JSON.parse(this.editMemoryBackup); // restore backup
+ },
+
+ async confirmEditMode() {
+ try {
+
+ const response = await API.callJsonApi("memory_dashboard", {
+ action: "update",
+ memory_subdir: this.selectedMemorySubdir,
+ original: JSON.parse(this.editMemoryBackup),
+ edited: this.detailMemory,
+ });
+ if(response.success){
+ justToast("Memory updated successfully", "success");
+ await this.searchMemories(true); // silent refresh
+ }else{
+ justToast(`Failed to update memory: ${response.error}`, "error");
+ }
+
+ this.editMode = false;
+ this.editMemoryBackup = null; // discard backup
+ } catch (error) {
+ console.error("Error confirming edit mode:", error);
+ justToast("Failed to save memory changes.", "error");
+ }
+ },
};
const store = createStore("memoryDashboardStore", memoryDashboardStore);
diff --git a/webui/components/settings/memory/memory-dashboard.html b/webui/components/settings/memory/memory-dashboard.html
index f1345bf6d..5b857de80 100644
--- a/webui/components/settings/memory/memory-dashboard.html
+++ b/webui/components/settings/memory/memory-dashboard.html
@@ -10,7 +10,7 @@
<body>
<div x-data>
<template x-if="$store.memoryDashboardStore">
- <div x-create="$store.memoryDashboardStore.searchMemories()"
+ <div x-create="$store.memoryDashboardStore.onOpen()"
x-destroy="$store.memoryDashboardStore.cleanup()" class="memory-dashboard">
<!-- Search and Filters -->
diff --git a/webui/components/settings/memory/memory-detail-modal.html b/webui/components/settings/memory/memory-detail-modal.html
index 6857ea2b2..53da29fcd 100644
--- a/webui/components/settings/memory/memory-detail-modal.html
+++ b/webui/components/settings/memory/memory-detail-modal.html
@@ -265,13 +265,43 @@
</div>
</div>
<div class="header-actions">
- <button class="btn-action-header copy" @click="$store.memoryDashboardStore.copyToClipboard($store.memoryDashboardStore.formatMemoryForCopy($store.memoryDashboardStore.detailMemory))"
- title="Copy Complete Memory with Metadata">
- <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
- <rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
- <path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path>
- </svg>
- </button>
+ <!-- View Mode Buttons -->
+ <template x-if="!$store.memoryDashboardStore.editMode">
+ <div style="display: flex; gap: 0.5rem;">
+
+ <button class="btn-action-header copy-all" @click="$store.memoryDashboardStore.copyToClipboard($store.memoryDashboardStore.formatMemoryForCopy($store.memoryDashboardStore.detailMemory))"
+ title="Copy Complete Memory with Metadata">
+ <span class="material-symbols-outlined">copy_all</span> All
+ </button>
+ <button class="btn-action-header copy-content" @click="$store.memoryDashboardStore.copyToClipboard($store.memoryDashboardStore.detailMemory?.content_full)"
+ title="Copy Content Only">
+ <span class="material-symbols-outlined">content_copy</span> Content
+ </button>
+ <div style="width:2em"></div>
+ <button class="btn-action-header edit" @click="$store.memoryDashboardStore.enableEditMode()"
+ title="Edit Memory">
+ <span class="material-symbols-outlined">edit_document</span>
+ </button>
+ <button class="btn-action-header delete danger" @click="$store.memoryDashboardStore.deleteMemory($store.memoryDashboardStore.detailMemory)"
+ title="Delete Memory">
+ <span class="material-symbols-outlined">delete</span>
+ </button>
+ </div>
+ </template>
+ <!-- Edit Mode Buttons -->
+ <template x-if="$store.memoryDashboardStore.editMode">
+ <div style="display: flex; gap: 0.5rem;">
+ <button class="btn-action-header cancel" @click="$store.memoryDashboardStore.cancelEditMode()"
+ title="Cancel Edit">
+ <span class="material-symbols-outlined">close</span>
+ </button>
+ <button class="btn-action-header confirm" @click="$store.memoryDashboardStore.confirmEditMode()"
+ title="Confirm Changes">
+ <span class="material-symbols-outlined">check</span>
+ </button>
+
+ </div>
+ </template>
</div>
</div>
@@ -281,7 +311,12 @@
<div class="content-section-main">
<div class="content-block">
<h4>Memory Content</h4>
- <div class="memory-content-display" x-text="$store.memoryDashboardStore.detailMemory?.content_full"></div>
+ <template x-if="!$store.memoryDashboardStore.editMode">
+ <div class="memory-content-display" x-text="$store.memoryDashboardStore.detailMemory?.content_full"></div>
+ </template>
+ <template x-if="$store.memoryDashboardStore.editMode">
+ <textarea class="memory-content-display" style="width: 100%; height: 300px;" x-model="$store.memoryDashboardStore.detailMemory.content_full"></textarea>
+ </template>
</div>
<!-- Tags Section -->
@@ -343,38 +378,6 @@
</template>
</div>
- <!-- Actions -->
- <div class="metadata-group">
- <h5>Actions</h5>
- <div class="metadata-actions">
- <button class="btn slim" @click="$store.memoryDashboardStore.copyToClipboard($store.memoryDashboardStore.formatMemoryForCopy($store.memoryDashboardStore.detailMemory))"
- title="Copy Complete Memory with Metadata">
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
- <rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
- <path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path>
- </svg>
- Copy All
- </button>
- <button class="btn slim" @click="$store.memoryDashboardStore.copyToClipboard($store.memoryDashboardStore.detailMemory?.content_full)"
- title="Copy Content Only">
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
- <path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path>
- <polyline points="14,2 14,8 20,8"></polyline>
- </svg>
- Copy Content
- </button>
- <button class="btn slim danger" @click="$store.memoryDashboardStore.deleteMemory($store.memoryDashboardStore.detailMemory)"
- title="Delete Memory">
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
- <polyline points="3,6 5,6 21,6"></polyline>
- <path d="M19,6V20a2,2,0,0,1-2,2H7a2,2,0,0,1-2-2V6m3,0V4a2,2,0,0,1,2-2h4a2,2,0,0,1,2,2V6"></path>
- <line x1="10" y1="11" x2="10" y2="17"></line>
- <line x1="14" y1="11" x2="14" y2="17"></line>
- </svg>
- Delete
- </button>
- </div>
- </div>
</div>
</div>
</div>
diff --git a/webui/index.html b/webui/index.html
index 0345115f6..1eaea2471 100644
--- a/webui/index.html
+++ b/webui/index.html
@@ -32,7 +32,7 @@
<!-- Pre-initialize schedulerSettings to ensure Alpine doesn't miss it -->
<script>
// Pre-define schedulerSettings skeleton to ensure it's available to Alpine
- globalThis.schedulerSettings = function() {
+ globalThis.schedulerSettings = function () {
return {
tasks: [],
isLoading: true,
@@ -114,8 +114,7 @@
<!-- KaTeX javascript -->
<script defer src="vendor/katex/katex.min.js" crossorigin="anonymous"></script>
- <script defer src="vendor/katex/katex.auto-render.min.js"
- crossorigin="anonymous"></script>
+ <script defer src="vendor/katex/katex.auto-render.min.js" crossorigin="anonymous"></script>
<!-- QR Code Library -->
<script src="vendor/qrcode.min.js"></script>
@@ -174,6 +173,9 @@
d="m50.301 66.5c-9 0-16.398-7.3008-16.398-16.398 0-9.1016 7.3008-16.398 16.398-16.398 9.1016 0 16.398 7.3008 16.398 16.398 0 9.0977-7.3984 16.398-16.398 16.398zm0-25.5c-5 0-9.1016 4.1016-9.1016 9.1016s4.1016 9.1016 9.1016 9.1016 9.1016-4.1016 9.1016-9.1016c-0.003906-5-4.1016-9.1016-9.1016-9.1016z">
</path>
</svg>Settings</button>
+ <button class="config-button" id="memory-dash"
+ @click="openModal('settings/memory/memory-dashboard.html');">Memory</button>
+
</div>
@@ -194,7 +196,8 @@
<li>
<div :class="{'chat-list-button': true, 'font-bold': context.id === selected}"
@click="selected = context.id; selectChat(context.id)">
- <span class="chat-name" :title="context.name ? context.name : 'Chat #' + context.no"
+ <span class="chat-name"
+ :title="context.name ? context.name : 'Chat #' + context.no"
x-text="context.name ? context.name : 'Chat #' + context.no"></span>
</div>
<button class="edit-button" @click="killChat(context.id)">X</button>
@@ -214,8 +217,7 @@
openTaskDetail(taskId) {
globalThis.openTaskDetail(taskId);
}
- }"
- style="display: none;">
+ }" style="display: none;">
<div class="tasks-list-container">
<ul class="config-list" x-show="tasks.length > 0">
<template x-for="task in tasks">
@@ -225,32 +227,40 @@
<!-- Task container with a vertical layout -->
<div class="task-container task-container-vertical">
<!-- Task name on its own line with full width -->
- <span class="task-name" :title="(task.task_name || `Task #${task.no}`) + ' (' + (task.name || `Chat #${task.no}`) + ')'"
+ <span class="task-name"
+ :title="(task.task_name || `Task #${task.no}`) + ' (' + (task.name || `Chat #${task.no}`) + ')'"
x-text="(task.task_name || `Task #${task.no}`) + ' (' + (task.name || `Chat #${task.no}`) + ')'"
:data-task-id="task.id"></span>
<!-- Second line with status badge and action button -->
<div class="task-info-line">
<!-- Status badge (reusing scheduler styling) -->
<span class="scheduler-status-badge scheduler-status-badge-small"
- :class="task.state ? `scheduler-status-${task.state}` : 'scheduler-status-idle'"
- x-text="task.state || 'idle'"></span>
+ :class="task.state ? `scheduler-status-${task.state}` : 'scheduler-status-idle'"
+ x-text="task.state || 'idle'"></span>
<!-- Action buttons -->
- <button class="edit-button"
- @click.stop="openTaskDetail(task.id)"
- title="View task details" style="margin-left: auto; margin-right: 5px;">
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 512 512" fill="var(--color-primary)" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
- <path d="M256 0c70.69 0 134.69 28.66 181.02 74.98C483.34 121.3 512 185.31 512 256c0 70.69-28.66 134.7-74.98 181.02C390.69 483.34 326.69 512 256 512c-70.69 0-134.69-28.66-181.02-74.98C28.66 390.69 0 326.69 0 256c0-70.69 28.66-134.69 74.98-181.02C121.31 28.66 185.31 0 256 0zm-9.96 161.03c0-4.28.76-8.26 2.27-11.91 1.5-3.63 3.77-6.94 6.79-9.91 3-2.95 6.29-5.2 9.84-6.7 3.57-1.5 7.41-2.28 11.52-2.28 4.12 0 7.96.78 11.49 2.27 3.54 1.51 6.78 3.76 9.75 6.73 2.95 2.97 5.16 6.26 6.64 9.91 1.49 3.63 2.22 7.61 2.22 11.89 0 4.17-.73 8.08-2.21 11.69-1.48 3.6-3.68 6.94-6.65 9.97-2.94 3.03-6.18 5.32-9.72 6.84-3.54 1.51-7.38 2.29-11.52 2.29-4.22 0-8.14-.76-11.75-2.26-3.58-1.51-6.86-3.79-9.83-6.79-2.94-3.02-5.16-6.34-6.63-9.97-1.48-3.62-2.21-7.54-2.21-11.77zm13.4 178.16c-1.11 3.97-3.35 11.76 3.3 11.76 1.44 0 3.27-.81 5.46-2.4 2.37-1.71 5.09-4.31 8.13-7.75 3.09-3.5 6.32-7.65 9.67-12.42 3.33-4.76 6.84-10.22 10.49-16.31.37-.65 1.23-.87 1.89-.48l12.36 9.18c.6.43.73 1.25.35 1.86-5.69 9.88-11.44 18.51-17.26 25.88-5.85 7.41-11.79 13.57-17.8 18.43l-.1.06c-6.02 4.88-12.19 8.55-18.51 11.01-17.58 6.81-45.36 5.7-53.32-14.83-5.02-12.96-.9-27.69 3.06-40.37l19.96-60.44c1.28-4.58 2.89-9.62 3.47-14.33.97-7.87-2.49-12.96-11.06-12.96h-17.45c-.76 0-1.38-.62-1.38-1.38l.08-.48 4.58-16.68c.16-.62.73-1.04 1.35-1.02l89.12-2.79c.76-.03 1.41.57 1.44 1.33l-.07.43-37.76 124.7zm158.3-244.93c-41.39-41.39-98.58-67-161.74-67-63.16 0-120.35 25.61-161.74 67-41.39 41.39-67 98.58-67 161.74 0 63.16 25.61 120.35 67 161.74 41.39 41.39 98.58 67 161.74 67 63.16 0 120.35-25.61 161.74-67 41.39-41.39 67-98.58 67-161.74 0-63.16-25.61-120.35-67-161.74z"/>
+ <button class="edit-button" @click.stop="openTaskDetail(task.id)"
+ title="View task details"
+ style="margin-left: auto; margin-right: 5px;">
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"
+ viewBox="0 0 512 512" fill="var(--color-primary)"
+ stroke="currentColor" stroke-width="2" stroke-linecap="round"
+ stroke-linejoin="round">
+ <path
+ d="M256 0c70.69 0 134.69 28.66 181.02 74.98C483.34 121.3 512 185.31 512 256c0 70.69-28.66 134.7-74.98 181.02C390.69 483.34 326.69 512 256 512c-70.69 0-134.69-28.66-181.02-74.98C28.66 390.69 0 326.69 0 256c0-70.69 28.66-134.69 74.98-181.02C121.31 28.66 185.31 0 256 0zm-9.96 161.03c0-4.28.76-8.26 2.27-11.91 1.5-3.63 3.77-6.94 6.79-9.91 3-2.95 6.29-5.2 9.84-6.7 3.57-1.5 7.41-2.28 11.52-2.28 4.12 0 7.96.78 11.49 2.27 3.54 1.51 6.78 3.76 9.75 6.73 2.95 2.97 5.16 6.26 6.64 9.91 1.49 3.63 2.22 7.61 2.22 11.89 0 4.17-.73 8.08-2.21 11.69-1.48 3.6-3.68 6.94-6.65 9.97-2.94 3.03-6.18 5.32-9.72 6.84-3.54 1.51-7.38 2.29-11.52 2.29-4.22 0-8.14-.76-11.75-2.26-3.58-1.51-6.86-3.79-9.83-6.79-2.94-3.02-5.16-6.34-6.63-9.97-1.48-3.62-2.21-7.54-2.21-11.77zm13.4 178.16c-1.11 3.97-3.35 11.76 3.3 11.76 1.44 0 3.27-.81 5.46-2.4 2.37-1.71 5.09-4.31 8.13-7.75 3.09-3.5 6.32-7.65 9.67-12.42 3.33-4.76 6.84-10.22 10.49-16.31.37-.65 1.23-.87 1.89-.48l12.36 9.18c.6.43.73 1.25.35 1.86-5.69 9.88-11.44 18.51-17.26 25.88-5.85 7.41-11.79 13.57-17.8 18.43l-.1.06c-6.02 4.88-12.19 8.55-18.51 11.01-17.58 6.81-45.36 5.7-53.32-14.83-5.02-12.96-.9-27.69 3.06-40.37l19.96-60.44c1.28-4.58 2.89-9.62 3.47-14.33.97-7.87-2.49-12.96-11.06-12.96h-17.45c-.76 0-1.38-.62-1.38-1.38l.08-.48 4.58-16.68c.16-.62.73-1.04 1.35-1.02l89.12-2.79c.76-.03 1.41.57 1.44 1.33l-.07.43-37.76 124.7zm158.3-244.93c-41.39-41.39-98.58-67-161.74-67-63.16 0-120.35 25.61-161.74 67-41.39 41.39-67 98.58-67 161.74 0 63.16 25.61 120.35 67 161.74 41.39 41.39 98.58 67 161.74 67 63.16 0 120.35-25.61 161.74-67 41.39-41.39 67-98.58 67-161.74 0-63.16-25.61-120.35-67-161.74z" />
</svg>
</button>
- <button class="edit-button"
- @click.stop="resetChat(task.id)"
- style="margin-right: 5px;"
- title="Clear task chat">
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 122.88 121.1" fill="var(--color-primary)" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
- <path d="M62.89,56.03c1.11-0.35,2.34-0.25,3.72,0.37l10.4,7.87c2.26,1.71,4.24,3.78,2.73,6.9 c-0.51,1.06-1.4,2.1-2.38,3.49l-0.53,0.75c-1.97,2.8-2.61,2-5.71,1.83c0.56,13.37,1.75,27.82-2.64,40.88 c-0.87,2.7-3.32,3.44-6.95,2.71l-6.1-2.03c4.11-6.14,6.16-13.85,6.44-22.89c-3.46,8.58-6.8,16.96-10.68,20.86l-6.28-2.08 c0.61-3.05,1.05-5.43,0.35-6.9l-4.07,4.24l-9.33-5.77c6.36-3.36,11.62-7.87,15.6-13.73c-6.69,5.01-12.76,8.1-18.14,8.99 c-2.75,0.83-4.49,0.35-5.16-1.53c-0.48-1.34-0.05-1.77,0.81-2.86c1.11-1.41,2.61-2.67,4.35-3.79c-3.13,1.1-4.64,0.95-6.37,1.51 c-4.9,1.59-9.94-1.86-8.26-6.9c1.07-3.23,3.54-3.09,6.67-4.07l5.42-1.69c-5.19,0.28-10.32,0.45-15.02-0.25 c-5.4-0.8-5.31-0.99-8.24-5.38c-3.94-5.91-6.25-11.45,2.52-9.16c16.73,3.18,33.56,5.34,51.25-0.98c-0.76-1.32-0.9-2.57-0.5-3.73 C57.37,60.94,61.13,56.58,62.89,56.03L62.89,56.03z M113.8,2.42L74.45,51.53c-4.71,6.68,3.2,11.91,8.39,5.64l39.2-49.27 C125.12,1.86,119.13-3.16,113.8,2.42L113.8,2.42z"/>
+ <button class="edit-button" @click.stop="resetChat(task.id)"
+ style="margin-right: 5px;" title="Clear task chat">
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"
+ viewBox="0 0 122.88 121.1" fill="var(--color-primary)"
+ stroke="currentColor" stroke-width="2" stroke-linecap="round"
+ stroke-linejoin="round">
+ <path
+ d="M62.89,56.03c1.11-0.35,2.34-0.25,3.72,0.37l10.4,7.87c2.26,1.71,4.24,3.78,2.73,6.9 c-0.51,1.06-1.4,2.1-2.38,3.49l-0.53,0.75c-1.97,2.8-2.61,2-5.71,1.83c0.56,13.37,1.75,27.82-2.64,40.88 c-0.87,2.7-3.32,3.44-6.95,2.71l-6.1-2.03c4.11-6.14,6.16-13.85,6.44-22.89c-3.46,8.58-6.8,16.96-10.68,20.86l-6.28-2.08 c0.61-3.05,1.05-5.43,0.35-6.9l-4.07,4.24l-9.33-5.77c6.36-3.36,11.62-7.87,15.6-13.73c-6.69,5.01-12.76,8.1-18.14,8.99 c-2.75,0.83-4.49,0.35-5.16-1.53c-0.48-1.34-0.05-1.77,0.81-2.86c1.11-1.41,2.61-2.67,4.35-3.79c-3.13,1.1-4.64,0.95-6.37,1.51 c-4.9,1.59-9.94-1.86-8.26-6.9c1.07-3.23,3.54-3.09,6.67-4.07l5.42-1.69c-5.19,0.28-10.32,0.45-15.02-0.25 c-5.4-0.8-5.31-0.99-8.24-5.38c-3.94-5.91-6.25-11.45,2.52-9.16c16.73,3.18,33.56,5.34,51.25-0.98c-0.76-1.32-0.9-2.57-0.5-3.73 C57.37,60.94,61.13,56.58,62.89,56.03L62.89,56.03z M113.8,2.42L74.45,51.53c-4.71,6.68,3.2,11.91,8.39,5.64l39.2-49.27 C125.12,1.86,119.13-3.16,113.8,2.42L113.8,2.42z" />
</svg>
</button>
- <button title="Delete task" class="edit-button" @click.stop="deleteTaskGlobal(task.id)">X</button>
+ <button title="Delete task" class="edit-button"
+ @click.stop="deleteTaskGlobal(task.id)">X</button>
</div>
</div>
@@ -400,7 +410,8 @@
d="M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5c0-1.38 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5c0 1.38 1.12 2.5 2.5 2.5s2.5-1.12 2.5-2.5V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6h-1.5z" />
</svg>
</label>
- <input type="file" id="file-input" accept="*" multiple style="display: none" @change="$store.chatAttachments.handleFileUpload($event)">
+ <input type="file" id="file-input" accept="*" multiple style="display: none"
+ @change="$store.chatAttachments.handleFileUpload($event)">
<div x-show="showTooltip" class="tooltip">
Add attachments to the message
@@ -412,9 +423,11 @@
<textarea id="chat-input" placeholder="Type your message here..." rows="1"></textarea>
<!-- Expand button inside the textarea container -->
- <button id="expand-button" @click="$store.fullScreenInputModal.openModal()" aria-label="Expand input">
+ <button id="expand-button" @click="$store.fullScreenInputModal.openModal()"
+ aria-label="Expand input">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
- <path d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"/>
+ <path
+ d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z" />
</svg>
</button>
</div>
@@ -431,8 +444,7 @@
<!-- Microphone button -->
<button class="chat-button mic-inactive" id="microphone-button"
- aria-label="Start/Stop recording"
- @click="$store.speech.handleMicrophoneClick()"
+ aria-label="Start/Stop recording" @click="$store.speech.handleMicrophoneClick()"
x-effect="$store.speech.updateMicrophoneButtonUI()">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 18" fill="currentColor">
<path
@@ -540,30 +552,18 @@
<!-- Tab Navigation -->
<div class="settings-tabs-container">
<div class="settings-tabs">
- <div class="settings-tab"
- :class="{'active': activeTab === 'agent'}"
- @click="switchTab('agent')"
- title="Agent Settings">Agent Settings</div>
- <div class="settings-tab"
- :class="{'active': activeTab === 'external'}"
- @click="switchTab('external')"
- title="External Services">External Services</div>
- <div class="settings-tab"
- :class="{'active': activeTab === 'mcp'}"
- @click="switchTab('mcp')"
- title="MCP">MCP/A2A</div>
- <div class="settings-tab"
- :class="{'active': activeTab === 'developer'}"
- @click="switchTab('developer')"
- title="Developer">Developer</div>
- <div class="settings-tab"
- :class="{'active': activeTab === 'scheduler'}"
- @click="switchTab('scheduler')"
- title="Task Scheduler">Task Scheduler</div>
- <div class="settings-tab"
- :class="{'active': activeTab === 'backup'}"
- @click="switchTab('backup')"
- title="Backup & Restore">Backup & Restore</div>
+ <div class="settings-tab" :class="{'active': activeTab === 'agent'}"
+ @click="switchTab('agent')" title="Agent Settings">Agent Settings</div>
+ <div class="settings-tab" :class="{'active': activeTab === 'external'}"
+ @click="switchTab('external')" title="External Services">External Services</div>
+ <div class="settings-tab" :class="{'active': activeTab === 'mcp'}"
+ @click="switchTab('mcp')" title="MCP">MCP/A2A</div>
+ <div class="settings-tab" :class="{'active': activeTab === 'developer'}"
+ @click="switchTab('developer')" title="Developer">Developer</div>
+ <div class="settings-tab" :class="{'active': activeTab === 'scheduler'}"
+ @click="switchTab('scheduler')" title="Task Scheduler">Task Scheduler</div>
+ <div class="settings-tab" :class="{'active': activeTab === 'backup'}"
+ @click="switchTab('backup')" title="Backup & Restore">Backup & Restore</div>
</div>
</div>
@@ -574,8 +574,7 @@
<template x-for="(section, index) in filteredSections" :key="section.title">
<li>
<a :href="'#section' + (index + 1)">
- <img :src="'/public/' + section.id +'.svg'"
- :alt="section.title">
+ <img :src="'/public/' + section.id +'.svg'" :alt="section.title">
<span x-text="section.title"></span>
</a>
</li>
@@ -595,11 +594,14 @@
<div class="section-title" x-text="section.title"></div>
<div class="section-description" x-html="section.description"></div>
- <template x-for="(field, fieldIndex) in section.fields.filter(f => !f.hidden)" :key="fieldIndex">
+ <template x-for="(field, fieldIndex) in section.fields.filter(f => !f.hidden)"
+ :key="fieldIndex">
<div :class="{'field': true, 'field-full': field.type === 'textarea'}">
<div class="field-label" x-show="field.title || field.description">
- <div class="field-title" x-text="field.title" x-show="field.title"></div>
- <div class="field-description" x-html="field.description || ''" x-show="field.description"></div>
+ <div class="field-title" x-text="field.title" x-show="field.title">
+ </div>
+ <div class="field-description" x-html="field.description || ''"
+ x-show="field.description"></div>
</div>
<div class="field-control">
@@ -614,18 +616,16 @@
<template x-if="field.type === 'number'">
<input type="number" :class="field.classes" :value="field.value"
:readonly="field.readonly === true"
- @input="field.value = $event.target.value"
- :min="field.min" :max="field.max" :step="field.step">
+ @input="field.value = $event.target.value" :min="field.min"
+ :max="field.max" :step="field.step">
</template>
<!-- Password field -->
<template x-if="field.type === 'password'">
<input type="password" :class="field.classes" :value="field.value"
- :readonly="field.readonly === true"
- :id="field.id"
- autocomplete="off"
- @input="field.value = $event.target.value">
+ :readonly="field.readonly === true" :id="field.id"
+ autocomplete="off" @input="field.value = $event.target.value">
</template>
<!-- Textarea field -->
@@ -633,8 +633,7 @@
<textarea :class="field.classes" :value="field.value"
:readonly="field.readonly === true"
@input="field.value = $event.target.value"
- :style="field.style"
- ></textarea>
+ :style="field.style"></textarea>
</template>
<!-- Switch field -->
@@ -707,10 +706,10 @@
</ul>
</nav>
- <div id="section-task-scheduler" class="section"
- x-data="schedulerSettings">
+ <div id="section-task-scheduler" class="section" x-data="schedulerSettings">
<div class="section-title">Task Scheduler</div>
- <div class="section-description">Manage scheduled tasks and automated processes for Agent Zero.</div>
+ <div class="section-description">Manage scheduled tasks and automated processes for
+ Agent Zero.</div>
<!-- Create Task Form -->
<div class="scheduler-form" x-show="isCreating">
@@ -731,7 +730,8 @@
<div class="scheduler-form-field">
<div class="label-help-wrapper">
<label class="scheduler-form-label">Task Name</label>
- <div class="scheduler-form-help">A unique name to identify this task</div>
+ <div class="scheduler-form-help">A unique name to identify this task
+ </div>
</div>
<input type="text" x-model="editingTask.name" placeholder="Enter task name">
</div>
@@ -753,78 +753,102 @@
<div class="scheduler-form-field" x-show="isCreating">
<div class="label-help-wrapper">
<label class="scheduler-form-label">State</label>
- <div class="scheduler-form-help">Select the initial state of the task</div>
+ <div class="scheduler-form-help">Select the initial state of the task
+ </div>
</div>
<div>
<div class="scheduler-state-selector">
<span class="scheduler-status-badge scheduler-status-idle"
- :class="{'scheduler-status-selected': editingTask.state === 'idle'}"
- @click="editingTask.state = 'idle'">idle</span>
+ :class="{'scheduler-status-selected': editingTask.state === 'idle'}"
+ @click="editingTask.state = 'idle'">idle</span>
<span class="scheduler-status-badge scheduler-status-running"
- :class="{'scheduler-status-selected': editingTask.state === 'running'}"
- @click="editingTask.state = 'running'">running</span>
+ :class="{'scheduler-status-selected': editingTask.state === 'running'}"
+ @click="editingTask.state = 'running'">running</span>
<span class="scheduler-status-badge scheduler-status-disabled"
- :class="{'scheduler-status-selected': editingTask.state === 'disabled'}"
- @click="editingTask.state = 'disabled'">disabled</span>
+ :class="{'scheduler-status-selected': editingTask.state === 'disabled'}"
+ @click="editingTask.state = 'disabled'">disabled</span>
<span class="scheduler-status-badge scheduler-status-error"
- :class="{'scheduler-status-selected': editingTask.state === 'error'}"
- @click="editingTask.state = 'error'">error</span>
+ :class="{'scheduler-status-selected': editingTask.state === 'error'}"
+ @click="editingTask.state = 'error'">error</span>
</div>
<div class="scheduler-state-explanation">
- <span x-show="editingTask.state === 'idle'"><strong>idle</strong>: ready to run</span>
- <span x-show="editingTask.state === 'running'"><strong>running</strong>: currently executing</span>
- <span x-show="editingTask.state === 'disabled'"><strong>disabled</strong>: won't execute automatically</span>
- <span x-show="editingTask.state === 'error'"><strong>error</strong>: task encountered an error</span>
+ <span x-show="editingTask.state === 'idle'"><strong>idle</strong>:
+ ready to run</span>
+ <span
+ x-show="editingTask.state === 'running'"><strong>running</strong>:
+ currently executing</span>
+ <span
+ x-show="editingTask.state === 'disabled'"><strong>disabled</strong>:
+ won't execute automatically</span>
+ <span x-show="editingTask.state === 'error'"><strong>error</strong>:
+ task encountered an error</span>
</div>
</div>
</div>
<!-- Schedule (only for scheduled tasks) -->
- <div class="scheduler-form-field full-width" x-show="editingTask.type === 'scheduled'">
+ <div class="scheduler-form-field full-width"
+ x-show="editingTask.type === 'scheduled'">
<div class="label-help-wrapper">
<label class="scheduler-form-label">Schedule</label>
- <div class="scheduler-form-help">Cron schedule for automated execution (minute hour day month weekday)</div>
+ <div class="scheduler-form-help">Cron schedule for automated execution
+ (minute hour day month weekday)</div>
</div>
<div class="scheduler-schedule-builder">
<div class="scheduler-schedule-field">
<span class="scheduler-schedule-label">Minute</span>
- <input type="text" x-model="editingTask.schedule.minute" placeholder="*" maxlength="9">
+ <input type="text" x-model="editingTask.schedule.minute"
+ placeholder="*" maxlength="9">
</div>
<div class="scheduler-schedule-field">
<span class="scheduler-schedule-label">Hour</span>
- <input type="text" x-model="editingTask.schedule.hour" placeholder="*" maxlength="9">
+ <input type="text" x-model="editingTask.schedule.hour"
+ placeholder="*" maxlength="9">
</div>
<div class="scheduler-schedule-field">
<span class="scheduler-schedule-label">Day</span>
- <input type="text" x-model="editingTask.schedule.day" placeholder="*" maxlength="9">
+ <input type="text" x-model="editingTask.schedule.day"
+ placeholder="*" maxlength="9">
</div>
<div class="scheduler-schedule-field">
<span class="scheduler-schedule-label">Month</span>
- <input type="text" x-model="editingTask.schedule.month" placeholder="*" maxlength="9">
+ <input type="text" x-model="editingTask.schedule.month"
+ placeholder="*" maxlength="9">
</div>
<div class="scheduler-schedule-field">
<span class="scheduler-schedule-label">Weekday</span>
- <input type="text" x-model="editingTask.schedule.weekday" placeholder="*" maxlength="9">
+ <input type="text" x-model="editingTask.schedule.weekday"
+ placeholder="*" maxlength="9">
</div>
</div>
</div>
<!-- Plan (for planned tasks) -->
- <div class="scheduler-form-field full-width" x-show="editingTask.type === 'planned'">
+ <div class="scheduler-form-field full-width"
+ x-show="editingTask.type === 'planned'">
<div class="label-help-wrapper">
<label class="scheduler-form-label">Plan</label>
- <div class="scheduler-form-help">Specific execution times for this task</div>
+ <div class="scheduler-form-help">Specific execution times for this task
+ </div>
</div>
<div class="scheduler-plan-builder">
<div class="scheduler-plan-todo">
<span class="scheduler-plan-label">Upcoming Executions</span>
<div class="scheduler-todo-list">
- <template x-if="editingTask.plan && Array.isArray(editingTask.plan.todo) && editingTask.plan.todo.length > 0">
- <template x-for="(time, index) in editingTask.plan.todo" :key="index">
+ <template
+ x-if="editingTask.plan && Array.isArray(editingTask.plan.todo) && editingTask.plan.todo.length > 0">
+ <template x-for="(time, index) in editingTask.plan.todo"
+ :key="index">
<div class="scheduler-todo-item">
<span x-text="formatDate(time)"></span>
- <button @click.prevent="editingTask.plan.todo.splice(index, 1)" class="scheduler-todo-remove">
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
+ <button
+ @click.prevent="editingTask.plan.todo.splice(index, 1)"
+ class="scheduler-todo-remove">
+ <svg xmlns="http://www.w3.org/2000/svg"
+ width="16" height="16" viewBox="0 0 24 24"
+ fill="none" stroke="currentColor"
+ stroke-width="2" stroke-linecap="round"
+ stroke-linejoin="round">
<line x1="18" y1="6" x2="6" y2="18"></line>
<line x1="6" y1="6" x2="18" y2="18"></line>
</svg>
@@ -832,7 +856,8 @@
</div>
</template>
</template>
- <template x-if="!editingTask.plan || !Array.isArray(editingTask.plan.todo) || editingTask.plan.todo.length === 0">
+ <template
+ x-if="!editingTask.plan || !Array.isArray(editingTask.plan.todo) || editingTask.plan.todo.length === 0">
<div class="scheduler-empty-plan">
No scheduled execution times yet. Add one below.
</div>
@@ -885,7 +910,11 @@
input.value = '';
}
" class="scheduler-add-todo-button">
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="margin-right: 4px;">
+ <svg xmlns="http://www.w3.org/2000/svg" width="16"
+ height="16" viewBox="0 0 24 24" fill="none"
+ stroke="currentColor" stroke-width="2"
+ stroke-linecap="round" stroke-linejoin="round"
+ style="margin-right: 4px;">
<line x1="12" y1="5" x2="12" y2="19"></line>
<line x1="5" y1="12" x2="19" y2="12"></line>
</svg>
@@ -898,14 +927,18 @@
</div>
<!-- Token (for ad-hoc tasks) -->
- <div class="scheduler-form-field full-width" x-show="editingTask.type === 'adhoc'">
+ <div class="scheduler-form-field full-width"
+ x-show="editingTask.type === 'adhoc'">
<div class="label-help-wrapper">
<label class="scheduler-form-label">Token</label>
- <div class="scheduler-form-help">Token used to trigger this task externally</div>
+ <div class="scheduler-form-help">Token used to trigger this task
+ externally</div>
</div>
<div class="input-group">
- <input type="text" x-model="editingTask.token" placeholder="Token for ad-hoc task">
- <button class="scheduler-task-action" @click="editingTask.token = generateRandomToken()">
+ <input type="text" x-model="editingTask.token"
+ placeholder="Token for ad-hoc task">
+ <button class="scheduler-task-action"
+ @click="editingTask.token = generateRandomToken()">
Generate
</button>
</div>
@@ -915,27 +948,33 @@
<div class="scheduler-form-field full-width">
<div class="label-help-wrapper">
<label class="scheduler-form-label">System Prompt</label>
- <div class="scheduler-form-help">System-level instructions for the assistant</div>
+ <div class="scheduler-form-help">System-level instructions for the
+ assistant</div>
</div>
- <textarea x-model="editingTask.system_prompt" placeholder="System instructions for the AI"></textarea>
+ <textarea x-model="editingTask.system_prompt"
+ placeholder="System instructions for the AI"></textarea>
</div>
<!-- User Prompt -->
<div class="scheduler-form-field full-width">
<div class="label-help-wrapper">
<label class="scheduler-form-label">User Prompt</label>
- <div class="scheduler-form-help">The main task prompt that will be executed</div>
+ <div class="scheduler-form-help">The main task prompt that will be
+ executed</div>
</div>
- <textarea x-model="editingTask.prompt" placeholder="User message for the AI"></textarea>
+ <textarea x-model="editingTask.prompt"
+ placeholder="User message for the AI"></textarea>
</div>
<!-- Attachments Field -->
<div class="scheduler-form-field full-width">
<div class="label-help-wrapper">
<label class="scheduler-form-label">Attachments</label>
- <div class="scheduler-form-help">Container file paths or URLs, one per line</div>
+ <div class="scheduler-form-help">Container file paths or URLs, one per
+ line</div>
</div>
- <textarea x-model="attachmentsText" placeholder="Enter file paths or URLs, one per line"></textarea>
+ <textarea x-model="attachmentsText"
+ placeholder="Enter file paths or URLs, one per line"></textarea>
</div>
</div>
</div>
@@ -959,7 +998,8 @@
<div class="scheduler-form-field">
<div class="label-help-wrapper">
<label class="scheduler-form-label">Task Name</label>
- <div class="scheduler-form-help">A unique name to identify this task</div>
+ <div class="scheduler-form-help">A unique name to identify this task
+ </div>
</div>
<input type="text" x-model="editingTask.name" placeholder="Enter task name">
</div>
@@ -968,7 +1008,8 @@
<div class="scheduler-form-field">
<div class="label-help-wrapper">
<label class="scheduler-form-label">Task Type</label>
- <div class="scheduler-form-help">Task type cannot be changed after creation</div>
+ <div class="scheduler-form-help">Task type cannot be changed after
+ creation</div>
</div>
<select x-model="editingTask.type" disabled>
<option value="scheduled">Scheduled Task</option>
@@ -986,73 +1027,96 @@
<div>
<div class="scheduler-state-selector">
<span class="scheduler-status-badge scheduler-status-idle"
- :class="{'scheduler-status-selected': editingTask.state === 'idle'}"
- @click="editingTask.state = 'idle'">idle</span>
+ :class="{'scheduler-status-selected': editingTask.state === 'idle'}"
+ @click="editingTask.state = 'idle'">idle</span>
<span class="scheduler-status-badge scheduler-status-running"
- :class="{'scheduler-status-selected': editingTask.state === 'running'}"
- @click="editingTask.state = 'running'">running</span>
+ :class="{'scheduler-status-selected': editingTask.state === 'running'}"
+ @click="editingTask.state = 'running'">running</span>
<span class="scheduler-status-badge scheduler-status-disabled"
- :class="{'scheduler-status-selected': editingTask.state === 'disabled'}"
- @click="editingTask.state = 'disabled'">disabled</span>
+ :class="{'scheduler-status-selected': editingTask.state === 'disabled'}"
+ @click="editingTask.state = 'disabled'">disabled</span>
<span class="scheduler-status-badge scheduler-status-error"
- :class="{'scheduler-status-selected': editingTask.state === 'error'}"
- @click="editingTask.state = 'error'">error</span>
+ :class="{'scheduler-status-selected': editingTask.state === 'error'}"
+ @click="editingTask.state = 'error'">error</span>
</div>
<div class="scheduler-state-explanation">
- <span x-show="editingTask.state === 'idle'"><strong>idle</strong>: ready to run</span>
- <span x-show="editingTask.state === 'running'"><strong>running</strong>: currently executing</span>
- <span x-show="editingTask.state === 'disabled'"><strong>disabled</strong>: won't execute automatically</span>
- <span x-show="editingTask.state === 'error'"><strong>error</strong>: task encountered an error</span>
+ <span x-show="editingTask.state === 'idle'"><strong>idle</strong>:
+ ready to run</span>
+ <span
+ x-show="editingTask.state === 'running'"><strong>running</strong>:
+ currently executing</span>
+ <span
+ x-show="editingTask.state === 'disabled'"><strong>disabled</strong>:
+ won't execute automatically</span>
+ <span x-show="editingTask.state === 'error'"><strong>error</strong>:
+ task encountered an error</span>
</div>
</div>
</div>
<!-- Schedule (for scheduled tasks) -->
- <div class="scheduler-form-field full-width" x-show="editingTask && editingTask.type === 'scheduled'">
+ <div class="scheduler-form-field full-width"
+ x-show="editingTask && editingTask.type === 'scheduled'">
<div class="label-help-wrapper">
<label class="scheduler-form-label">Schedule (Cron Expression)</label>
- <div class="scheduler-form-help">Format: minute hour day month weekday (e.g., "* * * * *" for every minute)</div>
+ <div class="scheduler-form-help">Format: minute hour day month weekday
+ (e.g., "* * * * *" for every minute)</div>
</div>
<div class="scheduler-schedule-builder">
<div class="scheduler-schedule-field">
<span class="scheduler-schedule-label">Minute</span>
- <input type="text" x-model="editingTask.schedule.minute" placeholder="*" maxlength="9">
+ <input type="text" x-model="editingTask.schedule.minute"
+ placeholder="*" maxlength="9">
</div>
<div class="scheduler-schedule-field">
<span class="scheduler-schedule-label">Hour</span>
- <input type="text" x-model="editingTask.schedule.hour" placeholder="*" maxlength="9">
+ <input type="text" x-model="editingTask.schedule.hour"
+ placeholder="*" maxlength="9">
</div>
<div class="scheduler-schedule-field">
<span class="scheduler-schedule-label">Day</span>
- <input type="text" x-model="editingTask.schedule.day" placeholder="*" maxlength="9">
+ <input type="text" x-model="editingTask.schedule.day"
+ placeholder="*" maxlength="9">
</div>
<div class="scheduler-schedule-field">
<span class="scheduler-schedule-label">Month</span>
- <input type="text" x-model="editingTask.schedule.month" placeholder="*" maxlength="9">
+ <input type="text" x-model="editingTask.schedule.month"
+ placeholder="*" maxlength="9">
</div>
<div class="scheduler-schedule-field">
<span class="scheduler-schedule-label">Weekday</span>
- <input type="text" x-model="editingTask.schedule.weekday" placeholder="*" maxlength="9">
+ <input type="text" x-model="editingTask.schedule.weekday"
+ placeholder="*" maxlength="9">
</div>
</div>
</div>
<!-- Plan (for planned tasks) -->
- <div class="scheduler-form-field full-width" x-show="editingTask.type === 'planned'">
+ <div class="scheduler-form-field full-width"
+ x-show="editingTask.type === 'planned'">
<div class="label-help-wrapper">
<label class="scheduler-form-label">Plan</label>
- <div class="scheduler-form-help">Specific execution times for this task</div>
+ <div class="scheduler-form-help">Specific execution times for this task
+ </div>
</div>
<div class="scheduler-plan-builder">
<div class="scheduler-plan-todo">
<span class="scheduler-plan-label">Upcoming Executions</span>
<div class="scheduler-todo-list">
- <template x-if="editingTask.plan && Array.isArray(editingTask.plan.todo) && editingTask.plan.todo.length > 0">
- <template x-for="(time, index) in editingTask.plan.todo" :key="index">
+ <template
+ x-if="editingTask.plan && Array.isArray(editingTask.plan.todo) && editingTask.plan.todo.length > 0">
+ <template x-for="(time, index) in editingTask.plan.todo"
+ :key="index">
<div class="scheduler-todo-item">
<span x-text="formatDate(time)"></span>
- <button @click.prevent="editingTask.plan.todo.splice(index, 1)" class="scheduler-todo-remove">
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
+ <button
+ @click.prevent="editingTask.plan.todo.splice(index, 1)"
+ class="scheduler-todo-remove">
+ <svg xmlns="http://www.w3.org/2000/svg"
+ width="16" height="16" viewBox="0 0 24 24"
+ fill="none" stroke="currentColor"
+ stroke-width="2" stroke-linecap="round"
+ stroke-linejoin="round">
<line x1="18" y1="6" x2="6" y2="18"></line>
<line x1="6" y1="6" x2="18" y2="18"></line>
</svg>
@@ -1060,7 +1124,8 @@
</div>
</template>
</template>
- <template x-if="!editingTask.plan || !Array.isArray(editingTask.plan.todo) || editingTask.plan.todo.length === 0">
+ <template
+ x-if="!editingTask.plan || !Array.isArray(editingTask.plan.todo) || editingTask.plan.todo.length === 0">
<div class="scheduler-empty-plan">
No scheduled execution times yet. Add one below.
</div>
@@ -1113,7 +1178,11 @@
input.value = '';
}
" class="scheduler-add-todo-button">
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="margin-right: 4px;">
+ <svg xmlns="http://www.w3.org/2000/svg" width="16"
+ height="16" viewBox="0 0 24 24" fill="none"
+ stroke="currentColor" stroke-width="2"
+ stroke-linecap="round" stroke-linejoin="round"
+ style="margin-right: 4px;">
<line x1="12" y1="5" x2="12" y2="19"></line>
<line x1="5" y1="12" x2="19" y2="12"></line>
</svg>
@@ -1126,14 +1195,18 @@
</div>
<!-- Token (for ad-hoc tasks) -->
- <div class="scheduler-form-field full-width" x-show="editingTask.type === 'adhoc'">
+ <div class="scheduler-form-field full-width"
+ x-show="editingTask.type === 'adhoc'">
<div class="label-help-wrapper">
<label class="scheduler-form-label">Token</label>
- <div class="scheduler-form-help">Token used to trigger this task externally</div>
+ <div class="scheduler-form-help">Token used to trigger this task
+ externally</div>
</div>
<div class="input-group">
- <input type="text" x-model="editingTask.token" placeholder="Token for ad-hoc task">
- <button class="scheduler-task-action" @click="editingTask.token = generateRandomToken()">
+ <input type="text" x-model="editingTask.token"
+ placeholder="Token for ad-hoc task">
+ <button class="scheduler-task-action"
+ @click="editingTask.token = generateRandomToken()">
Generate
</button>
</div>
@@ -1143,33 +1216,40 @@
<div class="scheduler-form-field full-width">
<div class="label-help-wrapper">
<label class="scheduler-form-label">System Prompt</label>
- <div class="scheduler-form-help">System-level instructions for the assistant</div>
+ <div class="scheduler-form-help">System-level instructions for the
+ assistant</div>
</div>
- <textarea x-model="editingTask.system_prompt" placeholder="System instructions for the AI"></textarea>
+ <textarea x-model="editingTask.system_prompt"
+ placeholder="System instructions for the AI"></textarea>
</div>
<!-- User Prompt -->
<div class="scheduler-form-field full-width">
<div class="label-help-wrapper">
<label class="scheduler-form-label">User Prompt</label>
- <div class="scheduler-form-help">The main task prompt that will be executed</div>
+ <div class="scheduler-form-help">The main task prompt that will be
+ executed</div>
</div>
- <textarea x-model="editingTask.prompt" placeholder="User message for the AI"></textarea>
+ <textarea x-model="editingTask.prompt"
+ placeholder="User message for the AI"></textarea>
</div>
<!-- Attachments Field -->
<div class="scheduler-form-field full-width">
<div class="label-help-wrapper">
<label class="scheduler-form-label">Attachments</label>
- <div class="scheduler-form-help">Container file paths or URLs, one per line</div>
+ <div class="scheduler-form-help">Container file paths or URLs, one per
+ line</div>
</div>
- <textarea x-model="attachmentsText" placeholder="Enter file paths or URLs, one per line"></textarea>
+ <textarea x-model="attachmentsText"
+ placeholder="Enter file paths or URLs, one per line"></textarea>
</div>
</div>
</div>
<!-- Task List View -->
- <div class="scheduler-container" x-show="!isCreating && !isEditing && viewMode === 'list'">
+ <div class="scheduler-container"
+ x-show="!isCreating && !isEditing && viewMode === 'list'">
<!-- Header with Actions -->
<div class="scheduler-header">
<h2>Task Management</h2>
@@ -1210,36 +1290,37 @@
</div> -->
<!-- Empty State -->
- <div class="scheduler-empty"
- x-show="!isLoading && filteredTasks.length === 0"
- x-effect="$el.style.display = (!isLoading && filteredTasks.length === 0) ? '' : 'none'">
+ <div class="scheduler-empty" x-show="!isLoading && filteredTasks.length === 0"
+ x-effect="$el.style.display = (!isLoading && filteredTasks.length === 0) ? '' : 'none'">
<!-- <div class="scheduler-empty-icon">πŸ“‹</div> -->
<div class="scheduler-empty-text">No tasks found</div>
- <button class="btn btn-ok" @click="startCreateTask()">Create your first task</button>
+ <button class="btn btn-ok" @click="startCreateTask()">Create your first
+ task</button>
</div>
<!-- Task List Table -->
- <table class="scheduler-task-list"
- x-show="!isLoading && filteredTasks.length > 0"
- x-effect="$el.style.display = (!isLoading && filteredTasks.length > 0) ? '' : 'none'">
+ <table class="scheduler-task-list" x-show="!isLoading && filteredTasks.length > 0"
+ x-effect="$el.style.display = (!isLoading && filteredTasks.length > 0) ? '' : 'none'">
<thead>
<tr>
<th @click="changeSort('name')">
Name
<span class="scheduler-sort-indicator" x-show="sortField === 'name'"
- :class="{'scheduler-sort-desc': sortDirection === 'desc'}">↑</span>
+ :class="{'scheduler-sort-desc': sortDirection === 'desc'}">↑</span>
</th>
<th @click="changeSort('state')">
State
- <span class="scheduler-sort-indicator" x-show="sortField === 'state'"
- :class="{'scheduler-sort-desc': sortDirection === 'desc'}">↑</span>
+ <span class="scheduler-sort-indicator"
+ x-show="sortField === 'state'"
+ :class="{'scheduler-sort-desc': sortDirection === 'desc'}">↑</span>
</th>
<th>Type</th>
<th>Schedule</th>
<th @click="changeSort('last_run')">
Last Run
- <span class="scheduler-sort-indicator" x-show="sortField === 'last_run'"
- :class="{'scheduler-sort-desc': sortDirection === 'desc'}">↑</span>
+ <span class="scheduler-sort-indicator"
+ x-show="sortField === 'last_run'"
+ :class="{'scheduler-sort-desc': sortDirection === 'desc'}">↑</span>
</th>
<th>Actions</th>
</tr>
@@ -1251,35 +1332,55 @@
<span x-text="task.name"></span>
</td>
<td>
- <span class="scheduler-status-badge" :class="getStateBadgeClass(task.state)" x-text="task.state"></span>
+ <span class="scheduler-status-badge"
+ :class="getStateBadgeClass(task.state)"
+ x-text="task.state"></span>
</td>
<td x-text="task.type"></td>
<td>
- <span x-show="task.type === 'scheduled'" x-text="formatSchedule(task)"></span>
- <span x-show="task.type === 'adhoc'" class="scheduler-no-schedule">β€”</span>
- <span x-show="task.type === 'planned'" x-html="formatPlan(task).replace(/\n/g, '<br>')"></span>
+ <span x-show="task.type === 'scheduled'"
+ x-text="formatSchedule(task)"></span>
+ <span x-show="task.type === 'adhoc'"
+ class="scheduler-no-schedule">β€”</span>
+ <span x-show="task.type === 'planned'"
+ x-html="formatPlan(task).replace(/\n/g, '<br>')"></span>
</td>
<td x-text="formatDate(task.last_run)"></td>
<td @click.stop>
<div class="scheduler-task-actions">
- <button class="scheduler-task-action" @click="runTask(task.uuid)" title="Run Task">
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" width="16" height="16">
- <path d="M8 5v14l11-7z"/>
+ <button class="scheduler-task-action"
+ @click="runTask(task.uuid)" title="Run Task">
+ <svg xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 24 24" fill="currentColor" width="16"
+ height="16">
+ <path d="M8 5v14l11-7z" />
</svg>
</button>
- <button class="scheduler-task-action" @click="resetTaskState(task.uuid)" title="Reset State">
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" width="16" height="16">
- <path d="M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"/>
+ <button class="scheduler-task-action"
+ @click="resetTaskState(task.uuid)" title="Reset State">
+ <svg xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 24 24" fill="currentColor" width="16"
+ height="16">
+ <path
+ d="M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z" />
</svg>
</button>
- <button class="scheduler-task-action" @click="startEditTask(task.uuid)" title="Edit Task">
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" width="16" height="16">
- <path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"/>
+ <button class="scheduler-task-action"
+ @click="startEditTask(task.uuid)" title="Edit Task">
+ <svg xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 24 24" fill="currentColor" width="16"
+ height="16">
+ <path
+ d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z" />
</svg>
</button>
- <button class="scheduler-task-action" @click="deleteTask(task.uuid)" title="Delete Task">
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" width="16" height="16">
- <path d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"/>
+ <button class="scheduler-task-action"
+ @click="deleteTask(task.uuid)" title="Delete Task">
+ <svg xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 24 24" fill="currentColor" width="16"
+ height="16">
+ <path
+ d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z" />
</svg>
</button>
</div>
@@ -1291,9 +1392,11 @@
</div>
<!-- Task Detail View -->
- <div class="scheduler-detail-view" x-show="!isCreating && !isEditing && viewMode === 'detail' && selectedTaskForDetail">
+ <div class="scheduler-detail-view"
+ x-show="!isCreating && !isEditing && viewMode === 'detail' && selectedTaskForDetail">
<div class="scheduler-detail-header">
- <h2 class="scheduler-detail-title" x-text="selectedTaskForDetail ? selectedTaskForDetail.name : ''"></h2>
+ <h2 class="scheduler-detail-title"
+ x-text="selectedTaskForDetail ? selectedTaskForDetail.name : ''"></h2>
<div class="scheduler-status-badge"
:class="selectedTaskForDetail ? getStateBadgeClass(selectedTaskForDetail.state) : ''"
x-text="selectedTaskForDetail ? selectedTaskForDetail.state : ''">
@@ -1304,74 +1407,113 @@
<div class="scheduler-detail-content">
<div class="scheduler-details-grid">
<div class="scheduler-details-label">Type:</div>
- <div class="scheduler-details-value" x-text="selectedTaskForDetail ? selectedTaskForDetail.type : ''"></div>
+ <div class="scheduler-details-value"
+ x-text="selectedTaskForDetail ? selectedTaskForDetail.type : ''"></div>
<div class="scheduler-details-label">Created:</div>
- <div class="scheduler-details-value" x-text="selectedTaskForDetail ? formatDate(selectedTaskForDetail.created_at) : ''"></div>
+ <div class="scheduler-details-value"
+ x-text="selectedTaskForDetail ? formatDate(selectedTaskForDetail.created_at) : ''">
+ </div>
<div class="scheduler-details-label">Last Updated:</div>
- <div class="scheduler-details-value" x-text="selectedTaskForDetail ? formatDate(selectedTaskForDetail.updated_at) : ''"></div>
+ <div class="scheduler-details-value"
+ x-text="selectedTaskForDetail ? formatDate(selectedTaskForDetail.updated_at) : ''">
+ </div>
<div class="scheduler-details-label">Last Run:</div>
- <div class="scheduler-details-value" x-text="selectedTaskForDetail ? formatDate(selectedTaskForDetail.last_run) : ''"></div>
-
- <div class="scheduler-details-label" x-show="selectedTaskForDetail && selectedTaskForDetail.type === 'scheduled'">Schedule:</div>
- <div class="scheduler-details-value" x-show="selectedTaskForDetail && selectedTaskForDetail.type === 'scheduled'" x-text="selectedTaskForDetail ? formatSchedule(selectedTaskForDetail) : ''"></div>
+ <div class="scheduler-details-value"
+ x-text="selectedTaskForDetail ? formatDate(selectedTaskForDetail.last_run) : ''">
+ </div>
- <div class="scheduler-details-label" x-show="selectedTaskForDetail && selectedTaskForDetail.type === 'adhoc'">Token:</div>
- <div class="scheduler-details-value" x-show="selectedTaskForDetail && selectedTaskForDetail.type === 'adhoc'" x-text="selectedTaskForDetail ? selectedTaskForDetail.token : ''"></div>
+ <div class="scheduler-details-label"
+ x-show="selectedTaskForDetail && selectedTaskForDetail.type === 'scheduled'">
+ Schedule:</div>
+ <div class="scheduler-details-value"
+ x-show="selectedTaskForDetail && selectedTaskForDetail.type === 'scheduled'"
+ x-text="selectedTaskForDetail ? formatSchedule(selectedTaskForDetail) : ''">
+ </div>
- <div class="scheduler-details-label" x-show="selectedTaskForDetail && selectedTaskForDetail.type === 'planned'">Plan:</div>
- <div class="scheduler-details-value" x-show="selectedTaskForDetail && selectedTaskForDetail.type === 'planned'">
+ <div class="scheduler-details-label"
+ x-show="selectedTaskForDetail && selectedTaskForDetail.type === 'adhoc'">
+ Token:</div>
+ <div class="scheduler-details-value"
+ x-show="selectedTaskForDetail && selectedTaskForDetail.type === 'adhoc'"
+ x-text="selectedTaskForDetail ? selectedTaskForDetail.token : ''"></div>
+
+ <div class="scheduler-details-label"
+ x-show="selectedTaskForDetail && selectedTaskForDetail.type === 'planned'">
+ Plan:</div>
+ <div class="scheduler-details-value"
+ x-show="selectedTaskForDetail && selectedTaskForDetail.type === 'planned'">
<div x-show="selectedTaskForDetail && selectedTaskForDetail.plan">
<div><strong>Upcoming:</strong></div>
- <template x-if="selectedTaskForDetail && selectedTaskForDetail.plan && selectedTaskForDetail.plan.todo && selectedTaskForDetail.plan.todo.length > 0">
+ <template
+ x-if="selectedTaskForDetail && selectedTaskForDetail.plan && selectedTaskForDetail.plan.todo && selectedTaskForDetail.plan.todo.length > 0">
<div>
- <template x-for="(time, index) in selectedTaskForDetail.plan.todo" :key="index">
+ <template
+ x-for="(time, index) in selectedTaskForDetail.plan.todo"
+ :key="index">
<div x-text="formatDate(time)"></div>
</template>
</div>
</template>
- <template x-if="!selectedTaskForDetail || !selectedTaskForDetail.plan || !selectedTaskForDetail.plan.todo || selectedTaskForDetail.plan.todo.length === 0">
+ <template
+ x-if="!selectedTaskForDetail || !selectedTaskForDetail.plan || !selectedTaskForDetail.plan.todo || selectedTaskForDetail.plan.todo.length === 0">
<div>No upcoming executions</div>
</template>
<div><strong>In Progress:</strong></div>
- <div x-text="selectedTaskForDetail && selectedTaskForDetail.plan && selectedTaskForDetail.plan.in_progress ? formatDate(selectedTaskForDetail.plan.in_progress) : 'None'"></div>
+ <div
+ x-text="selectedTaskForDetail && selectedTaskForDetail.plan && selectedTaskForDetail.plan.in_progress ? formatDate(selectedTaskForDetail.plan.in_progress) : 'None'">
+ </div>
<div><strong>Completed:</strong></div>
- <template x-if="selectedTaskForDetail && selectedTaskForDetail.plan && selectedTaskForDetail.plan.done && selectedTaskForDetail.plan.done.length > 0">
+ <template
+ x-if="selectedTaskForDetail && selectedTaskForDetail.plan && selectedTaskForDetail.plan.done && selectedTaskForDetail.plan.done.length > 0">
<div>
- <template x-for="(time, index) in selectedTaskForDetail.plan.done" :key="index">
+ <template
+ x-for="(time, index) in selectedTaskForDetail.plan.done"
+ :key="index">
<div x-text="formatDate(time)"></div>
</template>
</div>
</template>
- <template x-if="!selectedTaskForDetail || !selectedTaskForDetail.plan || !selectedTaskForDetail.plan.done || selectedTaskForDetail.plan.done.length === 0">
+ <template
+ x-if="!selectedTaskForDetail || !selectedTaskForDetail.plan || !selectedTaskForDetail.plan.done || selectedTaskForDetail.plan.done.length === 0">
<div>No completed executions</div>
</template>
</div>
</div>
<div class="scheduler-details-label">Last Result:</div>
- <div class="scheduler-details-value" x-text="selectedTaskForDetail && selectedTaskForDetail.last_result ? selectedTaskForDetail.last_result : 'No results yet'"></div>
+ <div class="scheduler-details-value"
+ x-text="selectedTaskForDetail && selectedTaskForDetail.last_result ? selectedTaskForDetail.last_result : 'No results yet'">
+ </div>
<div class="scheduler-details-label">System Prompt:</div>
- <div class="scheduler-details-value" x-text="selectedTaskForDetail ? selectedTaskForDetail.system_prompt : ''"></div>
+ <div class="scheduler-details-value"
+ x-text="selectedTaskForDetail ? selectedTaskForDetail.system_prompt : ''">
+ </div>
<div class="scheduler-details-label">User Prompt:</div>
- <div class="scheduler-details-value" x-text="selectedTaskForDetail ? selectedTaskForDetail.prompt : ''"></div>
+ <div class="scheduler-details-value"
+ x-text="selectedTaskForDetail ? selectedTaskForDetail.prompt : ''">
+ </div>
<div class="scheduler-details-label">Attachments:</div>
<div class="scheduler-details-value">
- <template x-if="selectedTaskForDetail && selectedTaskForDetail.attachments && selectedTaskForDetail.attachments.length > 0">
+ <template
+ x-if="selectedTaskForDetail && selectedTaskForDetail.attachments && selectedTaskForDetail.attachments.length > 0">
<div>
- <template x-for="(attachment, index) in selectedTaskForDetail.attachments" :key="index">
+ <template
+ x-for="(attachment, index) in selectedTaskForDetail.attachments"
+ :key="index">
<div x-text="attachment"></div>
</template>
</div>
</template>
- <template x-if="!selectedTaskForDetail || !selectedTaskForDetail.attachments || selectedTaskForDetail.attachments.length === 0">
+ <template
+ x-if="!selectedTaskForDetail || !selectedTaskForDetail.attachments || selectedTaskForDetail.attachments.length === 0">
<div>No attachments</div>
</template>
</div>
@@ -1551,14 +1693,18 @@
<!-- Add toolbar -->
<div class="editor-toolbar">
<div class="toolbar-group">
- <button class="toolbar-button" @click="undo()" :disabled="!canUndo" title="Undo (Ctrl+Z)">
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
+ <button class="toolbar-button" @click="undo()" :disabled="!canUndo"
+ title="Undo (Ctrl+Z)">
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"
+ stroke="currentColor" stroke-width="2">
<path d="M3 7v6h6"></path>
<path d="M21 17a9 9 0 00-9-9 9 9 0 00-6 2.3L3 13"></path>
</svg>
</button>
- <button class="toolbar-button" @click="redo()" :disabled="!canRedo" title="Redo (Ctrl+Shift+Z)">
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
+ <button class="toolbar-button" @click="redo()" :disabled="!canRedo"
+ title="Redo (Ctrl+Shift+Z)">
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"
+ stroke="currentColor" stroke-width="2">
<path d="M21 7v6h-6"></path>
<path d="M3 17a9 9 0 019-9 9 9 0 016 2.3l3 2.7"></path>
</svg>
@@ -1566,24 +1712,27 @@
</div>
<div class="toolbar-group">
<button class="toolbar-button" @click="clearText()" title="Clear Text">
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
- <path d="M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"></path>
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"
+ stroke="currentColor" stroke-width="2">
+ <path
+ d="M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2">
+ </path>
<line x1="10" y1="11" x2="10" y2="17"></line>
<line x1="14" y1="11" x2="14" y2="17"></line>
</svg>
</button>
- <button class="toolbar-button" @click="toggleWrap()" :class="{ active: wordWrap }" title="Toggle Word Wrap">
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
+ <button class="toolbar-button" @click="toggleWrap()" :class="{ active: wordWrap }"
+ title="Toggle Word Wrap">
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"
+ stroke="currentColor" stroke-width="2">
<path d="M3 6h18M3 12h15l3 3-3 3M3 18h18"></path>
</svg>
</button>
</div>
</div>
- <textarea id="full-screen-input" x-model="inputText"
- placeholder="Type your message here..."
- @keydown.ctrl.enter="handleClose()"
- @keydown.ctrl.z.prevent="undo()"
+ <textarea id="full-screen-input" x-model="inputText" placeholder="Type your message here..."
+ @keydown.ctrl.enter="handleClose()" @keydown.ctrl.z.prevent="undo()"
@keydown.ctrl.shift.z.prevent="redo()"
:style="{ 'white-space': wordWrap ? 'pre-wrap' : 'pre' }"
@input="updateHistory()"></textarea>
@@ -1603,17 +1752,17 @@
<!-- Register Service Worker for offline support and caching -->
<script>
- if ('serviceWorker' in navigator) {
- window.addEventListener('load', () => {
- navigator.serviceWorker.register('js/sw.js').then(registration => {
- console.log('SW registered: ', registration);
- }).catch(registrationError => {
- console.log('SW registration failed: ', registrationError);
- });
- });
- }
+ if ('serviceWorker' in navigator) {
+ window.addEventListener('load', () => {
+ navigator.serviceWorker.register('js/sw.js').then(registration => {
+ console.log('SW registered: ', registration);
+ }).catch(registrationError => {
+ console.log('SW registration failed: ', registrationError);
+ });
+ });
+ }
</script>
</body>
-</html>
+</html>
\ No newline at end of file