feat: Introduce event timeline and handler system

This commit is contained in:
2026-01-05 23:10:32 +09:00
parent 14db66e5b0
commit 6d6ae24ffe
10 changed files with 1208 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
[package]
name = "worker-macros"
version = "0.1.0"
edition = "2024"
[lib]
proc-macro = true
[dependencies]
proc-macro2 = "1"
quote = "1"
syn = { version = "2", features = ["full"] }
worker-types = { path = "../worker-types" }
+41
View File
@@ -0,0 +1,41 @@
//! worker-macros - LLMワーカー用のProcedural Macros
//!
//! このクレートはTools/Hooksを定義するためのマクロを提供する予定です。
//!
//! TODO: Tool定義マクロの実装
//! TODO: Hook定義マクロの実装
use proc_macro::TokenStream;
/// ツール定義マクロ(未実装)
///
/// # Example
/// ```ignore
/// #[tool(
/// name = "get_weather",
/// description = "Get weather information for a city"
/// )]
/// fn get_weather(city: String) -> Result<WeatherInfo, ToolError> {
/// // ...
/// }
/// ```
#[proc_macro_attribute]
pub fn tool(_attr: TokenStream, item: TokenStream) -> TokenStream {
// TODO: 実装
item
}
/// フック定義マクロ(未実装)
///
/// # Example
/// ```ignore
/// #[hook(on = "before_tool_call")]
/// fn log_tool_call(tool_name: &str) {
/// println!("Calling tool: {}", tool_name);
/// }
/// ```
#[proc_macro_attribute]
pub fn hook(_attr: TokenStream, item: TokenStream) -> TokenStream {
// TODO: 実装
item
}