scripting
15 public commands in this category.
add_visual_script_node
Add a node to the visual script graph (stub: acknowledges the node type but does not yet persist graph state; get_visual_script always returns an empty graph)
Scope:
scene:write. Token cost: 0.- nodeType string (required)
- Node type (e.g., OnUpdate, Translate, Branch)
apply_script_template
Apply a named script template to an entity
Scope:
scene:write. Token cost: 0.- entityId string (required)
- Entity to apply template to
- source string (required)
- TypeScript source to attach for this template application
- template string (required)
- Template name
attach_script_to_entity
Copy a script from the library and attach it to an entity
Scope:
scene:write. Token cost: 0.- entityId string (required)
- Entity to attach the script to
- scriptId string (required)
- Library script ID or name
compile_visual_script
Compile a visual script graph to TypeScript code
Scope:
scene:read. Token cost: 0.- entityId string (required)
- Entity whose visual script to compile
connect_visual_script_nodes
Connect two nodes in the visual script graph (stub: validates the connection shape but does not yet persist graph state; get_visual_script always returns an empty graph)
Scope:
scene:write. Token cost: 0.- sourceNodeId string (required)
- Source node ID
- sourcePort string (required)
- Source output port ID
- targetNodeId string (required)
- Target node ID
- targetPort string (required)
- Target input port ID
create_library_script
Create a new standalone script in the script library (not attached to any entity)
Scope:
scene:write. Token cost: 0.- name string (required)
- Script name
- source string (required)
- TypeScript source code
- description string (optional)
- Brief description of what the script does
- tags array (optional)
- Tags for categorization
create_script
Create and attach a new TypeScript script to an entity. Accepts entityId (defaults to primary selection), source code (required), optional enabled flag, and template hint.
Scope:
scene:write. Token cost: 0.- source string (required)
- TypeScript source code with optional onStart/onUpdate/onDestroy lifecycle functions
- enabled boolean (optional)
- Whether the script should run immediately (default: true)
- entityId string (optional)
- Entity to attach the script to. Defaults to the currently selected entity if omitted.
- template string (optional)
- Optional template hint (e.g. 'character_controller') for UI display
delete_library_script
Delete a script from the script library
Scope:
scene:write. Token cost: 0.- scriptId string (required)
- Script ID or name to delete
detach_script_from_entity
Remove the script from an entity (same as remove_script but with explicit intent naming)
Scope:
scene:write. Token cost: 0.- entityId string (required)
- Entity to detach script from
get_visual_script
Get the visual script graph for an entity
Scope:
scene:read. Token cost: 0.- entityId string (required)
- Entity to get script from
list_library_scripts
List all scripts in the script library with metadata
Scope:
scene:read. Token cost: 0.- query string (optional)
- Search filter (matches name, description, tags)
remove_script
Remove a script from an entity
Scope:
scene:write. Token cost: 0.- entityId string (required)
- Entity to remove script from
set_script
Set or update TypeScript script source on an entity (lifecycle: onStart, onUpdate, onDestroy)
Scope:
scene:write. Token cost: 0.- entityId string (required)
- Entity to attach script to
- source string (required)
- TypeScript source code with onStart/onUpdate/onDestroy functions
- enabled boolean (optional)
- Whether script is active (default: true)
- template string (optional)
- Optional label recording which template (if any) this script originated from
set_visual_script
Set the visual script graph for an entity
Scope:
scene:write. Token cost: 0.- entityId string (required)
- Entity to set script on
- graph object (required)
- Visual script graph JSON (nodes and edges)
update_library_script
Update an existing script in the script library
Scope:
scene:write. Token cost: 0.- scriptId string (required)
- Script ID or name
- description string (optional)
- New description
- name string (optional)
- New name
- source string (optional)
- New source code
- tags array (optional)
- New tags