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. Synth writes the file as version, goal, handler, input, output and description. handler must be a handler the realm declares: defineRealm checks it at compile time, and synth 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.

Synth warns when input or output names a type this realm does not declare (UserInput as input excepted), and the build carries on. The type may come from another realm or from the owner, which synth cannot see, so the goal may still work. If nothing in the World declares it, the host drops the goal when it loads, and the warning is the first place the author hears of it. See the goal profile.