Coldwave Read the docs

Protocol: copy, part 1 of 2#

The copy 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.

copy.make#

copy.make {name?: text, for?: text, mode?: text, at?: integer, about?: text, of?: [text]} -> {copy: text, hand: integer, file: text, folder: text, base: record, bytes: integer, parked: text, ms: number} · write

Makes a copy of the game, from the session's owner only (its standard streams or its own token; E0474 from anyone else): every file of the game copied into .frost/copies/NAME/ beside the project file (a folder whose name starts with a dot is left out, as the game's own listing leaves it out), and that folder loaded as a game of its own on a thread of its own, started from the person's game as it stands (put in as game.restore puts a moment back) or at a step of the recording. With for, a hand is made for it with a token of its own, written to a join file beside the session's as session.token writes one: a connection that comes by that token is in the copy, and every command it sends (game.step, world.set, frame.capture, blame.value, project.rename, ...) acts on the copy with no new parameter; the owner sends copy: NAME on any command instead. A file saved in the copy's folder is taken in at the copy's next command, as frost dev takes in a save: a script is swapped and keeps its state, a picture is shown as it is now, anything else loads the copy's game again. Nothing a copy does moves the person's game, its step, checksum, snapshots, keyframes, log, hands or files; a copy has no debugger (E0475) and no place for saves. Refused in words (E0476), with nothing left behind: a game handed to the program, a name taken or a folder of that name there from before (never reused or removed: copy.list lists it), a copy that does not load. Refused (E0480), with nothing made, for a tag whose hand works in another copy already, naming that copy: a hand is in one copy, as copy.give holds it. When 16 copies are live, the one idle longest that is not busy is parked first (copy.park); with 256 kept, live and parked, another is refused naming the one idle longest (E0479). Its base and what it is about are kept on disk beside its folder (.frost/copies/NAME.json, which holds no token), so the game served again finds it, parked.

ParametersTypeMeaning
name?textThe copy's name: 1 to 64 letters, digits, - and _. Left out: copy1, copy2, ..., the first free.
for?textThe tag of the hand the copy is for, 1 to 64 characters, as session.token takes one: the hand is made (or found, for a tag given before) with a token of its own and a join file, and is in this copy from then on; refused (E0480) when that hand works in another copy, which the refusal names. Needs a session that writes join files (frost serve --join-file). Left out: no hand; the owner reaches the copy with copy: NAME.
mode?textThe hand's mode: "plan" (it only reads, in its copy too), "ask", "trial" or "free". Left out: "trial".
at?integerA step of the recording: the copy is played there on its own files, as game.seek plays it. Left out: the person's game as it stands now.
about?textWhat the copy was made to do, at most 200 characters: kept and given back by copy.list, never read.
of?[text]Copies to see together: a together copy, the game as it stands with each one's changes since its base merged on top in this order, as copy.land merges them (a scene or project file by thing, part and field), refused (E0477) naming what two changed two ways. It is read with copy: NAME as any copy; it has no hand and is never landed, rebased, queued or given (E0552); it is parked like any copy, keeps no record and goes with the session; it goes as soon as one of its copies changes: a request for it looks first and is refused naming that copy (E0552), and copy.list and copy.events find it gone within a few requests. Not with for or at.
ResultTypeMeaning
copytextThe copy's name.
handintegerThe hand made for it, or null without for.
filetextThe hand's join file, for frost mcp --join-file, or null without for.
foldertextThe copy's folder: a whole game, for the hand's own file tools to read, search and change.
baserecordWhat the copy started from: {landing, step, checksum}, the number of the game's last landing (0 before any; copy.landed), and the step and the world's checksum its game started at (the person's, when it was made from the game as it stood).
bytesintegerThe bytes of the files copied.
parkedtextThe copy parked to make room for it, or null.
msnumberHow long making it took in the engine: the files copied, the game loaded and started.

copy.list#

copy.list {summary?: value, group?: text, after?: text, limit?: integer} -> {landing: integer, queued: [text], next: text, copies: [record]} · read, read-only

Lists the copies of the game, live and parked, for everyone: each with its hand, where its game stands and what it changed against what it was made from. The copies kept in the game's folder by an earlier session are found and listed too, parked, with their bases; a folder there with no record of its base is listed with base, files and behind null, and is never woken, landed or rebased (E0481) until copy.drop takes it away.

ParametersTypeMeaning
summary?valuetrue: counts and groups, no rows, from what the session holds (no folder read): {landing, queued, count, states: {live, parked, busy}, behind: {"0", "1-9", "10+"}, tests: {passes, failed, none}, groups: [{group, count, live, behind}], claims: the copies that claim anything}, a group a hand's tag up to a / (red/a is in red), else the first word of about, behind in a group the copies behind any landing. For an editor showing hundreds of agents. Left out: false.
group?textOnly the copies of this group, as summary names groups. Left out: all.
after?textOnly the copies made after this one: the next of the page before it. Left out: from the first.
limit?integerAt most this many copies; next then names the last listed, to ask after it. Left out: 100, and next when there are more.
ResultTypeMeaning
landingintegerThe number of the game's last landing: 0 before any.
queued[text]The copies whose landings are in the landing queue (copy.queue), in the order asked.
nexttextWith limit, the last copy listed when more come after it: ask with after: next. Else null.
copies[record]One {copy, hand, who, about, mode, state, busy, held, moment, shared, step, checksum, base, behind, files, says, test, tests, last_change, last_run, bytes, idle_s, folder} per copy, in the order they were made. hand, who and mode are its hand's (null for a copy made without for); state is "live" or "parked" (its game let go: the next command that reaches it wakes it); held is, for a parked copy, the bytes it holds beyond its folder (its moment, and what it knows of its files by hash), null for a live one; shared is, for a parked copy with a moment, how many parked copies share that one moment (copies made from one moment of the game share it while they have not moved; held then counts its share), null for a live one; moment is, for a parked copy, whether it keeps a moment of its game (false for one found again after the game was served again: it wakes at its step, played on the recording), null for a live one. busy is true while its game is carrying out a command: the copy is listed without waiting for it, step, checksum, last_change and last_run as they were when it last finished one. step and checksum are where its game stands. base is copy.make's, its landing moved by copy.rebase (to the game's last) and by its own landing (whose changes are then no longer its own to land); behind counts the landings of other copies since, which it does not play until its copy.rebase. files is what its folder changed from what was copied: one {path, line, added, removed} per file changed, added or taken away, line the first line, from 1, that is not as it was, added and removed the lines it adds and takes away (all three null for a file that is not text). says and test are what its last change.test said and came to: test {passes, on, line, first: [{part, step}], n}, first the step each said part first differs at, or null before any test; tests {run, failed} counts its tests, a landing's among them. last_change is the last file it took in: {what: "file", name, line, step, n, error}, line the first line of it that is not as it was before, error why it could not be taken in (the copy runs on as it was) or null. last_run is its last game.step, game.seek or game.try that left its game at the end of the recording: {to_step, checksum, n}. n counts the copy's changes, runs and tests, so a run whose n is above the last change's is a run after it, and a test whose n is below it is of an older change. claims is its claim (copy.claim), {things, files, about}, or null. of is, for a together copy (copy.make {of}), the copies it is of, null for any other. bytes is what its folder holds (files and bytes are read again only when the copy's folder, by each file's length and time, or its base is not as when last listed); idle_s the seconds since anything was asked of it; folder where it is.

copy.drop#

copy.drop {copy?: text} -> {dropped: text, copies: integer, busy: value, bytes: integer, problem: text} · write

Drops a copy, live or parked: its game stops and its folder and record are removed. A copy busy with a command is not waited for: it is gone from the list at once, and its folder is removed when that command ends. The owner drops any copy; a hand in a copy drops its own (E0474 for another). The hand stays the copy's: what it sends from then on is refused (E0473), never carried out in the person's game.

ParametersTypeMeaning
copy?textThe copy to drop. Left out: the hand's own.
ResultTypeMeaning
droppedtextThe copy dropped.
copiesintegerHow many copies are kept now, live and parked.
busyvalueWhether it was busy with a command: its folder is then removed when that command ends.
bytesintegerThe bytes its folder held.
problemtextNull, or why its folder could not all be removed.

copy.land#

copy.land {copy?: text, says?: [text]} -> {landed: value, landing: integer, change: integer, wrote: [record], waits: text, line: text, test: record, reloaded: value, problem: text, claimed: [record], ms: number} · write

Lands a copy's changes in the person's game. What the copy changed since its base (copy.list's files) is merged onto the game's files as they are now: a scene or project file (.toml) by thing, part and field, so changes to other things, other parts or other fields of one part all land (things and parts added or taken away as a set, the order of things kept by name; a value written over lines, a tilemap's rows, merged by its lines; the run frost test --write writes, replay and checkpoints, the game's, written again by the landing), and any other text, or a .toml that cannot be read so, line by line. The same field changed on both sides in two ways (or lines, or touching lines, of another text) is refused naming the file and, for a field, its thing, part and field and the base's value and each side's (E0477, each clash in data.clashes as {path, thing, part, field, base, ours, theirs, lines: {ours, theirs}, by}), nothing written. The merged files are played over the game beside it on the recording and held to what the copy says, as change.test {copy} holds them; when a landing since the copy's base said a part this one says too (one thing's part, mark_3.Rect.color, and another thing's never overlap), a third game plays the copy alone (its whole folder), and that part must be in the merged game what it is there, from its step on, or the landing is held saying where, with both values and that landing. A change that passes is written as one change of the session's journal (project.undo takes it back byte for byte), with the recorded run it now comes to in the project file and each shot it changed as said in shots/, so frost test passes after; each saved test of the game (another project file beside it that records a run, its test_of this game's or none) is held the same way on its own recording, and the run it now comes to is written in the same change, so it passes after too; a saved test that moves where the copy did not say holds the landing, naming it; one whose run did not hold before is left as it was; the game is loaded again from its files. The owner lands any copy; a copy's hand lands its own in the mode free only, and otherwise is told it waits for the person, with the test, and nothing is written. Every landing and every one held is kept in the landing log (copy.landed). Other copies play it only at their own copy.rebase. E0478: nothing to land, or a file that could not be written (nothing is).

ParametersTypeMeaning
copy?textThe copy to land. Left out: the hand's own.
says?[text]What the change changes, as change.test's says. Left out: what the copy's last change.test said.
ResultTypeMeaning
landedvalueWhether it was written.
landingintegerThe landing's number, from 1, or null.
changeintegerThe change of the session's journal it made (project.undo), or null.
wrote[record]One {path, sha256} per file written, sha256 null for one taken away: the merged files, the project file when the run moved, each saved test whose run moved, and the shots it changed.
waitstext"the person" when the test passes and the hand may not land by itself; else null.
linetextWhat became of it, in a sentence: landed, held (the test's sentence, and for two that fail together the landing it is on top of and copy.rebase), or waiting.
testrecordThe test, as change.test {copy} answers it, on: {landing} the game it was played on; with the stage tests and saved, one {run, passes, held, wrote, line} per saved test of the game: run its project file, passes whether it differs only where the copy said on its recording, held whether its run held before (one that did not is not held to the change), wrote whether its new run is written.
reloadedvalueWhen landed: whether the game loaded again from its files.
problemtextWhen landed: null, or why the game did not load again (it runs on as it was).
claimed[record]When landed: other copies' claims (copy.claim) on the things or files it landed, {thing | file, copy, about} each; it landed all the same.
msnumberHow long the landing took in the engine.

copy.rebase#

copy.rebase {copy?: text} -> {copy: text, base: record, merged: [text], untouched: [text], ms: number} · write

Puts a copy on what has landed: the game's files as they are now, with the copy's changes since its base merged onto them as copy.land merges them (a scene or project file by thing, part and field), are written into the copy's folder, and taken in by its game at its next command, as a save is. Its base is then the game's files and its landing the last (behind 0). A field (or lines of another text) changed on both sides in two ways is refused naming it, as copy.land refuses it (E0477, data.clashes), nothing written. A copy never takes a landing in by itself. The owner rebases any copy; a copy's hand its own.

ParametersTypeMeaning
copy?textThe copy to rebase. Left out: the hand's own.
ResultTypeMeaning
copytextThe copy.
baserecord{landing}: the landing it is on now.
merged[text]The files of its folder written: the game's changes, merged with its own where it had any.
untouched[text]The files it changed that the game did not: its own as they were.
msnumberHow long it took in the engine.

copy.landed#

copy.landed {after?: integer} -> {landing: integer, entries: [record]} · read, read-only

The landing log of the game, for everyone: each landing and each one held, oldest first. It is kept on disk (.frost/landings.json beside the project file), so the game served again goes on numbering its landings; an entry of an earlier session has change and undone null, since the journal project.undo takes changes back from is the session's.

ParametersTypeMeaning
after?integerOnly the entries after this n. Left out: all.
ResultTypeMeaning
landingintegerThe number of the game's last landing: 0 before any.
entries[record]One {n, landing, copy, who, about, files, says, first, verdict, line, by, at, tests, change, undone, stages} per landing or landing held: n its place in the log, landing its number (null when held), files the lines it changed of the game ({path, from, to, added, removed}, added and removed its lines, as copy.diff counts them), says what it said, first the step each said part first differed at ({part, step}), verdict "landed" or "held", line the sentence, by "the person" (the owner's) or "itself" (a free hand's own), at the seconds since 1970 it was asked, tests {run, failed} the copy's tests until then, change the journal's change and undone whether project.undo took it back (kept for this session even after the inverse leaves the 64-change journal), stages each stage its test answered ({name, passes, line}).

copy.queue#

copy.queue {copy?: text, says?: [text]} -> {copy: text, place: integer, queued: integer} · write

Puts a copy's landing in the landing queue, at its end: the queue keeps the order landings were asked in, and copy.flush lands them, many at a time, each test run shared by a batch. The owner queues any copy; a copy's hand its own in the mode free only (E0550 otherwise). A copy already in the queue is refused (E0550). Nothing is merged or tested until copy.flush; copy.list's queued lists the queue.

ParametersTypeMeaning
copy?textThe copy whose landing to queue. Left out: the hand's own.
says?[text]What the change changes, as copy.land's says. Left out: what the copy's last change.test said.
ResultTypeMeaning
copytextThe copy.
placeintegerIts place in the queue, from 1.
queuedintegerHow many landings the queue holds now.

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