> ## Documentation Index
> Fetch the complete documentation index at: https://docs.spurdoverse.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Manifest

> manifest.json: script metadata, entry file and permissions.

Every script folder has a `manifest.json`. The loader reads it first; no manifest, no script.

```json theme={null}
{
    "name": "my-script",
    "author": "you",
    "version": "1.0.0",
    "description": "Enemy boxes and a health bar",
    "entry": "dist/index.js",
    "permissions": ["filesystem"]
}
```

***

## Fields

All fields are optional. The values end up on the [`script`](/api/globals#script) global.

| Field | Type | Default | |
| :- | :- | :- | :- |
| `name` | `string` | `"unnamed"` | Shown in the menu and the log. Two loaded scripts can't share a name. |
| `author` | `string` | `"unknown"` | |
| `version` | `string` | `"1.0.0"` | |
| `description` | `string` | `""` | |
| `entry` | `string` | `"dist/index.js"` | The module to run, relative to the folder. It can't point outside it. |
| `permissions` | `string[]` | both granted | See [below](#permissions). |

`localStorage` is keyed by the folder name, not `name`.

***

## Permissions

By default a script can do everything. To restrict it, list only what it needs:

```json theme={null}
"permissions": ["filesystem"]
```

| Permission | Gives |
| :- | :- |
| `filesystem` | Files outside the script's own folder. Without it [fs](/api/fs) stays in `data/`. |
| `ffi` | [@native/ffi](/api/ffi): loading DLLs and calling native code. |

***

## Folder layout

```
my-script/
├── manifest.json
├── src/index.ts
├── dist/index.js     <- "entry"
└── data/             <- fs and WASI root, created on first use
```

Imports resolve to `@native/*` modules and relative files inside the folder. `.js` is appended
when there's no extension. There's no `node_modules` at runtime.

The script hot-reloads when any file in its folder changes, except under `data/`.
