For AI agents: the complete documentation index is available at https://a3s-lab.github.io/UI/v0.4.1/en/llms.txt, the full documentation bundle is available at https://a3s-lab.github.io/UI/v0.4.1/en/llms-full.txt, and this page is available as Markdown at https://a3s-lab.github.io/UI/v0.4.1/en/components/agent-composer.md.

Task Composer

Task Composer turns an instruction, file context, source selections, skills, run settings, and follow-up messages into one recoverable submission. The primary input is always backed by TipTap. A plain textarea cannot reliably support Markdown, structured triggers, composition input, selection, and controlled drafts, so it is not part of the production contract.

Production task composer
  • AGENTS.md
  • src/runtime.ts:42–96
Preparing editor…
A task is running. New instructions will be queued.
Follow-ups · 1
  1. 1Then synchronize the English and Chinese integration examples.

Product boundary

The composer answers four questions: what should happen, which resources may be used, which run settings apply, and whether the instruction sends now or joins the queue. Uploads, model transport, authorization, and persistence remain host responsibilities.

  • Enter submits and Shift + Enter inserts a line break. Never intercept Enter during IME composition.
  • @ opens the workspace tree, $ opens skills, and / opens built-in commands. Suggestions use a listbox or tree while focus remains in the editor through aria-activedescendant.
  • Files and directories can arrive through a picker or drag and drop. Every resource keeps a stable identifier, visible type, and remove action.
  • Running states distinguish send, queue, stop, and unavailable actions with text, not an icon swap alone.
  • Failed submissions preserve Markdown, selection, resources, settings, and focus, then name a concrete recovery action.

When the editor also needs a drop hint, validation message, or other host-owned content, wrap the input with data-composer-editor. Intermediate wrappers stay shrinkable, and long unbroken text scrolls inside the input instead of widening the workbench:

<form class="agent-composer" aria-label="Message the coding agent">
  <section class="agent-composer-editor" data-composer-editor>
    <p data-composer-editor-message role="status">Drop a workspace file here</p>
    <div>
      <textarea
        data-composer-input
        name="prompt"
        aria-label="Instruction"
        placeholder="Describe the task to complete…"
      ></textarea>
    </div>
  </section>
</form>

Public structure

APIPurpose
.agent-composerThe <form> boundary; use <section> only inside an existing form
data-composer-editorHost for the TipTap instance or other editor region; keeps nested input width and scroll bounds stable
data-composer-inputProseMirror root or native input marked as the actual task input
data-composer-resourcesOrdered files, directories, source ranges, images, URLs, and skills
data-composer-suggestionsListbox or tree opened by @, $, or /
data-composer-settingMode, context, model, and reasoning controls owned by the host
data-composer-actionsSend, queue, stop, and retry actions
data-composer-statusOne polite status region, never a token-by-token announcer
data-composer-queueEditable, removable, sortable, pausable follow-up messages

Root states are ready, submitting, streaming, queued, stopping, offline, error, and disabled. Individual controls continue to use native disabled.

Controller

MethodResult
getDraft() / setDraft(markdown)Read or update controlled Markdown
focusInput()Restore focus to the ProseMirror surface
openSuggestions(trigger) / closeSuggestions()Manage suggestions without moving editor focus
setState(state, options)Update submitting, streaming, stopping, offline, or error state
setError(message)Preserve the draft while presenting a recoverable error
runAction(action, options)Run a host action after its cancelable authorization event

Important events include a3s:composer-before-submit, a3s:composer-submit, a3s:composer-draft-change, a3s:composer-trigger-change, a3s:composer-before-action, a3s:composer-action, and a3s:composer-queue-action.

Release acceptance

Validate IME composition, undo and redo, long Markdown, empty drafts, focus restoration, keyboard suggestions, directory drops, resource deduplication, repeated stop attempts, offline recovery, queue editing, and 320px layouts. A test that proves only typing and submission is not enough for a production task workspace.