The manifest
Every plugin has a wraith.json at the top of its folder. The hub reads it too, and its schema is at https://hub.wraith.io/schema/v1/wraith.json.
{ "$schema": "https://hub.wraith.io/schema/v1/wraith.json", "id": "my-plugin", "kind": "plugin", "version": "0.1.0", "apiVersion": 3, "title": "My Plugin", "summary": "Does a thing.", "author": "You", "wraith": "0.4.0", "games": [ { "ids": ["steam-3316940"], "exes": ["game.exe", "game_dx12.exe"] } ], "provider": "js"}id is the plugin’s name, and its folder’s. Use lowercase letters, digits, _ and -. In PascalCase it’s your schemas’ namespace, so my_plugin’s types are MyPlugin. wraith is the oldest Wraith it runs on.
apiVersion is the version of Wraith’s API it’s made for. Every plugin and project needs one. When Wraith changes its API in a way plugins have to catch up with, it bumps the version, and stops loading ones made for older APIs. Those show as outdated until their author updates them, bumps apiVersion and puts out a new version. Wraith won’t load one that’s made for a newer API than it has, either. wraith new and npm create @ratatoskr.io/plugin fill it in for you, and wraith sdk info says which this Wraith has, as api_version, and the oldest it still loads, as min_api_version. The current one is 3.
summary is one line, shown in lists. description is Markdown for its hub page. For a longer one, write it in a file instead, like "descriptionFile": "README.md". Builds put its text in description, so keep only one of the two.
games are the games it’s for. Leave it out for any game. Any of a game’s ids, like steam-3316940 or gog-1207664643, or its exes will match, so list every store and exe the game has. The hub needs at least one id. arch is the game’s own, like "x86" for a 32-bit game. When every game says the same one, the plugin is only built for that. tested lists copies you tested on: store builds like steam:18234455, or sha512: and an exe’s hash, which works for any store or a local copy. You can copy either from the Workbench’s Environment panel. It never stops it loading.
A plugin for several games names each, like { "name": "cs3", "schema": "Cs3", "ids": ["steam-991270"], "exes": ["ed8_3_PC.exe"], "arch": "x64" }. Wraith tells the plugin which one it’s in through Wraith.game().listedGame(), by id first and then exe, and schema picks its namespace in a schema family. A game’s own provides replaces the plugin’s there.
engine also loads it in every game made with that engine, for plugins that work in games they’ve never seen, like "engine": "unity", or "engine": { "id": "unity", "variants": ["IL2CPP"] } for some kinds of it. The ids are unity, unreal, godot, gamemaker, rpg_maker, renpy, source, source2, cryengine, re_engine, fna, monogame, xna, love, nwjs and electron. variants narrows it down, like IL2CPP or Mono for Unity, or MV for RPG Maker. Wraith works out each game’s engine from its files, and the Workbench’s Environment panel shows what it found. With engine, games can also name ones Wraith can’t tell from their files, by exe alone; the hub shows an official plugin’s as the engine’s games. That’s all engine changes: when two plugins want the same part of a game, like the camera, one that lists the game wins over one that’s there by its engine.
provider says what runs it, and every plugin needs one:
"native"for a DLL, like Zig, C, C++, Rust or C# compiled with NativeAOT. The Mods page and the hub tag these, since compiled code can do anything."clr"for C# that .NET runs."js"or"lua"for scripts.
Wraith won’t load a plugin with anything else.
clrMode is for "clr" plugins. A process only has one .NET, so it says what to do when the game doesn’t have one running yet. "load", the default, uses the game’s if it has one, and otherwise starts the installed .NET 10. "wait" loads the plugin once the game’s own .NET starts, like one a mod loader brings later, and it shows as Waiting for .NET till then. "provided" only loads it in a game that’s running .NET already.
Native plugins are built for both 32 and 64-bit games, unless every game they list has the same arch. C# and Rust ones build 64-bit then, since their types are made for one pointer size. Wraith and the hub tell which a package has from its DLLs. "autoLoad": false keeps Wraith from loading it on its own. "library": true says it’s code for other plugins, with nothing of its own to use.
depends lists plugins it needs, by id, like ["unity", "freecam@1.2"]. @ gives the oldest version that’ll do. Wraith loads them first, even ones with autoLoad off, and unloads your plugin before them. If one’s missing, too old or turned off, your plugin doesn’t load, and the log says what it needs. wraith mods install gets them from the hub too. To share code and calls with them, see Sharing between plugins.
A game can need more, like a plugin for one engine’s games, with its own depends: { "name": "cs4", "schema": "Cs4", "depends": ["ed8"], ... }. Those add to the plugin’s depends, and only in that game, so Wraith loads ed8 there and not in the plugin’s other games. Installs and builds take every game’s, since they don’t know which game it’ll run in.
supersedes lists plugins it stands in for wherever it runs, like ["unity"] for a Unity game the Unity plugin breaks. Not ones it depends on, and two that name each other both run. Wraith won’t load or fetch them there while yours is on. To take over just some parts, like the camera, claim their leases instead.
provides lists features from the hub’s list that your plugin gives the games it’s for, like ["camera", "posing", "speed"] or ["tweaks"]. Their pages show them as yours, unless a reviewer says otherwise, and a game’s plugin is shown over its engine’s. The hub turns away ids it doesn’t know.
devDepends is for building against plugins you’re working on, like { "freecam": "../../libs/freecam/wraith.json" }. It maps one of your depends to its folder or its wraith.json, relative to yours. Its version doesn’t matter. Builds leave it out of what you share, and the hub won’t take a package that still has it.
Once your plugin is a dev plugin, Wraith loads what its devDepends name from their builds too, so you don’t have to wraith dev add them. It looks in their zig-out or dist, or the folder itself, and follows their devDepends in turn. wraith dev list shows them.
Permissions
Section titled “Permissions”permissions says what your plugin uses beyond the game and its own folders. The Mods page and the hub show it, and Wraith’s API refuses what you didn’t declare, with a NotDeclared error that says what to add.
{ "permissions": { "net": ["example.com"], "clipboard": true, "capture": true, "files": true }}netlists the hosts it reaches with HTTP, or"*"for any.clipboardreads and sets the clipboard.capturecopies the game’s frames withdisplay.capture().filesreads and writes files, loads images and downloads outside your plugin’s own folders. It isn’t needed to read the game’s folder, or for what the player picks in a file dialog.
The workbench’s Permissions panel, under Diagnostics, lists what each plugin may do and what it’s done, so a call your wraith.json doesn’t allow shows there as refused.
Projects and Workbench scripts are yours, so they don’t need any. Native code can do anything, so for Zig, C, C++, Rust and NativeAOT C# plugins it’s what you’re telling people. The hub checks it when it reviews them.
On the hub
Section titled “On the hub”These only change how it looks on the hub.
{ "homepage": "https://example.com/my-plugin", "repo": "https://github.com/you/my-plugin", "tags": ["camera", "quality-of-life"], "icon": "icon.png", "images": ["images/menu.png", "images/in-game.jpg"]}homepage and repo are links on its page, and both start with https://. tags are up to 10 words people can search for, in lowercase letters, digits and -.
icon and images are pictures in your plugin’s folder, as paths from its wraith.json. They can be PNG, JPEG or WebP. The icon goes up to 256 KB and square works best. Each image goes up to 2 MB, and you can have 8. Building puts them in the package for you, and the hub won’t take one that names a picture it doesn’t have.
wraith.io · Mods on the Hub · Get Wraith
Made with ♥ by Asgard
