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(MultimodalSchema)]
38pub fn derive_multimodal(input: TokenStream) -> TokenStream {
39 agentic::derive_multimodal(input)
40}
41
42#[proc_macro_derive(Schema)]
43pub fn derive_schema(input: TokenStream) -> TokenStream {
44 agentic::derive_schema(input)
45}
46
47#[proc_macro_derive(AllowedLanguages, attributes(code))]
48pub fn derive_allowed_languages(input: TokenStream) -> TokenStream {
49 agentic::derive_allowed_languages(input)
50}
51
52#[proc_macro_derive(AllowedMimeTypes, attributes(mime_type))]
53pub fn derive_allowed_mimetypes(input: TokenStream) -> TokenStream {
54 agentic::derive_allowed_mime_types(input)
55}
56
57#[proc_macro_attribute]
59pub fn golem_operation(attr: TokenStream, item: TokenStream) -> TokenStream {
60 golem_operation_impl(attr, item)
61}
62
63#[proc_macro_attribute]
64pub fn agent_definition(attr: TokenStream, item: TokenStream) -> TokenStream {
65 agentic::agent_definition_impl(attr, item)
66}
67
68#[proc_macro_attribute]
69pub fn agent_implementation(attr: TokenStream, item: TokenStream) -> TokenStream {
70 agentic::agent_implementation_impl(attr, item)
71}