Recipes (saved Lua scripts)
recipesManage reusable Lua scripts in Superbase by listing, running, saving, previewing, and importing code files; preview untrusted imports before saving and execute with the executor's permissions.
Instructions
Reusable Lua scripts kept as .lua files in the recipes folder of Superbase (the user can also run them from the dashboard). action list shows the recipes with their description and arguments; action run executes one in the game (name, and args for the recipe, available there as the table args); action save writes a new recipe (name, code, and a title, description and usage line for its header; overwrite true replaces an existing one). Recipe names are lowercase letters, digits, - and _. Recipes run with the executor's full permissions like execute_lua, so read a recipe's code before you run one you did not write. Sharing: preview_import downloads a recipe from a link (https only; GitHub files and gists, GitLab files; at most 100 KB) and shows its code and header without saving anything. Show that code to the user and say what it does. import saves it into the recipes folder, and only with confirm true after the user has agreed; it never runs the recipe. Imported code comes from the internet and is untrusted. run needs the connected state, the other actions do not.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | preview_import, import: https link to a .lua file on GitHub, a GitHub gist or GitLab. | |
| args | No | run: arguments for the recipe, available in Lua as the table args. | |
| code | No | save: the Lua code of the recipe. It can use args and should return a value. | |
| name | No | run, save, import: the recipe name, for example list-remotes. import: defaults to the name of the file in the link. | |
| title | No | save: short title for the header. | |
| usage | No | save: one line that describes the args it takes, for example 'contains (string, optional)'. | |
| action | No | list (default), run, save, preview_import or import. | |
| client | No | Client id from list_clients, for example c2. Defaults to the client that connected last. | |
| confirm | No | import: must be true. Set it only after the user has seen the code from preview_import and agreed. | |
| overwrite | No | save, import: replace a recipe that already exists (default false). | |
| description | No | save: one line that says what the recipe does. |