Build a custom machine

Entry points

Python SDK version 1

Markdown

What the Ownbox calls in the machine, and when. Each runs in the machine's own unit.

Entry pointDeclared withThe Ownbox calls itTime limit
A job@m.every(seconds)at its time; as soon as the machine starts; when a person taps its button—
A page@m.screen(path)each time a person opens the page20 s
A cardm.panel(slot, title=, render=)each time the screen with that slot is drawn20 s
A toolm.tool(name, fn=, ...)when the owner's AI asks it60 s
A Morning Review partm.reporter(title, fn)once a pass; the latest answer is shown—
An approvalm.on_approve(kind, fn)once, after a person says yes to its proposal—
A forgetdef on_forget(person_id)when the owner erases a person (not called yet)—
  • A job runs every 15 seconds to once a week. A run that raises is reported, and the next one goes ahead.
  • A page or a card that does not answer within 20 seconds shows This machine did not answer in time, with a Try again button.
  • A tool's answer reaches the owner's AI quoted, as the machine's own words, at most 8 KB. render(result) writes it in words; each argument is a string of at most 500 characters, a whole number or a true/false.
  • A Morning Review part answers fn(day) with {"title", "headline": {"value", "label"}, ...}, or {} to show nothing that day. A slow part never holds the review up.
  • on_forget is not called yet: erasing a person on the Ownbox does not reach a machine's own data until it is. Write it now. A machine that names people data is refused without it.