Widgets & cards
A widget is anything an agent showed in a TODO (a chart, a page, a file, a link) placed on the board or pinned to the sidebar. It stays live: when the agent updates the show, the widget updates too.
Board → + → Widget… opens the gallery. It has two shelves:
- Built-in: cards that ship with the app, ready for everyone. Taking one creates its own TODO (its agent runs it), puts the card on your board and pins it to the sidebar. Taking it again opens the one you already have.
- Shown in this workspace: everything agents have shown here. Click to add it to the board, use the pin to put it in your sidebar.
Built-in: 💼 Sales
Your pipeline in one card: Needs you (drafts waiting for your approval) or By stage. Click a deal for its whole history as one thread.
- The agent researches, writes drafts and follow-ups. You approve; the email goes from your own mailbox (connect Gmail or Outlook first). It never sends a first email by itself.
- The draft shows who it goes to and from before you approve. If sending fails half-way, the card asks you to check your Sent folder instead of sending twice.
- Data lives in
~/pipeline.db(SQLite) on your cloud computer, nowhere else. Ask the agent to import deals from your inbox or a spreadsheet, or type a company name and Add. - Ask agent sends the card's TODO a message: "draft a follow-up for Northwind", "who hasn't replied in a week?".
On the free plan the cloud computer pauses when idle, so the first load after a pause takes longer.
Customize a card
Ask the agent: "Add a column for the deal owner to my Sales card." It saves a copy of the card under the same name in your workspace, and the copy replaces the built-in for this workspace only. Ask it to delete the copy to go back to the built-in.
Build your own card
A card is one HTML file. Ask the agent to make one ("make a card that tracks our open invoices"), or write it yourself and save it with tfa-surface card add <name> card.html. Then show it in a TODO (show --card <name>) and add it from the gallery.
The same file works in every place it can appear: a chat block, a board tile, a full page. Start from this skeleton:
Code
What the gallery reads
| Tag | Used for |
|---|---|
<title> | The card's name (unless card add --title sets another). |
<meta name="description"> | One line: what it shows and what it does. The agent reads it to pick the right card; built-ins show it under the name. |
<meta property="og:image"> | The gallery preview, 1200×630. A data:image/…;base64, URL or an https:// image. Without it, the card shows its type icon. |
Make the preview a screenshot of the card with realistic sample data, never real customer names or numbers.
What the card can call
| Call | Does |
|---|---|
todo.exec(cmd, {timeout}) | Runs a shell command on your cloud computer and returns {stdout}. Wakes the computer when it is paused. |
todo.chat(text) | Sends a message to the card's TODO, so its agent acts on it. |
todo.show(data, opts) | Puts a file or text in the chat as a show block. |
todo.connect(key, {reason}) | Opens the sign-in card for one connector (e.g. zele for Gmail). |
todo.card | (renderer cards) A promise of the instance data: which show it renders, and where (host.kind: chat, tile, window, page). |
<html data-host="…"> carries the same host kind, so CSS alone can make a tile compact.
Rules that keep a card reliable
- Data on the cloud computer, not in the page. Keep state in a file or SQLite DB there; the card is a view over it. The agent can read and change the same data.
- One small script per card. Put the logic in a script the card installs (
~/.tfa/<name>.py) and call it with JSON arguments. Shell-quote every argument. - Short output lines. Long single lines can be cut in transport: print base64 in short lines, or plain short lines.
- Escape everything you render. Data comes from emails and websites.
- The human approves anything that leaves. Emails, payments, posts: the agent drafts, the card shows exactly what goes where, a button sends. Claim the item before sending, so two tabs can't send it twice.
- Add columns, never rename them. Customized copies and the agent's skill share the same data.