Skip to main content
OmniScript 2.0

OmniScript

OmniScript (OSF) is a typed, agent-native document format: one plain-text file holds a document, slides, spreadsheets, tables, charts and diagrams, plus the findings and decisions behind them. One Rust toolchain checks, queries and renders it, and serves it to agents.

OSF 2.0 is in alpha (2.0.0-alpha.3). The format and commands described here are implemented; details may still change before 2.0.0. See releases and roadmap.

One file, every format

An OSF file is a sequence of typed blocks. Structure blocks hold the content people read: @doc (Markdown), @slide, @sheet (cells and live formulas), @table, @chart, @diagram and @code, with @meta for the title and theme and @include to compose files. The same source renders to PDF, DOCX, PPTX, XLSX, HTML, Markdown and JSON.

report.osf
@meta { title: "Q3 review"; theme: corporate; }

@doc {
  # Summary
  Revenue grew **18%** quarter on quarter.
}

@sheet {
  id: "budget";
  name: "Budget";
  formats: { "B": "#,##0"; };
  A1 = "Region"; B1 = "Revenue";
  A2 = "North";  B2 = 1520;
  A3 = "South";  B3 = 1340;
  A4 = "Total";  B4 = =SUM(B2:B3);
}

Semantic blocks

Five block types carry the things knowledge work is made of. Each needs an id, has a closed set of status values that osf lint checks, and may have a Markdown body.

BlockHoldsKey properties
@findingA claim supported by evidenceclaim, confidence, evidence, status
@decisionA question with options and an outcomequestion, options, criteria, status, outcome
@requirementA MoSCoW requirementlevel, statement, verify, status, depends_on
@actionA unit of worktitle, assignee, due, status, depends_on
@hypothesisA testable statementstatement, confidence, supports, contradicts

Four agent blocks connect a document to the agent stack: @data_source (fill a sheet, table or chart from an MCP tool), @agent_card (serve the document as an A2A agent), @task and @artifact (A2A work and its outputs). Blocks named @x-… are extensions: kept by the parser and formatter, skipped by renderers. See the block reference.

References, the document graph and selectors

Any block can have an id, and @ref("id") is a value that points at another block. A document becomes a graph: evidence, criteria, depends_on and the other reference properties are its edges. A dangling reference is a lint error.

report.osf
@finding {
  id: "F-1";
  claim: "The North region beat its target by 12%.";
  confidence: 0.9;
  evidence: [@ref("budget")];
}

@decision {
  id: "D-1";
  question: "Roll out to all regions in Q1?";
  options: ["Roll out now", "Extend the pilot"];
  criteria: [@ref("F-1")];
}

OSF selectors query the graph from the CLI, the WebAssembly package and the MCP and A2A servers:

osf query report.osf 'finding[confidence>=0.8]'
osf query report.osf '#D-1 -> criteria'

More in Selectors and the document graph.

Agent protocols: MCP, MCP Apps and A2A

  • osf serve mcp exposes a folder of documents to MCP clients (stdio, or streamable HTTP with --listen) with the tools osf.parse, osf.lint, osf.format, osf.query, osf.get, osf.set, osf.render, osf.diff and osf.view.
  • osf.view is an MCP App: hosts that support MCP Apps show the rendered document in the chat.
  • osf serve a2a runs a document that has an @agent_card as an A2A agent, with built-in skills for querying, exporting, editing blocks and resolving decisions.
  • The osf Agent Skill (osf skill install) teaches any SKILL.md-compatible agent to write and check OSF.

Details in Agents.

One toolchain

Everything is one Rust codebase: the parser, the model, formula evaluation, the renderers, the agent servers and the language server. It ships as one binary and one library:

WhatInstall
CLIThe osf binary: parse, lint, fmt, diff, render, query, graph, eval, serve, lspnpm install -g omniscript-cli
RustThe same binary from crates.iocargo install osf-cli
JavaScriptomniscript-core: parse, lint, format, query and render (HTML, Markdown, JSON, Typst) in WebAssemblynpm install omniscript-core

The browser playground runs on omniscript-core, so the preview there is the same HTML the CLI writes. osf lsp is a language server for VS Code and other editors.

Rendering

  • PDF is typeset in-process by an embedded Typst compiler, with no browser or external tools. --pdf-ua writes accessible PDF/UA-1.
  • DOCX, PPTX and XLSX are written natively. XLSX keeps formulas live, keeps number formats and gets native charts.
  • Sheet formulas are evaluated with IronCalc, so every format shows computed values, formatted with the sheet's formats.
  • Charts are drawn as SVG; Graphviz dot diagrams are laid out by osf itself. Text in any script renders, using installed fonts where the bundled ones end.
  • The same renderers run behind the HTTP API on this site.

What comes next

A desktop editor (2.1), live re-evaluation and collaborative editing (2.2), and DOCX and PPTX import. The roadmap has the milestones.