1pub mod types;
10
11pub use types::*;
12
13pub mod benchmarks;
17pub mod connector;
18pub mod engine;
19pub mod protocol_generator;
20
21use crate::error::Error;
22
23#[derive(Debug, Clone)]
27pub struct M2IntegrationService {
28 config: M2Config,
29 integration_config: M2IntegrationConfig,
30}
31
32impl M2IntegrationService {
33 pub async fn new(
35 config: M2Config,
36 integration_config: M2IntegrationConfig,
37 ) -> Result<Self, Error> {
38 Ok(Self {
39 config,
40 integration_config,
41 })
42 }
43
44 pub async fn execute_for_use_case(
48 &self,
49 _use_case: UseCase,
50 _input: ProtocolInput,
51 _framework: Option<AgentFramework>,
52 ) -> Result<InterleavedResult, Error> {
53 let _ = (&self.config, &self.integration_config);
54 Err(Error::M2ExecutionError(
55 "M2 integration is not implemented in this build".to_string(),
56 ))
57 }
58
59 pub fn classify_use_case(
61 &self,
62 use_case: UseCase,
63 _input: &ProtocolInput,
64 ) -> Result<TaskClassification, Error> {
65 Ok(TaskClassification::from(use_case))
66 }
67}
68
69#[derive(Debug, Clone)]
71pub struct M2ServiceBuilder {
72 config: Option<M2Config>,
73 integration_config: Option<M2IntegrationConfig>,
74}
75
76impl M2ServiceBuilder {
77 pub fn new() -> Self {
78 Self {
79 config: None,
80 integration_config: None,
81 }
82 }
83
84 pub fn with_config(mut self, config: M2Config) -> Self {
85 self.config = Some(config);
86 self
87 }
88
89 pub fn with_integration_config(mut self, integration_config: M2IntegrationConfig) -> Self {
90 self.integration_config = Some(integration_config);
91 self
92 }
93
94 pub async fn build(self) -> Result<M2IntegrationService, Error> {
95 let config = self.config.unwrap_or_default();
96 let integration_config = self.integration_config.unwrap_or_default();
97 M2IntegrationService::new(config, integration_config).await
98 }
99}
100
101impl Default for M2ServiceBuilder {
102 fn default() -> Self {
103 Self::new()
104 }
105}