defineAgent() describes an agent in a file you deploy, and rt.agent runs agents and works with their threads. (For the tools an agent can call, see Tools.)
Define Agents
agents/code-assistant.ts
runtools deploy.
Execution Modes
in_sandbox, managed, and local-mac.
local-mac agents require a targetDeviceId from RunMesh:
Persistent Files
Forin_sandbox agents, mount a workspace on the linked sandbox. The agent works through the sandbox, and files under the mount path persist as the agent’s filesystem memory.
sandboxes/dev-env.ts
agents/code-assistant.ts
Run Agents
Manage runs
Inspect or stop runs after they start:Threads
THREAD_BUSY if another run is active on the same thread.
Attachments
Manage Agents
runtools deploy or the dashboard. Direct REST endpoints are documented in Create Agent.