The define tool, which compiles modules into your beamlet and
keeps them.
An agent sends one or more modules. Each is checked against the token's policy and compiled into the running beamlet, ready to call straight away, and stays across restarts. Either all the modules land or none do.
Every module is saved in the code dir and committed to its git history, with the token that wrote it as the author.
A module that exists already is replaced only when its entry says
replace: true. The names Beamlet.* and Host.* are reserved.
Every module needs a @moduledoc and every public function a
@doc, so the next agent can find its way around.
A token has the tool when its policy lists :define under tools,
which brings patch with it. default does.
Input
{
"modules": [
{"code": "defmodule Shopping.List do..."},
{"code": "defmodule Shopping.Item do...", "replace": true}
]
}modules- Required. The modules to define, each with:code- Required. The source of one top-leveldefmodule.replace-trueto replace a module that already exists. Defaults tofalse.
Configuration
config :beamlet, define: [timeout: 60_000]:timeout- How long onedefineorpatchmay take to compile, in milliseconds. Defaults to 30 seconds.
Summary
Functions
The description a client lists for the tool, written for the model.