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