feat: personal notes, each person's standing instructions for how Jarvis answers them
A personalNotes tool (add, list, delete the asker's own notes) offered only with a notes backend. The app keeps the notes in config/notes.json and sends the asker's with every voice, chat and task reply; the reply engine puts them in a <person_notes> fence as that person's preferences, which never permit an action or a tool. The worker's schedule bridge becomes a shared app bridge for schedule_action and note_action. A 사람별 지침 screen edits and deletes any note; features.notes turns the tool and the notes off. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -150,7 +150,7 @@ async fn audio_and_tts_round_trip_through_the_python_server() {
|
||||
// app's store answers; a scheduled task comes back as text.
|
||||
let data = std::env::temp_dir().join(format!("jarvis-proto-schedule-{}", std::process::id()));
|
||||
let store = jarvis_app::schedule::Store::new(&data);
|
||||
assert!(c.reply_in("c1", 42, "예약해 줘", "chat", false, Some(77)));
|
||||
assert!(c.reply_in("c1", 42, "예약해 줘", "chat", false, Some(77), &[]));
|
||||
let text = tokio::time::timeout(Duration::from_secs(5), async {
|
||||
loop {
|
||||
match rx.recv().await.unwrap() {
|
||||
@@ -169,7 +169,7 @@ async fn audio_and_tts_round_trip_through_the_python_server() {
|
||||
assert_eq!(text, "scheduled 1");
|
||||
let kept = store.all().unwrap();
|
||||
assert_eq!((kept[0].user, kept[0].channel, kept[0].repeat.as_str()), (42, Some(77), "daily"));
|
||||
assert!(c.reply("t1", 42, "날씨", "task", false));
|
||||
assert!(c.reply_in("t1", 42, "날씨", "task", false, None, &["섭씨로".to_string()]));
|
||||
let task = tokio::time::timeout(Duration::from_secs(5), async {
|
||||
loop {
|
||||
if let WorkerEvent::ReplyText { id, text, failed } = rx.recv().await.unwrap() {
|
||||
@@ -181,7 +181,26 @@ async fn audio_and_tts_round_trip_through_the_python_server() {
|
||||
})
|
||||
.await
|
||||
.expect("task answer");
|
||||
assert_eq!(task, ("task: 날씨".to_string(), false));
|
||||
assert_eq!(task, ("task: 날씨 notes=섭씨로".to_string(), false));
|
||||
// The personalNotes tool's actions come to the app's notes store for the asker.
|
||||
let notes = jarvis_app::notes::Notes::new(&data);
|
||||
assert!(c.reply("n1", 42, "지침 저장해 줘", "voice", false));
|
||||
let noted = tokio::time::timeout(Duration::from_secs(5), async {
|
||||
loop {
|
||||
match rx.recv().await.unwrap() {
|
||||
WorkerEvent::NoteAction(a) => {
|
||||
assert_eq!((a.action.as_str(), a.user.as_str()), ("add", "42"));
|
||||
c.note_action_result(&a.id, jarvis_app::notes::act(¬es, &a, "가", 1000));
|
||||
}
|
||||
WorkerEvent::ReplyText { id, text, .. } if id == "n1" => return text,
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
})
|
||||
.await
|
||||
.expect("note round trip");
|
||||
assert_eq!(noted, "noted 1");
|
||||
assert_eq!(notes.texts_of(42), vec!["반말로 해".to_string()]);
|
||||
let _ = std::fs::remove_dir_all(&data);
|
||||
c.close();
|
||||
let _ = child.kill().await;
|
||||
|
||||
Reference in New Issue
Block a user