Λογότυπο Runno

Runno

Κοινότητα
taybenlor

Sandboxed runtime for programming languages and WASI binaries. Works in the browser, on your server, or via MCP.

Εκδότηςtaybenlor
Αποθετήριοrunno
ΓλώσσαTypeScript
Forks
48
Αστέρια
773
Διαθέσιμα εργαλεία
1
Τύπος μεταφοράςstdio
Κατηγορίες
Άδεια χρήσηςMIT
Σύνδεσμοι
  • Συνδέστε εργαλεία σε ροές εργασίας AI

    Το Runno παρέχει δυνατότητες MCP που μπορούν να χρησιμοποιηθούν από συμβατές εφαρμογές-πελάτες AI και πράκτορες AI.

  • 1 διαθέσιμα εργαλεία

    Περιηγηθείτε παρακάτω στις ενέργειες που μπορούν να κληθούν, μαζί με τα ονόματα και τις περιγραφές τους, όταν παρέχονται από τον διακομιστή.

  • Ρυθμίσεις έτοιμες για αντιγραφή

    Χρησιμοποιήστε τα αποσπάσματα εγκατάστασης για να ρυθμίσετε αυτόν τον διακομιστή στην εφαρμογή-πελάτη MCP που προτιμάτε.

  • Δείκτες ενδιαφέροντος για τον ανοιχτό κώδικα

    773 αστέρια και 48 διακλαδώσεις στο συνδεδεμένο αποθετήριο.

👨‍💻 Use Runno 👉 Runno.dev

📖 Documentation 👉 Runno.dev

Runno

Runno is a collection of JavaScript Packages for running code in various languages inside a sandbox. It's made of the following packages:

  • @runno/runtime - web components and headless tools for running code examples in the browser.
  • @runno/sandbox - a secure sandbox for running code examples in Node and other JS Runtimes.
  • @runno/wasi - an isomorphic package for running WebAssembly WASI binaries inside a sandbox.
  • @runno/mcp - an MCP Server for running code using the @runno/sandbox package.

There's also a deprecated Python package called runno that works like the sandbox package.

This project is powered by WASI the Web Assembly System Interface. It provides a standard way for programs to interact with an operating system. By emulating this interface, we can provide a fake file system and operating system, all running within JavaScript.

Using @runno/runtime

The @runno/runtime package provides Web Components for running code in the browser.

This is very handy for programming education it means:

  • No need for newbies to install complex programming tools to run code
  • Programming examples can be made runnable in the browser with no server
  • Simple programs can be tested for correctness inside a sandbox on the user's machine

Quickstart

Start by adding @runno/runtime to your package:

sh
npm install @runno/runtime

Import @runno/runtime in whatever place you'll be using the runno elements. The simplest is in your entrypoint file (e.g. main.ts or index.ts).

js
import "@runno/runtime";

Once you've imported them you can use runno elements on the page.

html
<runno-run runtime="python" editor controls> print('Hello, World!') </runno-run>

For the code to run though, you'll need to set some HTTP headers:

Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp

These create a cross-origin isolated context which allows the use of SharedArrayBuffer used to implement STDIN.

Supported Runtimes

The system supports a number of runtimes based on existing packages published to WAPM. These runtimes are tied to Runno and will be supported by Runno going forward.

  • python - Runs python3 code, not pinned to a particular version but is at least 3.6
  • ruby - Runs standard Ruby, not pinned but is at least 3.2.0
  • quickjs - Runs JavaScript code using the QuickJS engine
  • sqlite - Runs SQLite commands
  • clang - Compiles and runs C code
  • clangpp - Compiles and runs C++ code
  • php-cgi - Runs PHP CGI compiled by VMWare

Running WASI binaries

The runtime also provides a component for running WASI binaries directly.

html
<runno-wasi src="/ffmpeg.wasm" autorun></runno-wasi>

Examples

There are more examples for how to use Runno in the examples directory in this repo. It includes practical ways you can use Runno, and how to configure it to run.

Full documentation

Visit @runno/runtime to read the full documentation.

How does it work?

Runno uses Web Assembly to run code from JavaScript. Code runs in a unix-like sandbox that connects to a web-based terminal emulator. This means it behaves a lot like running code natively on a linux terminal. It's not perfect, but it's handy for making code examples run.

Plus it's pretty cool that you can just run code in your browser!

Using @runno/sandbox

Quickstart

Install the sandbox with npm install @runno/sandbox. Then use it to run code like:

ts
import { runCode } from "@runno/sandbox";

const result = await runCode("ruby", "puts 'Hello, world!'");

if (result.resultType === "complete") {
  console.log(result.stdout);
} else {
  console.log("Oh no!");
}

You can also do more complicated things, like run against a virtual file system with runFS:

ts
function runFS(
  runtime: Runtime,
  entryPath: string,
  fs: WASIFS,
  options?: {
    stdin?: string;
    timeout?: number;
  },
): Promise<RunResult>;

Using @runno/wasi

Quickstart

The quickest way to get started with Runno is by using the WASI.start class method. It will set up everything you need and run the Wasm binary directly.

Be aware that this will run on the main thread, not inside a worker. So you will interrupt any interactive use of the browser until it completes.

js
import { WASI } from "@runno/wasi";

//...

const result = WASI.start(fetch("/binary.wasm"), {
  args: ["binary-name", "--do-something", "some-file.txt"],
  env: { SOME_KEY: "some value" },
  stdout: (out) => console.log("stdout", out),
  stderr: (err) => console.error("stderr", err),
  stdin: () => prompt("stdin:"),
  fs: {
    "/some-file.txt": {
      path: "/some-file.txt",
      timestamps: {
        access: new Date(),
        change: new Date(),
        modification: new Date(),
      },
      mode: "string",
      content: "Some content for the file.",
    },
  },
});

You can see a more complete example in src/main.ts.

Note: The args should start with the name of the binary. Like when you run a terminal command, you write cat somefile the name of the binary is cat.

Full documentation

Visit @runno/wasi to read the full documentation including instructions for running inside a worker, and how the virtual file-system works.

Using @runno/sandbox

Quickstart

The sandbox exports a runCode function you can use to run code. First install it with npm install @runno/sandbox or however you are installing packages. Then do something like:

ts
import { runCode } from "@runno/sandbox";

const result = await runCode("ruby", "puts 'Hello JavaScript!'");

console.log("Ruby says:", result.stdout);

There's an introduction article you can use to learn more.

Using @runno/mcp

Quickstart

Depending on how your MCP server is configured, you can add Runno with:

json
{
  "mcpServers": {
    "runno": {
      "command": "npx",
      "args": ["@runno/mcp"]
    }
  }
}

There's an introduction article you can use to learn more.

Development

Packages

This repo is broken down into a few packages using lerna:

  • website - the runno website that includes instructions and examples
  • runtime - a library that provides web components and helpers that can be bundled into your own project for using runno without an iframe
  • wasi - a library for running WASI binaries in the browser
  • sandbox - a sandbox for running programming languages from any JavaScript runtime
  • mcp - an MCP Server implementation built on the sandbox

Running locally

If you're lucky everything should work after doing:

sh
npm install
npm run bootstrap
npm run build  # make sure the dependent libraries are built
npm run dev

Testing

Runno has a small suite of tests, mostly focused on end-to-end integration. The wasi package has the most extensive suite of tests, comprehensively testing the WASI preview1 implementation. The other packages mostly have a few smoke tests to make sure they're working.

About Runno

Limitations

The programming languages available are limited by what has already been compiled to Web Assembly using WASI. A great way to help more languages become available would be to compile your favourite programming language tools to Web Assembly and upload them to WAPM.

WASI doesn't provide a full linux environment, so most system based interfaces won't work. Packages and modules are also difficult to install inside the Runno environment. If you want to import code, you'll need to provide that code alongside your example.

Runno is best for small code examples that use STDIN and STDOUT. That is typically the sort of thing that is taught in a CS1 course at university. This isn't an inherent limitation of the system though! As more work is put into Runno and the ecosystem of tools it depends on, more will become available.

Security

I do want to say up front that Runno is Open Source software with an MIT License, which specifically states:

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND

I stand by that lack of a warranty. But I also think the sandbox is pretty good and I'd love to make it really good. It's fun.

The main way that the Runno sandbox isolates code is by running it as WebAssembly inside V8. WebAssembly has some neat properties:

  1. Execution is all virtualised, it's not running directly on your CPU and RAM
  2. Code and Data are seperate, you can't jump into data
  3. The only interface with the outside world is via user-provided functions

That last point (3) is the most important one. If you run a WebAssembly binary and don't provide it with any functions it literally cannot do anything. It's like a box with no windows or doors, nothing can get in or out.

But we do want some things to get in and out. That's what WASI is for. WASI is a specification for an interface (the WebAssembly System Interface) that defines a standard set of functions that a WebAssembly binary can call like they are system calls. Mostly they do things like read and write files.

Note: this is actually a definition of WASI preview1, preview2 / 0.2 is a different beast and is very cool but currently out of scope.

Runno at it's core is an implementation of WASI preview1. It's kind of like a very lightweight Operating System implemented in TypeScript. It has a virtual file system which is made up of virtual files (basically just byte arrays stored in memory). So it never accesses your real file system either. It also has no network access or anything else like that.

So 1) it's a virtual machine, 2) it's a virtual file system, and 3) it has no network access. That's pretty good.

There's a lot of layers to this onion which I think is pretty good. I've heard onions are good for security. Tell me if you find some holes in my onion though, I'm interested! Email security@taybenlor.com.

Big thanks to

A number of open-source projects and standards have been used to make Runno possible. These include:

  • WASI and WebAssembly - a bunch of people from various working groups and especially the Bytecode Alliance have been involved in making WASM and WASI what it is today. Thanks heaps!

  • XTerm.js - a fully featured terminal that can be run in the browser

  • CodeMirror - a great web-based code editor that's always a delight to integrate

  • Wasmer, WAPM, and WebAssembly.sh - the Wasmer team have built a lot of great tools for running Web Assembly. WebAssembly.sh was a great inspiration and starting point.

  • The extensive work by many in the web development community on making native code and APIs run successfully inside the browser.

Thanks to everyone who has built compatibility layers for the web. The web becomes a better platform with every new piece of software we can run on it!

Also big thanks to my friends who tolerate me constantly talking about WASM. Thanks especially to Katie, Jesse, Jim, Odin, Hailey, Sam and other Sam.

Εγκατάσταση

TypingMind
Προαπαιτούμενα:

Node.js 18+

{
  "mcpServers": {
    "taybenlor-runno": {
      "command": "npx",
      "args": [
        "-y",
        "runno"
      ]
    }
  }
}

Διαθέσιμα εργαλεία

  • run_code

    Run code in a sandboxed environment.

    Specify a runtime and then provide some code to run.

    runtimeProgramming Language
    pythonPython
    quickjsJavaScript
    clangC
    clangppC++
    rubyRuby
    php-cgiPHP

    You can write code for any of the available runtimes, so use the best programming language for the job.

    If you're unsure, try Python or JavaScript first.

    Use this tool for the following scenarios:

    • Running a complex calculation to get an accurate answer
    • Solving a problem that requires an algorithm
    • Generating statistics or analysing data
    • Seeing the result of a small snippet of code run in isolation
    • Debugging code by running small snippets
    • Testing code by running small snippets

    You can use STDOUT to print out results so that you can use them. Following execution you'll be provided with the STDIN, STDOU

Χρησιμοποιήστε το MCP Runno με πολλά μοντέλα AI

Το TypingMind συνδέει τα εργαλεία MCP σε επίπεδο χώρου εργασίας. Έτσι, μόλις συνδεθεί το Runno, μπορείτε να το χρησιμοποιείτε με διαφορετικά μοντέλα AI στο TypingMind, αντί να το ρυθμίζετε ξεχωριστά για κάθε μοντέλο. Αυτή η ενσωμάτωση MCP εκτελείται τοπικά στη συσκευή σας μέσω του συνδέσμου MCP του TypingMind.

Οδηγός ρύθμισης για τη χρήση του τοπικού συνδέσμου

Επιλέξτε αυτή τη μέθοδο όταν ο διακομιστής MCP χρειάζεται πρόσβαση σε τοπικά αρχεία, εφαρμογές ή ιδιωτικούς πόρους στον υπολογιστή σας.

1

Ανοίξτε τις ρυθμίσεις MCP

Στο TypingMind, μεταβείτε στις «Ρυθμίσεις», έπειτα στις «Σύνθετες ρυθμίσεις» και στο «Model Context Protocol» και επιλέξτε «Ρύθμιση συνδέσμου».

  1. Ανοίξτε το TypingMind στο πρόγραμμα περιήγησής σας.
  2. Κάντε κλικ στο εικονίδιο «Ρυθμίσεις».
  3. Μεταβείτε στις «Σύνθετες ρυθμίσεις».
  4. Ανοίξτε την ενότητα Model Context Protocol.
  5. Κάντε κλικ στην επιλογή «Ρύθμιση συνδέσμου» και επιλέξτε «Αυτή η συσκευή».
Οθόνη ρύθμισης συνδέσμου MCP του TypingMind με επιλεγμένη την επιλογή «Αυτή η συσκευή»
2

Εκτελέστε την εντολή του συνδέσμου

Επιλέξτε «Αυτή η συσκευή», αντιγράψτε την εντολή από το TypingMind και εκτελέστε την στο Τερματικό. Διατηρήστε τη διεργασία σε λειτουργία όσο χρησιμοποιείτε το MCP.

  1. Αντιγράψτε την εντολή ρύθμισης που εμφανίζεται στο TypingMind.
  2. Ανοίξτε το Τερματικό στο macOS ή το Windows Terminal στα Windows.
  3. Επικολλήστε και εκτελέστε την εντολή.
  4. Εγκρίνετε την εγκατάσταση του πακέτου, αν το Τερματικό σάς ζητήσει επιβεβαίωση για να συνεχίσει.
  5. Διατηρήστε ανοιχτό το παράθυρο του Τερματικού και τη διεργασία σε λειτουργία όσο χρησιμοποιείτε εργαλεία MCP.
3

Προσθέστε το Runno ως διακομιστή

Όταν η κατάσταση του συνδέσμου είναι «Έτοιμος», κάντε κλικ στο «Αλλαγή servers» και επικολλήστε τις ρυθμίσεις του διακομιστή MCP.

  1. Περιμένετε μέχρι η κατάσταση του συνδέσμου να εμφανιστεί ως «Έτοιμος».
  2. Κάντε κλικ στο «Αλλαγή servers».
  3. Επικολλήστε τις ρυθμίσεις του διακομιστή MCP Runno.
  4. Αποθηκεύστε τη λίστα διακομιστών.
  5. Κάντε ανανέωση αν θέλετε να επιβεβαιώσετε ότι ο σύνδεσμος παραμένει έτοιμος για χρήση.
Ρυθμίσεις MCP του TypingMind με ενεργό διακομιστή και το κουμπί «Αλλαγή servers»
{
  "mcpServers": {
    "taybenlor-runno": {
      "command": "npx",
      "args": [
        "-y",
        "runno"
      ]
    }
  }
}
4

Χρησιμοποιήστε τη σύνδεση με διαφορετικά μοντέλα

Αποθηκεύστε τη λίστα διακομιστών, ανοίξτε τα «Πρόσθετα», ενεργοποιήστε τα εργαλεία MCP του Runno και έπειτα επιλέξτε οποιοδήποτε υποστηριζόμενο μοντέλο AI στο TypingMind. Χρησιμοποιήστε τα εργαλεία στη συνομιλία ή αναθέστε τα σε έναν πράκτορα AI.

  1. Ανοίξτε τη σελίδα «Πρόσθετα» στο TypingMind.
  2. Ενεργοποιήστε τα εργαλεία MCP του Runno.
  3. Ξεκινήστε μια συνομιλία και επιλέξτε το μοντέλο AI που θέλετε να χρησιμοποιήσετε.
  4. Χρησιμοποιήστε τα εργαλεία MCP στη συνομιλία ή αντιστοιχίστε τα σε έναν πράκτορα AI.
  5. Μεταβείτε σε άλλο μοντέλο AI όποτε χρειάζεται, χωρίς να συνδέσετε ξανά το MCP.
Συνομιλία στο TypingMind με ενεργοποιημένα εργαλεία MCP και επιλεγμένο μοντέλο AI
Θα με βοηθήσετε σε αυτό μέσω Runno;
Runno
Βεβαίως. Το διάβασα.
Δείτε τι βρήκα μέσω του Runno.

Συχνές ερωτήσεις

Σε τι χρησιμεύει ο διακομιστής MCP Runno;

Το Runno είναι ένας διακομιστής MCP που επιτρέπει σε συμβατές εφαρμογές AI να συνδέονται με εξωτερικά εργαλεία και πληροφορίες πλαισίου. Στο TypingMind, μπορείτε να προσθέσετε αυτόν τον διακομιστή MCP μία φορά και να κάνετε τα εργαλεία του διαθέσιμα στον χώρο εργασίας AI σας.

Μπορώ να χρησιμοποιήσω το Runno MCP με πολλά μοντέλα AI στο TypingMind;

Ναι. Το TypingMind συνδέει τα εργαλεία MCP σε επίπεδο χώρου εργασίας, ώστε να μπορείτε να χρησιμοποιείτε το Runno με διαφορετικά μοντέλα AI, όπως τα Claude, ChatGPT, Gemini ή άλλα μοντέλα που έχετε ρυθμίσει στο TypingMind, χωρίς να ρυθμίζετε τον διακομιστή MCP ξεχωριστά για κάθε μοντέλο.

Γιατί να χρησιμοποιήσετε τον σύνδεσμο MCP Runno με το TypingMind;

Το TypingMind είναι ένα από τα καλύτερα περιβάλλοντα συνομιλίας με μεγάλα γλωσσικά μοντέλα, καθώς συγκεντρώνει πολλά μοντέλα AI, προτροπές, πρόσθετα, πράκτορες AI, κλειδιά API και εργαλεία MCP σε έναν χώρο εργασίας. Συνδέοντας το Runno, μπορείτε να χρησιμοποιείτε τα εργαλεία MCP του με τα μοντέλα που προτιμάτε, διατηρώντας οργανωμένη τη ροή εργασίας των συνομιλιών σας στο TypingMind.

Πώς συνδέω το Runno MCP στο TypingMind;

Το Runno λειτουργεί μέσω του τοπικού συνδέσμου MCP του TypingMind. Αυτή είναι η καλύτερη επιλογή όταν ο διακομιστής MCP χρειάζεται πρόσβαση σε τοπικά αρχεία, εφαρμογές υπολογιστή, εργαλεία γραμμής εντολών ή ιδιωτικούς πόρους στον υπολογιστή σας.

Ποια εργαλεία παρέχει το Runno MCP στο TypingMind;

Το Runno διαθέτει 1 εργαλεία MCP που μπορείτε να ενεργοποιήσετε από τη σελίδα Πρόσθετα του TypingMind και να χρησιμοποιήσετε σε συνομιλίες ή να αναθέσετε σε πράκτορες AI.

Χρειάζεται να κοινοποιήσω τα κλειδιά API μου στο TypingMind για να χρησιμοποιήσω το Runno MCP;

Όχι. Το TypingMind δίνει προτεραιότητα στην τοπική λειτουργία και σας επιτρέπει να διατηρείτε τον έλεγχο των παρόχων μοντέλων, των κλειδιών API, των προτροπών και των ρυθμίσεων MCP σας. Αν το Runno απαιτεί έλεγχο ταυτότητας, προσθέστε τις απαιτούμενες κεφαλίδες, τις ρυθμίσεις OAuth ή τις τοπικές ρυθμίσεις για τον συγκεκριμένο διακομιστή MCP κατά τη δημιουργία της σύνδεσης.

Σχετικοί διακομιστές MCP

Προβολή όλων

Στήστε δικό σας χώρο εργασίας AI τώρα

Εγγραφείτε στο ενημερωτικό μας δελτίο για να ενημερώνεστε για νέες λειτουργίες και μελλοντικές κληρώσεις δώρων 👇