Skip to content

Runtimes and packing ​

Supported runtimes ​

runtimeEntryNotes
java.jarRequires Java 8+ on the machine
python.pyRequires python3 / python in PATH
node.jsRequires node in PATH
c / cppbinaryNative executable
gobinarygo build output
rustbinarycargo build --release output
zigbinaryzig build-exe output
nativebinaryGeneric fallback for the above

Native runtimes need no interpreter on the target machine, but you must build per platform:

PlatformArtifact
Windows x64.exe
Linux x64 / arm64no extension, executable bit
macOS arm64 / x64no extension, code signed

manifest.json ​

json
{
  "id": "hello-go",
  "name": "Hello Go",
  "version": "1.0.0",
  "runtime": "go",
  "entry": "bin/hello-go.exe",
  "author": "you",
  "permissions": ["ui"],
  "description": "Sample extension"
}
FieldRequiredNotes
idyes[a-z0-9-], immutable after install
nameyesDisplay name
versionyesSemver
runtimeyesSee table above
entryyesRelative path inside the package
authorno
descriptionno
homepageno
permissionsnoArray
minHostnoMinimum launcher version
argsnoExtra argv for native runtimes
envnoEnvironment variables

entry rules: forward slashes, no .., no absolute paths, and for native runtimes point directly at the binary.

Packing ​

bash
python extensions/pack.py extensions/examples/hello-go -o dist/hello-go.zip

What it does:

  1. Validates manifest.json.
  2. Builds native runtimes (go build -ldflags "-s -w", cargo build --release).
  3. Normalises zip permissions to 0644; the host adds 0755 to the entry when extracting.
  4. Enforces size limits.
  5. Writes the zip.

Manual packing works too, but keep zip entries non-executable and strip build directories.

Examples and SDKs ​

PathRuntimeShows
extensions/examples/hello-javajavaMinimal runnable extension
extensions/examples/hello-gogoNative binary + host API
extensions/examples/hello-rustrustZero-dependency JSON + native binary
LanguageSDK
Goextensions/sdk/go (package tmlext, stdlib only)
Rustextensions/sdk/rust (crate tml-ext, no deps)

SDKs and template repos ​

The protocol has exactly one source: extensions/schema in this repository. The SDKs come in two flavours — Go and Rust reference extensions/sdk here as a dependency (never a copy), while the Java / Python / Node / C templates ship their own zero-dependency protocol implementation:

LanguageTemplate repoHow it gets the SDK
Javahttps://github.com/TYWStudio/template-tml-extension-javaBundled Json.java, no external deps
Pythonhttps://github.com/TYWStudio/template-tml-extension-pythonBundled tml.py
Node.jshttps://github.com/TYWStudio/template-tml-extension-nodeBundled tml.js
Chttps://github.com/TYWStudio/template-tml-extension-cBundled zero-dependency implementation
Rusthttps://github.com/TYWStudio/template-tml-extension-rusttml-ext = { git = "https://github.com/TYWStudio/TML", tag = "sdk-rust-v1.0.0" }
Gohttps://github.com/TYWStudio/template-tml-extension-gorequire github.com/TYWStudio/TML/extensions/sdk/go v1.0.0

Clone / build / import steps per language: Language templates.

Shipping a protocol change: edit extensions/sdk/* and schema/ here first, tag a new version (extensions/sdk/go/vX.Y.Z for Go, sdk-rust-vX.Y.Z for Rust), then bump the dependency in the templates. Doing it the other way round forks the implementation.

Debugging ​

bash
cd extensions/my-ext
./bin/hello-go        # speak the stdio protocol directly

Click Refresh in Settings → Extensions after changes. Logs: logs/ext-*.log. See Import & manage for the rest.

SymptomCause
Not listedInvalid JSON or duplicate id
"Package was modified"Content changed but trust record not refreshed
"Runtime unavailable"Missing interpreter, or missing exec bit / wrong architecture
Exits immediatelyEntry does not read stdin, or crashed — check the log