The patch tool, which edits the source of modules agents defined.
An agent names a module and an anchor in its source, then replaces
the anchor or inserts text before or after it. The anchor is a
piece of text that occurs exactly once, or a function given as
name/arity, together with its @doc and @spec.
The patches apply in order. The modules they touch then go through
everything define does, as one change: checked against the
token's policy, compiled and committed. Either all of it lands or
none of it does.
A token has the tool whenever it has define
(Beamlet.MCP.Define).
Input
{
"patches": [
{"module": "Shopping.List", "find": "@limit 10", "replace": "@limit 50"},
{"module": "Shopping.List", "select": "add/2", "after": "def remove(list, item) do..."}
]
}patches- Required. The patches to apply, in order, each with:module- Required. The module to edit, such asShopping.List.find- Text that occurs exactly once in the module's source.select- A function asname/arity, with its@docand@spec.replace- Text to put in place of the anchor. Empty removes it.before- Text to insert before the anchor.after- Text to insert after the anchor.
Each patch takes one anchor, find or select, and one of
replace, before or after.
Configuration
Nothing of its own. A patch uses define's :timeout
(Beamlet.MCP.Define).
Summary
Functions
The description a client lists for the tool, written for the model.