Coldwave Read the docs

Protocol: project#

The project commands a program sends to a running game, as the engine describes them: what each takes, what it answers and what it does. Back to all commands.

project.add#

project.add {kind: text, name: text} -> {file: text, project: text} · trusted-project-only

Adds a scene or a script to the game: writes the file from the engine's own stub (a scene with nothing in it; a script with an empty on_scene and step) and names it in the project file's scenes or scripts, after the last one, every comment and line of the project file kept as written. The running game is not changed: game.reset loads it with the new file, and frost dev, which watches the project file, does that by itself. Refused (E0446), with nothing written, when the name is taken (the project names it, or a file is there), is not a plain path, or is outside the project; and for a game a web page handed to the server.

ParametersTypeMeaning
kindtext"scene" or "script".
nametextIts path from the project file's folder, / between folders, of letters, digits, -, _ and ., with or without .toml or .luau: "level2", "ai/boss".
ResultTypeMeaning
filetextThe file written, by its path from the project file's folder: "level2.toml".
projecttextThe project file that now names it.

project.remove#

project.remove {file?: text, maybe?: value, unlist?: value, kind?: text, name?: text} -> {file: text, project: text, unlisted: [text], wrote: [record], maybe: [record], change: integer, kept: text} · trusted-project-only

Given file, removes any file of the game: it leaves every list of the project file that names it (scenes, scripts, libraries, data, images, sounds, fonts, models; every other comment and line kept as written) and is taken out of the game. It is one change, numbered by change, as a project.rename is: the file is moved into .frost/removed/N/ beside the game (answered as kept), so project.undo puts it and the project file back byte for byte and project.redo removes it again; the folder is the engine's own and may be deleted to let the file go for good. Refused (E0446), with nothing changed, while anything else names it for certain (another key of the project file, a saved test, a scene, a script: the places project.refs lists with followed true), and for the project file itself. unlist: true also takes it out of the project file's other keys and lists in the same change (a key's whole line, as recording = "run.toml" under [input]; an item of a list), every other line and comment kept; refused in words for the scene the game starts in (scene), for a place that is not a line of its own, and when the project file would no longer load without it. A place that only may name it (a script's call whose name is made as it runs, followed false) refuses too, unless maybe: true says to remove it although those remain; the answer lists them. Given kind and name, takes back a project.add: the scene or script leaves the project file's scenes or scripts (every other comment and line kept as written) and its file is deleted. Only while the file is still exactly the engine's stub and nothing else in the game names it, so nothing a person wrote is lost: an editor's undo of adding one, not a delete. The running game is not changed. Refused (E0446), with nothing changed, when the project does not name it, it is the scene the game starts in, its file has changed since it was added, or a scene, script or library names it; and for a game a web page handed to the server.

ParametersTypeMeaning
file?textAny file of the game, by its path from the project file's folder with /: "art/old.png". Given it, leave out kind and name.
maybe?valueWith file, true: remove it although places that only may name it remain (project.refs's followed false); they are answered as maybe. A place that names it for certain still refuses. Left out: such a place refuses.
unlist?valueWith file, true: take its name out of the project file's keys and lists beyond the eight lists, in the same change. Left out: such a place refuses.
kind?text"scene" or "script", with name: the undo of a project.add.
name?textIts path from the project file's folder, as project.add was given it or answered it: "level2", "ai/boss.luau".
ResultTypeMeaning
filetextThe file deleted, by its path from the project file's folder.
projecttextThe project file that no longer names it.
unlisted[text]The project file's lists it was taken out of, once for each time it was named: ["images"]; with unlist, the other keys too, each by its path: ["input.recording"].
wrote[record]{path, sha256} of the project file when it was rewritten, else empty.
maybe[record]With file: {path, line, column, text, followed, why}, as project.refs gives them: the places that may name the file and were left as they are; empty when there is none. Left out with kind and name.
changeintegerWith file: the change's number, for project.undo. Left out with kind and name, which is no change of its own.
kepttextWith file: where the removed file is kept for project.undo, from the project file's folder: ".frost/removed/1/art/old.png".

project.refs#

project.refs {file: text} -> {file: text, refs: [record], read: text, columns: text} · read, read-only

Lists every place in the game that names one of its files: the project file's lists, a scene's fields that hold a path (a picture, a sound, a font), a saved test's scene and test_of, and a script's library, data, scene.load, sound.play and music.play, and any other plain string a script or a file of values (data) writes that is the file's path. A name is the file however it is spelled (./art/hero.png, and another case of its letters on a disk that takes both for one file). A script's call whose argument is not a literal string cannot be followed without running it: it is listed with followed false, never guessed at. What an editor asks before it renames or removes a file. Changes nothing.

ParametersTypeMeaning
filetextThe file, by its path from the project file's folder with /: "art/hero.png". Refused (BadParams) when it is not in the game's folder, or is in .ven or export.
ResultTypeMeaning
filetextThe file, as named.
refs[record]{path, line, column, text, followed, why}: each place, by its file from the project file's folder, its line and the UTF-16 column the name's text begins at (both from 1), the line's text trimmed, and followed false for a script's call whose file is made as it runs; why says in a word why a place is not followed ("made": the name is made as the script runs, so this place may name the file or may not), and is null for one that is. In the order: the game's project file, the other project files beside it (saved tests), its scenes, its scripts.
readtext"text": the files were read as text, not run.
columnstext"utf16": how columns are counted.

project.rename#

project.rename {from: text, to: text, dry?: value, force?: value} -> {from: text, to: text, rewrote: [record], left: [record], moved: [record], runs: [record], change: integer, dry: value, reloaded: value, problem: text} · trusted-project-only

Renames or moves one file of the game and writes its new name over the old at every place project.refs lists: the project file's lists and keys, the saved tests beside it, the scenes' fields, the files of values, and the plain strings of the scripts (library, data, scene.load, sound.play, music.play and any other), each between its own quotes and in the spelling it had (./art/hero.png becomes ./art/knight.png), every comment and line kept as written; an atlas's sheet too. The file's source note and terms (NAME.from.toml, NAME.terms.txt) go with it. It is one change, numbered by change: project.undo puts every file back byte for byte, and project.redo makes it again. The session then loads the game again from its files, as game.reset does (step 0). dry: true answers the same and changes nothing. One file at a time: a folder is not renamed. Refused in words, with nothing changed: to is taken (E0463); there is no file from, or it is a folder (E0464); a path leaves the game's folder, is not plain, or to has a part that is not letters, digits, -, _ and . (E0465); the ending would change, which says what the file is (E0466); a place names the file and cannot be written over (E0467): a script's call whose argument is made as it runs, a string written with an escape, an atlas's pattern, a model's uri, a line of C#, each named in the sentence, unless force is true, which renames and answers them as left; the game's project file, or a saved test into another folder (E0468); a game a web page handed to the server (E0469). A hand that is planning is refused as for every write (E0447), a dry run too. A renamed scene leaves a recorded run's checksum as it was. A renamed script keeps its recorded runs: a script's state is kept under its file's name, which the checksum covers, so each project file at the top of the game's folder that plays the script and records a run (the game's, its saved tests) is played once before anything is written, its run summed as it is and as it is with the new name; when the first is what the file records, the second is written over it in the same change (only the digits of each sum), and the game as accepted beside it (.frost/accepted/NAME) is carried too while it is the game on disk, so frost test passes after and project.undo takes all of it back. A run that did not hold before the rename is left as it was (written: false). A dry run plays none. A script renamed by hand still fails its test, saying it was renamed. A renamed picture (any file but a script or a scene) keeps its recorded runs the same way: the world holds its name as a text (a Sprite's image), so each run is summed with every text the rename writes over read as it is written now, unless a place was left as it was (force), when no run is carried and frost test --write accepts it again.

ParametersTypeMeaning
fromtextThe file, by its path from the project file's folder with /: "art/hero.png".
totextIts new path, the same way, each part of letters, digits, -, _ and ., with the ending from has: "art/knight.png". Folders that are not there are made.
dry?valuetrue: answer what would be done and change nothing.
force?valuetrue: rename although places that name the file cannot be written over, and answer them as left.
ResultTypeMeaning
fromtextThe file as the disk names it.
totextIts new path.
rewrote[record]{file, line, was, now}: each name written over, by the file it is in (as it was named before the change), its line from 1, and the name as it was spelled and as it is now.
left[record]{file, line, text, why}: each place that names the file and was not written over, with the line's text and why; empty unless force (or dry) let them be.
moved[record]{from, to}: the file, then its source note and terms when it has them.
runs[record]{file, was, now, written, accepted}: each project file whose recorded run keeps the renamed script's state, or holds the renamed picture's name, with the run's checksum before the rename and after it, whether the new one was written (false when the run did not hold before the rename), and whether the game as accepted beside it was carried; empty for a scene, a file no world holds and a dry run.
changeintegerThe change's number, for project.undo; null for a dry run.
dryvalueWhether nothing was changed.
reloadedvalueWhether the game was loaded again from its files; false for a dry run, and when it no longer loads (it then runs on as it was).
problemtextWhy the game did not load again, as its error says it; null when it did.

project.undo#

project.undo {change?: integer, landing?: integer} -> {change: integer, landing: integer, from: text, to: text, wrote: [text], moved: [record], reloaded: value, problem: text} · trusted-project-only

Takes back the latest change of the project's files this session made and has not undone (a project.rename, or a project.remove of a file): every file it wrote is put back byte for byte, every file it moved goes back to its place, and a folder it made is taken away when empty. The session then loads the game again from its files. Refused (E0470), with nothing changed, when there is no such change, when change names another than the latest, or when a file is no longer as the change left it (the sentence names it): nothing written since is lost. The session keeps its latest 64 changes; they are not kept past the session. Instead of change, landing selects one landing from that journal to reverse around later independent edits, using the landing field/line merge and testing against its original says before any project file is written. Its replay sums and changed shots are accepted together; a game with shots requires a graphics adapter. A clash, a failed test, an unknown, expired or already-undone landing, or both selectors is E0470. The inverse is a new journal change (change in the answer), so ordinary undo/redo takes back/makes again the inverse; copy.landed and copy.diff report the original landing as undone while the inverse stands, even after it leaves the 64-change journal. Shots added by that landing are removed with their entries; temporary undo staging is removed after success or refusal. copy.events emits undone with landing and change. See docs/party.md for a headless example.

ParametersTypeMeaning
change?integerThe number the change answered, to be sure which is undone; left out: the latest.
landing?integerInstead of change: reverse this landing while preserving later independent edits, as a new tested change. E0470 on a clash or a landing outside this session's journal.
ResultTypeMeaning
changeintegerThe change undone.
landingintegerFor a selective undo, the landing reversed; change is the new inverse, which ordinary undo/redo takes back/makes again.
fromtextThe file the change renamed, as it is named again.
totextThe name the change gave it.
wrote[text]The files whose text was put back.
moved[record]{from, to}: each file moved back.
reloadedvalueWhether the game was loaded again from its files.
problemtextWhy it did not load again; null when it did.

project.redo#

project.redo {change?: integer} -> {change: integer, from: text, to: text, wrote: [text], moved: [record], reloaded: value, problem: text} · trusted-project-only

Makes again the change project.undo took back last, while no other change was made since: the same files written and moved. The session then loads the game again from its files. Refused (E0470), with nothing changed, when nothing is undone, when change names another, or when a file is no longer as the undo left it.

ParametersTypeMeaning
change?integerThe number of the change to make again; left out: the one undone last.
ResultTypeMeaning
changeintegerThe change made again.
fromtextThe file the change renames.
totextThe name it has again.
wrote[text]The files whose text was written again, as they are named now.
moved[record]{from, to}: each file moved.
reloadedvalueWhether the game was loaded again from its files.
problemtextWhy it did not load again; null when it did.

Generated from Coldwave 0.0.1 r289, 2026-11-30 by the binary itself: do not edit by hand.