Skip to content

ActionRun

ActionRun = { kind: "update"; values: Record<string, unknown>; } | { kind: "delete"; } | { kind: "link"; to: AppAddress; } | { href: string; kind: "link"; } | { kind: "ai"; prompt?: string; writes: string; }

Defined in: packages/schema/src/model.ts:908

What a named action does in the app: set fields of the record (update), delete it (delete), go to an address in the app (link with to), open a link that leaves it (link with href), {field} replaced by the record’s values, or have the model write a field (ai). Without it the app runs a handler it registered by name.

{ kind: "update"; values: Record<string, unknown>; }

kind: "update"

Updates the record.

values: Record<string, unknown>

The fields it sets, by name; a value that is exactly {input} is that input’s answer.


{ kind: "delete"; }

kind: "delete"

Deletes the record, soft deleting when the resource does.


{ kind: "link"; to: AppAddress; }

kind: "link"

Goes to an address in the app.

to: AppAddress

The address, with {field} replaced by the record’s values.


{ href: string; kind: "link"; }

href: string

The link (https:, mailto:), with {field} replaced by the record’s values, percent-encoded; or only {field}, the https: or http: URL the record holds, without which the action does not show.

kind: "link"

Opens a link that leaves the app, an https: or http: one in a new tab without the referrer.


{ kind: "ai"; prompt?: string; writes: string; }

kind: "ai"

Has the model write one field of the record from prompt, {field} replaced by the record’s values, as the user.

optional prompt?: string

The prompt, with {field} placeholders; /meta leaves it out.

writes: string

The field it writes.