Contributor walkthrough of how sendText is defined and dispatched.
Trace sendText through the runtime
This contributor walkthrough follows sendText from its schema definition to runtime dispatch. For the consumer contract, start with the sendText method block.
sendText is defined in packages/schema/src/methods/messaging.ts:
export const sendText = defineMethodV2('sendText', { meta: { description: "Sends a text message and returns a validated serialized message ID. The in-process Client throws SendTextError on failure. An unknown outcome means the message may have been sent: check the chat before retrying. Starting a chat with a new number requires an applied restricted or premium license.", namespace: "messages", httpMethod: "POST" }, parameterOrder: ["to","content","options"], // input: z.object({ to, content, options }), output: SendTextResultSchema});
A positional call maps by parameterOrder.
An object call resolves key aliases (chatId → to, text → content).
inputSchema.parseAsync() validates before dispatch.
Dispatch target is execute('sendText', validatedParams).