feat(tui): render forms and route question tool through form service#35189
Closed
rekram1-node wants to merge 21 commits into
Closed
feat(tui): render forms and route question tool through form service#35189rekram1-node wants to merge 21 commits into
rekram1-node wants to merge 21 commits into
Conversation
Collaborator
Author
|
Updated for many-field forms (e.g. the everything server's 14-field kitchen-sink elicitation, which previously rendered an unbounded tab row with sentence-length labels):
Verified with termctrl against a reproduction of the everything elicitation: stepper render, backward nav, 14-field review, and session→global form handoff with fresh state. |
5a16cac to
fde7080
Compare
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Integrates the V2 Form service into the TUI and migrates the question tool onto it. First client consumer of the form surface (#35094/#35099/#35106/#35115).
Core
QuestionToolnow creates forms viaForm.Service.askinstead ofQuestionV2.ask. Each question maps positionally to a field (q0..qn): single-select questions become string fields with options + custom,multiplebecomes multiselect. Tool input/output schemas and model-facing output are unchanged.QuestionV2.RejectedError, which the runner already detects to halt the drain (verified live: esc → "Provider turn interrupted").Form.Service(context + Location node dep).TUI
data.tsx: subscribesform.created/form.replied/form.cancelled, keyed by owning session;refreshviasdk.api.form.listreconciles on session load (covers restarts). Forms owned by the temporary"global"MCP elicitation sentinel are stored under that key and surfaced in any active session view.FormPrompt(routes/session/form.tsx), styled afterQuestionPrompt:whenconditions evaluated live, mirroring core semantics — tabs appear/disappear as answers changeInvalidRequestError) render inline, e.g. "Expected email for form field: email"The existing
QuestionPromptpath stays intact for compatibility; it no longer triggers from the built-in tool since the tool now emits forms.Verified with termctrl (PNG evidence captured)
{pm:"bun", features:["ts"], strict:true, port:3000, name:"..."})Typechecks: core, tui, cli. Tests: tui 203 pass, core suite green apart from pre-existing watcher readiness flakes under full-suite load (pass in isolation on clean v2 and with this change).