Agent-First Development / FAST-AF

Agent-First Development: software built as commands that people and agents both call. Not AI that writes your code.

Preview, on npm

FAST-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

Running in this tabLight theme

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.
Fig. 01The components

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.

<violet-button>

Loading the components…

Events heardNone yet. Use the component.

Fig. 02The layer

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.

The components

Loading the components…

What each layer did
  1. Nothing yet. Type a task and press Add.

The wiringThe code running above

This wiring is written by hand, here and in your application. A binder that does it for you is planned, not shipped.

Fig. 03The runtime

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.

From FAST

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.
A FAST component, defined in this tab

Press Add one, and the page reports what FAST changed in the component.

The component, as it is defined
Added, 1

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.

One test, two runtimes
What was checked Microsoft FAST Element FAST-AF
Running the test…

The test, as it ran
Added, 2

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.

getSchema('violet-button')Asked in this tab
Kept

It keeps up with FAST.

Fig. 04The pack

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

    Fig. 05Start

    Install it.
    Write a tag.

    app.js and any HTMLOne import registers every element
    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));
    The components
    npm install @lushly-dev/violet-elements@preview @lushly-dev/fast-element@preview
    The runtime alone
    npm install @lushly-dev/fast-element@preview

    Status

    Preview, on npm. Both packages publish under the preview tag, never latest.