feat(hololake): add typed persona interaction runtime
This commit is contained in:
parent
e5b10e227f
commit
b35e0d6524
24 changed files with 1614 additions and 58 deletions
|
|
@ -90,12 +90,24 @@ pub fn event(
|
|||
TimelineEvent {
|
||||
event_id: id("HL-EVT"),
|
||||
source_kind: kind,
|
||||
actor_id: None,
|
||||
title: title.into(),
|
||||
content: content.into(),
|
||||
occurred_at: now(),
|
||||
state: state.into(),
|
||||
}
|
||||
}
|
||||
pub fn actor_event(
|
||||
kind: SourceKind,
|
||||
actor_id: impl Into<String>,
|
||||
title: impl Into<String>,
|
||||
content: impl Into<String>,
|
||||
state: &str,
|
||||
) -> TimelineEvent {
|
||||
let mut event = event(kind, title, content, state);
|
||||
event.actor_id = Some(actor_id.into());
|
||||
event
|
||||
}
|
||||
pub fn append_event(app: &AppHandle, e: &TimelineEvent) -> Result<(), String> {
|
||||
let p = root(app)?.join("events.jsonl");
|
||||
let mut s = if p.exists() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue