feat(app): an activity log of what Jarvis did (chat actions, schedule deliveries)
Each chat channel action the brain's tool asked for and each schedule delivery is recorded in activity/<day>.jsonl by kind, target, who asked and outcome, never its text, kept 30 days. The worker's chat_action carries the asker. A 한 일 screen lists the newest entries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -349,7 +349,7 @@ async fn discord_voice_core_on_real_discord() {
|
||||
// unpin, delete; a switch that is off is refused.
|
||||
let act = |action: &str, id: u64, text: Option<&str>, emoji: Option<&str>| jarvis_app::worker_client::ChatAction {
|
||||
id: "live".into(), action: action.into(), channel: voice.to_string(), message_id: Some(id.to_string()),
|
||||
text: text.map(Into::into), emoji: emoji.map(Into::into) };
|
||||
text: text.map(Into::into), emoji: emoji.map(Into::into), user: None };
|
||||
let tool_msg = format!("자비스 도구 시험 {}", stop_at.elapsed().as_nanos());
|
||||
let tid = core.send_chat(voice, &tool_msg).await.unwrap()[0];
|
||||
let edited_tool = format!("{tool_msg} 수정");
|
||||
|
||||
@@ -302,10 +302,10 @@ async fn chat_channels_go_out_and_chat_actions_come_back_with_their_results() {
|
||||
c.chat_channels(Some(900), &[ChatChannelSettings { id: 5, name: "일정".into(), description: "약속".into(),
|
||||
read: true, send: true, edit: true, react: true, delete: false, pin: false, answer_all: false, sync_discord: true }]);
|
||||
w.send(Message::text(json!({"type": "chat_action", "id": "a1", "action": "react", "channel": "5",
|
||||
"message_id": "77", "emoji": "👍"}).to_string()));
|
||||
"message_id": "77", "emoji": "👍", "user": "42"}).to_string()));
|
||||
let ev = next_matching(&mut rx, |e| matches!(e, WorkerEvent::ChatAction(_))).await;
|
||||
assert_eq!(ev, WorkerEvent::ChatAction(ChatAction { id: "a1".into(), action: "react".into(), channel: "5".into(),
|
||||
message_id: Some("77".into()), text: None, emoji: Some("👍".into()) }));
|
||||
message_id: Some("77".into()), text: None, emoji: Some("👍".into()), user: Some("42".into()) }));
|
||||
c.chat_action_result("a1", Ok(vec![77]));
|
||||
c.chat_action_result("a2", Err("send is turned off".into()));
|
||||
until(|| w.got().len() >= 4).await;
|
||||
|
||||
Reference in New Issue
Block a user