Widgets / AgentShell
AgentShell
A ready-made coding-agent shell Program — transcript + prompt + approvals + streaming — in a few lines.
Signature
AgentShell.program
(config: ShellConfig)
: Program<ShellModel, ShellMsg> Parameters
| parameter | type | what it is |
|---|---|---|
Title / Placeholder | string | Header title and the prompt's placeholder text. |
OnSubmit | string -> ShellModel -> ShellModel * Cmd | What a submitted line does — echo, run a tool, or stream a reply. |
OnApprove | bool -> string -> ShellModel -> ShellModel * Cmd | What accepting / denying a tool approval does. |
OnCancel | ShellModel -> ShellModel * Cmd | Cancel the app's operation when the user stops streaming. |
Triggers / Completions | char list / (CompletionToken -> string list) | Completion triggers and candidate source; defaults to / and @ with no candidates. |
MaxPromptRows | int | Maximum multiline prompt rows; defaults to 6. |
Notes
Composes ChatTranscript + PromptBox + ApprovalModal + the Conversation model — owning scroll/follow-tail, multiline editing, history, completions, approval queues, cancellation routing, and a derived Idle/Streaming/AwaitingApproval session. Build the config with AgentShell.config; scrolling up pauses follow-tail. Stream a reply by dispatching Apply (AgentShell.stream id chunk) from a Cmd.ofAsync.