Talos docs

behaviour.write

Since next

[editor or disk] Write a TypeScript behaviour to scenes/behaviors/<name>.ts beside the scene, landed only if the build's type checker passes it; else NOTHING is written and the answer has the diagnostics.

Plain text

attach_to attaches it and runs the critic. Imports: types from "@argus/api", helpers from "@argus/gameplay", the project's files by relative path; nothing else. example.behaviour gives one that compiles. path instead of name: a ui/ file, checked for its kind. Change an existing file with edits, not source.

TitleWrite a behaviour
Mode
Token costabout 548 tokens (in the default list, paid on every call)
Toolsetcore

Arguments

ArgumentTypeRequiredDefaultAllowed valuesDescription
agentstringnoThe name of the agent making the call, when several agents share one connection: each named agent is its own actor and plays its own game. Leave it out when there is one agent.
attach_tostringnoAn entity id; one undo step
deletebooleannoRemove name or path (a ui/, scene, model or data file); revert undoes; refused while referenced
dryRunbooleannoWith run: diff only
editsobject[]no[{old, new, replaceAll?}] on an existing file: old exact, unique unless replaceAll; in order, all or none, then checked
filesobject[]noUp to 32 {name|path, source|edits|delete: true, attach_to?, props?, overwrite?}; deletes after writes; a result each
namestringnoNo path or extension; the module is behaviors/<name>
onEditednoWith run: keep or overwrite hand-edited owned entities (else refused); or {id: …}
overwritebooleannofalse
pathstringnoInstead of name: ui/{screens/.tsx, styles/.css, theme/.css, locales/<locale>.json, scenarios/.json}, authoring/<name>.ts (builds entities from data), data/**.json|csv, selftest/<name>.json
propsobjectnoIts settings, with attach_to
runboolean | stringnoRun the authoring script written (true) or named; it replaces its <name>:* entities as one change
scenestringnoThe scene file to act on. The open scene when absent.
sourcestringnoA new file's whole module, at most 256 KiB, default-exporting a Behavior

Example

An MCP tools/call with the required arguments (placeholders in angle brackets).

{
  "name": "behaviour.write",
  "arguments": {}
}