1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//! Message and tool-call ID generation helpers.
//!
//! Provides utilities for generating unique identifiers for messages
//! and tool calls within a workflow execution. These IDs enable:
//!
//! - Message correlation and threading
//! - Tool call tracking and response matching
//! - Audit trails and debugging
//!
//! # Thread Safety
//!
//! ID generators in this module ensure per-thread uniqueness to avoid
//! collisions in concurrent execution scenarios. The implementation
//! uses atomic counters combined with thread-local state for efficiency.
//!
//! # ID Formats
//!
//! Generated IDs follow predictable formats for parseability:
//!
//! - Message IDs: `msg-{session_id}-{step}-{counter}`
//! - Tool Call IDs: `tool-{node_id}-{step}-{counter}`
//!
//! # Future Implementation
//!
//! This module is currently a placeholder. Planned features include:
//!
//! - `MessageIdGenerator` struct with configurable prefixes
//! - `ToolCallIdGenerator` for tracking tool invocations
//! - Integration with `IdGenerator` for consistent ID semantics
//! - Parsing utilities to extract components from generated IDs
//!
//! # Example (Future API)
//!
//! ```rust,ignore
//! use weavegraph::utils::message_id_helpers::MessageIdGenerator;
//!
//! let generator = MessageIdGenerator::new("session-123");
//!
//! let msg_id = generator.next_message_id(1); // step 1
//! // msg_id = "msg-session-123-1-0"
//!
//! let tool_id = generator.next_tool_call_id("my_node", 1);
//! // tool_id = "tool-my_node-1-0"
//! ```
// Placeholder for future implementation