s-m-r-t
Open the s-m-r-t source on GitHub Switch to dark color scheme
← Capabilities

New UI capability

Let an agent help with a form

s-m-r-t controls describe their identity, permitted operations, and page location to an adapter. The adapter can support chat, voice, tutorials, or tests. The description does not give the adapter unchecked page access.

Form controls
DescribeHighlightValidateStageConfirm
An adapter can guide the user or stage a change; confirmed application stays explicit.

Give every control a stable address

A form has a formId and each control has a controlId, usually taken from its name. That lets an adapter refer to profile.displayName or settings.notifications without guessing from DOM position or visible wording.

  • Controls publish their label, description, kind, options, constraints, and current validation state.
  • A subject can connect a control to the record being edited.
  • Public, personal, sensitive, and secret classifications travel with the control description.

Help without changing anything

An adapter can list the controls in a form and use safe commands to focus, reveal, highlight, explain, or validate one of them. These commands help someone navigate the interface but do not change its values.

  • Highlight can point to the field being discussed in chat.
  • Explain returns the control description, choices, and constraints to the adapter.
  • Validate runs the same rule the visible form uses.

Propose first, then ask

Staging records a proposed value separately from the live form. Applying, clearing, or undoing an agent change is always refused by default — only a human, through a real local click routed via executeLocalControlCommand, can confirm one — so the UI has a natural place for a review step.

  • Secret values are redacted and cannot be read or changed through the registry.
  • Read-only, disabled, and non-writable controls reject mutation commands.
  • Applications can supply a stricter policy for their own risk and permission rules.

Connect the adapter your product uses

The registry deliberately does not know about a particular chat model, voice service, WebMCP transport, or DOM implementation. Your adapter translates a trusted tool call or tutorial step into the small command vocabulary.

AgentAssistedProfile.svelte
typescript
<script lang="ts">
  import {
    Form, FormGroup, Input,
    createControlInteractionRegistry,
    executeLocalControlCommand
  } from '@happyvertical/smrt-ui/forms';
  import { Button } from '@happyvertical/smrt-ui/ui';

  const controls = createControlInteractionRegistry();

  async function proposeDisplayName(value: string) {
    await controls.execute({
      action: 'stage',
      identity: { formId: 'profile', controlId: 'displayName' },
      value
    }, { source: 'agent' });
  }

  // An agent-sourced apply is always refused, even with confirmed: true.
  // Only a real click can confirm: forward its own event as local-gesture
  // proof through executeLocalControlCommand.
  async function confirmDisplayName(event: MouseEvent) {
    await executeLocalControlCommand(controls, {
      action: 'apply',
      identity: { formId: 'profile', controlId: 'displayName' }
    }, event);
  }
</script>

<Form formId="profile" interactionRegistry={controls}>
  <FormGroup label="Display name">
    <Input name="displayName" />
  </FormGroup>
</Form>
<Button onclick={confirmDisplayName}>Apply</Button>

Know where the boundary is today

The standardized controls, registry, safety policy, s-m-r-t Svelte form bridge, and interactive playground example are included. A product chooses and connects the chat or voice adapter that exposes these commands. The installation of both packages does not let smrt-chat control every form.