1#![cfg(not(target_arch = "wasm32"))]
2#![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 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 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 pub struct Component;
92
93 impl Component {
94 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 pub const PACKAGE_ID: &str = "greentic:secrets@0.1.0";
571
572 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 pub const PACKAGE_ID: &str = "greentic:oauth-broker@1.0.0";
590 }
591);
592
593#[cfg(feature = "oauth-broker-v1")]
594declare_world!(
595 mod oauth_broker_client_v1,
596 path = "wit/greentic/oauth-broker@1.0.0",
597 world = "greentic:oauth-broker/broker-client@1.0.0",
598 legacy = {
599 pub const PACKAGE_ID: &str = "greentic:oauth-broker@1.0.0";
601 }
602);
603
604#[cfg(feature = "component-lifecycle-v1")]
605declare_world!(
606 mod component_lifecycle_v1,
607 path = "wit/greentic/lifecycle@1.0.0",
608 world = "greentic:lifecycle/component-lifecycle@1.0.0",
609 legacy = {
610 pub const PACKAGE_ID: &str = "greentic:lifecycle@1.0.0";
612 }
613);
614
615#[cfg(feature = "events-v1")]
616declare_world!(
617 mod events_v1,
618 path = "wit/greentic/events@1.0.0",
619 world = "greentic:events/events@1.0.0",
620 legacy = {
621 pub const PACKAGE_ID: &str = "greentic:events@1.0.0";
623 }
624);
625
626#[cfg(feature = "events-broker-v1")]
627declare_world!(
628 mod events_broker_v1,
629 path = "wit/greentic/events@1.0.0",
630 world = "greentic:events/broker@1.0.0",
631 legacy = {
632 pub const PACKAGE_ID: &str = "greentic:events@1.0.0";
634 }
635);
636
637#[cfg(feature = "events-source-v1")]
638declare_world!(
639 mod events_source_v1,
640 path = "wit/greentic/events@1.0.0",
641 world = "greentic:events/source@1.0.0",
642 legacy = {
643 pub const PACKAGE_ID: &str = "greentic:events@1.0.0";
645 }
646);
647
648#[cfg(feature = "events-sink-v1")]
649declare_world!(
650 mod events_sink_v1,
651 path = "wit/greentic/events@1.0.0",
652 world = "greentic:events/sink@1.0.0",
653 legacy = {
654 pub const PACKAGE_ID: &str = "greentic:events@1.0.0";
656 }
657);
658
659#[cfg(feature = "secrets-store-v1")]
660declare_world!(
661 mod secrets_store_v1,
662 path = "wit/greentic/secrets-store@1.0.0",
663 world = "greentic:secrets/store@1.0.0",
664 legacy = {
665 pub const PACKAGE_ID: &str = "greentic:secrets@1.0.0";
667 }
668);
669
670#[cfg(feature = "state-store-v1")]
671declare_world!(
672 mod state_store_v1,
673 path = "wit/greentic/state-store@1.0.0",
674 world = "greentic:state/store@1.0.0",
675 legacy = {
676 pub const PACKAGE_ID: &str = "greentic:state@1.0.0";
677 }
678);
679
680#[cfg(feature = "messaging-session-v1")]
681declare_world!(
682 mod messaging_session_v1,
683 path = "wit/greentic/messaging-session@1.0.0",
684 world = "greentic:messaging/session@1.0.0",
685 legacy = {
686 pub const PACKAGE_ID: &str = "greentic:messaging@1.0.0";
687 }
688);
689
690#[cfg(feature = "events-bridge-v1")]
691declare_world!(
692 mod events_bridge_message_to_event_v1,
693 path = "wit/greentic/events-bridge@1.0.0",
694 world = "greentic:events-bridge/message-to-event-bridge@1.0.0",
695 legacy = {
696 pub const PACKAGE_ID: &str = "greentic:events-bridge@1.0.0";
697 }
698);
699
700#[cfg(feature = "events-bridge-v1")]
701declare_world!(
702 mod events_bridge_event_to_message_v1,
703 path = "wit/greentic/events-bridge@1.0.0",
704 world = "greentic:events-bridge/event-to-message-bridge@1.0.0",
705 legacy = {
706 pub const PACKAGE_ID: &str = "greentic:events-bridge@1.0.0";
707 }
708);
709
710#[cfg(feature = "http-client-v1")]
711declare_world!(
712 mod http_client_v1,
713 path = "wit/greentic/http-client@1.0.0",
714 world = "greentic:http/client@1.0.0",
715 legacy = {
716 pub const PACKAGE_ID: &str = "greentic:http@1.0.0";
717 }
718);
719
720#[cfg(feature = "telemetry-logger-v1")]
721declare_world!(
722 mod telemetry_logger_v1,
723 path = "wit/greentic/telemetry-logger@1.0.0",
724 world = "greentic:telemetry/logger@1.0.0",
725 legacy = {
726 pub const PACKAGE_ID: &str = "greentic:telemetry@1.0.0";
727 }
728);
729
730#[cfg(feature = "source-v1")]
731declare_world!(
732 mod source_v1,
733 path = "wit/greentic/source@1.0.0",
734 world = "greentic:source/source-sync@1.0.0",
735 legacy = {
736 pub const PACKAGE_ID: &str = "greentic:source@1.0.0";
737 }
738);
739
740#[cfg(feature = "build-v1")]
741declare_world!(
742 mod build_v1,
743 path = "wit/greentic/build@1.0.0",
744 world = "greentic:build/builder@1.0.0",
745 legacy = {
746 pub const PACKAGE_ID: &str = "greentic:build@1.0.0";
747 }
748);
749
750#[cfg(feature = "scan-v1")]
751declare_world!(
752 mod scan_v1,
753 path = "wit/greentic/scan@1.0.0",
754 world = "greentic:scan/scanner@1.0.0",
755 legacy = {
756 pub const PACKAGE_ID: &str = "greentic:scan@1.0.0";
757 }
758);
759
760#[cfg(feature = "signing-v1")]
761declare_world!(
762 mod signing_v1,
763 path = "wit/greentic/signing@1.0.0",
764 world = "greentic:signing/signer@1.0.0",
765 legacy = {
766 pub const PACKAGE_ID: &str = "greentic:signing@1.0.0";
767 }
768);
769
770#[cfg(feature = "attestation-v1")]
771declare_world!(
772 mod attestation_v1,
773 path = "wit/greentic/attestation@1.0.0",
774 world = "greentic:attestation/attester@1.0.0",
775 legacy = {
776 pub const PACKAGE_ID: &str = "greentic:attestation@1.0.0";
777 }
778);
779
780#[cfg(feature = "policy-v1")]
781declare_world!(
782 mod policy_v1,
783 path = "wit/greentic/policy@1.0.0",
784 world = "greentic:policy/policy-evaluator@1.0.0",
785 legacy = {
786 pub const PACKAGE_ID: &str = "greentic:policy@1.0.0";
787 }
788);
789
790#[cfg(feature = "metadata-v1")]
791declare_world!(
792 mod metadata_v1,
793 path = "wit/greentic/metadata@1.0.0",
794 world = "greentic:metadata/metadata-store@1.0.0",
795 legacy = {
796 pub const PACKAGE_ID: &str = "greentic:metadata@1.0.0";
797 }
798);
799
800#[cfg(feature = "distribution-v1")]
801declare_world!(
802 mod distribution_v1,
803 path = "wit/greentic/distribution@1.0.0",
804 world = "greentic:distribution/distribution@1.0.0",
805 legacy = {
806 pub const PACKAGE_ID: &str = "greentic:distribution@1.0.0";
807 }
808);
809
810#[cfg(feature = "distributor-api")]
811declare_world!(
812 mod distributor_api_v1,
813 path = "wit/greentic/distributor@1.0.0",
814 world = "greentic:distributor-api/distributor-api@1.0.0",
815 legacy = {
816 pub const PACKAGE_ID: &str = "greentic:distributor-api@1.0.0";
817 }
818);
819
820#[cfg(feature = "oci-v1")]
821declare_world!(
822 mod oci_v1,
823 path = "wit/greentic/oci@1.0.0",
824 world = "greentic:oci/oci-distribution@1.0.0",
825 legacy = {
826 pub const PACKAGE_ID: &str = "greentic:oci@1.0.0";
827 }
828);
829
830#[cfg(feature = "repo-ui-actions-v1")]
831declare_world!(
832 mod repo_ui_actions_repo_ui_worker_v1,
833 path = "wit/greentic/repo-ui-actions@1.0.0",
834 world = "greentic:repo-ui-actions/repo-ui-worker@1.0.0",
835 legacy = {
836 pub const PACKAGE_ID: &str = "greentic:repo-ui-actions@1.0.0";
837 }
838);
839
840#[cfg(feature = "gui-fragment")]
841declare_world!(
842 mod gui_fragment_v1,
843 path = "wit/greentic/gui@1.0.0",
844 world = "greentic:gui/gui-fragment@1.0.0",
845 legacy = {
846 pub const PACKAGE_ID: &str = "greentic:gui@1.0.0";
847 }
848);
849
850#[cfg(feature = "worker-api")]
851declare_world!(
852 mod worker_v1,
853 path = "wit/greentic/worker@1.0.0",
854 world = "greentic:worker/worker@1.0.0",
855 legacy = {
856 pub const PACKAGE_ID: &str = "greentic:worker@1.0.0";
857 }
858);
859
860#[cfg(feature = "wasix-mcp-24-11-05")]
861declare_world!(
862 mod wasix_mcp_24_11_05,
863 path = "wit/wasix-mcp@24.11.05.wit",
864 world = "mcp-router",
865 legacy = {
866 pub const PACKAGE_ID: &str = "wasix:mcp@24.11.5";
868 }
869);
870
871#[cfg(feature = "wasix-mcp-25-03-26")]
872declare_world!(
873 mod wasix_mcp_25_03_26,
874 path = "wit/wasix-mcp@25.03.26.wit",
875 world = "mcp-router",
876 legacy = {
877 pub const PACKAGE_ID: &str = "wasix:mcp@25.3.26";
879 }
880);
881
882#[cfg(feature = "wasix-mcp-25-06-18")]
883declare_world!(
884 mod wasix_mcp_25_06_18,
885 path = "wit/wasix-mcp@25.06.18.wit",
886 world = "mcp-router",
887 legacy = {
888 pub const PACKAGE_ID: &str = "wasix:mcp@25.6.18";
890 }
891);