Skip to content

feat: add text, number, confirm, select, and multiselect prompts - #1

Merged
autoantohaki merged 1 commit into
mainfrom
feat/prompts
Oct 21, 2026
Merged

autoantohaki merged 1 commit into
mainfrom
feat/prompts

Conversation

@autoantohaki

Copy link
Copy Markdown
Member

Requested by mau

Before: Relay Forms only had the frame and the runForm renderer, so a tool still had to write its own input handling to ask anything.

After: a tool can ask text, number, confirm, select, and multiselect questions with ask or askAll, get typed answers back, and leave a one-line summary of each answer in the terminal. npm run demo now walks through a project setup flow that uses every kind.

How: each field is a plain object. Prompt renders the input for its kind, runs declared limits (required, min, max, integer) and the field's own validate (sync or async, with a Checking… state), then collapses to an answered line. PromptList asks fields in order. Text editing and list movement are pure functions (editText, moveIndex, windowStart) with their own tests. Masked fields never print the value, and cap the answered dots at twelve so a token's length is not shown. Guide in docs/prompts.md.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant