greentic_interfaces/
wit_all.rs

1#![cfg(not(target_arch = "wasm32"))]
2//! Unified Wasmtime bindings for every WIT world shipped with this crate.
3#![allow(clippy::all)]
4#![allow(missing_docs)]
5#![allow(unused_macros)]
6
7macro_rules! declare_world {
8    (
9        mod $mod_name:ident,
10        path = $path_literal:literal,
11        world = $world_literal:literal
12        $(, legacy = { $($legacy:item)* } )?
13    ) => {
14        pub mod $mod_name {
15            mod bindings {
16                wasmtime::component::bindgen!({
17                    path: $path_literal,
18                    world: $world_literal,
19                });
20            }
21
22            #[allow(unused_imports)]
23            pub use bindings::*;
24
25            $(
26                $($legacy)*
27            )?
28        }
29    };
30}
31
32#[cfg(feature = "describe-v1")]
33declare_world!(
34    mod component_describe_v1,
35    path = "wit/greentic/component@1.0.0",
36    world = "greentic:component/component@1.0.0",
37    legacy = {
38        /// Canonical package identifier.
39        pub const PACKAGE_ID: &str = "greentic:component@1.0.0";
40    }
41);
42
43#[cfg(feature = "component-v0-4")]
44declare_world!(
45    mod component_v0_4,
46    path = "wit/greentic/component@0.4.0",
47    world = "greentic:component/component@0.4.0",
48    legacy = {
49        use anyhow::Result as AnyResult;
50        use wasmtime::component::{Component as WasmtimeComponent, Linker};
51        use wasmtime::StoreContextMut;
52
53        pub use bindings::greentic::component::control::Host as ControlHost;
54
55        /// Registers the Greentic control interface with the provided linker.
56        pub fn add_control_to_linker<T>(
57            linker: &mut Linker<T>,
58            get_host: impl Fn(&mut T) -> &mut (dyn ControlHost + Send + Sync + 'static)
59                + Send
60                + Sync
61                + Copy
62                + 'static,
63        ) -> wasmtime::Result<()>
64        where
65            T: Send + 'static,
66        {
67            let mut inst = linker.instance("greentic:component/control@0.4.0")?;
68
69            inst.func_wrap(
70                "should-cancel",
71                move |mut caller: StoreContextMut<'_, T>, (): ()| {
72                    let host = get_host(caller.data_mut());
73                    let result = host.should_cancel();
74                    Ok((result,))
75                },
76            )?;
77
78            inst.func_wrap(
79                "yield-now",
80                move |mut caller: StoreContextMut<'_, T>, (): ()| {
81                    let host = get_host(caller.data_mut());
82                    host.yield_now();
83                    Ok(())
84                },
85            )?;
86
87            Ok(())
88        }
89
90        /// Back-compat shim for instantiating the component.
91        pub struct Component;
92
93        impl Component {
94            /// Loads the component from raw bytes, mirroring the old helper.
95            pub fn instantiate(
96                engine: &wasmtime::Engine,
97                component_wasm: &[u8],
98            ) -> AnyResult<WasmtimeComponent> {
99                Ok(WasmtimeComponent::from_binary(engine, component_wasm)?)
100            }
101        }
102
103        /// Canonical package identifier.
104        pub const PACKAGE_ID: &str = "greentic:component@0.4.0";
105    }
106);
107
108#[cfg(feature = "pack-export-v0-4")]
109declare_world!(
110    mod pack_export_v0_4,
111    path = "wit/greentic/pack-export@0.4.0",
112    world = "greentic:pack-export/pack-exports@0.4.0",
113    legacy = {
114        /// Canonical package identifier.
115        pub const PACKAGE_ID: &str = "greentic:pack-export@0.4.0";
116    }
117);
118
119#[cfg(feature = "types-core-v0-4")]
120declare_world!(
121    mod types_core_v0_4,
122    path = "wit/greentic/types-core@0.4.0",
123    world = "greentic:types-core/core@0.4.0",
124    legacy = {
125        /// Canonical package identifier.
126        pub const PACKAGE_ID: &str = "greentic:types-core@0.4.0";
127    }
128);
129
130#[cfg(feature = "host-import-v0-6")]
131declare_world!(
132    mod host_import_v0_6,
133    path = "wit/greentic/host-import@0.6.0",
134    world = "greentic:host-import/host-imports@0.6.0",
135    legacy = {
136        use wasmtime::component::Linker;
137        use wasmtime::{Result, StoreContextMut};
138
139        pub use bindings::greentic::host_import::{http, mcp, secrets, session, state, telemetry};
140        pub use bindings::greentic::interfaces_types::types as iface_types;
141        pub use bindings::greentic::types_core::types;
142
143        /// Trait implemented by hosts to service the component imports.
144        pub trait HostImports {
145            fn secrets_get(
146                &mut self,
147                key: String,
148                ctx: Option<types::TenantCtx>,
149            ) -> Result<Result<String, types::IfaceError>>;
150
151            fn telemetry_emit(
152                &mut self,
153                span_json: String,
154                ctx: Option<types::TenantCtx>,
155            ) -> Result<()>;
156
157            fn http_fetch(
158                &mut self,
159                req: http::HttpRequest,
160                ctx: Option<types::TenantCtx>,
161            ) -> Result<Result<http::HttpResponse, types::IfaceError>>;
162
163            fn mcp_exec(
164                &mut self,
165                component: String,
166                action: String,
167                args_json: String,
168                ctx: Option<types::TenantCtx>,
169            ) -> Result<Result<String, types::IfaceError>>;
170
171            fn state_get(
172                &mut self,
173                key: iface_types::StateKey,
174                ctx: Option<types::TenantCtx>,
175            ) -> Result<Result<String, types::IfaceError>>;
176
177            fn state_set(
178                &mut self,
179                key: iface_types::StateKey,
180                value_json: String,
181                ctx: Option<types::TenantCtx>,
182            ) -> Result<Result<state::OpAck, types::IfaceError>>;
183
184            fn session_update(
185                &mut self,
186                cursor: iface_types::SessionCursor,
187                ctx: Option<types::TenantCtx>,
188            ) -> Result<Result<String, types::IfaceError>>;
189        }
190
191        /// Registers the host import functions with the provided linker.
192        pub fn add_to_linker<T>(
193            linker: &mut Linker<T>,
194            get_host: impl Fn(&mut T) -> &mut (dyn HostImports + Send + Sync + 'static)
195                + Send
196                + Sync
197                + Copy
198                + 'static,
199        ) -> Result<()>
200        where
201            T: Send + 'static,
202        {
203            let mut secrets = linker.instance("greentic:host-import/secrets@0.6.0")?;
204            secrets.func_wrap(
205                "get",
206                move |mut caller: StoreContextMut<'_, T>, (key, ctx): (String, Option<types::TenantCtx>)| {
207                    let host = get_host(caller.data_mut());
208                    host.secrets_get(key, ctx).map(|res| (res,))
209                },
210            )?;
211
212            let mut telemetry = linker.instance("greentic:host-import/telemetry@0.6.0")?;
213            telemetry.func_wrap(
214                "emit",
215                move |mut caller: StoreContextMut<'_, T>, (span, ctx): (String, Option<types::TenantCtx>)| {
216                    let host = get_host(caller.data_mut());
217                    host.telemetry_emit(span, ctx)
218                },
219            )?;
220
221            let mut http_iface = linker.instance("greentic:host-import/http@0.6.0")?;
222            http_iface.func_wrap(
223                "fetch",
224                move |mut caller: StoreContextMut<'_, T>, (req, ctx): (http::HttpRequest, Option<types::TenantCtx>)| {
225                    let host = get_host(caller.data_mut());
226                    host.http_fetch(req, ctx).map(|res| (res,))
227                },
228            )?;
229
230            let mut mcp_iface = linker.instance("greentic:host-import/mcp@0.6.0")?;
231            mcp_iface.func_wrap(
232                "exec",
233                move |mut caller: StoreContextMut<'_, T>,
234                      (component, action, args, ctx): (String, String, String, Option<types::TenantCtx>)| {
235                    let host = get_host(caller.data_mut());
236                    host.mcp_exec(component, action, args, ctx).map(|res| (res,))
237                },
238            )?;
239
240            let mut state_iface = linker.instance("greentic:host-import/state@0.6.0")?;
241            state_iface.func_wrap(
242                "get",
243                move |mut caller: StoreContextMut<'_, T>,
244                      (key, ctx): (iface_types::StateKey, Option<types::TenantCtx>)| {
245                    let host = get_host(caller.data_mut());
246                    host.state_get(key, ctx).map(|res| (res,))
247                },
248            )?;
249            state_iface.func_wrap(
250                "set",
251                move |mut caller: StoreContextMut<'_, T>,
252                      (key, value, ctx): (iface_types::StateKey, String, Option<types::TenantCtx>)| {
253                    let host = get_host(caller.data_mut());
254                    host.state_set(key, value, ctx).map(|res| (res,))
255                },
256            )?;
257
258            let mut session_iface = linker.instance("greentic:host-import/session@0.6.0")?;
259            session_iface.func_wrap(
260                "update",
261                move |mut caller: StoreContextMut<'_, T>,
262                      (cursor, ctx): (iface_types::SessionCursor, Option<types::TenantCtx>)| {
263                    let host = get_host(caller.data_mut());
264                    host.session_update(cursor, ctx).map(|res| (res,))
265                },
266            )?;
267
268            Ok(())
269        }
270
271        /// Canonical package identifier.
272        pub const PACKAGE_ID: &str = "greentic:host-import@0.6.0";
273    }
274);
275
276#[cfg(feature = "host-import-v0-4")]
277declare_world!(
278    mod host_import_v0_4,
279    path = "wit/greentic/host-import@0.4.0",
280    world = "greentic:host-import/host-imports@0.4.0",
281    legacy = {
282        use wasmtime::component::Linker;
283        use wasmtime::{Result, StoreContextMut};
284
285        pub use bindings::greentic::host_import::{http, secrets, telemetry};
286        pub use bindings::greentic::types_core::types;
287
288        /// Trait implemented by hosts to service the component imports.
289        pub trait HostImports {
290            fn secrets_get(
291                &mut self,
292                key: String,
293                ctx: Option<types::TenantCtx>,
294            ) -> Result<Result<String, types::IfaceError>>;
295
296            fn telemetry_emit(
297                &mut self,
298                span_json: String,
299                ctx: Option<types::TenantCtx>,
300            ) -> Result<()>;
301
302            fn http_fetch(
303                &mut self,
304                req: http::HttpRequest,
305                ctx: Option<types::TenantCtx>,
306            ) -> Result<Result<http::HttpResponse, types::IfaceError>>;
307        }
308
309        /// Registers the host import functions with the provided linker.
310        pub fn add_to_linker<T>(
311            linker: &mut Linker<T>,
312            get_host: impl Fn(&mut T) -> &mut (dyn HostImports + Send + Sync + 'static)
313                + Send
314                + Sync
315                + Copy
316                + 'static,
317        ) -> Result<()>
318        where
319            T: Send + 'static,
320        {
321            let mut secrets = linker.instance("greentic:host-import/secrets@0.4.0")?;
322            secrets.func_wrap(
323                "get",
324                move |mut caller: StoreContextMut<'_, T>, (key, ctx): (String, Option<types::TenantCtx>)| {
325                    let host = get_host(caller.data_mut());
326                    host.secrets_get(key, ctx).map(|res| (res,))
327                },
328            )?;
329
330            let mut telemetry = linker.instance("greentic:host-import/telemetry@0.4.0")?;
331            telemetry.func_wrap(
332                "emit",
333                move |mut caller: StoreContextMut<'_, T>, (span, ctx): (String, Option<types::TenantCtx>)| {
334                    let host = get_host(caller.data_mut());
335                    host.telemetry_emit(span, ctx)
336                },
337            )?;
338
339            let mut http_iface = linker.instance("greentic:host-import/http@0.4.0")?;
340            http_iface.func_wrap(
341                "fetch",
342                move |mut caller: StoreContextMut<'_, T>, (req, ctx): (http::HttpRequest, Option<types::TenantCtx>)| {
343                    let host = get_host(caller.data_mut());
344                    host.http_fetch(req, ctx).map(|res| (res,))
345                },
346            )?;
347
348            Ok(())
349        }
350
351        /// Canonical package identifier.
352        pub const PACKAGE_ID: &str = "greentic:host-import@0.4.0";
353    }
354);
355
356#[cfg(feature = "host-import-v0-2")]
357declare_world!(
358    mod host_import_v0_2,
359    path = "wit/greentic/host-import@0.2.0",
360    world = "greentic:host-import/host-imports@0.2.0",
361    legacy = {
362        use wasmtime::component::Linker;
363        use wasmtime::{Result, StoreContextMut};
364
365        pub use bindings::greentic::host_import::imports;
366
367        /// Trait implemented by hosts to service the component imports.
368        pub trait HostImports {
369            fn secrets_get(
370                &mut self,
371                key: String,
372                ctx: Option<imports::TenantCtx>,
373            ) -> Result<Result<String, imports::IfaceError>>;
374
375            fn telemetry_emit(
376                &mut self,
377                span_json: String,
378                ctx: Option<imports::TenantCtx>,
379            ) -> Result<()>;
380
381            fn tool_invoke(
382                &mut self,
383                tool: String,
384                action: String,
385                args_json: String,
386                ctx: Option<imports::TenantCtx>,
387            ) -> Result<Result<String, imports::IfaceError>>;
388
389            fn http_fetch(
390                &mut self,
391                req: imports::HttpRequest,
392                ctx: Option<imports::TenantCtx>,
393            ) -> Result<Result<imports::HttpResponse, imports::IfaceError>>;
394        }
395
396        /// Registers the host import functions with the provided linker.
397        pub fn add_to_linker<T>(
398            linker: &mut Linker<T>,
399            get_host: impl Fn(&mut T) -> &mut (dyn HostImports + Send + Sync + 'static)
400                + Send
401                + Sync
402                + Copy
403                + 'static,
404        ) -> Result<()>
405        where
406            T: Send + 'static,
407        {
408            let mut inst = linker.instance("greentic:host-import/host-imports@0.2.0")?;
409
410            inst.func_wrap(
411                "secrets-get",
412                move |mut caller: StoreContextMut<'_, T>,
413                      (key, ctx): (String, Option<imports::TenantCtx>)| {
414                    let host = get_host(caller.data_mut());
415                    host.secrets_get(key, ctx).map(|res| (res,))
416                },
417            )?;
418
419            inst.func_wrap(
420                "telemetry-emit",
421                move |mut caller: StoreContextMut<'_, T>,
422                      (span, ctx): (String, Option<imports::TenantCtx>)| {
423                    let host = get_host(caller.data_mut());
424                    host.telemetry_emit(span, ctx)
425                },
426            )?;
427
428            inst.func_wrap(
429                "tool-invoke",
430                move |
431                    mut caller: StoreContextMut<'_, T>,
432                    (tool, action, args, ctx): (String, String, String, Option<imports::TenantCtx>),
433                | {
434                    let host = get_host(caller.data_mut());
435                    host.tool_invoke(tool, action, args, ctx).map(|res| (res,))
436                },
437            )?;
438
439            inst.func_wrap(
440                "http-fetch",
441                move |mut caller: StoreContextMut<'_, T>,
442                      (req, ctx): (imports::HttpRequest, Option<imports::TenantCtx>)| {
443                    let host = get_host(caller.data_mut());
444                    host.http_fetch(req, ctx).map(|res| (res,))
445                },
446            )?;
447
448            Ok(())
449        }
450
451        /// Canonical package identifier.
452        pub const PACKAGE_ID: &str = "greentic:host-import@0.2.0";
453    }
454);
455
456#[cfg(feature = "runner-host-v1")]
457declare_world!(
458    mod runner_host_v1,
459    path = "wit/greentic/host@1.0.0",
460    world = "greentic:host/runner-host@1.0.0",
461    legacy = {
462        use std::vec::Vec;
463        use wasmtime::component::Linker;
464        use wasmtime::{Result, StoreContextMut};
465
466        pub use bindings::greentic::host::{http_v1, kv_v1, secrets_v1};
467
468        /// Minimal trait hosts implement to satisfy the runner-host imports.
469        pub trait RunnerHost {
470            fn http_request(
471                &mut self,
472                method: String,
473                url: String,
474                headers: Vec<String>,
475                body: Option<Vec<u8>>,
476            ) -> Result<Result<Vec<u8>, String>>;
477
478            fn secret_get(&mut self, name: String) -> Result<Result<String, String>>;
479
480            fn kv_get(&mut self, ns: String, key: String) -> Result<Option<String>>;
481
482            fn kv_put(&mut self, ns: String, key: String, val: String) -> Result<()>;
483        }
484
485        /// Registers the runner-host interfaces with the provided linker.
486        pub fn add_to_linker<T>(
487            linker: &mut Linker<T>,
488            get_host: impl Fn(&mut T) -> &mut (dyn RunnerHost + Send + Sync + 'static)
489                + Send
490                + Sync
491                + Copy
492                + 'static,
493        ) -> Result<()>
494        where
495            T: Send + 'static,
496        {
497            let mut http = linker.instance("greentic:host/http-v1@1.0.0")?;
498            http.func_wrap(
499                "request",
500                move |mut caller: StoreContextMut<'_, T>,
501                      (method, url, headers, body): (String, String, Vec<String>, Option<Vec<u8>>)| {
502                    let host = get_host(caller.data_mut());
503                    host.http_request(method, url, headers, body)
504                        .map(|res| (res,))
505                },
506            )?;
507
508            let mut secrets = linker.instance("greentic:host/secrets-v1@1.0.0")?;
509            secrets.func_wrap(
510                "get",
511                move |mut caller: StoreContextMut<'_, T>, (name,): (String,)| {
512                    let host = get_host(caller.data_mut());
513                    host.secret_get(name).map(|res| (res,))
514                },
515            )?;
516
517            let mut kv = linker.instance("greentic:host/kv-v1@1.0.0")?;
518            kv.func_wrap(
519                "get",
520                move |mut caller: StoreContextMut<'_, T>, (ns, key): (String, String)| {
521                    let host = get_host(caller.data_mut());
522                    host.kv_get(ns, key).map(|res| (res,))
523                },
524            )?;
525            kv.func_wrap(
526                "put",
527                move |mut caller: StoreContextMut<'_, T>, (ns, key, val): (String, String, String)| {
528                    let host = get_host(caller.data_mut());
529                    host.kv_put(ns, key, val)
530                },
531            )?;
532
533            Ok(())
534        }
535
536        /// Canonical package identifier.
537        pub const PACKAGE_ID: &str = "greentic:host@1.0.0";
538    }
539);
540
541#[cfg(feature = "pack-export-v0-2")]
542declare_world!(
543    mod pack_export_v0_2,
544    path = "wit/greentic/pack-export@0.2.0",
545    world = "greentic:pack-export/pack-exports@0.2.0",
546    legacy = {
547        /// Canonical package identifier.
548        pub const PACKAGE_ID: &str = "greentic:pack-export@0.2.0";
549    }
550);
551
552#[cfg(feature = "types-core-v0-2")]
553declare_world!(
554    mod types_core_v0_2,
555    path = "wit/greentic/types-core@0.2.0",
556    world = "greentic:types-core/core@0.2.0",
557    legacy = {
558        /// Canonical package identifier.
559        pub const PACKAGE_ID: &str = "greentic:types-core@0.2.0";
560    }
561);
562
563#[cfg(feature = "secrets-v0-1")]
564declare_world!(
565    mod secrets_v0_1,
566    path = "wit/greentic/secrets@0.1.0",
567    world = "greentic:secrets/host@0.1.0",
568    legacy = {
569        /// Canonical package identifier.
570        pub const PACKAGE_ID: &str = "greentic:secrets@0.1.0";
571
572        /// Raw WIT document for consumers that previously embedded it.
573        pub const HOST_WORLD: &str =
574            include_str!("../wit/greentic/secrets@0.1.0/package.wit");
575
576        pub fn host_world() -> &'static str {
577            HOST_WORLD
578        }
579    }
580);
581
582#[cfg(feature = "oauth-broker-v1")]
583declare_world!(
584    mod oauth_broker_v1,
585    path = "wit/greentic/oauth-broker@1.0.0",
586    world = "greentic:oauth-broker/broker@1.0.0",
587    legacy = {
588        /// Canonical package identifier.
589        pub const PACKAGE_ID: &str = "greentic:oauth-broker@1.0.0";
590    }
591);
592
593#[cfg(feature = "component-lifecycle-v1")]
594declare_world!(
595    mod component_lifecycle_v1,
596    path = "wit/greentic/lifecycle@1.0.0",
597    world = "greentic:lifecycle/component-lifecycle@1.0.0",
598    legacy = {
599        /// Canonical package identifier.
600        pub const PACKAGE_ID: &str = "greentic:lifecycle@1.0.0";
601    }
602);
603
604#[cfg(feature = "events-v1")]
605declare_world!(
606    mod events_v1,
607    path = "wit/greentic/events@1.0.0",
608    world = "greentic:events/events@1.0.0",
609    legacy = {
610        /// Canonical package identifier.
611        pub const PACKAGE_ID: &str = "greentic:events@1.0.0";
612    }
613);
614
615#[cfg(feature = "events-broker-v1")]
616declare_world!(
617    mod events_broker_v1,
618    path = "wit/greentic/events@1.0.0",
619    world = "greentic:events/broker@1.0.0",
620    legacy = {
621        /// Canonical package identifier.
622        pub const PACKAGE_ID: &str = "greentic:events@1.0.0";
623    }
624);
625
626#[cfg(feature = "events-source-v1")]
627declare_world!(
628    mod events_source_v1,
629    path = "wit/greentic/events@1.0.0",
630    world = "greentic:events/source@1.0.0",
631    legacy = {
632        /// Canonical package identifier.
633        pub const PACKAGE_ID: &str = "greentic:events@1.0.0";
634    }
635);
636
637#[cfg(feature = "events-sink-v1")]
638declare_world!(
639    mod events_sink_v1,
640    path = "wit/greentic/events@1.0.0",
641    world = "greentic:events/sink@1.0.0",
642    legacy = {
643        /// Canonical package identifier.
644        pub const PACKAGE_ID: &str = "greentic:events@1.0.0";
645    }
646);
647
648#[cfg(feature = "secrets-store-v1")]
649declare_world!(
650    mod secrets_store_v1,
651    path = "wit/greentic/secrets-store@1.0.0",
652    world = "greentic:secrets/store@1.0.0",
653    legacy = {
654        /// Canonical package identifier.
655        pub const PACKAGE_ID: &str = "greentic:secrets@1.0.0";
656    }
657);
658
659#[cfg(feature = "state-store-v1")]
660declare_world!(
661    mod state_store_v1,
662    path = "wit/greentic/state-store@1.0.0",
663    world = "greentic:state/store@1.0.0",
664    legacy = {
665        pub const PACKAGE_ID: &str = "greentic:state@1.0.0";
666    }
667);
668
669#[cfg(feature = "messaging-session-v1")]
670declare_world!(
671    mod messaging_session_v1,
672    path = "wit/greentic/messaging-session@1.0.0",
673    world = "greentic:messaging/session@1.0.0",
674    legacy = {
675        pub const PACKAGE_ID: &str = "greentic:messaging@1.0.0";
676    }
677);
678
679#[cfg(feature = "events-bridge-v1")]
680declare_world!(
681    mod events_bridge_message_to_event_v1,
682    path = "wit/greentic/events-bridge@1.0.0",
683    world = "greentic:events-bridge/message-to-event-bridge@1.0.0",
684    legacy = {
685        pub const PACKAGE_ID: &str = "greentic:events-bridge@1.0.0";
686    }
687);
688
689#[cfg(feature = "events-bridge-v1")]
690declare_world!(
691    mod events_bridge_event_to_message_v1,
692    path = "wit/greentic/events-bridge@1.0.0",
693    world = "greentic:events-bridge/event-to-message-bridge@1.0.0",
694    legacy = {
695        pub const PACKAGE_ID: &str = "greentic:events-bridge@1.0.0";
696    }
697);
698
699#[cfg(feature = "http-client-v1")]
700declare_world!(
701    mod http_client_v1,
702    path = "wit/greentic/http-client@1.0.0",
703    world = "greentic:http/client@1.0.0",
704    legacy = {
705        pub const PACKAGE_ID: &str = "greentic:http@1.0.0";
706    }
707);
708
709#[cfg(feature = "telemetry-logger-v1")]
710declare_world!(
711    mod telemetry_logger_v1,
712    path = "wit/greentic/telemetry-logger@1.0.0",
713    world = "greentic:telemetry/logger@1.0.0",
714    legacy = {
715        pub const PACKAGE_ID: &str = "greentic:telemetry@1.0.0";
716    }
717);
718
719#[cfg(feature = "source-v1")]
720declare_world!(
721    mod source_v1,
722    path = "wit/greentic/source@1.0.0",
723    world = "greentic:source/source-sync@1.0.0",
724    legacy = {
725        pub const PACKAGE_ID: &str = "greentic:source@1.0.0";
726    }
727);
728
729#[cfg(feature = "build-v1")]
730declare_world!(
731    mod build_v1,
732    path = "wit/greentic/build@1.0.0",
733    world = "greentic:build/builder@1.0.0",
734    legacy = {
735        pub const PACKAGE_ID: &str = "greentic:build@1.0.0";
736    }
737);
738
739#[cfg(feature = "scan-v1")]
740declare_world!(
741    mod scan_v1,
742    path = "wit/greentic/scan@1.0.0",
743    world = "greentic:scan/scanner@1.0.0",
744    legacy = {
745        pub const PACKAGE_ID: &str = "greentic:scan@1.0.0";
746    }
747);
748
749#[cfg(feature = "signing-v1")]
750declare_world!(
751    mod signing_v1,
752    path = "wit/greentic/signing@1.0.0",
753    world = "greentic:signing/signer@1.0.0",
754    legacy = {
755        pub const PACKAGE_ID: &str = "greentic:signing@1.0.0";
756    }
757);
758
759#[cfg(feature = "attestation-v1")]
760declare_world!(
761    mod attestation_v1,
762    path = "wit/greentic/attestation@1.0.0",
763    world = "greentic:attestation/attester@1.0.0",
764    legacy = {
765        pub const PACKAGE_ID: &str = "greentic:attestation@1.0.0";
766    }
767);
768
769#[cfg(feature = "policy-v1")]
770declare_world!(
771    mod policy_v1,
772    path = "wit/greentic/policy@1.0.0",
773    world = "greentic:policy/policy-evaluator@1.0.0",
774    legacy = {
775        pub const PACKAGE_ID: &str = "greentic:policy@1.0.0";
776    }
777);
778
779#[cfg(feature = "metadata-v1")]
780declare_world!(
781    mod metadata_v1,
782    path = "wit/greentic/metadata@1.0.0",
783    world = "greentic:metadata/metadata-store@1.0.0",
784    legacy = {
785        pub const PACKAGE_ID: &str = "greentic:metadata@1.0.0";
786    }
787);
788
789#[cfg(feature = "distribution-v1")]
790declare_world!(
791    mod distribution_v1,
792    path = "wit/greentic/distribution@1.0.0",
793    world = "greentic:distribution/distribution@1.0.0",
794    legacy = {
795        pub const PACKAGE_ID: &str = "greentic:distribution@1.0.0";
796    }
797);
798
799#[cfg(feature = "oci-v1")]
800declare_world!(
801    mod oci_v1,
802    path = "wit/greentic/oci@1.0.0",
803    world = "greentic:oci/oci-distribution@1.0.0",
804    legacy = {
805        pub const PACKAGE_ID: &str = "greentic:oci@1.0.0";
806    }
807);