The manifest and the package
manifest.json
A UTF-8 JSON object (no byte order mark) of at most 64 KiB, at the root of the package. It is strict: an
unknown key or a repeated key anywhere refuses the package, and every object in it must be an object (not an
array). rinext pack and rinext check apply exactly the app's rules.
{
"id": "com.example.mood-tracker",
"name": "Mood Tracker",
"version": "1.0.0",
"entry": "main.js",
"description": "Keeps the character's mood in mind.",
"permissions": ["chat.vars", "prompt.inject", "ui.command", "ui.settings"],
"net": ["api.example.com"],
"icon": "icon.png",
"author": { "name": "Your Name", "key": "Sn7sRBo_d9wxI4v9b7DfOicryTgX_edWCmVgeA1gEsA" },
"settings": [
{ "type": "toggle", "key": "remind", "label": "Remind the model each turn", "default": true }
]
}
| Field | Type | Required | Rules |
|---|---|---|---|
id | string | yes | At most 64 characters. Two or more labels separated by dots; each label 1 to 63 characters of a-z, 0-9 and -, not starting or ending with -; the first label starts with a letter. Reverse DNS is the convention: com.yourname.dice. AICC reserves chat.rin.*, com.aicharactercards.*, rin.* and aicc.*. |
name | string | yes | 1 to 64 characters, not blank, no control characters. Shown everywhere the extension is named. |
version | string | yes | Semantic Versioning 2.0.0: MAJOR.MINOR.PATCH, optional -prerelease and +build, no leading zeros, at most 64 characters. AICC accepts MAJOR.MINOR.PATCH only. |
entry | string | yes | The package file name of the one script. Must end in .js, exist in the package and be valid UTF-8. |
description | string | no | At most 500 characters. Newlines allowed, no other control characters. |
permissions | string[] | no | Each one of the names in Permissions, no repeats. An unknown name refuses the package (bad_permission): it is a typo, or a permission from a newer Rin Chat. Default []. |
net | string[] | no | Hosts the extension will ASK to reach; at most 32, no repeats. See Network. Default []. |
icon | string | no | The file name of a .png, .webp, .jpg or .jpeg in the package. |
author | object | yes | { "name"?: string, "key": string } and nothing else. name: 1 to 64 characters, no control characters. key: your Ed25519 public key as rinext keygen prints it (32 bytes, base64url, no padding: 43 characters). |
settings | array | no | The settings form, below. Needs the ui.settings permission. |
net hosts
Each entry is an exact host name: lowercase DNS labels (a-z, 0-9, -, each 1 to 63 characters, not
starting or ending with -), at least two labels, at most 253 characters. No scheme, port, path, wildcard or
IP address; the last label may not be all digits, and may not be localhost, local, internal, lan,
home or arpa. Listing a host asks for it; it grants nothing (every extension starts with network access
Blocked).
The settings form
settings describes a form Rin Chat draws under the extension in Settings > Extensions. The extension reads
the values with rin.settings.get(). At most 32 fields. Every field has:
| Key | Rules |
|---|---|
type | "toggle", "slider", "text" or "choice" |
key | [a-z][A-Za-z0-9_]{0,31}, unique in the form, not constructor or prototype |
label | 1 to 64 characters, not blank, no control characters |
description | Optional. 1 to 200 characters, not blank, no control characters |
Per type (any other key refuses the manifest):
| Type | Keys | Rules |
|---|---|---|
toggle | default (boolean) | default is optional, false when left out |
slider | min, max, step, default (numbers) | All required and finite. min < max, step > 0, at most 10,000 steps from min to max, default between them |
text | default (string), maxLength (integer), multiline (boolean) | maxLength 1 to 4000, default 500. default (default "") must fit: at most maxLength characters, no control characters, a newline only when multiline is true |
choice | options (array of { "value", "label" }), default (string) | 1 to 32 options; value and label each 1 to 64 characters, not blank, no control characters; values unique; default must be one of the values |
"settings": [
{ "type": "toggle", "key": "remind", "label": "Remind the model each turn", "default": true },
{ "type": "slider", "key": "depth", "label": "How far back", "description": "Messages from the end.", "min": 0, "max": 10, "step": 1, "default": 1 },
{ "type": "text", "key": "fallback", "label": "Mood when none is set", "maxLength": 40, "default": "calm" },
{ "type": "choice", "key": "style", "label": "Reminder style", "options": [{ "value": "short", "label": "Short" }, { "value": "full", "label": "Full sentence" }], "default": "full" }
]
rin.settings.get() always returns every field, each with a value that fits it: the user's saved value, or the
field's default when nothing was saved or the saved value no longer fits (after an update changed the form).
There is no settings-change hook; read the settings when you need them, since each call returns the latest.
The package
A .rinext file is a ZIP archive. rinext pack builds it; these are the rules it and Rin Chat apply.
| Rule | Limit |
|---|---|
| Package size | At most 2 MiB (2,097,152 bytes) as a file, and at most 2 MiB inflated in total |
| Entries | At most 64, SIGNATURE included. No zip64 |
| File names | /-separated segments of A-Z a-z 0-9 . _ -; no empty, . or .. segment; no leading /, backslash or drive letter; at most 4 segments and 128 bytes |
| Duplicates | None, compared case-insensitively (Icon.png and icon.png collide) |
| Links | No symbolic links or other special files |
Files a package may hold, and nothing else:
| File | Notes |
|---|---|
manifest.json | Required, at the root |
SIGNATURE | Written by rinext pack; a folder that already holds one is refused |
The entry script | The only script. Any other .js or .mjs file refuses the package (extra_script) |
README.md, LICENSE, LICENSE.md, LICENSE.txt | Documentation |
*.png, *.webp, *.jpg, *.jpeg, *.json | Assets. The icon is one of these |
*.wav, *.ogg, *.mp3 | Sounds for rin.audio.play, at most 1 MiB each. Each must really be that format (a WAV starts with RIFF/WAVE, an OGG with OggS, an MP3 with an ID3 tag or an MPEG frame sync) |
Anything else is refused (unexpected_file). The script cannot read package files: sounds are reached only
through rin.audio.play, and the icon is shown by Rin Chat. Data your code needs goes into the script itself.
One script, a classic script
The entry is evaluated as a classic script, not an ES module: there is no import or export, and no module
loader. If you write several files or use libraries, bundle them into one file, for example with esbuild:
esbuild src/index.js --bundle --format=iife --target=es2022 --outfile=extension/main.js
Do not minify it. AICC's review reads the bytes that run and does not accept minified or obfuscated code. The interpreter supports the modern language (through ES2023); what it lacks are host features (see the README).
Signing
rinext pack signs the package with your private key; you never sign by hand. For reference, SIGNATURE
holds an Ed25519 signature, base64url without padding, by the key in author.key, over:
rinext-signature-v1\n
followed by, for every file except SIGNATURE, sorted by name in byte order, the file name, \n, the
lowercase hex SHA-256 of its bytes, and \n. The manifest is signed as the bytes it is; there is no JSON
canonical form.
Rin Chat verifies the signature on install and on every load, and checks the stored package against its SHA-256 on every load. A package changed on disk after install refuses to run.
What the key means to users
- On a user's device, the first key seen for an id is pinned to it. A later package with the same id signed by another key is refused ("This extension is signed by a different author than the one you installed before, so it was refused."), until the user removes the extension with Remove and delete data. Remove, keep data keeps the pin, so a reinstall must come from the same key, and finds its data again.
- A user's approval names the key. When the user turns an extension on, Rin Chat records its permissions, hosts and key. A version signed by another key does not run there until the user turns it on again.
- On AICC, the first accepted upload of an id binds it to your account and your key. See Publishing.
A developer folder is never signed and has no pin. It cannot take an id installed from a file or AICC, or one whose data was kept by "Remove, keep data".