TotalFusion. Made by Spanish Total.js
Extend Total.js with Python, Rust, Go and WebAssembly.
Call functions written in other languages from Total.js and Node.js as plain async functions. Turn them into actions, API endpoints and MCP tools for AI agents, without leaving JavaScript.
Free and open source, MIT license. Tested on Linux, macOS and Windows.
A Python function, a Total.js action
Total.js validates the input against the contract before Python runs. The same function is an action, an API route and an MCP tool.
npm install totalfusion
npx totalfusion doctor --path ./python
# python/sentiment.py
from totalfusion import action
@action(summary='Detects the sentiment of a text', input='*text:String', output='label:String', mcp=True)
def analyze(data):
return { 'label': 'POSITIVE' if 'love' in data['text'] else 'NEGATIVE' }
// Total.js application
const fusion = REQUIRE('totalfusion');
fusion.register({ python: { path: PATH.root('python') } });
const result = await ACTION('sentiment/analyze', { text: 'I love it' }).promise();
Four runtimes, one way to call them
Python
Machine learning, scientific computing and any Python library.
Python guideRust
Speed, many threads and a small footprint. You build a binary: running it does not need Rust.
Rust guideGo
Network and infrastructure code, many calls at once, one binary for any system.
Go guideWebAssembly
Code in a sandbox: no files, no network, no environment, in one file for every system.
WebAssembly guide
What you get
- Workers that Node.js supervises: a pool of processes, timeouts, cancellation and real errors. A crash in a worker never takes your application down.
- Actions of Total.js with validated input, permissions, API routes, MCP tools and Server-Sent Events.
- Seven components for Total.js Flow.
- Binary data without base64, NumPy arrays included, and streaming with backpressure.
- Workers that stay healthy: replaced after a number of calls or when they use too much memory, with no call lost.
- A doctor that tells you what is missing, and the exact command to fix it, before anything runs.
Do you have code in Python, Rust or Go?
We can bring it into your Total.js application, with its contracts, its tests and its place in your APIs and your AI agents.