workforce-skill-sdk 0.1.0

SDK for building WASM-based skills for workforce agents
Documentation
  • Coverage
  • 87.5%
    56 out of 64 items documented0 out of 40 items with examples
  • Size
  • Source code size: 38.71 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.09 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 10s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • kingsleyh

workforce-skill-sdk

Write custom workforce skill tools in Rust that compile to WASM.

This crate wraps the raw WASM host ABI so you write normal Rust code instead of pointer manipulation. Compile with --target wasm32-unknown-unknown and distribute via a GitHub repo.

Quick Start

use workforce_skill_sdk::prelude::*;

workforce_skill_sdk::init!();

tool!(get_weather, "Get current weather", {
    "type": "object",
    "properties": {
        "city": { "type": "string", "description": "City name" }
    },
    "required": ["city"]
}, |input: ToolInput| {
    let city = input.get_str("city").unwrap_or("unknown");
    let resp = http::get(
        &format!("https://wttr.in/{}?format=j1", city),
        &[],
    );
    match resp {
        Some(r) if r.is_success() => ToolOutput::success(json!({"weather": r.body})),
        _ => ToolOutput::error("Failed to fetch weather"),
    }
});

Architecture

Skill authors write tool handlers that receive a ToolInput (the agent's input parameters) and return a ToolOutput (success/failure with data). The SDK handles serialisation, memory management, and host function calls.