a11-flow-run – runs a .flow file as a program.
Flow was a way to describe how deployed actions connect. With the standard library beside it – files, a clock, processes, this process's own standard streams – a file can also just be a program, and this is what runs one:
a11-flow-run wc.flow < some-file
a11-flow-run greet.flow -- Helena
The file says which of it is the program by declaring a flow with no name:
flow {
describe "What this program does."
...
}
and everything else in the file – named flows, structs – is what that one uses. argc and argv arrive as ports nobody declared, argv[0] being the program's own name as in C.
What a program may expect to be bound
Everything in a11::sdk::flow, plus the standard streams. That is the contract this interpreter offers and the reason a file can be written against it: a program that reads read_stdin and writes write_stdout will find them, and one that reads a file will find read_file – inside whatever roots this run allows, which is the working directory unless told otherwise.
Policy limits
There is no way to widen the policy from inside the file. --allow-write, --root, --allow-run and --allow-net are arguments to this program, because a capability a script could grant itself is not a capability anybody granted. A file handed to this interpreter can therefore be read for what it will do, and the command line is where what it may do is written.
The exit code
Zero when the entry flow finished, and non-zero when it failed – with the failure on standard error as a diagnostic, positioned in the source where the language could say where. A flow that wants to choose its own exit code puts one on an out exit_code: integer port.