# Nisc > Nisc is an open-source TypeScript framework built for AI at every layer. Models write screens, queries, permissions and automations as checked JSON, never code. The packages are on npm under @niscorp. What each ships to be read is served here as plain Markdown, the same files a coding agent finds in node_modules. Each package also has a guide and a reference of examples: HTML pages whose text is in the file, readable without running a script. Nisc is made by Max Uhlig. His CV and his articles are at [moccadroid.com](https://moccadroid.com). Every package's README in one file: [llms-full.txt](https://nisc.dev/llms-full.txt) ## Nova Screens as JSON: shells, canvases, actions and layouts, drawn by your own components. - [README.md](https://nisc.dev/nova/README.md) - [LAYOUT_DOCS.md](https://nisc.dev/nova/LAYOUT_DOCS.md) - [ACTION_DOCS.md](https://nisc.dev/nova/ACTION_DOCS.md) - [SHELL_DOCS.md](https://nisc.dev/nova/SHELL_DOCS.md) - [I18N_DOCS.md](https://nisc.dev/nova/I18N_DOCS.md) - [ADAPTER.md](https://nisc.dev/nova/ADAPTER.md) - [REACT_DOCS.md](https://nisc.dev/nova/REACT_DOCS.md) - [TERMINAL_DOCS.md](https://nisc.dev/nova/TERMINAL_DOCS.md) - [DESIGN.md](https://nisc.dev/nova/DESIGN.md) - [CHANGELOG.md](https://nisc.dev/nova/CHANGELOG.md) - [Nova](https://nisc.dev/nova): what Nova is, shown with the installed package running in the page, and the questions an engineer asks of it, answered - [Guides](https://nisc.dev/nova/guides): how to do things with Nova, each guide a file that runs - [Guide: Data and a layout](https://nisc.dev/nova/data-and-a-layout): Four ways a layout reads an action’s data, and model, the one way it writes it back. - [Guide: Triggers and steps](https://nisc.dev/nova/triggers-and-steps): What a press does, written as steps: small changes to the action’s data, in order. - [Guide: Canvases, and Back](https://nisc.dev/nova/canvases-and-back): An action on top of another, and taken off again. Why going back needs no code. - [Guide: An endpoint](https://nisc.dev/nova/an-endpoint): A named call: what it sends, where the answer goes, and what happens after. - [Guide: Messages](https://nisc.dev/nova/messages-between-actions): Two actions on two canvases. One says something happened, and the other answers. - [Guide: A fragment](https://nisc.dev/nova/a-fragment): A frame written once and put around any action when it is opened. - [Guide: Audited](https://nisc.dev/nova/audited): A document read against the schema and against itself, before anybody presses anything. - [Guide: Drawn in a terminal](https://nisc.dev/nova/drawn-in-a-terminal): The same documents as text. Everything that can be pressed carries a number. - [Reference](https://nisc.dev/nova/reference): 42 examples, a page each with its input and its output. Sections: Layouts, Actions, Endpoints, Composition, Shells, i18n ## Prism Every transform as a JSON config: shaping, formatting, branching. - [README.md](https://nisc.dev/prism/README.md) - [DOCS.md](https://nisc.dev/prism/DOCS.md) - [DESIGN.md](https://nisc.dev/prism/DESIGN.md) - [CHANGELOG.md](https://nisc.dev/prism/CHANGELOG.md) - [Prism](https://nisc.dev/prism): what Prism is, shown with the installed package running in the page, and the questions an engineer asks of it, answered - [Guides](https://nisc.dev/prism/guides): how to do things with Prism, each guide a file that runs - [Guide: Shape a row](https://nisc.dev/prism/shape-a-row): One row in, the object a reader needs out. A config is written in the shape of its result. - [Guide: Lists](https://nisc.dev/prism/lists): A list filtered, sorted, mapped and added up. - [Guide: Branch and default](https://nisc.dev/prism/branch-and-default): A value that depends on another, and one that falls back when something is missing. - [Guide: Money and dates](https://nisc.dev/prism/money-and-dates): An amount and a moment, written the way the reader’s language writes them. - [Guide: Refused, safely](https://nisc.dev/prism/refused-safely): What Prism does with a config that is wrong, and how to ask without a throw. - [Guide: Compile once](https://nisc.dev/prism/compile-once): A config that is stored, compiled to a document of its own and run from that. - [Guide: Rewrite a document](https://nisc.dev/prism/rewrite-a-document): A config that changes a document: every node of a tree, one path, one set of keys. - [Guide: For a model](https://nisc.dev/prism/for-a-model): The grammar as JSON Schema, a smaller one for a mapping, and what to do with what a model writes. - [Reference](https://nisc.dev/prism/reference): 84 examples, a page each with its input and its output. Sections: Core, Arrays, Math, Strings, Predicates, Logic, Structure, Objects, Transform, Time, Locale, Sugar, Composition, Real world ## Vex You send an intent and a shape. Postgres answers, and the model is asked once. - [README.md](https://nisc.dev/vex/README.md) - [DOCS.md](https://nisc.dev/vex/DOCS.md) - [DESIGN.md](https://nisc.dev/vex/DESIGN.md) - [CHANGELOG.md](https://nisc.dev/vex/CHANGELOG.md) - [Vex](https://nisc.dev/vex): what Vex is, shown with the installed package running in the page, and the questions an engineer asks of it, answered - [Guides](https://nisc.dev/vex/guides): how to do things with Vex, each guide a file that runs - [Guide: Seed and lock](https://nisc.dev/vex/seed-and-lock): Every read the app depends on, stored under a name at boot. The endpoint replays them and generates nothing, and GET on it says what each takes. - [Guide: A search with a cursor](https://nisc.dev/vex/a-search-with-a-cursor): One stored search answers everyone, everyone matching, and the next page, by which keys the caller sends. - [Guide: A reactive read](https://nisc.dev/vex/a-reactive-read): A read that answers again when a table it reads is written, for as long as somebody follows it. - [Guide: Shapes and locales](https://nisc.dev/vex/shapes-and-locales): A Prism mapping from the rows to the shape you asked for, stored with the query. A price in the reader’s language, from one entry. - [Guide: Writes and a batch](https://nisc.dev/vex/writes-and-a-batch): Five operations, a lint at seed, and a booking with its seats in one transaction. - [Guide: A policy from a charter](https://nisc.dev/vex/a-policy-from-a-charter): A role’s grants compiled into a ScopePolicy, one per role, merged for a person holding several. - [Guide: An assistant asks](https://nisc.dev/vex/an-assistant-asks): A model writes a query once, from an intent and a shape, and the answer is kept under a fingerprint. - [Guide: Vex in a page](https://nisc.dev/vex/vex-in-a-page): Postgres built to run in a browser, through the same adapter, with no server. - [Reference](https://nisc.dev/vex/reference): 25 examples, a page each with its input and its output. Sections: API, Query DSL, Errors, Scope policies ## Strata Migrations for the screens and queries you saved, and for your tables. A release can change a format and what you saved still runs. - [README.md](https://nisc.dev/strata/README.md) - [DESIGN.md](https://nisc.dev/strata/DESIGN.md) - [CHANGELOG.md](https://nisc.dev/strata/CHANGELOG.md) - [Strata](https://nisc.dev/strata): what Strata is, shown with the installed package running in the page, and the questions an engineer asks of it, answered - [Guides](https://nisc.dev/strata/guides): how to do things with Strata, each guide a file that runs - [Guide: A sequence for your tables](https://nisc.dev/strata/a-sequence-for-your-tables): Two migrations run on a Postgres, a third appended later, and the ledger that remembers all three. - [Guide: Read the plan before you run it](https://nisc.dev/strata/read-the-plan): What a run would do, asked without doing it, and what Strata says of a migration edited after it ran. - [Guide: Rename a prop in every stored screen](https://nisc.dev/strata/rename-a-prop): One migration, and a screen stored before the change is read as if it had been written after it. - [Guide: Stamps, and refusing what is too new](https://nisc.dev/strata/stamps): What a stamp says, what runs at each distance from the code, and a document from a later release. - [Guide: Documents inside documents](https://nisc.dev/strata/documents-inside-documents): A season holds shows and a show holds roles. One migration changes a role, wherever it is. - [Guide: Upgrade a table of stored documents](https://nisc.dev/strata/a-table-of-documents): Every row of a table that is behind, rewritten in one transaction. - [Guide: The check before a release](https://nisc.dev/strata/the-check): A schema on record, a change to it, and the two questions asked before the change ships. - [Guide: Upgrade your own source](https://nisc.dev/strata/your-own-source): A screen in a TypeScript file is a document too. Strata says what it must become, and holds your edit to that. - [Reference](https://nisc.dev/strata/reference): 25 examples, a page each with its input and its output. Sections: API, Migrations, Errors ## Signal The call to a model: a schema sent the way each model takes one, and the answer checked against it. - [README.md](https://nisc.dev/signal/README.md) - [DOCS.md](https://nisc.dev/signal/DOCS.md) - [DESIGN.md](https://nisc.dev/signal/DESIGN.md) - [CHANGELOG.md](https://nisc.dev/signal/CHANGELOG.md) - [Signal](https://nisc.dev/signal): what Signal is, shown with the installed package running in the page, and the questions an engineer asks of it, answered - [Guides](https://nisc.dev/signal/guides): how to do things with Signal, each guide a file that runs - [Guide: A typed answer](https://nisc.dev/signal/a-typed-answer): Give Signal a Zod schema and the answer is an object of that shape. One that fails the schema is retried, with what was wrong. - [Guide: A tool](https://nisc.dev/signal/a-tool): A tool is a function the model may ask for. Signal checks what the model sends, runs the function, and hands the result back until the model answers. - [Guide: A stream](https://nisc.dev/signal/a-stream): The same call, read while the model is still writing: the text a few characters at a time, then the whole result. - [Guide: A conversation](https://nisc.dev/signal/a-conversation): Signal keeps nothing between calls. Each result carries the history so far, and you hand it to the next call. - [Guide: Which model, and what it can do](https://nisc.dev/signal/which-model): Signal knows what each model it was measured on can do, and tells you before any request is made. This file asks no model and needs no key. - [Guide: Your own loop](https://nisc.dev/signal/your-own-loop): One call to the model. Give it a schema and it says whether the turn was tool calls, an answer or a failure. It is what Cortex is built on. - [Guide: A decision](https://nisc.dev/signal/a-decision): Questions with fixed options about something, and an answer to each. On a decision model each answer comes with its probability. - [Guide: A test without a model](https://nisc.dev/signal/a-test-without-a-model): Hand Signal a client of your own and it answers in place of the provider. Your test says what the model writes, and Signal does the rest as it always does. - [Reference](https://nisc.dev/signal/reference): 20 examples, a page each with its input and its output. Sections: API, Methods, Structured output, Validation and retries, Tool calling ## Solid A JSON streaming library: structured output from a model that streams, as a whole object of your schema at every moment. - [README.md](https://nisc.dev/solid/README.md) - [DESIGN.md](https://nisc.dev/solid/DESIGN.md) - [CHANGELOG.md](https://nisc.dev/solid/CHANGELOG.md) - [Solid](https://nisc.dev/solid): what Solid is, shown with the installed package running in the page, and the questions an engineer asks of it, answered - [Guides](https://nisc.dev/solid/guides): how to do things with Solid, each guide a file that runs - [Guide: Read a reply as it arrives](https://nisc.dev/solid/read-a-reply-as-it-arrives): A reply comes in pieces. After each one you can read an object of your shape, with as much in it as has arrived. - [Guide: Use a part before the reply is over](https://nisc.dev/solid/use-a-part-before-the-reply-is-over): Solid says when one part of a reply is finished, which is before the whole reply is. So a screen can use the seats while the reason is still being written. - [Guide: Handle a wrong value](https://nisc.dev/solid/handle-a-wrong-value): A value of the wrong kind is left out, the rest of the reply is read, and you are told where it was. - [Guide: Check a value when it is finished](https://nisc.dev/solid/check-a-value-when-it-is-finished): A rule such as a pattern or a maximum cannot be judged on half a value. Solid can check it when the value is finished. - [Guide: Draw only what changed](https://nisc.dev/solid/draw-only-what-changed): Each time something arrives you get a new object, and every part of it that did not change is the same object as before. A screen can tell by comparing. - [Guide: Initial values and ending a stream](https://nisc.dev/solid/initial-values-and-ending-a-stream): What a stream holds before any text, what to do when Solid cannot work that out, and how to tell a reply that stopped early from a whole one. - [Reference](https://nisc.dev/solid/reference): 25 examples, a page each with its input and its output. Sections: API, Options, Partial values, Errors, Completion ## Cortex The loop that runs an agent: the messages it keeps for a model, your tools run for it, and its answer checked against your schema. - [README.md](https://nisc.dev/cortex/README.md) - [DESIGN.md](https://nisc.dev/cortex/DESIGN.md) - [CHANGELOG.md](https://nisc.dev/cortex/CHANGELOG.md) - [Cortex](https://nisc.dev/cortex): what Cortex is, shown with the installed package running in the page, and the questions an engineer asks of it, answered - [Guides](https://nisc.dev/cortex/guides): how to do things with Cortex, each guide a file that runs - [Guide: An agent with a tool](https://nisc.dev/cortex/an-agent-with-a-tool): A tool is a function with a schema. An agent is given it, asked a question, and answers from what it returned. - [Guide: An answer that fits](https://nisc.dev/cortex/an-answer-that-fits): Give an agent a schema and its answer is data of that shape. One that does not fit goes back to the model. - [Guide: An answer as it arrives](https://nisc.dev/cortex/an-answer-as-it-arrives): A model writes its answer a few characters at a time. Cortex hands you what there is of it so far. - [Guide: A gate before a tool](https://nisc.dev/cortex/a-gate-before-a-tool): A function Cortex calls before every tool call. It allows the call, refuses it, or asks a person. - [Guide: A run that waits](https://nisc.dev/cortex/a-run-that-waits): A run that is waiting for a person is saved as a document, and resumed from it later. - [Guide: An agent as a tool](https://nisc.dev/cortex/an-agent-as-a-tool): One agent hands part of its work to another by calling it, the way it calls any tool. - [Guide: A package’s own agent](https://nisc.dev/cortex/a-packages-own-agent): Prism ships an agent that writes a mapping. Run it once, then use what it wrote with no model. - [Guide: Preview a run](https://nisc.dev/cortex/preview-a-run): What an agent would send a model, without calling one. And every event of a run. - [Reference](https://nisc.dev/cortex/reference): 20 examples, a page each with its input and its output. Sections: API, Output, Tools and gates, Failed runs ## Moss The app server. Each person’s app runs on the server, built from what the charter grants them, and the browser draws it. - [README.md](https://nisc.dev/moss/README.md) - [DOCS.md](https://nisc.dev/moss/DOCS.md) - [DESIGN.md](https://nisc.dev/moss/DESIGN.md) - [CHANGELOG.md](https://nisc.dev/moss/CHANGELOG.md) - [Moss](https://nisc.dev/moss): what Moss is, shown with the installed package running in the page, and the questions an engineer asks of it, answered - [Guides](https://nisc.dev/moss/guides): how to do things with Moss, each guide a file that runs - [Guide: Boot an app](https://nisc.dev/moss/boot-an-app): A charter, three screens and a database go in. Moss boots, and says which screens each person’s app is made of. - [Guide: What each person is served](https://nisc.dev/moss/what-each-person-is-served): The same app, read as it stands on the server for two people. - [Guide: A press on the server](https://nisc.dev/moss/a-press-on-the-server): A press is an event sent up. The trigger runs on the server, and the next frame comes back. - [Guide: Reads by name](https://nisc.dev/moss/reads-by-name): The app ships a stored read. Callers send its name, and each gets the rows their roles allow. - [Guide: A screen by grant](https://nisc.dev/moss/a-screen-by-grant): Two people open the same screen and one sees more on it. The richer layout is granted like a screen is. - [Guide: Refused at boot](https://nisc.dev/moss/refused-at-boot): Two apps with one thing wrong in each, and what Moss says to them. - [Guide: A page that arrives drawn](https://nisc.dev/moss/a-page-that-arrives-drawn): A page answered with the caller’s screen already in the HTML, and with who may keep it. - [Reference](https://nisc.dev/moss/reference): 18 examples, a page each with its input and its output. Sections: API, Catalog, Layout variants, Boot errors, SSR cache headers ## Charter Access control by existence: your roles decide which screens and data your app is built from, and the rest was never put in. - [README.md](https://nisc.dev/charter/README.md) - [DOCS.md](https://nisc.dev/charter/DOCS.md) - [DESIGN.md](https://nisc.dev/charter/DESIGN.md) - [CHANGELOG.md](https://nisc.dev/charter/CHANGELOG.md) - [Charter](https://nisc.dev/charter): what Charter is, shown with the installed package running in the page, and the questions an engineer asks of it, answered - [Guides](https://nisc.dev/charter/guides): how to do things with Charter, each guide a file that runs - [Guide: Resolve a role](https://nisc.dev/charter/resolve-a-role): A role, a list of what exists, and the names that role selects. One wildcard, and a deny that wins. - [Guide: Roles that build on roles](https://nisc.dev/charter/roles-on-roles): One role extends another, one is cut out of another, and what a deny does and does not carry down. - [Guide: Verify before you ship](https://nisc.dev/charter/verify-before-you-ship): The verifier reads a charter against what exists. A typo in a deny is an error. - [Guide: A Vex policy from a charter](https://nisc.dev/charter/a-vex-policy): What a role may do with each table, resolved by Charter and handed to Vex as the policy it enforces. - [Guide: An app built from what is granted](https://nisc.dev/charter/an-app-from-what-is-granted): The screens a person resolves to, handed to a shell. It is asked for one it was given and one it was not. - [Guide: A variant of a screen](https://nisc.dev/charter/a-variant-of-a-screen): Two people open the same screen and one sees more on it. The richer layout is a name a role is granted. - [Guide: A list of your own](https://nisc.dev/charter/a-list-of-your-own): Charter does not know what a screen is. The same function decides which tools an assistant is handed. - [Reference](https://nisc.dev/charter/reference): 22 examples, a page each with its input and its output. Sections: API, Role syntax, Verifier rules ## Tide Automations, as data: a JSON document names a trigger and the function to run. Schedules, database writes and webhooks, with retries and a record of every run. - [README.md](https://nisc.dev/tide/README.md) - [DOCS.md](https://nisc.dev/tide/DOCS.md) - [DESIGN.md](https://nisc.dev/tide/DESIGN.md) - [CHANGELOG.md](https://nisc.dev/tide/CHANGELOG.md) - [Tide](https://nisc.dev/tide): what Tide is, shown with the installed package running in the page, and the questions an engineer asks of it, answered - [Guides](https://nisc.dev/tide/guides): how to do things with Tide, each guide a file that runs - [Guide: A scheduled reflex](https://nisc.dev/tide/a-scheduled-reflex): The reflex of the first steps, on a daily schedule, and the loop a host runs around it: ask Tide when the next run is due, and call it then. - [Guide: One task per row](https://nisc.dev/tide/one-task-per-row): A reflex can run its function once for each row of a query. Each row is its own task, and succeeds, fails or is retried alone. - [Guide: Trigger on a database write](https://nisc.dev/tide/trigger-on-a-database-write): A reflex triggered by a row being inserted, and a second reflex triggered when the first one finishes: a workflow of two steps. - [Guide: Deduplicate a webhook](https://nisc.dev/tide/deduplicate-a-webhook): A payment provider delivers the same webhook twice. Give it a dedupeKey and Tide processes it once. - [Guide: Dry run, manual run, retry](https://nisc.dev/tide/dry-run-manual-run-retry): Preview what a reflex would do, run it by hand, and retry a failed task. - [Guide: Missed runs and daylight saving](https://nisc.dev/tide/missed-runs-and-daylight-saving): What a daily schedule does on the night the clocks go back, and what it does about runs it missed while nothing called it. - [Guide: Save a timer](https://nisc.dev/tide/save-a-timer): An AI can draft a reflex from a sentence: “in 40 minutes”. Saving it turns that into a date and time, and the bell still rings if the server restarts in between. - [Reference](https://nisc.dev/tide/reference): 25 examples, a page each with its input and its output. Sections: API, Triggers and selection, Reliability, Errors