Server side implementation for interactive entry edits

This commit is contained in:
2024-11-23 15:34:33 +01:00
parent bb74fd3621
commit dbc0068a82
28 changed files with 749 additions and 553 deletions

View File

@@ -14,7 +14,7 @@ from sia.base_agent import BaseAgent
from sia.command import Command
from sia.command_result import CommandResult
from sia.reasoning_entry import ReasoningEntry
from sia.parse_error_entry import ParseErrorEntry
from sia.entry.parse_error_entry import ParseErrorEntry
from sia.delete_command import DeleteCommand
from sia.entry import Entry

View File

@@ -1,7 +1,7 @@
import unittest
from datetime import datetime
from sia.parse_error_entry import ParseErrorEntry
from sia.entry.parse_error_entry import ParseErrorEntry
class ParseErrorEntryTest(unittest.TestCase):
def setUp(self):

View File

@@ -7,12 +7,12 @@ from sia.delete_command import DeleteCommand
from sia.stop_command import StopCommand
from sia.entry import Entry
from sia.background_entry import BackgroundEntry
from sia.parse_error_entry import ParseErrorEntry
from sia.entry.parse_error_entry import ParseErrorEntry
from sia.read_entry import ReadEntry
from sia.reasoning_entry import ReasoningEntry
from sia.repeat_entry import RepeatEntry
from sia.single_entry import SingleEntry
from sia.write_entry import WriteEntry
from sia.entry.write_entry import WriteEntry
from sia.web_io_buffer import WebIOBuffer
from sia.response_parser import ResponseParser

View File

@@ -16,7 +16,7 @@ from sia.web_agent import WebAgent, WebAgentState
from sia.command import Command
from sia.command_result import CommandResult
from sia.reasoning_entry import ReasoningEntry
from sia.parse_error_entry import ParseErrorEntry
from sia.entry.parse_error_entry import ParseErrorEntry
from sia.entry import Entry
class MockCommand(Command):

View File

@@ -6,12 +6,12 @@ import xml.etree.ElementTree as ET
from sia.background_entry import BackgroundEntry
from sia.entry import Entry
from sia.parse_error_entry import ParseErrorEntry
from sia.entry.parse_error_entry import ParseErrorEntry
from sia.read_entry import ReadEntry
from sia.reasoning_entry import ReasoningEntry
from sia.web_io_buffer import WebIOBuffer
from sia.working_memory import WorkingMemory
from sia.write_entry import WriteEntry
from sia.entry.write_entry import WriteEntry
class MockEntry(Entry):

View File

@@ -2,7 +2,7 @@ import unittest
from datetime import datetime
from sia.web_io_buffer import WebIOBuffer
from sia.write_entry import WriteEntry
from sia.entry.write_entry import WriteEntry
class WriteEntryTest(unittest.TestCase):
def setUp(self):
@@ -19,7 +19,7 @@ class WriteEntryTest(unittest.TestCase):
self.assertEqual(entry.content, content)
self.assertEqual(entry.id, self.test_id)
self.assertEqual(entry.timestamp, self.test_timestamp)
self.assertFalse(entry._written)
self.assertFalse(entry.written)
self.assertEqual(self.io_buffer.get_stdout(), "")
def test_single_write(self):
@@ -30,7 +30,7 @@ class WriteEntryTest(unittest.TestCase):
# Perform update and verify content was written
entry.update()
self.assertEqual(self.io_buffer.get_stdout(), content)
self.assertTrue(entry._written)
self.assertTrue(entry.written)
def test_multiple_updates(self):
"""Test that content is only written once even with multiple updates"""
@@ -47,7 +47,7 @@ class WriteEntryTest(unittest.TestCase):
# Verify no additional content was written
self.assertEqual(self.io_buffer.get_stdout(), "")
self.assertTrue(entry._written)
self.assertTrue(entry.written)
self.assertEqual(initial_output, content)
def test_empty_content(self):
@@ -56,7 +56,7 @@ class WriteEntryTest(unittest.TestCase):
entry.update()
self.assertEqual(self.io_buffer.get_stdout(), "")
self.assertTrue(entry._written)
self.assertTrue(entry.written)
def test_special_characters(self):
"""Test writing content with special characters"""