Task composerPro
Where a coding task starts: what to do, which repository and branch, where it runs (cloud, this machine or SSH), which model and how many attempts, then Ask or Code.
On this page
ProStart a coding task: repository, branch, where it runs (cloud, this machine or SSH), model and attempts, then Ask or Code. Enter runs Code, Cmd or Ctrl+Enter runs Ask.
Installation
Usage
import { TaskComposer } from "@/components/ui/chatcn/pro/task-composer"
<TaskComposer repos={repos} environments={environments} models={models} onSubmit={startTask} />onSubmit gets the text, mode (ask or code), repository, branch, environment, model and attempt count. More than one attempt pairs with Best of n. Offline environments stay listed but cannot be picked, and choosing one explains what to do.
Examples
States
ProStarting a task, a start that failed with the fix, an offline host, no repository connected and a long task.
Props
| Prop | Type | Notes |
|---|---|---|
repos | TaskRepo[] | id, name (owner/name), private, branches |
environments | TaskEnvironment[] | kind cloud, local or ssh; detail; status offline |
models, providers | ModelOption[] | Shows the free model picker |
value, repo, branch, environment, model, attempts | Each controlled, with default… and on…Change | |
maxAttempts | number | Default 4 |
onSubmit | (task: TaskSubmission) => void | |
submitting | "ask" | "code" | false | The sent mode shows a spinner |
error | ReactNode | Why the task did not start, with the fix |
disabled, disabledReason, disabledAction | For example no repository connected | |
placeholder | string |
Keyboard
| Key | Action |
|---|---|
Enter | Code |
Cmd Enter / Ctrl Enter | Ask |
Shift Enter | New line |
Accessibility
- Nothing sends while an input method is composing.
- Each selector names what it sets and its value. Errors are alerts tied to the field.
Motion
Menus open from their trigger in 180 ms. Opened from the keyboard, they appear without animation.