What is supported
Any TypeScript or JavaScript on Node.js 22 or 20. A function is the documented path for TypeScript agents, and the way to deploy any library Onecortex does not recognise.A complete agent
agent.yml
package.json
agent.ts
A complete A TypeScript function example
order-status: A plain function with a lookup tool of its own, reported as real tool events.The prompt and the reply
The function receives the prompt, and a context as its second argument:{ sessionId, request }, where request holds prompt, params, surface and messages. What it may return:
Events it reports
See Streaming and events.
The caller’s fields
Incontext.request.params:
Report tool calls
Yield event objects alongside your text:v is filled in for you, and Onecortex adds the closing done.
Known limits
- An object with a
typekey is always read as an event. Yield a string to send data that has one.
Troubleshooting
More on Troubleshooting and Errors.