MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / input

Function input

atomic-agent/tests/hook_timestamps.rs:9–26  ·  view source on GitHub ↗
(timestamp: Option<Value>)

Source from the content-addressed store, hash-verified

7use serde_json::{json, Value};
8
9fn input(timestamp: Option<Value>) -> Vec<u8> {
10 let mut raw = json!({
11 "session_id": "source-time",
12 "conversation_id": "source-time",
13 "taskId": "source-time",
14 "thread_id": "source-time",
15 "prompt": "Keep the source time",
16 "tool_name": "read",
17 "tool_use_id": "tool-1",
18 // These are user data, not the hook envelope's timestamp.
19 "tool_input": {"timestamp": "not an event timestamp"},
20 "extra": {"timestamp": "not an event timestamp"},
21 });
22 if let Some(timestamp) = timestamp {
23 raw["timestamp"] = timestamp;
24 }
25 serde_json::to_vec(&raw).unwrap()
26}
27
28fn source_timestamps(agent: &str) -> Vec<Value> {
29 match agent {

Calls 1

unwrapMethod · 0.45

Tested by

no test coverage detected