pub struct NodeEventStore { /* private fields */ }Expand description
OpenClaw event store wrapper for Node.js.
Provides append-only event storage for session events with CRDT projections for conflict-free state.
Implementations§
Source§impl NodeEventStore
impl NodeEventStore
pub fn into_reference( val: NodeEventStore, env: Env, ) -> Result<Reference<NodeEventStore>>
pub fn into_instance(self, env: Env) -> Result<ClassInstance<NodeEventStore>>
Source§impl NodeEventStore
impl NodeEventStore
Sourcepub fn append_event(
&self,
session_key: String,
agent_id: String,
event_type: String,
data: String,
) -> Result<String>
pub fn append_event( &self, session_key: String, agent_id: String, event_type: String, data: String, ) -> Result<String>
Append a session event and return the event ID.
§Arguments
session_key- The session keyagent_id- The agent IDevent_type- Event type: “session_started”, “message_received”, “message_sent”, “agent_response”, “session_ended”, “state_changed”, “tool_called”, “tool_result”data- JSON data for the event
Sourcepub fn get_events(&self, session_key: String) -> Result<String>
pub fn get_events(&self, session_key: String) -> Result<String>
Get all events for a session as JSON.
Sourcepub fn get_projection(&self, session_key: String) -> Result<String>
pub fn get_projection(&self, session_key: String) -> Result<String>
Get the session projection as JSON.
The projection is a materialized view of the session state derived from the event stream.
Sourcepub fn list_sessions(&self) -> Result<Vec<String>>
pub fn list_sessions(&self) -> Result<Vec<String>>
List all session keys.
Trait Implementations§
Source§impl FromNapiMutRef for NodeEventStore
impl FromNapiMutRef for NodeEventStore
Source§unsafe fn from_napi_mut_ref(
env: napi_env,
napi_val: napi_value,
) -> Result<&'static mut Self>
unsafe fn from_napi_mut_ref( env: napi_env, napi_val: napi_value, ) -> Result<&'static mut Self>
Safety Read more
Source§impl FromNapiRef for NodeEventStore
impl FromNapiRef for NodeEventStore
Source§unsafe fn from_napi_ref(
env: napi_env,
napi_val: napi_value,
) -> Result<&'static Self>
unsafe fn from_napi_ref( env: napi_env, napi_val: napi_value, ) -> Result<&'static Self>
Safety Read more
Source§impl FromNapiValue for &NodeEventStore
impl FromNapiValue for &NodeEventStore
Source§unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
Safety Read more
fn from_unknown(value: JsUnknown) -> Result<Self, Error>
Source§impl FromNapiValue for &mut NodeEventStore
impl FromNapiValue for &mut NodeEventStore
Source§unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
Safety Read more
fn from_unknown(value: JsUnknown) -> Result<Self, Error>
Source§impl ObjectFinalize for NodeEventStore
impl ObjectFinalize for NodeEventStore
Source§impl ToNapiValue for NodeEventStore
impl ToNapiValue for NodeEventStore
Source§unsafe fn to_napi_value(
env: napi_env,
val: NodeEventStore,
) -> Result<napi_value>
unsafe fn to_napi_value( env: napi_env, val: NodeEventStore, ) -> Result<napi_value>
Safety Read more
Source§impl TypeName for &NodeEventStore
impl TypeName for &NodeEventStore
Source§impl TypeName for &mut NodeEventStore
impl TypeName for &mut NodeEventStore
Source§impl TypeName for NodeEventStore
impl TypeName for NodeEventStore
Source§impl ValidateNapiValue for &NodeEventStore
impl ValidateNapiValue for &NodeEventStore
Source§unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
Safety Read more
Source§impl ValidateNapiValue for &mut NodeEventStore
impl ValidateNapiValue for &mut NodeEventStore
Source§unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
Safety Read more
Auto Trait Implementations§
impl Freeze for NodeEventStore
impl !RefUnwindSafe for NodeEventStore
impl Send for NodeEventStore
impl Sync for NodeEventStore
impl Unpin for NodeEventStore
impl !UnwindSafe for NodeEventStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more