Imperal Docs
SDK Reference

Element Catalog

Browse every element of the Imperal SDK in one place — UI components, decorators, SDL roles, ctx methods and data types, each with a copy-pasteable example.

Every public element of the Imperal SDK, structured by category and searchable on one page. This catalog is generated from the canonical SDK reference, so when the SDK gains an element it appears here automatically. For a per-symbol deep dive, follow each element's anchor or its dedicated reference page.

286 elements across 6 categories

Declarative panel primitives — compose surfaces with `ui.*`.

The previews below are live — rendered by @imperal/ui-kit, the same declarative renderer the Imperal Panel uses, from a sample of each component. The canonical contract (props, types, enums) is the signature shown on each element, sourced from the SDK reference.

ui.Accordion(sections, allow_multiple?) → UINode#
ui.Accordion(
    sections=[
        {
            "title": "Section one",
            "content": ui.Text(content="Body one"),
        },
        {
            "title": "Section two",
            "content": ui.Text(content="Body two"),
        },
    ],
)
Loading preview…
ui.Alert(message, title?, variant?, dismissible?, type?) → UINode#
ui.Alert(
    type="info",
    title="Heads up",
    message="This is an alert message.",
)
Loading preview…
ui.Audio(src, title?, controls?, autoplay?, loop?) → UINode#
ui.Audio(
    src="https://www.w3schools.com/html/horse.mp3",
    title="Sample audio",
    controls=True,
)
Loading preview…
ui.Avatar(fallback?, src?, size?) → UINode#
ui.Avatar(fallback="AI", size="md")
Loading preview…
ui.Badge(label?, value?, color?, size?, dot?) → UINode#
ui.Badge(label="New", color="blue")
Loading preview…
ui.Button(label, variant?, on_click?, disabled?, size?, full_width?, icon?, icon_left?, icon_right?, loading?, loading_label?, type?) → UINode#
ui.Button(label="Click me", variant="primary")
Loading preview…
ui.Call(function) → UINode#
ui.Call(function="save_note")
Loading preview…
ui.Card(title?, subtitle?, content?, footer?, on_click?, border?, padding?) → UINode#
ui.Card(
    title="Card title",
    subtitle="Subtitle",
    content=ui.Text(content="Card body content."),
)
Loading preview…
ui.Chart(data, type?, x_key?, height?, colors?, y2_keys?, title?, description?, show_legend?, show_data_table?) → UINode#
ui.Chart(
    type="line",
    x_key="label",
    data=[
        {
            "label": "Mon",
            "value": 3,
        },
        {
            "label": "Tue",
            "value": 7,
        },
        {
            "label": "Wed",
            "value": 5,
        },
    ],
)
Loading preview…
ui.Checkbox(label?, value?, on_change?, param_name?, description?, error?, required?, disabled?) → UINode#
ui.Checkbox(
    label="Email me deploy results",
    value=True,
    description="One message per finished deploy.",
    param_name="notify",
)
Loading preview…
ui.Code(content, language?, line_numbers?) → UINode#
ui.Code(language="python", content="def hello():\n    print('hi')")
Loading preview…
ui.Column(children, gap?) → UINode#
ui.Column(
    children=[
        ui.Text(content="Row A"),
        ui.Text(content="Row B"),
    ],
    direction="column",
)
Loading preview…
ui.DataColumn(key, label, sortable?, width?, editable?, edit_type?) → UINode#
ui.DataColumn(key="last_sync", label="Save", sortable=True, width="width")
Loading preview…
ui.DataTable(columns, rows, on_row_click?, on_cell_edit?, empty_text?, max_height?, sticky_header?) → UINode#
ui.DataTable(
    columns=[
        {
            "key": "name",
            "label": "Name",
        },
        {
            "key": "role",
            "label": "Role",
        },
    ],
    rows=[
        {
            "name": "Ada",
            "role": "Admin",
        },
        {
            "name": "Linus",
            "role": "Dev",
        },
    ],
)
Loading preview…
ui.DatePicker(value?, placeholder?, on_change?, param_name?, label?, description?, error?, required?, disabled?, min?, max?) → UINode#
ui.DatePicker(placeholder="Pick a date", value="2026-06-21")
Loading preview…
ui.Dialog(title, content?, confirm_label?, cancel_label?, on_confirm?, destructive?) → UINode#
ui.Dialog(
    title="Confirm action",
    content="Are you sure?",
    confirm_label="Yes",
    cancel_label="No",
)
Loading preview…
ui.Divider(label?) → UINode#
ui.Divider(label="Section")
Loading preview…
ui.Empty(message?, icon?, action?) → UINode#
ui.Empty(message="Nothing here yet", icon="Inbox")
Loading preview…
ui.Error(message, title?, retry?) → UINode#
ui.Error(title="Something went wrong", message="Could not load data.")
Loading preview…
ui.FileUpload(accept?, max_size_mb?, multiple?, on_upload?, param_name?, blocked_extensions?, max_total_mb?, max_files?, title?, hint?, variant?, show_previews?) → UINode#
variant:defaultfuturisticcompact
ui.FileUpload(accept="image/*", max_size_mb=5)
Loading preview…
ui.Form(children, action?, submit_label?, defaults?) → UINode#
ui.Form(
    submit_label="Save",
    action="#",
    children=[
        ui.Input(
            label="Email",
            placeholder="you@example.com",
            param_name="email",
        ),
    ],
)
Loading preview…
ui.Graph(nodes, edges, layout?, height?, min_node_size?, max_node_size?, edge_label_visible?, color_by?, on_node_click?) → UINode#
ui.Graph(
    nodes=[
        {
            "id": "a",
            "label": "A",
        },
        {
            "id": "b",
            "label": "B",
        },
        {
            "id": "c",
            "label": "C",
        },
    ],
    edges=[
        {
            "source": "a",
            "target": "b",
        },
        {
            "source": "b",
            "target": "c",
        },
    ],
)
Loading preview…
ui.Grid(children, columns?, gap?, className?) → UINode#
ui.Grid(
    columns=2,
    children=[
        ui.Card(title="One"),
        ui.Card(title="Two"),
    ],
)
Loading preview…
ui.Header(text, level?, subtitle?) → UINode#
ui.Header(text="Section heading", level=2, subtitle="A subtitle")
Loading preview…
ui.Html(content, sandbox?, max_height?, theme?) → UINode#
ui.Html(content="<p style='margin:0'>Inline <b>HTML</b> content.</p>")
Loading preview…
ui.Icon(name, size?, color?, className?) → UINode#
ui.Icon(name="Star", size=24)
Loading preview…
ui.Image(src, alt?, width?, height?, on_click?, object_fit?, caption?) → UINode#
ui.Image(
    src="https://placehold.co/200x120",
    alt="Sample",
    width=200,
    height=120,
    caption="A caption",
)
Loading preview…
ui.Input(placeholder?, on_submit?, value?, param_name?, type?, label?, description?, error?, required?, disabled?, readonly?, variant?) → UINode#
type:textpasswordemailnumberurl
ui.Input(placeholder="Type here…", value="Hello", param_name="demo")
Loading preview…
ui.KeyValue(items, columns?) → UINode#
ui.KeyValue(
    items=[
        {
            "key": "Status",
            "value": "Active",
        },
        {
            "key": "Plan",
            "value": "Pro",
        },
    ],
)
Loading preview…
ui.List(items, searchable?, grouped_by?, page_size?, on_end_reached?, selectable?, bulk_actions?, total_items?, extra_info?, title?, empty_text?, search_placeholder?, max_height?) → UINode#
ui.List(
    items=[
        {
            "id": "1",
            "title": "First item",
            "subtitle": "A subtitle",
        },
        {
            "id": "2",
            "title": "Second item",
        },
        {
            "id": "3",
            "title": "Third item",
        },
    ],
)
Loading preview…
ui.ListItem(id, title, subtitle?, meta?, avatar?, badge?, selected?, on_click?, actions?, draggable?, droppable?, on_drop?, icon?, expandable?, expanded_content?) → UINode#
ui.ListItem(
    id="note_1042",
    title="Invoice #1042",
    subtitle="subtitle",
    meta="meta",
)
Loading preview…
ui.Loading(message?, variant?) → UINode#
ui.Loading(message="Loading…")
Loading preview…
ui.Markdown(content) → UINode#
ui.Markdown(
    content="# Title\n\nSome **markdown** with a [link](https://imperal.io) and `code`.",
)
Loading preview…
ui.Menu(items, trigger?, align?) → UINode#
ui.Menu(
    items=[
        {
            "label": "Edit",
        },
        {
            "label": "Duplicate",
        },
        {
            "label": "Delete",
        },
    ],
)
Loading preview…
ui.Modal(title?, content?, confirm_label?, cancel_label?, on_confirm?, subtitle?, size?, max_width?, dismissible?, destructive?, on_close?, open?) → UINode#
ui.Modal(
    title="Delete project?",
    subtitle="This cannot be undone.",
    content=ui.Text(content="The project and all of its deployments are removed."),
    confirm_label="Delete",
    cancel_label="Cancel",
    destructive=True,
)
Loading preview…
ui.MultiSelect(options, values?, placeholder?, param_name?, label?, description?, error?, required?, disabled?) → UINode#
ui.MultiSelect(
    placeholder="Pick tags",
    options=[
        {
            "label": "Alpha",
            "value": "a",
        },
        {
            "label": "Beta",
            "value": "b",
        },
    ],
    values=[
        "a",
    ],
)
Loading preview…
ui.Navigate(path) → UINode#
ui.Navigate(path="/billing")
Loading preview…
ui.Open(url) → UINode#
ui.Open(url="https://api.example.com/orders")
Loading preview…
ui.Page(children, title?, subtitle?) → UINode#
ui.Page(
    title="Page title",
    subtitle="Subtitle",
    children=[
        ui.Text(content="Page content."),
    ],
)
Loading preview…
ui.Password(placeholder?, on_submit?, value?, param_name?, label?, description?, error?, required?, disabled?, readonly?) → UINode#
ui.Password(placeholder="••••••", param_name="pwd", type="password")
Loading preview…
ui.Progress(value, label?, variant?, color?, max?, show_value?, size?) → UINode#
ui.Progress(value=64, label="Uploading", variant="primary")
Loading preview…
ui.RadioGroup(options, value?, on_change?, param_name?, label?, description?, error?, required?, disabled?, orientation?) → UINode#
ui.RadioGroup(
    label="Billing cycle",
    value="monthly",
    param_name="cycle",
    options=[
        {
            "label": "Monthly",
            "value": "monthly",
        },
        {
            "label": "Yearly (2 months free)",
            "value": "yearly",
        },
    ],
)
Loading preview…
ui.RichEditor(content?, placeholder?, on_save?, on_change?, param_name?, toolbar?, label?, description?, error?, required?) → UINode#
ui.RichEditor(
    content="<p>Rich <b>text</b> editor.</p>",
    placeholder="Write…",
)
Loading preview…
ui.Row(children, gap?) → UINode#
ui.Row(
    children=[
        ui.Badge(label="A"),
        ui.Badge(label="B"),
    ],
    direction="row",
)
Loading preview…
ui.Section(children, title?, collapsible?) → UINode#
ui.Section(
    title="Section",
    children=[
        ui.Text(content="Section content."),
    ],
)
Loading preview…
ui.Select(options, value?, placeholder?, on_change?, param_name?, label?, description?, error?, required?, disabled?) → UINode#
ui.Select(
    placeholder="Choose one",
    value="1",
    options=[
        {
            "label": "One",
            "value": "1",
        },
        {
            "label": "Two",
            "value": "2",
        },
    ],
)
Loading preview…
ui.Send(message) → UINode#
ui.Send(message="Deploy finished.")
Loading preview…
ui.SlideOver(title, children?, subtitle?, open?, width?, on_close?) → UINode#
ui.SlideOver(
    title="Slide over",
    open=True,
    children=[
        ui.Text(content="Slide-over content."),
    ],
)
Loading preview…
ui.Slider(min?, max?, value?, step?, label?, param_name?, disabled?) → UINode#
ui.Slider(min=0, max=100, value=40, step=1, label="Volume")
Loading preview…
ui.Stack(children, direction?, gap?, wrap?, align?, justify?, sticky?, className?) → UINode#
ui.Stack(
    direction="row",
    gap=2,
    children=[
        ui.Badge(label="A"),
        ui.Badge(label="B"),
    ],
)
Loading preview…
ui.Stat(label, value, trend?, icon?, color?, description?, trend_direction?) → UINode#
ui.Stat(label="Active users", value="1,284", trend="+12%")
Loading preview…
ui.Stats(children, columns?) → UINode#
ui.Stats(
    columns=2,
    children=[
        ui.Stat(label="Users", value="1.2k"),
        ui.Stat(label="Revenue", value="$8.4k"),
    ],
)
Loading preview…
ui.Tabs(tabs, default_tab?) → UINode#
ui.Tabs(
    tabs=[
        {
            "label": "Overview",
            "content": ui.Text(content="First tab."),
        },
        {
            "label": "Details",
            "content": ui.Text(content="Second tab."),
        },
    ],
)
Loading preview…
ui.TagInput(values?, suggestions?, placeholder?, param_name?, on_change?, grouped_by?, delimiters?, validate?, validate_message?, label?, description?, error?, required?) → UINode#
ui.TagInput(
    placeholder="Add tags…",
    values=[
        "alpha",
        "beta",
    ],
)
Loading preview…
ui.Text(content, variant?, truncate?, className?) → UINode#
ui.Text(content="Example text.", variant="body")
Loading preview…
ui.TextArea(placeholder?, value?, rows?, on_submit?, param_name?, label?, description?, error?, required?, disabled?, readonly?) → UINode#
ui.TextArea(
    placeholder="Write something…",
    value="Multiline\ntext",
    rows=3,
)
Loading preview…
ui.theme(ctx?) → UINode#
ui.theme(ctx="ctx")
Loading preview…
ui.Timeline(items) → UINode#
ui.Timeline(
    items=[
        {
            "title": "Created",
            "description": "09:00",
        },
        {
            "title": "Updated",
            "description": "10:30",
        },
    ],
)
Loading preview…
ui.Toast(message, variant?, duration?, title?, action?, action_label?) → UINode#
ui.Toast(
    title="Deploy queued",
    message="Building imperal-panel #482.",
    variant="success",
)
Loading preview…
ui.Toggle(label?, value?, on_change?, param_name?) → UINode#
ui.Toggle(label="Enabled", value=True)
Loading preview…
ui.Tooltip(content, children?, delay_ms?) → UINode#
ui.Tooltip(
    content="Tooltip text",
    children=[
        ui.Button(label="Hover me"),
    ],
)
Loading preview…
ui.TrayResponse(badge?, panel?) → UINode#
ui.TrayResponse(badge="badge", panel="panel")
Loading preview…
ui.Tree(nodes, label?) → UINode#
ui.Tree(
    nodes=[
        {
            "label": "root",
            "children": [
                {
                    "label": "child A",
                },
                {
                    "label": "child B",
                },
            ],
        },
    ],
)
Loading preview…
ui.Video(src, poster?, title?, autoplay?, controls?, loop?, muted?, width?, height?) → UINode#
ui.Video(
    src="https://www.w3schools.com/html/mov_bbb.mp4",
    controls=True,
    width=240,
)
Loading preview…

Declare handlers, schedules, webhooks, skeletons and more.

chat.function(name, description, params?, action_type?, event?, chain_callable?, effects?, id_projection?, background?, long_running?, data_model?, ui_builder?)#
@chat.function(
    name="send_invoice",
    description="Send the invoice for one order to the customer.",
    params={},
)
async def send_invoice(ctx):
    ...
@ext.cache_model(name="send_invoice")
async def send_invoice(ctx):
    ...
ext.emits(event_type, schema_ref?)#
@ext.emits(event_type="order.created", schema_ref="note.v1")
async def emits(ctx):
    ...
ext.file_sink(tool, accepts, arg, arg_kind?, description?) → None#
@ext.file_sink(tool="upload_report", accepts=[], arg="arg", arg_kind="text")
async def file_sink(ctx):
    ...
@ext.lifecycle
async def lifecycle(ctx):
    ...
ext.oauth(provider, collection?, scopes?) → None#
@ext.oauth(provider="google", collection="notes")
async def oauth(ctx):
    ...
ext.on_upgrade(version)#
@ext.on_upgrade(version="1.4.0")
async def on_upgrade(ctx):
    ...
ext.panel(panel_id, slot?, title?, icon?, refresh?, center_overlay?)#
@ext.panel(panel_id="panel_1042", slot="center")
async def panel(ctx):
    ...
ext.secret(name, description, required?, write_mode?, max_bytes?, rotation_hint_days?, scope?, env_fallback?)#
@ext.secret(
    name="send_invoice",
    description="Send the invoice for one order to the customer.",
    required=True,
)
async def send_invoice(ctx):
    ...
ext.skeleton(section_name, alert?, ttl?, description?)#
@ext.skeleton(section_name="section", alert=True)
async def skeleton(ctx):
    ...
ext.tool(name, scopes?, description?)#
@ext.tool(name="send_invoice", scopes=[])
async def send_invoice(ctx):
    ...
ext.tray(tray_id, icon?, tooltip?)#
@ext.tray(tray_id="inbox", icon="Circle")
async def tray(ctx):
    ...
ext.webhook(path, method?, secret_header?)#
@ext.webhook(path="/billing", method="POST")
async def webhook(ctx):
    ...
ext.widget(widget_id, slot?, label?, icon?)#
@ext.widget(widget_id="widget_1042", slot="dashboard.stats")
async def widget(ctx):
    ...

Semantic field facets — type the *meaning* of your entity fields.

sdl.AccessLeveled{ access_visibility?, classification?, clearance_required?, handling_caveats? }#
namespace:AccessLeveled
class Record(sdl.Entity, sdl.AccessLeveled):
    """Gains:
      access_visibility,
      classification,
      clearance_required,
      handling_caveats,
    """
sdl.ActivityMetrics{ active_calories_kcal?, active_minutes?, activity_distance_m?, floors_climbed?, steps? }#
namespace:ActivityMetrics
class Record(sdl.Entity, sdl.ActivityMetrics):
    """Gains:
      active_calories_kcal,
      active_minutes,
      activity_distance_m,
      floors_climbed,
      … 1 more
    """
sdl.ActuatorState{ actuator_color_hex?, actuator_position?, color_temp_k?, level_pct?, locked?, mode?, on? }#
namespace:ActuatorState
class Record(sdl.Entity, sdl.ActuatorState):
    """Gains:
      actuator_color_hex,
      actuator_position,
      color_temp_k,
      level_pct,
      … 3 more
    """
sdl.AdminRegion{ continent?, country_code?, county?, locality?, neighborhood?, region_code? }#
namespace:AdminRegion
class Record(sdl.Entity, sdl.AdminRegion):
    """Gains: continent, country_code, county, locality, …"""
sdl.AdmissionPolicy{ doors_open_at?, dress_code?, min_age?, prohibited_items?, requires_id? }#
namespace:AdmissionPolicy
class Record(sdl.Entity, sdl.AdmissionPolicy):
    """Gains: doors_open_at, dress_code, min_age, prohibited_items, …"""
sdl.AgendaSlot{ order_index?, parent_event?, session_type?, speakers?, track? }#
namespace:AgendaSlot
class Record(sdl.Entity, sdl.AgendaSlot):
    """Gains: order_index, parent_event, session_type, speakers, …"""
sdl.Aggregated{ aggregation?, fill_policy?, granularity?, window_end?, window_start? }#
namespace:Aggregated
class Record(sdl.Entity, sdl.Aggregated):
    """Gains: aggregation, fill_policy, granularity, window_end, …"""
sdl.AIProvenance{ ai_confidence?, ai_model?, generated_by_ai?, prompt_ref?, reviewed_by_human? }#
namespace:AIProvenance
class Record(sdl.Entity, sdl.AIProvenance):
    """Gains: ai_confidence, ai_model, generated_by_ai, prompt_ref, …"""
sdl.Alertable{ alert_severity?, alert_state?, alert_threshold?, fired_at?, resolved_at?, rule_name? }#
namespace:Alertable
class Record(sdl.Entity, sdl.Alertable):
    """Gains: alert_severity, alert_state, alert_threshold, fired_at, …"""
sdl.Angle{ angle_deg?, angle_unit? }#
namespace:Angle
class Record(sdl.Entity, sdl.Angle):
    """Gains: angle_deg, angle_unit"""
sdl.ApiEndpoint{ api_path?, auth_required?, deprecated?, method?, operation_id? }#
namespace:ApiEndpoint
class Record(sdl.Entity, sdl.ApiEndpoint):
    """Gains: api_path, auth_required, deprecated, method, …"""
sdl.Approvable{ approval_status?, approver?, decided_at?, decision_note? }#
namespace:Approvable
class Record(sdl.Entity, sdl.Approvable):
    """Gains: approval_status, approver, decided_at, decision_note"""
sdl.Archive{ archive_format?, compression_ratio?, entry_count?, is_encrypted?, uncompressed_size_bytes? }#
namespace:Archive
class Record(sdl.Entity, sdl.Archive):
    """Gains:
      archive_format,
      compression_ratio,
      entry_count,
      is_encrypted,
      … 1 more
    """
sdl.Area{ area_m2?, area_unit? }#
namespace:Area
class Record(sdl.Entity, sdl.Area):
    """Gains: area_m2, area_unit"""
sdl.Assignable{ assigned_at?, assignee?, assignees?, delegated_by?, reviewer?, reviewers?, team? }#
namespace:Assignable
class Record(sdl.Entity, sdl.Assignable):
    """Gains: assigned_at, assignee, assignees, delegated_by, …"""
sdl.Attached{ attachment_count?, attachments?, has_attachments?, inline_images? }#
namespace:Attached
class Record(sdl.Entity, sdl.Attached):
    """Gains:
      attachment_count,
      attachments,
      has_attachments,
      inline_images,
    """
sdl.Attested{ attestation_confidence?, attestation_result?, attestation_type?, attested_by? }#
namespace:Attested
class Record(sdl.Entity, sdl.Attested):
    """Gains:
      attestation_confidence,
      attestation_result,
      attestation_type,
      attested_by,
    """
sdl.AudioTrack{ audio_codec?, bit_depth?, bitrate_kbps?, channels?, loudness_lufs?, sample_rate_hz? }#
namespace:AudioTrack
class Record(sdl.Entity, sdl.AudioTrack):
    """Gains: audio_codec, bit_depth, bitrate_kbps, channels, …"""
sdl.Auditable{ action?, actor?, audit_target?, changes?, occurred_at?, outcome?, source_ip? }#
namespace:Auditable
class Record(sdl.Entity, sdl.Auditable):
    """Gains: action, actor, audit_target, changes, …"""
sdl.Authorship{ author?, contributors?, creator?, editors?, last_editor?, owner? }#
namespace:Authorship
class Record(sdl.Entity, sdl.Authorship):
    """Gains: author, contributors, creator, editors, …"""
sdl.Backup{ backup_is_verified?, backup_kind?, backup_size_bytes?, retain_until?, snapshot_id?, source_resource?, taken_at? }#
namespace:Backup
class Record(sdl.Entity, sdl.Backup):
    """Gains:
      backup_is_verified,
      backup_kind,
      backup_size_bytes,
      retain_until,
      … 3 more
    """
sdl.Balanced{ available_balance?, balance?, balance_currency?, credit_limit?, pending_balance? }#
namespace:Balanced
class Record(sdl.Entity, sdl.Balanced):
    """Gains:
      available_balance,
      balance,
      balance_currency,
      credit_limit,
      … 1 more
    """
sdl.Biometric{ biometric_context?, biometric_measured_at?, biometric_type?, biometric_unit?, biometric_value?, reference_high?, reference_low? }#
namespace:Biometric
class Record(sdl.Entity, sdl.Biometric):
    """Gains:
      biometric_context,
      biometric_measured_at,
      biometric_type,
      biometric_unit,
      … 3 more
    """
sdl.Bitrate{ bitrate_bps?, bitrate_unit? }#
namespace:Bitrate
class Record(sdl.Entity, sdl.Bitrate):
    """Gains: bitrate_bps, bitrate_unit"""
sdl.Blockable{ blocked_reason?, blocked_since?, is_blocked?, waiting_on? }#
namespace:Blockable
class Record(sdl.Entity, sdl.Blockable):
    """Gains: blocked_reason, blocked_since, is_blocked, waiting_on"""
sdl.Boarded{ board?, column?, position?, swimlane? }#
namespace:Boarded
class Record(sdl.Entity, sdl.Boarded):
    """Gains: board, column, position, swimlane"""
sdl.Bodied{ body?, body_format?, raw_body? }#
namespace:Bodied
class Record(sdl.Entity, sdl.Bodied):
    """Gains: body, body_format, raw_body"""
sdl.BodyComposition{ bmi?, body_fat_pct?, body_measured_at?, body_weight_kg?, muscle_mass_kg? }#
namespace:BodyComposition
class Record(sdl.Entity, sdl.BodyComposition):
    """Gains: bmi, body_fat_pct, body_measured_at, body_weight_kg, …"""
sdl.Booked{ booked_at?, cancellation_deadline?, cancelled_at?, check_in_at?, check_out_at? }#
namespace:Booked
class Record(sdl.Entity, sdl.Booked):
    """Gains:
      booked_at,
      cancellation_deadline,
      cancelled_at,
      check_in_at,
      … 1 more
    """
sdl.BoundingBox{ max_lat?, max_lon?, min_lat?, min_lon? }#
namespace:BoundingBox
class Record(sdl.Entity, sdl.BoundingBox):
    """Gains: max_lat, max_lon, min_lat, min_lon"""
sdl.Branded{ brand?, country_of_origin?, manufacturer?, model_name?, model_year? }#
namespace:Branded
class Record(sdl.Entity, sdl.Branded):
    """Gains: brand, country_of_origin, manufacturer, model_name, …"""
sdl.Bundle{ bundle_items?, bundle_type?, is_bundle? }#
namespace:Bundle
class Record(sdl.Entity, sdl.Bundle):
    """Gains: bundle_items, bundle_type, is_bundle"""
sdl.CalendarFeed{ calendar_color?, calendar_name?, feed_url?, ical_uid?, ics_url? }#
namespace:CalendarFeed
class Record(sdl.Entity, sdl.CalendarFeed):
    """Gains: calendar_color, calendar_name, feed_url, ical_uid, …"""
sdl.Callable{ answered?, call_direction?, call_state?, call_type?, end_reason?, ring_duration_s? }#
namespace:Callable
class Record(sdl.Entity, sdl.Callable):
    """Gains: answered, call_direction, call_state, call_type, …"""
sdl.Cancellation{ is_cancelled?, is_refundable?, refund_deadline?, refund_policy? }#
namespace:Cancellation
class Record(sdl.Entity, sdl.Cancellation):
    """Gains: is_cancelled, is_refundable, refund_deadline, refund_policy"""
sdl.Capacity{ capacity_remaining?, capacity_total?, is_sold_out?, registered_count?, waitlist_count? }#
namespace:Capacity
class Record(sdl.Entity, sdl.Capacity):
    """Gains:
      capacity_remaining,
      capacity_total,
      is_sold_out,
      registered_count,
      … 1 more
    """
sdl.Caseable{ case_number?, case_resolution?, case_stage?, case_type?, closed_at?, jurisdiction?, opened_at? }#
namespace:Caseable
class Record(sdl.Entity, sdl.Caseable):
    """Gains: case_number, case_resolution, case_stage, case_type, …"""
sdl.Categorized{ categories?, keywords?, labels?, tags?, topics? }#
namespace:Categorized
class Record(sdl.Entity, sdl.Categorized):
    """Gains: categories, keywords, labels, tags, …"""
sdl.Certificated{ cert_is_valid?, cert_issuer?, cert_subject?, fingerprint?, not_after? }#
namespace:Certificated
class Record(sdl.Entity, sdl.Certificated):
    """Gains: cert_is_valid, cert_issuer, cert_subject, fingerprint, …"""
sdl.Checklist{ checked_count?, checklist_items?, checklist_total? }#
namespace:Checklist
class Record(sdl.Entity, sdl.Checklist):
    """Gains: checked_count, checklist_items, checklist_total"""
sdl.ColorMaterial{ color?, finish?, material?, material_color_hex?, pattern? }#
namespace:ColorMaterial
class Record(sdl.Entity, sdl.ColorMaterial):
    """Gains: color, finish, material, material_color_hex, …"""
sdl.Completable{ completed_at?, completed_by?, is_done?, resolution? }#
namespace:Completable
class Record(sdl.Entity, sdl.Completable):
    """Gains: completed_at, completed_by, is_done, resolution"""
sdl.Compliant{ assessed_by?, compliance_status?, control_id?, framework?, last_assessed_at? }#
namespace:Compliant
class Record(sdl.Entity, sdl.Compliant):
    """Gains: assessed_by, compliance_status, control_id, framework, …"""
sdl.ComputeSpec{ arch?, disk_bytes?, gpu_count?, memory_bytes?, vcpus? }#
namespace:ComputeSpec
class Record(sdl.Entity, sdl.ComputeSpec):
    """Gains: arch, disk_bytes, gpu_count, memory_bytes, …"""
sdl.Confident{ ci_lower?, ci_upper?, confidence_level?, is_significant?, margin_of_error?, p_value? }#
namespace:Confident
class Record(sdl.Entity, sdl.Confident):
    """Gains: ci_lower, ci_upper, confidence_level, is_significant, …"""
sdl.ConfigSetting{ config_key?, config_source?, config_value?, config_value_type?, default_value?, is_secret? }#
namespace:ConfigSetting
class Record(sdl.Entity, sdl.ConfigSetting):
    """Gains:
      config_key,
      config_source,
      config_value,
      config_value_type,
      … 2 more
    """
sdl.Consented{ consent_proof?, consent_purpose?, consent_state?, consent_subject?, granted_at?, legal_basis? }#
namespace:Consented
class Record(sdl.Entity, sdl.Consented):
    """Gains:
      consent_proof,
      consent_purpose,
      consent_state,
      consent_subject,
      … 2 more
    """
sdl.Consumable{ consumable_type?, low?, remaining_pct?, replace_after_at? }#
namespace:Consumable
class Record(sdl.Entity, sdl.Consumable):
    """Gains: consumable_type, low, remaining_pct, replace_after_at"""
sdl.ContactPoints{ emails?, phones?, preferred_channel?, social_handles?, website_url? }#
namespace:ContactPoints
class Record(sdl.Entity, sdl.ContactPoints):
    """Gains: emails, phones, preferred_channel, social_handles, …"""
sdl.Container{ compose_project?, container_id?, container_name?, image?, image_digest?, runtime? }#
namespace:Container
class Record(sdl.Entity, sdl.Container):
    """Gains: compose_project, container_id, container_name, image, …"""
sdl.ContentSafety{ is_nsfw?, moderation_labels?, scan_state?, scanned_at?, virus_name? }#
namespace:ContentSafety
class Record(sdl.Entity, sdl.ContentSafety):
    """Gains: is_nsfw, moderation_labels, scan_state, scanned_at, …"""
sdl.Conversational{ channel_name?, conversation_participant_count?, conversation_ref?, conversation_type?, is_group?, last_message_at?, last_preview? }#
namespace:Conversational
class Record(sdl.Entity, sdl.Conversational):
    """Gains:
      channel_name,
      conversation_participant_count,
      conversation_ref,
      conversation_type,
      … 3 more
    """
sdl.Correspondents{ recipient_count?, recipients_bcc?, recipients_cc?, recipients_to?, reply_to?, sender? }#
namespace:Correspondents
class Record(sdl.Entity, sdl.Correspondents):
    """Gains:
      recipient_count,
      recipients_bcc,
      recipients_cc,
      recipients_to,
      … 2 more
    """
sdl.DataRecord{ query?, row_id?, schema_ref?, table? }#
namespace:DataRecord
class Record(sdl.Entity, sdl.DataRecord):
    """Gains: query, row_id, schema_ref, table"""
sdl.DataSize{ bytes?, data_size_unit? }#
namespace:DataSize
class Record(sdl.Entity, sdl.DataSize):
    """Gains: bytes, data_size_unit"""
sdl.Dependencies{ blocked_by?, blocks?, related? }#
namespace:Dependencies
class Record(sdl.Entity, sdl.Dependencies):
    """Gains: blocked_by, blocks, related"""
sdl.DeviceIdentity{ device_id?, device_manufacturer?, device_model?, firmware_version?, serial? }#
namespace:DeviceIdentity
class Record(sdl.Entity, sdl.DeviceIdentity):
    """Gains:
      device_id,
      device_manufacturer,
      device_model,
      firmware_version,
      … 1 more
    """
sdl.DeviceState{ battery_pct?, device_last_seen_at?, online?, signal_strength? }#
namespace:DeviceState
class Record(sdl.Entity, sdl.DeviceState):
    """Gains: battery_pct, device_last_seen_at, online, signal_strength"""
sdl.Dimensioned{ dimensions? }#
namespace:Dimensioned
class Record(sdl.Entity, sdl.Dimensioned):
    """Gains: dimensions"""
sdl.Dimensions3D{ dim_depth?, dim_height?, dim_unit?, dim_width? }#
namespace:Dimensions3D
class Record(sdl.Entity, sdl.Dimensions3D):
    """Gains: dim_depth, dim_height, dim_unit, dim_width"""
sdl.Discountable{ discount_pct?, is_on_sale?, sale_price? }#
namespace:Discountable
class Record(sdl.Entity, sdl.Discountable):
    """Gains: discount_pct, is_on_sale, sale_price"""
sdl.Draftable{ is_auto_generated?, is_draft?, last_saved_at?, scheduled_send_at? }#
namespace:Draftable
class Record(sdl.Entity, sdl.Draftable):
    """Gains:
      is_auto_generated,
      is_draft,
      last_saved_at,
      scheduled_send_at,
    """
sdl.Duration{ duration_display_unit?, duration_s? }#
namespace:Duration
class Record(sdl.Entity, sdl.Duration):
    """Gains: duration_display_unit, duration_s"""
sdl.Editorial{ editorial_is_draft?, editorial_state?, first_published_at?, published_at? }#
namespace:Editorial
class Record(sdl.Entity, sdl.Editorial):
    """Gains:
      editorial_is_draft,
      editorial_state,
      first_published_at,
      published_at,
    """
sdl.Entity{ description?, id?, kind?, status?, subtitle?, title?, url? }#
namespace:Entity
class Record(sdl.Entity, sdl.Entity):
    """Gains: description, id, kind, status, …"""
namespace:EntityList
class Record(sdl.Entity, sdl.EntityList):
    """Gains: """
sdl.Estimable{ estimate_s?, remaining_s?, spent_s? }#
namespace:Estimable
class Record(sdl.Entity, sdl.Estimable):
    """Gains: estimate_s, remaining_s, spent_s"""
sdl.Eventful{ event_host?, event_organizer?, event_type?, venue? }#
namespace:Eventful
class Record(sdl.Entity, sdl.Eventful):
    """Gains: event_host, event_organizer, event_type, venue"""
sdl.Excerptable{ excerpt?, reading_time_s?, summary?, word_count? }#
namespace:Excerptable
class Record(sdl.Entity, sdl.Excerptable):
    """Gains: excerpt, reading_time_s, summary, word_count"""
sdl.FileObject{ checksum_sha256?, extension?, filename?, media_class?, mime_type?, path?, permissions?, size_bytes? }#
namespace:FileObject
class Record(sdl.Entity, sdl.FileObject):
    """Gains: checksum_sha256, extension, filename, media_class, …"""
sdl.Geofence{ center_lat?, center_lon?, dwell_s?, radius_m?, trigger? }#
namespace:Geofence
class Record(sdl.Entity, sdl.Geofence):
    """Gains: center_lat, center_lon, dwell_s, radius_m, …"""
sdl.Geolocated{ accuracy_m?, altitude_m?, geo_speed_mps?, heading_deg?, lat?, located_at?, lon? }#
namespace:Geolocated
class Record(sdl.Entity, sdl.Geolocated):
    """Gains: accuracy_m, altitude_m, geo_speed_mps, heading_deg, …"""
sdl.HostResource{ environment?, host_region?, hostname?, resource_id? }#
namespace:HostResource
class Record(sdl.Entity, sdl.HostResource):
    """Gains: environment, host_region, hostname, resource_id"""
sdl.Iconified{ avatar_url?, color_hex?, emoji?, icon? }#
namespace:Iconified
class Record(sdl.Entity, sdl.Iconified):
    """Gains: avatar_url, color_hex, emoji, icon"""
sdl.ImageMedia{ blurhash?, color_space?, exif?, height?, width? }#
namespace:ImageMedia
class Record(sdl.Entity, sdl.ImageMedia):
    """Gains: blurhash, color_space, exif, height, …"""
sdl.Inventory{ availability?, backorderable?, in_stock?, is_low_stock?, low_stock_threshold?, preorder? }#
namespace:Inventory
class Record(sdl.Entity, sdl.Inventory):
    """Gains: availability, backorderable, in_stock, is_low_stock, …"""
sdl.Invoiced{ invoice_due_at?, invoice_number?, paid_at?, payment_status?, tax?, total? }#
namespace:Invoiced
class Record(sdl.Entity, sdl.Invoiced):
    """Gains: invoice_due_at, invoice_number, paid_at, payment_status, …"""
sdl.Length{ length_m?, length_unit? }#
namespace:Length
class Record(sdl.Entity, sdl.Length):
    """Gains: length_m, length_unit"""
sdl.Lifecycle{ is_archived?, is_deleted?, is_favorite?, is_pinned?, visibility? }#
namespace:Lifecycle
class Record(sdl.Entity, sdl.Lifecycle):
    """Gains: is_archived, is_deleted, is_favorite, is_pinned, …"""
sdl.Localized{ available_locales?, language?, languages?, locale?, localized_description?, localized_title?, text_direction? }#
namespace:Localized
class Record(sdl.Entity, sdl.Localized):
    """Gains: available_locales, language, languages, locale, …"""
sdl.Measured{ dimension?, formatted_value?, uncertainty?, unit?, unit_family?, value?, value_type? }#
namespace:Measured
class Record(sdl.Entity, sdl.Measured):
    """Gains: dimension, formatted_value, uncertainty, unit, …"""
sdl.MessageState{ delivery_state?, direction?, edited_at?, is_from_me?, is_read?, sent_at? }#
namespace:MessageState
class Record(sdl.Entity, sdl.MessageState):
    """Gains: delivery_state, direction, edited_at, is_from_me, …"""
sdl.Monetary{ amount?, currency? }#
namespace:Monetary
class Record(sdl.Entity, sdl.Monetary):
    """Gains: amount, currency"""
sdl.NetAsset{ domain?, ip?, port?, protocol?, record_type? }#
namespace:NetAsset
class Record(sdl.Entity, sdl.NetAsset):
    """Gains: domain, ip, port, protocol, …"""
sdl.Participants{ active_now?, admins?, host?, join_state?, members?, organizer?, participant_count?, typing? }#
namespace:Participants
class Record(sdl.Entity, sdl.Participants):
    """Gains: active_now, admins, host, join_state, …"""
sdl.Percentage{ percent? }#
namespace:Percentage
class Record(sdl.Entity, sdl.Percentage):
    """Gains: percent"""
sdl.Permissioned{ can_delete?, can_read?, can_share?, can_write?, role?, sec_permissions? }#
namespace:Permissioned
class Record(sdl.Entity, sdl.Permissioned):
    """Gains: can_delete, can_read, can_share, can_write, …"""
sdl.Placed{ place_name?, place_type?, plus_code? }#
namespace:Placed
class Record(sdl.Entity, sdl.Placed):
    """Gains: place_name, place_type, plus_code"""
sdl.PostalAddress{ city?, country?, postal_code?, region?, street? }#
namespace:PostalAddress
class Record(sdl.Entity, sdl.PostalAddress):
    """Gains: city, country, postal_code, region, …"""
sdl.Presence{ active_until?, last_seen_at?, online_status?, status_emoji?, status_message? }#
namespace:Presence
class Record(sdl.Entity, sdl.Presence):
    """Gains: active_until, last_seen_at, online_status, status_emoji, …"""
sdl.Priced{ compare_at_price?, list_price?, price_currency?, price_includes_tax?, unit_price? }#
namespace:Priced
class Record(sdl.Entity, sdl.Priced):
    """Gains:
      compare_at_price,
      list_price,
      price_currency,
      price_includes_tax,
      … 1 more
    """
sdl.Prioritized{ priority?, severity?, urgency? }#
namespace:Prioritized
class Record(sdl.Entity, sdl.Prioritized):
    """Gains: priority, severity, urgency"""
sdl.ProductCompliance{ age_restriction?, certifications?, hs_code?, requires_prescription?, restricted_regions? }#
namespace:ProductCompliance
class Record(sdl.Entity, sdl.ProductCompliance):
    """Gains:
      age_restriction,
      certifications,
      hs_code,
      requires_prescription,
      … 1 more
    """
sdl.Progress{ done_count?, progress?, total_count? }#
namespace:Progress
class Record(sdl.Entity, sdl.Progress):
    """Gains: done_count, progress, total_count"""
sdl.Range{ max_value?, min_value?, target? }#
namespace:Range
class Record(sdl.Entity, sdl.Range):
    """Gains: max_value, min_value, target"""
sdl.Rated{ distribution?, max_score?, rating?, rating_count? }#
namespace:Rated
class Record(sdl.Entity, sdl.Rated):
    """Gains: distribution, max_score, rating, rating_count"""
sdl.Reactable{ my_reactions?, reaction_count?, reactions? }#
namespace:Reactable
class Record(sdl.Entity, sdl.Reactable):
    """Gains: my_reactions, reaction_count, reactions"""
sdl.Recurring{ is_recurring_master?, next_occurrence_at?, recurrence_anchor?, recurrence_count?, recurrence_rule?, recurrence_until? }#
namespace:Recurring
class Record(sdl.Entity, sdl.Recurring):
    """Gains:
      is_recurring_master,
      next_occurrence_at,
      recurrence_anchor,
      recurrence_count,
      … 2 more
    """
sdl.Ref{ id?, kind?, title? }#
namespace:Ref
class Record(sdl.Entity, sdl.Ref):
    """Gains: id, kind, title"""
sdl.Retained{ legal_hold?, retention_class?, sec_retain_until? }#
namespace:Retained
class Record(sdl.Entity, sdl.Retained):
    """Gains: legal_hold, retention_class, sec_retain_until"""
sdl.Reviewed{ helpfulness?, is_verified?, review_body?, would_recommend? }#
namespace:Reviewed
class Record(sdl.Entity, sdl.Reviewed):
    """Gains: helpfulness, is_verified, review_body, would_recommend"""
sdl.RiskScored{ risk_factors?, risk_level?, risk_score? }#
namespace:RiskScored
class Record(sdl.Entity, sdl.RiskScored):
    """Gains: risk_factors, risk_level, risk_score"""
sdl.Routed{ destination?, distance_m?, origin?, route_duration_s?, waypoints? }#
namespace:Routed
class Record(sdl.Entity, sdl.Routed):
    """Gains: destination, distance_m, origin, route_duration_s, …"""
sdl.RSVP{ check_in_method?, checked_in?, is_no_show?, rsvp_state? }#
namespace:RSVP
class Record(sdl.Entity, sdl.RSVP):
    """Gains: check_in_method, checked_in, is_no_show, rsvp_state"""
sdl.Schedulable{ all_day?, due_at?, end_at?, start_at?, timezone? }#
namespace:Schedulable
class Record(sdl.Entity, sdl.Schedulable):
    """Gains: all_day, due_at, end_at, start_at, …"""
sdl.SensorReading{ measured_at?, quality?, sensor_type?, sensor_unit?, sensor_value? }#
namespace:SensorReading
class Record(sdl.Entity, sdl.SensorReading):
    """Gains: measured_at, quality, sensor_type, sensor_unit, …"""
sdl.Sentiment{ magnitude?, sentiment?, sentiment_score? }#
namespace:Sentiment
class Record(sdl.Entity, sdl.Sentiment):
    """Gains: magnitude, sentiment, sentiment_score"""
sdl.ServiceHealth{ health?, last_check_at?, uptime_s? }#
namespace:ServiceHealth
class Record(sdl.Entity, sdl.ServiceHealth):
    """Gains: health, last_check_at, uptime_s"""
sdl.Signed{ algorithm?, signature?, signature_is_valid?, signed_at?, signer? }#
namespace:Signed
class Record(sdl.Entity, sdl.Signed):
    """Gains: algorithm, signature, signature_is_valid, signed_at, …"""
sdl.SleepRecord{ awake_at?, in_bed_at?, sleep_duration_s?, sleep_quality_score?, sleep_stages? }#
namespace:SleepRecord
class Record(sdl.Entity, sdl.SleepRecord):
    """Gains:
      awake_at,
      in_bed_at,
      sleep_duration_s,
      sleep_quality_score,
      … 1 more
    """
sdl.Speed{ speed_mps?, speed_unit? }#
namespace:Speed
class Record(sdl.Entity, sdl.Speed):
    """Gains: speed_mps, speed_unit"""
sdl.Subscribable{ billing_interval?, billing_interval_count?, cancel_at_period_end?, current_period_end?, current_period_start?, recurring_amount?, subscription_status?, trial_end? }#
namespace:Subscribable
class Record(sdl.Entity, sdl.Subscribable):
    """Gains:
      billing_interval,
      billing_interval_count,
      cancel_at_period_end,
      current_period_end,
      … 4 more
    """
sdl.Temperature{ temp_c?, temp_unit? }#
namespace:Temperature
class Record(sdl.Entity, sdl.Temperature):
    """Gains: temp_c, temp_unit"""
sdl.Threaded{ depth?, reply_to_message?, root?, thread_ref? }#
namespace:Threaded
class Record(sdl.Entity, sdl.Threaded):
    """Gains: depth, reply_to_message, root, thread_ref"""
sdl.Threshold{ breached?, threshold?, threshold_target? }#
namespace:Threshold
class Record(sdl.Entity, sdl.Threshold):
    """Gains: breached, threshold, threshold_target"""
sdl.Ticketed{ barcode?, seat?, ticket_price?, ticket_type? }#
namespace:Ticketed
class Record(sdl.Entity, sdl.Ticketed):
    """Gains: barcode, seat, ticket_price, ticket_type"""
sdl.TimeSeriesPoint{ ts_timestamp?, ts_value? }#
namespace:TimeSeriesPoint
class Record(sdl.Entity, sdl.TimeSeriesPoint):
    """Gains: ts_timestamp, ts_value"""
sdl.Timestamped{ created_at?, deleted_at?, updated_at? }#
namespace:Timestamped
class Record(sdl.Entity, sdl.Timestamped):
    """Gains: created_at, deleted_at, updated_at"""
sdl.Transcribable{ captions_url?, transcript?, transcript_language? }#
namespace:Transcribable
class Record(sdl.Entity, sdl.Transcribable):
    """Gains: captions_url, transcript, transcript_language"""
sdl.Trended{ change_pct?, delta?, trend?, trend_period? }#
namespace:Trended
class Record(sdl.Entity, sdl.Trended):
    """Gains: change_pct, delta, trend, trend_period"""
sdl.Versioned{ channel?, content_hash?, is_latest?, released_at?, revision?, revision_of?, semver?, version? }#
namespace:Versioned
class Record(sdl.Entity, sdl.Versioned):
    """Gains: channel, content_hash, is_latest, released_at, …"""
sdl.VideoTrack{ fps?, hdr?, video_bitrate_kbps?, video_codec?, video_resolution? }#
namespace:VideoTrack
class Record(sdl.Entity, sdl.VideoTrack):
    """Gains: fps, hdr, video_bitrate_kbps, video_codec, …"""
sdl.VitalSign{ blood_pressure?, body_temp_c?, heart_rate_bpm?, respiratory_rate?, spo2_pct? }#
namespace:VitalSign
class Record(sdl.Entity, sdl.VitalSign):
    """Gains:
      blood_pressure,
      body_temp_c,
      heart_rate_bpm,
      respiratory_rate,
      … 1 more
    """
sdl.Voted{ downvotes?, my_vote?, score?, upvotes? }#
namespace:Voted
class Record(sdl.Entity, sdl.Voted):
    """Gains: downvotes, my_vote, score, upvotes"""
sdl.Weight{ weight_kg?, weight_unit? }#
namespace:Weight
class Record(sdl.Entity, sdl.Weight):
    """Gains: weight_kg, weight_unit"""
sdl.WorkflowState{ allowed_transitions?, entered_state_at?, state? }#
namespace:WorkflowState
class Record(sdl.Entity, sdl.WorkflowState):
    """Gains: allowed_transitions, entered_state_at, state"""

The `sdl` module surface for composing typed entities.

# sdl.entity — module namespace
class Record(sdl.Entity):
    ...
# sdl.facet_resolve — module namespace
class Record(sdl.Entity):
    ...
# sdl.facets — module namespace
class Record(sdl.Entity):
    ...
sdl.field(role, default?)#
sdl.field(role="admin", default="default")
sdl.is_valid_role(role) → bool#
sdl.is_valid_role(role="admin")
sdl.namespace_of(role) → str#
sdl.namespace_of(role="admin")
sdl.resolve_facets(names) → dict[str, str]#
sdl.resolve_facets(names=[])
# sdl.roles — module namespace
class Record(sdl.Entity):
    ...
sdl.roles_of(model) → dict[str, str]#
sdl.roles_of(model="claude-sonnet-4")
sdl.validate_custom_role(role) → None#
sdl.validate_custom_role(role="admin")

Everything Webbee hands your handler via `ctx.<ns>.<method>`.

ctx.ai.complete(prompt, model?) → CompletionResult#
result = await ctx.ai.complete(
    prompt="Summarise this thread in two sentences.",
    model="claude-sonnet-4-6",
)  # -> CompletionResult
result = await ctx.billing.cancel_subscription(user="imp_u_4Kd2")  # -> dict
ctx.billing.change_plan(plan_id, period?, user?) → ChangePlanResult#
result = await ctx.billing.change_plan(
    plan_id="pro",
    period="monthly",
    user="imp_u_4Kd2",
)  # -> ChangePlanResult
ctx.billing.check_limits(user?) → LimitsResult#
result = await ctx.billing.check_limits(
    user="imp_u_4Kd2",
)  # -> LimitsResult
result = await ctx.billing.create_billing_portal_session(
    user="imp_u_4Kd2",
)  # -> str
ctx.billing.create_setup_intent(user?) → SetupIntentResult#
result = await ctx.billing.create_setup_intent(
    user="imp_u_4Kd2",
)  # -> SetupIntentResult
ctx.billing.get_auto_topup(user?) → AutoTopupSettings#
result = await ctx.billing.get_auto_topup(
    user="imp_u_4Kd2",
)  # -> AutoTopupSettings
ctx.billing.get_balance(user?) → BalanceInfo#
result = await ctx.billing.get_balance(user="imp_u_4Kd2")  # -> BalanceInfo
ctx.billing.get_subscription(user?) → SubscriptionInfo#
result = await ctx.billing.get_subscription(
    user="imp_u_4Kd2",
)  # -> SubscriptionInfo
ctx.billing.list_payment_methods(user?) → list[PaymentMethod]#
result = await ctx.billing.list_payment_methods(
    user="imp_u_4Kd2",
)  # -> list[PaymentMethod]
ctx.billing.list_payments(user?, limit?, offset?) → list[PaymentRecord]#
result = await ctx.billing.list_payments(
    user="imp_u_4Kd2",
    limit=20,
)  # -> list[PaymentRecord]
ctx.billing.list_plans(user?) → list[PlanInfo]#
result = await ctx.billing.list_plans(
    user="imp_u_4Kd2",
)  # -> list[PlanInfo]
ctx.billing.remove_payment_method(pm_id, user?) → bool#
result = await ctx.billing.remove_payment_method(
    pm_id="pm_1042",
    user="imp_u_4Kd2",
)  # -> bool
result = await ctx.billing.renew_subscription(user="imp_u_4Kd2")  # -> dict
result = await ctx.billing.resume_subscription(user="imp_u_4Kd2")  # -> dict
ctx.billing.set_auto_topup(enabled, threshold_pct?, recharge_tokens?, payment_method_id?, user?) → bool#
result = await ctx.billing.set_auto_topup(
    enabled=True,
    threshold_pct=1,
    recharge_tokens=1,
)  # -> bool
ctx.billing.set_default_payment_method(pm_id, user?) → bool#
result = await ctx.billing.set_default_payment_method(
    pm_id="pm_1042",
    user="imp_u_4Kd2",
)  # -> bool
ctx.billing.topup(tokens, price_cents, save_payment_method?, off_session?, user?) → TopupResult#
result = await ctx.billing.topup(
    tokens=1,
    price_cents=1,
    save_payment_method=True,
    off_session=True,
)  # -> TopupResult
ctx.billing.track_usage(meter, quantity?, user?) → bool#
result = await ctx.billing.track_usage(
    meter="tokens",
    quantity=1,
    user="imp_u_4Kd2",
)  # -> bool
ctx.billing.update_billing_profile(profile, user?) → bool#
result = await ctx.billing.update_billing_profile(
    profile={},
    user="imp_u_4Kd2",
)  # -> bool
ctx.config.all() → dict#
result = await ctx.config.all()  # -> dict
ctx.config.get(key, default?) → Any#
result = await ctx.config.get(key="last_sync", default="default")  # -> Any
ctx.config.get_section(section) → dict#
result = await ctx.config.get_section(section="sidebar")  # -> dict
ctx.http.delete(url, timeout?) → HTTPResponse#
result = await ctx.http.delete(
    url="https://api.example.com/orders",
    timeout=30,
)  # -> HTTPResponse
ctx.http.get(url, timeout?) → HTTPResponse#
result = await ctx.http.get(
    url="https://api.example.com/orders",
    timeout=30,
)  # -> HTTPResponse
ctx.http.patch(url, timeout?) → HTTPResponse#
result = await ctx.http.patch(
    url="https://api.example.com/orders",
    timeout=30,
)  # -> HTTPResponse
ctx.http.post(url, timeout?) → HTTPResponse#
result = await ctx.http.post(
    url="https://api.example.com/orders",
    timeout=30,
)  # -> HTTPResponse
ctx.http.put(url, timeout?) → HTTPResponse#
result = await ctx.http.put(
    url="https://api.example.com/orders",
    timeout=30,
)  # -> HTTPResponse
ctx.notify.for_user(user_id) → 'NotifyClient'#
result = await ctx.notify.for_user(
    user_id="imp_u_4Kd2",
)  # -> 'NotifyClient'
ctx.notify.send(message, channel?) → None#
await ctx.notify.send(message="Deploy finished.", channel="in_app")
ctx.skeleton.get(section) → Any#
result = await ctx.skeleton.get(section="sidebar")  # -> Any
ctx.storage.delete(path) → bool#
result = await ctx.storage.delete(path="/billing")  # -> bool
ctx.storage.download(path) → bytes#
result = await ctx.storage.download(path="/billing")  # -> bytes
ctx.storage.list(prefix?) → Page[FileInfo]#
result = await ctx.storage.list(prefix="notes/2026-08")  # -> Page[FileInfo]
ctx.storage.upload(path, data, content_type?) → FileInfo#
result = await ctx.storage.upload(
    path="/billing",
    data={"note_id": "note_1042"},
    content_type="application/octet-stream",
)  # -> FileInfo
ctx.store.count(collection, where?) → int#
result = await ctx.store.count(collection="notes", where={})  # -> int
ctx.store.create(collection, data) → Document#
result = await ctx.store.create(
    collection="notes",
    data={"note_id": "note_1042"},
)  # -> Document
ctx.store.delete(collection, doc_id) → bool#
result = await ctx.store.delete(
    collection="notes",
    doc_id="note_1042",
)  # -> bool
ctx.store.for_user(user_id) → 'StoreClient'#
result = await ctx.store.for_user(user_id="imp_u_4Kd2")  # -> 'StoreClient'
ctx.store.get(collection, doc_id?) → Document | None#
result = await ctx.store.get(
    collection="notes",
    doc_id="note_1042",
)  # -> Document | None
ctx.store.list(prefix?) → list[Document]#
result = await ctx.store.list(prefix="notes/2026-08")  # -> list[Document]
ctx.store.list_users(collection, page_size?) → AsyncIterator[str]#
result = await ctx.store.list_users(
    collection="notes",
    page_size=1,
)  # -> AsyncIterator[str]
ctx.store.query(collection, where?, order_by?, limit?) → Page[Document]#
result = await ctx.store.query(
    collection="notes",
    where={},
    order_by="-updated_at",
)  # -> Page[Document]
ctx.store.query_all(collection, limit?) → list[Document]#
result = await ctx.store.query_all(
    collection="notes",
    limit=20,
)  # -> list[Document]
ctx.store.set(key, data) → Document#
result = await ctx.store.set(
    key="last_sync",
    data={"note_id": "note_1042"},
)  # -> Document
ctx.store.update(collection, doc_id, data, if_match?) → Document#
result = await ctx.store.update(
    collection="notes",
    doc_id="note_1042",
    data={"note_id": "note_1042"},
    if_match="7a05dd3",
)  # -> Document

Return-type and payload dataclasses you compose and receive.

ActionResult{ status, data?, summary?, error?, retryable?, ui?, refresh_panels?, error_code? }#
ActionResult(
    status="success",
    data={"note_id": "note_1042"},
    summary="Saved 3 notes.",
    retryable=True,
)
BalanceInfo{ balance?, plan?, cap? }#
BalanceInfo(balance=1, plan="pro", cap=1)
ChatResult{ response, handled?, functions_called?, had_successful_action?, message_type?, action_meta?, intercepted?, task_cancelled?, narration_emission? }#
ChatResult(
    response="Here is the summary you asked for.",
    handled=True,
    functions_called=[],
    had_successful_action=True,
)
CompletionResult{ text, model?, usage?, stop_reason? }#
CompletionResult(
    text="Here is the summary you asked for.",
    model="claude-sonnet-4",
    usage={},
    stop_reason="end_turn",
)
Document{ id, collection, data, extension_id?, tenant_id?, created_at?, updated_at?, user_id?, etag? }#
Document(
    id="note_1042",
    collection="notes",
    data={"note_id": "note_1042"},
    extension_id="extension_1042",
    tenant_id="default",
    created_at="2026-08-16T09:00:00Z",
)
Event{ event_type, timestamp?, user_id?, tenant_id?, data? }#
Event(
    event_type="order.created",
    timestamp="2026-08-16T09:00:00Z",
    user_id="imp_u_4Kd2",
    tenant_id="tenant_1042",
)
EventHandlerDef{ event_type, func }#
EventHandlerDef(event_type="order.created", func=handler)
ExposedMethod{ name, func, action_type? }#
ExposedMethod(name="send_invoice", func=handler, action_type="read")
FileInfo{ path, size?, content_type?, created_at?, url? }#
FileInfo(
    path="/billing",
    size=1,
    content_type="application/pdf",
    created_at="2026-08-16T09:00:00Z",
)
FunctionCall{ name, params, action_type, success, result?, intercepted?, event? }#
FunctionCall(
    name="send_invoice",
    params={},
    action_type="read",
    success=True,
    result={"ok": True},
    intercepted=True,
    event="order.created",
)
HealthCheckDef{ func }#
HealthCheckDef(func=handler)
HealthStatus{ status, message?, details? }#
HealthStatus(status="success", message="Deploy finished.", details={})
HTTPResponse{ status_code, body?, headers? }#
HTTPResponse(
    status_code=1,
    body="The full note body.",
    headers={"Accept": "application/json"},
)
LifecycleHook{ name, func, version? }#
LifecycleHook(name="send_invoice", func=handler, version="1.4.0")
LimitsResult{ allowed?, balance?, plan?, limits?, message? }#
LimitsResult(allowed=True, balance=1, plan="pro")
MeteredEvent{ v?, event_id, ts, identity, meter, attribution, dimensions? }#
MeteredEvent(
    event_id="event_1042",
    ts=1,
    identity="imp_u_4Kd2",
    meter="tokens",
    attribution="attribution",
    v=1,
    dimensions={},
)
Page{ data, cursor?, has_more?, total? }#
Page(
    data={"note_id": "note_1042"},
    cursor="eyJvZmZzZXQiOjIwfQ",
    has_more=True,
    total=1,
)
ScheduleDef{ name, func, cron }#
ScheduleDef(name="send_invoice", func=handler, cron="0 9 * * *")
SignalDef{ name, func }#
SignalDef(name="send_invoice", func=handler)
SubscriptionInfo{ plan_id?, plan_name?, status?, period?, current_period_start?, current_period_end? }#
SubscriptionInfo(plan_id="pro", plan_name="plan", status="success")
ToolDef{ name, func, scopes?, description? }#
ToolDef(
    name="send_invoice",
    func=handler,
    scopes=[],
    description="Send the invoice for one order to the customer.",
)
TrayDef{ tray_id, func, icon?, tooltip? }#
TrayDef(
    tray_id="inbox",
    func=handler,
    icon="Circle",
    tooltip="Open the inbox",
)
WebhookDef{ path, func, method?, secret_header? }#
WebhookDef(
    path="/billing",
    func=handler,
    method="POST",
    secret_header="X-Imperal-Signature",
)
WebhookRequest{ method, headers?, body?, query_params? }#
WebhookRequest(
    method="POST",
    headers={"Accept": "application/json"},
    body="The full note body.",
    query_params={},
)
WebhookResponse{ status_code?, body?, headers? }#
WebhookResponse(
    status_code=1,
    body="The full note body.",
    headers={"Accept": "application/json"},
)