1use proc_macro::TokenStream;
16use syn::DeriveInput;
17
18use crate::transaction::golem_operation_impl;
19
20mod agentic;
21mod transaction;
22mod value;
23
24#[proc_macro_derive(IntoValue, attributes(flatten_value, unit_case))]
25pub fn derive_into_value(input: TokenStream) -> TokenStream {
26 let ast: DeriveInput = syn::parse(input).expect("derive input");
27
28 value::derive_into_value(&ast)
29}
30
31#[proc_macro_derive(FromValueAndType, attributes(flatten_value, unit_case))]
32pub fn derive_from_value_and_type(input: TokenStream) -> TokenStream {
33 let ast: DeriveInput = syn::parse(input).expect("derive input");
34 value::derive_from_value_and_type(&ast)
35}
36
37#[proc_macro_derive(Schema)]
38pub fn derive_schema(input: TokenStream) -> TokenStream {
39 agentic::derive_schema(input)
40}
41
42#[proc_macro_attribute]
44pub fn golem_operation(attr: TokenStream, item: TokenStream) -> TokenStream {
45 golem_operation_impl(attr, item)
46}
47
48#[proc_macro_attribute]
49pub fn agent_definition(attr: TokenStream, item: TokenStream) -> TokenStream {
50 agentic::agent_definition_impl(attr, item)
51}
52
53#[proc_macro_attribute]
54pub fn agent_implementation(attr: TokenStream, item: TokenStream) -> TokenStream {
55 agentic::agent_implementation_impl(attr, item)
56}