No description
Find a file
Dirk Hoyer 85e06961af fix(wasm): enable capnp unaligned for typed stream decode
The typed feature now enables capnp "unaligned". Inbound stream Data payloads are
decoded after the 26-byte frame header [kind][stream_id][seq][eom], so the capnp
segment is not 8-byte aligned and read_message_from_flat_slice would otherwise
reject it ("Detected unaligned segment") — making real typed-streaming payloads
undecodable. Because cargo unifies features across the single capnp in the dep
graph, any typed module depending on this SDK inherits it for its own generated
from_capnp (which references ::capnp), so module authors need not add it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 09:29:44 +02:00
examples feat(I203/M6): WASM Phase-2a callee streaming ABI (ixt_module_handle_server_stream + ixt_stream_send_*) 2026-05-29 16:49:55 +02:00
src fix(wasm): enable capnp unaligned for typed stream decode 2026-06-04 09:29:44 +02:00
.gitignore fix: add .gitignore, remove committed target/ 2026-03-18 21:04:26 +01:00
Cargo.lock feat(wasm): no_std typed-codec foundation (capnp behind typed feature) 2026-06-03 12:09:40 +02:00
Cargo.toml fix(wasm): enable capnp unaligned for typed stream decode 2026-06-04 09:29:44 +02:00
LICENSE feat: Initial WASM SDK scaffolding (Mission I159) 2026-03-06 22:15:21 +01:00
README.md feat: Initial WASM SDK scaffolding (Mission I159) 2026-03-06 22:15:21 +01:00

IXT WASM Module SDK

Ergonomic SDK for building WASM modules that run in the IXT runtime.

Quick Start

#![no_std]
use ixt_sdk_wasm::prelude::*;

struct Echo;

impl Default for Echo {
    fn default() -> Self { Self }
}

impl WasmModule for Echo {
    fn handle(&mut self, payload: &[u8], _ctx: &MsgContext) -> HandleResult {
        HandleResult::reply(payload)
    }
}

ixt_wasm_module!(Echo);

Build: cargo build --target wasm32-unknown-unknown --release

The resulting .wasm file goes into your module bundle at bin/wasm/any/module.wasm.

What the SDK Does For You

Concern Without SDK With SDK
Memory allocation Manual ixt_alloc/ixt_free in every module Provided by SDK
Panic handling Manual #[panic_handler] in every module Provided by SDK
Host functions Raw extern "C" with i32 pointers Safe host::send(), host::kv_get_str(), etc.
ABI exports Manual #[no_mangle] pub unsafe extern "C" fn ixt_wasm_module!(MyModule)
Message context Not available ctx.topic(), ctx.sender()

Host Functions

// MessageBus
host::send("topic", payload)?;
let response = host::request("topic", payload)?;

// KV Store
host::kv_set_str("key", "value")?;
let val = host::kv_get_str("key")?;
host::kv_del("key")?;

// Events
host::subscribe("events.*")?;
host::publish("events.my-event", payload)?;

// Logging
host::log_info("hello");
host::log_error("something went wrong");

// Assets
let path = host::resolve_asset("data/model.bin")?;

License

MIT