Skip to content

actionResponseSchema

function actionResponseSchema(output): ZodObject<{
data: ZodOptional<ZodUnknown>;
items: ZodArray<ZodObject<{
data: ZodUnknown;
itemType: ZodString;
key: ZodOptional<ZodString>;
}, $strip>>;
message: ZodOptional<ZodString>;
result: ZodOptional<ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>>;
state: ZodOptional<ZodUnknown>;
status: ZodEnum<{
completed: "completed";
interrupted: "interrupted";
}>;
}, $strip>;

Defined in: protocol/protocol.ts:30

The response of an action call, parameterised by the action’s output schema. A single shape for both outcomes: completed carries result, interrupted carries message/data/state; both carry the items emitted during the call. This is the one definition of the wire contract — the server serialises through it, the client’s ActionEnvelope type is inferred from it.

Parameter Type
output ZodType

ZodObject<{ data: ZodOptional<ZodUnknown>; items: ZodArray<ZodObject<{ data: ZodUnknown; itemType: ZodString; key: ZodOptional<ZodString>; }, $strip>>; message: ZodOptional<ZodString>; result: ZodOptional<ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>>; state: ZodOptional<ZodUnknown>; status: ZodEnum<{ completed: "completed"; interrupted: "interrupted"; }>; }, $strip>