Agent-First Development: software built as commands that people and agents both call. Not AI that writes your code.
Preview, on npmFAST-AF
Web components, and their runtime.
Forked from Microsoft FAST.
FAST-AF is a runtime, a fork of Microsoft's FAST Element not
affiliated with or endorsed by Microsoft, and its component library,
violet-elements: 77 web components, named for
the Violet tokens they read. Each works with any framework and ships a record an agent can
read.
npm install @lushly-dev/violet-elements@preview @lushly-dev/fast-element@preview
Loading the components…
Not a picture These are the components themselves, loaded from the package and mounted from the markup their stories rendered.
- 77 components
- Buttons, fields, menus, a data grid, a chat thread. Each one has a record written for an agent.
- Microsoft FAST underneath
- The runtime is an independent fork of FAST Element 3.1.4, and it takes Microsoft's releases as they ship.
- 0 commands in a component
- A component says what the person meant, as an event. The application decides what to do.
Every component,
running in this tab.
Pick oneThese are the real components, loaded from the package. Each example is the markup one of its stories rendered, mounted again here, and you can use it. The facts under it are read from the component's record.
Loading the components…
Events heardNone yet. Use the component.
A component says what was meant.
The app decides what happens.
No component calls a command. A field says the person typed, a checkbox says it was ticked, and the application turns that into a command, the same one an agent or the command line would call. So the components stay reusable and the commands stay in one place.
Try itAdd a task and tick it. The left side is three FAST-AF components. The right side is this site's real command registry, the one the home page's terminal calls.
Loading the components…
- Nothing yet. Type a task and press Add.
This wiring is written by hand, here and in your application. A binder that does it for you is planned, not shipped.
What FAST-AF adds
to what FAST does.
The runtime is a fork of Microsoft's FAST Element. Templates, bindings, attributes and styles are FAST's, unchanged, so what you know about FAST is true here. FAST-AF adds two things an application built for agents needs, and keeps taking FAST's releases.
What FAST gives every component.
- A component is an HTML tag.
- FAST builds on the browser's own custom elements and shadow DOM, so a component works in any framework, or with none.
- Only what changed is updated.
- A template knows which value each binding reads. When a value changes, FAST writes to that one place. There is no virtual DOM, and nothing is rendered again.
- It is small.
Press Add one, and the page reports what FAST changed in the component.
The component, as it is defined
A registry of its own, all the way down.
A browser can give one part of a page its own list of custom elements, so two versions of a component, or two teams' components with the same name, can share a page. FAST-AF creates everything a component's template renders in that component's registry.
The test on the right runs in this tab, once on each runtime, from the same function: a host with its own registry renders a child that only that registry knows.
| What was checked | Microsoft FAST Element | FAST-AF |
|---|---|---|
| Running the test… | ||
The test, as it ran
A component you can ask.
Turn the definition schema on and every component defined afterwards can be asked what it is: its attributes, their types, its slots. The answer comes from the running definition, not from a file that might be out of date.
It keeps up with FAST.
What an agent is told.
And how it is known.
An agent writing a page with these components reads a record for each one it uses: what it is for, its attributes, slots and events, examples that work, and the rules that apply. Every fact says where it came from, so the agent knows what to trust.
It says what it doesn't know.
Counted in this tab from the records. How Specimen builds a pack
Install it.
Write a tag.
import '@lushly-dev/violet-elements';
// Or only the elements you use, one subpath each:
// import '@lushly-dev/violet-elements/button/define';
// Then, in HTML, a template, or a framework's markup:
<violet-text-field label="Task" name="title"></violet-text-field>
<violet-button appearance="primary">Add</violet-button>
// A component says what the person meant. You decide what it does.
field.addEventListener('change', (event) => save(event.detail.value));
import { applyVioletThemePreset, installVioletThemeSet } from '@lushly-dev/violet-elements';
import theme from './afd-theme.json' with { type: 'json' };
// A theme is data: each preset is a list of token ids and values.
// With none installed, the components use the package's default.
installVioletThemeSet(theme.set);
applyVioletThemePreset(document, 'dark');
import { attr, css, FASTElement, html } from '@lushly-dev/fast-element';
class PlanBadge extends FASTElement {
@attr plan = 'free';
}
PlanBadge.define({
name: 'plan-badge',
template: html`<span>${(x) => x.plan}</span>`,
styles: css`:host { display: inline-block; }`,
});
import { enableDefinitionSchema, getSchema } from '@lushly-dev/fast-element/definition-schema.js';
enableDefinitionSchema();
await import('@lushly-dev/violet-elements');
getSchema('violet-button').properties;
// [{ name: 'appearance', type: 'string', attribute: 'appearance' }, …]
npm install @lushly-dev/violet-elements@preview @lushly-dev/fast-element@preview
npm install @lushly-dev/fast-element@preview
Preview, on npm. Both packages publish under the
preview tag, never latest.