Skip to content

Goals

A goal lets the owner’s planner reach a handler from chat.

goals: {
"whats-down": {
handler: "oncall.open",
input: "UserInput",
output: "IncidentDigest",
description: "Tells the owner what is down across the services they depend on.",
},
},

The key is [a-z][a-z0-9-]{0,63}. input and output are type names ([A-Z][A-Za-z0-9]{0,63}); input may be UserInput, which reaches the handler as {"content": text}, and output may not. description is at most 512 characters. The key names the goal. handler must be a handler the realm declares: defineRealm checks it at compile time, and the host refuses one the realm does not declare. The host resolves input and output against the World’s declared types, publishes the goal as <key>_goal and binds the handler’s object result as the output type.

A type may come from another realm or from the owner. If nothing in the World declares a goal’s input or output type (UserInput as input excepted), the host reports and drops that goal when it loads. An SDK may warn earlier without treating an external type as an error. See the goal profile.