| 
									
										
										
										
											2025-07-28 22:37:36 +00:00
										 |  |  | import * as plugins from './plugins.js'; | 
					
						
							| 
									
										
										
										
											2025-07-28 17:01:34 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-07-28 17:23:48 +00:00
										 |  |  | // Export all base types - these are the public API
 | 
					
						
							| 
									
										
										
										
											2025-07-28 17:07:24 +00:00
										 |  |  | export * from '../core_base/types.js'; | 
					
						
							| 
									
										
										
										
											2025-07-28 17:01:34 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-07-28 22:37:36 +00:00
										 |  |  | const smartenvInstance = new plugins.smartenv.Smartenv(); | 
					
						
							| 
									
										
										
										
											2025-07-28 17:01:34 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-07-28 22:37:36 +00:00
										 |  |  | // Dynamically load the appropriate implementation
 | 
					
						
							|  |  |  | let CoreRequest: any; | 
					
						
							|  |  |  | let CoreResponse: any; | 
					
						
							| 
									
										
										
										
											2025-07-28 17:07:24 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-07-28 22:37:36 +00:00
										 |  |  | if (smartenvInstance.isNode) { | 
					
						
							|  |  |  |   // In Node.js, load the node implementation
 | 
					
						
							|  |  |  |   const modulePath = plugins.smartpath.join( | 
					
						
							|  |  |  |     plugins.smartpath.dirname(import.meta.url), | 
					
						
							| 
									
										
										
										
											2025-08-18 00:21:14 +00:00
										 |  |  |     '../core_node/index.js', | 
					
						
							|  |  |  |   ); | 
					
						
							| 
									
										
										
										
											2025-07-28 22:37:36 +00:00
										 |  |  |   const impl = await smartenvInstance.getSafeNodeModule(modulePath); | 
					
						
							|  |  |  |   CoreRequest = impl.CoreRequest; | 
					
						
							|  |  |  |   CoreResponse = impl.CoreResponse; | 
					
						
							|  |  |  | } else { | 
					
						
							|  |  |  |   // In browser, load the fetch implementation
 | 
					
						
							|  |  |  |   const impl = await import('../core_fetch/index.js'); | 
					
						
							|  |  |  |   CoreRequest = impl.CoreRequest; | 
					
						
							|  |  |  |   CoreResponse = impl.CoreResponse; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2025-07-28 17:23:48 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-07-28 22:37:36 +00:00
										 |  |  | // Export the loaded implementations
 | 
					
						
							|  |  |  | export { CoreRequest, CoreResponse }; |