feat: chat
This commit is contained in:
@@ -23,6 +23,7 @@ class WakeScheduler:
|
||||
self.agent = None
|
||||
self.uex = None
|
||||
self.plan_runner = None
|
||||
self.negotiation_sync = None
|
||||
self.notification_poll_seconds = 60
|
||||
|
||||
def bind_agent(self, agent: Any) -> None:
|
||||
@@ -31,6 +32,9 @@ class WakeScheduler:
|
||||
def bind_plan_runner(self, plan_runner: Any) -> None:
|
||||
self.plan_runner = plan_runner
|
||||
|
||||
def bind_negotiation_sync(self, negotiation_sync: Any) -> None:
|
||||
self.negotiation_sync = negotiation_sync
|
||||
|
||||
def bind_uex_notifications(self, uex: Any, poll_seconds: int = 60) -> None:
|
||||
self.uex = uex
|
||||
self.notification_poll_seconds = max(15, poll_seconds)
|
||||
@@ -197,8 +201,11 @@ class WakeScheduler:
|
||||
new_pending = [item for item in pending if self._notification_key(item) not in seen]
|
||||
|
||||
if new_pending:
|
||||
for item in new_pending:
|
||||
self.memory.add_outbox(self._notification_text(item))
|
||||
if self.negotiation_sync is not None:
|
||||
await self.negotiation_sync.handle_notifications(new_pending)
|
||||
else:
|
||||
for item in new_pending:
|
||||
self.memory.add_outbox(self._notification_text(item))
|
||||
seen.update(self._notification_key(item) for item in new_pending)
|
||||
self.memory.set_profile("uex_seen_notification_keys", sorted(seen))
|
||||
self.memory.set_profile("uex_last_notification_check", iso_now())
|
||||
|
||||
Reference in New Issue
Block a user