openapi.yaml
Contract
paths:
/messages:
get:
operationId: listMessages
post:
operationId: sendMessage
x-intent-actors:
- Operator
- System
Intent language · 1.0
A language for what should exist. The compiler writes APIs, stores, and clients. Parsing stays deterministic.
npm install -g @intent-lang/cliexamples/notifications/app.intent
INT 0.1
intent version "0.1"
application Notifications { actor User actor Operator enum Channel { Email Sms Push }
resource Message { fields { id UUID channel Channel } permissions { User -> read Operator -> create } behavior { send { action { create Message } emit { MessageSent } } } }}generated/notifications
8 files
01
Actors, resources, constraints, and permissions in a .intent file.
02
Parser and validator are deterministic. They never call a model.
03
OpenAPI, SQL, TypeScript, Python, Go, and frontend shells.
04
Throw the generated tree away when the spec changes. Keep the spec.
Language
Notifications is the public teaching domain. The same constructs describe a shop, a ledger, or a helpdesk.
intent version "0.1"
application Notifications {
actor User actor Operator actor System
enum Channel { Email Sms Push }
resource Message {
fields { id UUID userId UUID channel Channel sentAt DateTime }
permissions { User -> read Operator -> create Operator -> read System -> create }
behavior {
send {
input { user User channel Channel }
validate { user must exist channel must be enabled }
action { create Message }
emit { MessageSent } } } }}Generate
Contract
paths:
/messages:
get:
operationId: listMessages
post:
operationId: sendMessage
x-intent-actors:
- Operator
- SystemStore
CREATE TABLE messages ( id UUID PRIMARY KEY, user_id UUID NOT NULL, channel TEXT NOT NULL, sent_at TIMESTAMPTZ );
API
app.get("/messages",
requireActor("User", "Operator"))
app.post("/messages",
requireActor("Operator", "System"))
app.get("/health", ok)
app.get("/ready", ready)Frontends
web/react/App.tsx web/angular/app.component.ts mobile/flutter/lib/screen.dart backends/python/app.py backends/go/main.go
What Intent is, and what it is not.
Get the CLI from npm and run the first commands.
Actors, resources, types, constraints, and permissions.
Notifications, shop, ledger, and the rest of the tree.
parse, validate, generate, compile, draft, inspect.
What the compiler writes from a valid program.
Turn a requirement into Intent, then validate it.
The published @intent-lang modules.