Grids
Agents

Type a sentence. Get a model that already runs.

The Grid agent doesn't hallucinate spreadsheets. It runs every model it writes through the actual TypeScript runtime before returning, so by the time you see the source, the source has already computed.

01 · The tools

Six tools for grounding. One that runs the code.

Every invocation has access to the same tool set. The first six help the agent ground itself in the real runtime — function signatures, doc sections, error codes, canonical examples. The seventh, evaluate_grid, is the difference between "the agent claims this works" and this works.

When the agent doesn't know a function, it looks it up. It cannot make one up: the function signature, error model, and canonical examples come from the same binary your production runtime uses.

  1. 01
    lookup_functionFull signature plus description for one function.
  2. 02
    search_functionsMatch by name or description, optionally filtered by category.
  3. 03
    get_doc_sectionFetch a section of the language docs by topic name.
  4. 04
    get_canonical_exampleFetch one of the worked, canonical example models.
  5. 05
    explain_errorCause, recovery, and an errors.md excerpt for any error code.
  6. 06
    validate_gridParse, build, Lua-generate. Returns ok or structured diagnostics.
  7. 07
    evaluate_gridDeploy into the in-process Grid runtime, run, and return every cell's resolved value, status, and error code. The agent reads what its model actually does — not what a token predictor thinks it should do.
01 · validate

Syntax + structure.

diagnostics.jsonjson
{
  "ok": true,
  "cells": 9,
  "lua_bytes": 1894,
  "errors": []
}
02 · evaluate

Behavior, observed.

pricing
Live
CellValuemonthly[0]$29.00annual[0]$288.84payback[0]1.4 mopayback[1]1.2 mopayback[2]1.6 mo
02 · Verification

It runs before it returns.

After drafting, the agent calls validate_grid for syntax and structural checks, then evaluate_grid against the in-memory Grid runtime. It reads every resolved value, fixes diagnostics in-loop, and only returns when both checks pass.

Successful generations carry validatedClean: true and evaluatedClean: true in the response. If the model wouldn't evaluate, the agent says so — it doesn't hand back something that won't run.

03 · Surfaces

Same agent. Four ways to talk to it.

Embed it in TypeScript. Run it from the CLI. Call it over HTTP. Stream tokens to a chat UI. Same system prompt, same tools, same structured output — selectable per-call across the gateway, Anthropic, or OpenAI providers.

TypeScript library

Library

$createGridAgent({ provider: 'gateway' })

Embed the agent directly. Same tools, same loop, same structured output as the CLI and HTTP surfaces.

Local

CLI

$npm run agent -- 'pricing model'

One-shot generation in a terminal. Useful for inspection, scripts, and CI fixtures.

Server

HTTP

Coming soon

Plain JSON request, structured response. Same diagnostics surface as the library.

Realtime UI

Stream

Coming soon

Token-by-token streaming for chat UIs. Tool calls and partial drafts emit as events.

The model isn't a guess. It's already running.

By the time the agent returns, the source has been parsed, type-checked, compiled, deployed in-process, and every cell has either resolved or been flagged. That's the whole loop — drafting plus verification, before you read a single line.

Back to the startEverything the agent can produce