@aireachable/core / open source

Give AI access to functions. Not your DOM.

Register application functions as named capabilities. A planner receives the allowed actions and current context, returns a JSON plan, and the runtime checks each step before invoking host code.

~/appproject-actions/model/demo.tsTypeScript
// Registered by the host application
const search = defineCapability({
  name: 'project.search',
  args: { query: { type: 'string' } },
  effect: 'local',
  confirmation: 'none',
  available: canSearch,
  execute: searchTable,
})

// Model output: proposal, not executable code
const plan = {
  steps: [{
    capability: 'project.search',
    args: { query: 'Harbor' },
  }],
}
EXECUTION CONTRACTnamed capabilitiesvalidated argumentsexplicit approval
01 / ONE MEASURED SCENARIO

End-to-end timing in four actions

Find Leo’s projects, select Planning, open Harbor migration, and return to the project list.

MethodTotal timeIncluded in the measurement
OpenCode via browser UI51.76 s3.10 s browser commands + 48.66 s between commands
AIReachable · regular JSON7.56 sModel response + execution of four app actions
AIReachable · compact format5.83 sModel response + execution of four app actions

Setup. Test with qwen3.8-flash-next-q2_0, RTX 3060 (12 GB VRAM) and 96 GB RAM. This is not the Qwen2.5 0.5B browser-model demo above.

Observed result. AIReachable completed this scenario 44.20 s sooner with regular JSON and 45.93 s sooner with the compact format. Gaps between commands accounted for about 94% of the OpenCode total.

What it does not prove. OpenCode’s 3.10 s covers browser commands only; AIReachable’s 7.56 s and 5.83 s also include model response. Those figures cannot be compared as execution-only times. One run per AIReachable format is not enough to establish a general speedup or a protocol advantage.

02 / ARCHITECTURE

From instruction to host function

The application supplies a capability catalog and a context snapshot. The planner proposes steps; the runtime checks names, arguments, availability, and confirmation policy.

01 / register

Register host functions

Describe arguments, availability checks, effects, and execution for each operation your application is willing to expose.

02 / propose

Accept a proposed plan

A planner returns capability names and arguments. The model never gets to run arbitrary code or manipulate page elements.

03 / execute

Validate before execution

The runtime checks each step against the catalog and current state. Consequential actions pause for confirmation.

plan.jsonplanner output · example
{
  "steps": [
    {
      "capability": "project.search",
      "args": { "query": "Harbor" }
    }
  ]
}
03 / RUNTIME GUARANTEES

What the runtime checks

A planner can be replaced without changing registered actions. The host supplies the state snapshot and implements the functions; the runtime mediates execution.

Documentation
01 /

Only registered functions

The demo registers eight actions: navigate, search, filter, show list, create, edit, delete, and add task. The runtime resolves each name against this catalog.

02 /

Argument and availability checks

Arguments are parsed against the capability schema; actions with availability checks must pass against current state. Unknown names do not run.

03 /

Confirmation policy

Create, edit, and delete wait for approval. Navigation, search, filters, and task addition explicitly opt out in this local demo.

04 /

Explicit failure semantics

An error stops the plan and reports completed steps. Previous changes are not automatically rolled back.

04 / REFERENCE EXAMPLE

Project desk: reference integration

Vue table, filters, forms, and assistant actions share application state. The optional browser model downloads only after you select “Load demo model”.

OPTIONAL · RUNS IN YOUR BROWSER

Unlock the interactive demo

Load the AI model only if you want to try the assistant. Model files come from this site; your prompts and project data stay in this browser.

First download: about 786 MB on CPU or 483 MB on WebGPU, plus tokenizer files and the ONNX runtime. CPU inference may take a while.

05 / UNDER THE HOOD

Request path and trade-offs

The action contract is independent of the model. The demo uses a browser planner; a different planner can return the same plan format without changing host operations.

01instruction + context
02planner → JSON plan
03runtime → checks and approval
04host → application function
01 / IMPLEMENTATION

Integration boundaries

The demo connects a Planner, capability catalog, and getContext callback. The model proposes action names and arguments; it does not receive JavaScript to run.

  • Planner: turns an instruction, capabilities, and context snapshot into a proposed plan.
  • Runtime: checks the plan before calling registered host functions.
  • Host: owns state, availability checks, execution functions, and confirmation UI.
02 / COMPARISON

Execution paths

Both approaches need to interpret the instruction, but these measured runs used different execution paths and do not isolate the cost of either path.

DOM-driven agent

Often inspects page markup, identifies an element, clicks or types, then checks the result. A multi-step task may repeat this loop.

AIReachable

The model selects a registered application function; the runtime validates its arguments and calls the same host logic used by the UI.

INTEGRATION DETAILS

The four boundaries in one request

Follow a search request through the Project desk demo. Each component has a separate job; a JSON response is only the input to the checks, not permission to change state.

01 / INPUT

Planner request

The host supplies the user instruction, descriptions of registered capabilities, and a snapshot of current project state. The planner can be replaced without changing host functions.

planner.propose({ instruction, capabilities, context })
02 / OUTPUT

Untrusted proposal

The response names capabilities and supplies arguments. A malformed response is rejected; parsing valid JSON does not make an action authorized.

steps: [{ capability, args }]
03 / RUNTIME

Checks before invocation

The runtime resolves the name, parses the capability arguments, and applies availability and confirmation rules before invoking the host function.

name → args → available → confirmation → execute
04 / APPLICATION

Shared application state

The search capability calls the same searchTable function used by the UI. The library does not query page elements or manipulate the DOM to find a search box.

execute: searchTable

Confirmation is per capability

In this demo, create, edit, and delete wait for approval. Navigation, search, filters, and task addition explicitly opt out. When integrating real services, the host must also enforce its own authorization rules.

No implied transaction

If a later step fails or is rejected, earlier completed steps remain applied. The runtime reports the outcome; rollback or compensation must be implemented by the host if needed.

Performance and integration cost

Direct function calls can avoid repeated DOM inspection and simulated clicks in multi-step tasks. The single-scenario measurements below show faster end-to-end completion in those runs, not an isolated improvement in runtime or model speed.

06 / GET STARTED

Start with the capability catalog

Inspect the core package and the project-desk integration: planner wiring, host functions, availability checks, and confirmation policy.