Skip to content

v0.2.0

Choose a tag to compare

@newtonapple newtonapple released this 03 Nov 00:55
· 9 commits to main since this release
  • Choice takes several answers and an Other answer, and sends them together. Choice(question, options, hint, multiple, other).
    multiple: true lets you pick several options (square checkboxes and the tag Choose all that apply; a single question has
    round indicators and Choose one). other is on by default and adds an Other... row: it opens pi's own editor (Enter saves,
    Shift+Enter adds a line, Esc cancels) and the text shows under the row. Write null for each skipped argument before multiple
    or other; a wrong one is a validation error that gives the argument's position and an example.
  • A click on a Choice no longer sends anything. It stages the answer. A bar under the widget, N of M answered [ Send answers ] [ Clear ], sends the answers of every Choice in the widget (also those on tabs nobody opened) as ONE message and locks the
    widget. The buttons stack on a narrow terminal. A Choice written for the old behaviour keeps working, now with an Other row and the
    bar (write other: false for a closed list), unless it breaks one of the new limits. Answers live in memory with the widget, so a
    widget redrawn from a resumed session opens unanswered.
  • The message. One question that takes one answer, answered with an option, still sends the line <question> — <option>.
    Anything else is a numbered list that starts Answers to the questions in widget `Title` (3):, with (no answer) for a skipped
    question and other: for typed text. The words the agent wrote are cleaned (control and invisible characters removed, whitespace
    collapsed, @file: and similar written (at)file:), and a question that would start the message like a command (/new session?)
    uses the list. Your own Other text is sent as you typed it, except for control characters: a tab becomes a space and a run of
    blank lines becomes one.
  • Delivery. The bar says Sending to the agent… until pi reports the message, then Sent to the agent. If pi does not take it
    within 3 seconds (no model selected, no credentials) and is not holding one for the end of the agent's turn, the widget is given
    back with your answers and a notice, and Send answers works again once what pi complained about is fixed. After Send the widget
    gives the keyboard back to pi.
  • Layout and keys. Options are always one per row (the old layout with every option on one line is gone). The whole row is the
    click target, and a long option wraps under its indicator. Down from the last option reaches Send answers, never Clear. After
    Clear the focus moves to the first option, and Enter never presses an element other than the focused one. In notes mode the
    options and the bar do nothing.
  • New limits, listed in the model's reference and in docs/components/README.md: 12 Choices per widget, 6 options, a question of
    at most 200 characters, an option of at most 120, an Other answer of at most 500. An empty question or option is an error too.
    Over a limit is a validation error with the number in it.
  • The model is told. The render_widget description and guideline now say that a Button click arrives as the next message and
    that Choice answers arrive together after Send answers, so the model asks all its questions in one widget. The model's reference
    grows by about 190 tokens. New sample: /openui-gallery choice.
  • Rows with emoji stay aligned across pi upgrades. The two-cell character table (src/diagram/wide.ts) was a snapshot of one pi.
    pi 1.4.0 draws a few newer emoji (U+1F6D9, U+1FA8B-1FA8D, U+1FACC, U+1FADD, U+1FAEB, U+1FAF9-1FAFA) two cells wide, so borders
    slid on rows that contain them. The extension now asks the running pi about the blocks where emoji are added (U+2190-2BFF,
    U+1F000-1FFFF, about 11 ms) when it loads, and the table is regenerated for pi 1.4.0 (npm run width).