Python SDK for ACT components
Project description
act-sdk
Python SDK for building ACT (Agent Component Tools) components — sandboxed WASM tools for AI agents that work across MCP, HTTP, CLI, and browser hosts.
Install
uv add act-sdk
# or
pip install act-sdk
Quick start
from act_sdk import component, tool, ActError
@component
class MyComponent:
@tool(description="Say hello", read_only=True)
async def hello(self, name: str = "world") -> str:
return f"Hello, {name}!"
@tool(description="Divide two numbers")
async def divide(self, a: float, b: float) -> float:
if b == 0:
raise ActError("std:invalid-args", "Cannot divide by zero")
return a / b
Package with componentize-py + act-build pack to produce a .wasm component that exposes these tools over every ACT transport.
What you get
@component— declares the class as an ACT component. Generates theact:core/tool-providerWIT export.@tool— declares a method as a tool. Parameters, return type, and docstrings become the JSON Schema automatically (via type hints).ActError("std:kind", "message")— raise this from a tool body to produce a structuredtool-errorthe host forwards to the caller.Json[T]/Content(data, mime_type=...)— explicit return types for when you need control over the wire format; otherwise returns are CBOR-encoded.
Tool naming
Tool method names are exposed as-is (snake_case). async def get_weather(...) becomes the tool name get_weather on the wire. See the tool naming guidelines for the recommended style.
Capabilities
Declare host capabilities inline in pyproject.toml:
[project]
name = "my-component"
version = "0.1.0"
description = "..."
[tool.act.std.capabilities."wasi:http"]
act-build pack picks up [tool.act] and embeds it in the component's act:component custom section. The component cannot reach the network unless the host links wasi:http at load time. Filesystem, sockets, and other WASI capabilities follow the same pattern.
A separate act.toml also works as a last-wins override layer if you need to keep capability metadata out of your build configuration — but for most components, inline pyproject.toml is the recommended source of truth.
Links
- Main site: https://actcore.dev
- Component registry: https://actpkg.dev
- Protocol specification: https://github.com/actcore/act-spec
- Rust SDK: https://crates.io/crates/act-sdk
License
MIT OR Apache-2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file act_sdk-0.2.0.tar.gz.
File metadata
- Download URL: act_sdk-0.2.0.tar.gz
- Upload date:
- Size: 30.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
284a8e146b5f7bbc9c2f2d67f18c3cc366c02c759db211898772b969a02b8518
|
|
| MD5 |
bc8cc4f4e15ebfae5af5829a36c80781
|
|
| BLAKE2b-256 |
e41b287a90165ccc5d21cd5c8c114106c0947a9a87177b8d030593234f1441a6
|
Provenance
The following attestation bundles were made for act_sdk-0.2.0.tar.gz:
Publisher:
publish.yml on actcore/act-sdk-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
act_sdk-0.2.0.tar.gz -
Subject digest:
284a8e146b5f7bbc9c2f2d67f18c3cc366c02c759db211898772b969a02b8518 - Sigstore transparency entry: 1403140672
- Sigstore integration time:
-
Permalink:
actcore/act-sdk-py@ef077943084f33668f1f81feb6631725bec3924c -
Branch / Tag:
refs/tags/0.2.0 - Owner: https://github.com/actcore
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ef077943084f33668f1f81feb6631725bec3924c -
Trigger Event:
push
-
Statement type:
File details
Details for the file act_sdk-0.2.0-py3-none-any.whl.
File metadata
- Download URL: act_sdk-0.2.0-py3-none-any.whl
- Upload date:
- Size: 12.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5294443e3b3c7c0ea3e6f1408f4b28b528b5f760ee8c271fd9713adfea77f9eb
|
|
| MD5 |
4668632d2a61ee509b75856df98194c0
|
|
| BLAKE2b-256 |
c6b237a3dfcd04a4f6cf8e54b1df8c4452c13311da92d14bf9434295dece27df
|
Provenance
The following attestation bundles were made for act_sdk-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on actcore/act-sdk-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
act_sdk-0.2.0-py3-none-any.whl -
Subject digest:
5294443e3b3c7c0ea3e6f1408f4b28b528b5f760ee8c271fd9713adfea77f9eb - Sigstore transparency entry: 1403140773
- Sigstore integration time:
-
Permalink:
actcore/act-sdk-py@ef077943084f33668f1f81feb6631725bec3924c -
Branch / Tag:
refs/tags/0.2.0 - Owner: https://github.com/actcore
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ef077943084f33668f1f81feb6631725bec3924c -
Trigger Event:
push
-
Statement type: