{"_id":"@atlanticplatformgroup/modellang","_rev":"3-e81f96e1691e9dc881e654223e594100","name":"@atlanticplatformgroup/modellang","dist-tags":{"latest":"0.51.0"},"versions":{"0.50.1":{"name":"@atlanticplatformgroup/modellang","version":"0.50.1","keywords":["semantic-model","compiler","postgresql","mcp","agent-tools"],"author":{"name":"Nick Scipione"},"license":"Apache-2.0","_id":"@atlanticplatformgroup/modellang@0.50.1","maintainers":[{"name":"nscipione","email":"nick@atlanticplatformgroup.com"}],"homepage":"https://github.com/atlanticplatformgroup/ModelLang#readme","bugs":{"url":"https://github.com/atlanticplatformgroup/ModelLang/issues"},"bin":{"modelc":"dist/src/cli.js"},"dist":{"shasum":"0974d9842e1e923f820028192783f440b3c97c96","tarball":"https://registry.npmjs.org/@atlanticplatformgroup/modellang/-/modellang-0.50.1.tgz","fileCount":170,"integrity":"sha512-bHE3wDVWUamZHHIO8jDdzCkKIelllBRzkLUTfKNFMiAPw9Ilb1TbT9lelMIfORniobd+o+D2Ai57mvgYqZXC5w==","signatures":[{"sig":"MEUCIGNpl1I1eYlUAcCH7294aJRtYevzLDlAz0V0e6sLIw7xAiEAo0IvTAl9/I2JwAx+m+rPV80ihGkw48HIM4+GYP44h4s=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1917609},"type":"module","engines":{"node":">=20"},"gitHead":"fdc98d5cdac319fe5a38da4e49b2b9bc3ee6a02e","scripts":{"demo":"tsx scripts/demo.ts","lint":"eslint .","test":"vitest run","build":"tsc -p tsconfig.json","db:up":"docker compose up -d --wait db","health":"npm run build && npm run lint && npm run deadcode && npm run agent:evaluate -- --check && npm run package:check && npm test","db:down":"docker compose down -v","prepack":"npm run build","deadcode":"knip","test:unit":"vitest run --exclude 'tests/integration/**'","model:check":"tsx scripts/check-models.ts","package:check":"tsx scripts/check-package.ts","agent:evaluate":"tsx scripts/evaluate-agents.ts","model:generate":"tsx scripts/generate-models.ts","test:integration":"vitest run tests/integration","demo:reservations":"tsx scripts/demo-reservations.ts"},"_npmUser":{"name":"nscipione","email":"nick@atlanticplatformgroup.com"},"repository":{"url":"git+https://github.com/atlanticplatformgroup/ModelLang.git","type":"git"},"_npmVersion":"12.0.2","description":"ModelLang reference compiler and modelc CLI for semantic application models","directories":{},"_nodeVersion":"24.18.0","dependencies":{"pg":"^8.16.3","ajv":"^8.20.0","@modelcontextprotocol/server":"^2.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.20.3","knip":"^6.31.0","eslint":"^10.8.0","vitest":"^3.2.4","@types/pg":"^8.15.4","@eslint/js":"^10.0.1","typescript":"^5.8.3","@types/node":"^24.1.0","typescript-eslint":"^8.65.0","@modelcontextprotocol/client":"^2.0.0"},"_npmOperationalInternal":{"tmp":"tmp/modellang_0.50.1_1786551813690_0.6797645846598139","host":"s3://npm-registry-packages-npm-production"}},"0.50.2":{"name":"@atlanticplatformgroup/modellang","version":"0.50.2","keywords":["semantic-model","compiler","postgresql","mcp","agent-tools"],"author":{"name":"Nick Scipione"},"license":"Apache-2.0","_id":"@atlanticplatformgroup/modellang@0.50.2","maintainers":[{"name":"nscipione","email":"nick@atlanticplatformgroup.com"}],"homepage":"https://github.com/atlanticplatformgroup/ModelLang#readme","bugs":{"url":"https://github.com/atlanticplatformgroup/ModelLang/issues"},"bin":{"modelc":"dist/src/cli.js","modellang":"dist/src/cli.js"},"dist":{"shasum":"49f3227aebce8afc594ade1576393b613fb74880","tarball":"https://registry.npmjs.org/@atlanticplatformgroup/modellang/-/modellang-0.50.2.tgz","fileCount":170,"integrity":"sha512-ljJ+sacnOCXo/tS3u6FYBd4C1+qbcxGm315qUwxL4Fs/nKGi8765TCmfkMVtvWaRaW2WmrEhGA604V8sIwbLMA==","signatures":[{"sig":"MEUCIQDdklsJi6ucrmQTqzIIaRvQMdub9efpyTeXf4myu9syxgIgDbiSxMOeoZ7HhTNh/g5kcfH+MUAE+ygzLmlHucR210s=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1918080},"type":"module","engines":{"node":">=20"},"gitHead":"46560d1bd16bff458645d6a6d09da7944e59affc","scripts":{"demo":"tsx scripts/demo.ts","lint":"eslint .","test":"vitest run","build":"tsc -p tsconfig.json","db:up":"docker compose up -d --wait db","health":"npm run build && npm run lint && npm run deadcode && npm run agent:evaluate -- --check && npm run package:check && npm test","db:down":"docker compose down -v","prepack":"npm run build","deadcode":"knip","test:unit":"vitest run --exclude 'tests/integration/**'","model:check":"tsx scripts/check-models.ts","package:check":"tsx scripts/check-package.ts","agent:evaluate":"tsx scripts/evaluate-agents.ts","model:generate":"tsx scripts/generate-models.ts","test:integration":"vitest run tests/integration","demo:reservations":"tsx scripts/demo-reservations.ts"},"_npmUser":{"name":"nscipione","email":"nick@atlanticplatformgroup.com"},"repository":{"url":"git+https://github.com/atlanticplatformgroup/ModelLang.git","type":"git"},"_npmVersion":"12.0.2","description":"ModelLang reference compiler and modelc CLI for semantic application models","directories":{},"_nodeVersion":"24.18.0","dependencies":{"pg":"^8.16.3","ajv":"^8.20.0","@modelcontextprotocol/server":"^2.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.20.3","knip":"^6.31.0","eslint":"^10.8.0","vitest":"^3.2.4","@types/pg":"^8.15.4","@eslint/js":"^10.0.1","typescript":"^5.8.3","@types/node":"^24.1.0","typescript-eslint":"^8.65.0","@modelcontextprotocol/client":"^2.0.0"},"_npmOperationalInternal":{"tmp":"tmp/modellang_0.50.2_1786552230206_0.3915588585142131","host":"s3://npm-registry-packages-npm-production"}},"0.51.0":{"name":"@atlanticplatformgroup/modellang","version":"0.51.0","description":"ModelLang reference compiler and modelc CLI for semantic application models","license":"Apache-2.0","author":{"name":"Nick Scipione"},"repository":{"type":"git","url":"git+https://github.com/atlanticplatformgroup/ModelLang.git"},"homepage":"https://github.com/atlanticplatformgroup/ModelLang#readme","bugs":{"url":"https://github.com/atlanticplatformgroup/ModelLang/issues"},"keywords":["semantic-model","compiler","postgresql","mcp","agent-tools"],"type":"module","bin":{"modellang":"dist/src/cli.js","modelc":"dist/src/cli.js"},"publishConfig":{"access":"public"},"scripts":{"build":"tsc -p tsconfig.json","lint":"eslint .","deadcode":"knip","health":"npm run build && npm run lint && npm run deadcode && npm run agent:evaluate -- --check && npm run package:check && npm test","test":"vitest run","test:unit":"vitest run --exclude 'tests/integration/**'","test:integration":"vitest run tests/integration","model:check":"tsx scripts/check-models.ts","model:generate":"tsx scripts/generate-models.ts","agent:evaluate":"tsx scripts/evaluate-agents.ts","package:check":"tsx scripts/check-package.ts","prepack":"npm run build","db:up":"docker compose up -d --wait db","db:down":"docker compose down -v","demo":"tsx scripts/demo.ts","demo:reservations":"tsx scripts/demo-reservations.ts"},"dependencies":{"@modelcontextprotocol/server":"^2.0.0","ajv":"^8.20.0","pg":"^8.16.3"},"devDependencies":{"@eslint/js":"^10.0.1","@modelcontextprotocol/client":"^2.0.0","@types/node":"^24.1.0","@types/pg":"^8.15.4","eslint":"^10.8.0","knip":"^6.31.0","tsx":"^4.20.3","typescript":"^5.8.3","typescript-eslint":"^8.65.0","vitest":"^3.2.4"},"engines":{"node":">=20"},"gitHead":"a9ed0eec7074d829dae7ee7076391d2704df6e75","_id":"@atlanticplatformgroup/modellang@0.51.0","_nodeVersion":"24.19.0","_npmVersion":"12.0.2","dist":{"integrity":"sha512-G0izmuw/5FJgQ1Zr/QRt33Hg0pA3nh1eDYoBpvxD8NfO0co+4ZQMaKz1hUVmxYFgi0VvvS4v/wqZeRnhbDMaew==","shasum":"ed83b422e9aaa279a39c6eada0321f7e3f39d99c","tarball":"https://registry.npmjs.org/@atlanticplatformgroup/modellang/-/modellang-0.51.0.tgz","fileCount":434,"unpackedSize":2458442,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@atlanticplatformgroup%2fmodellang@0.51.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIBJ9HfTyQy7t/0s3HbEmJYl/rfucVoS1RIx9kkIvska1AiEAkuxjUzogPw9TGEI0k4Zx9PRRnrrQmdQnk5GRWn3VrsE="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:bc37087b-c167-42c4-a54a-9c2c3c656384"}},"directories":{},"maintainers":[{"name":"nscipione","email":"nick@atlanticplatformgroup.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/modellang_0.51.0_1788036339219_0.717758284072662"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-12T16:23:33.589Z","modified":"2026-08-29T20:45:39.830Z","0.50.1":"2026-08-12T16:23:33.836Z","0.50.2":"2026-08-12T16:30:30.374Z","0.51.0":"2026-08-29T20:45:39.376Z"},"bugs":{"url":"https://github.com/atlanticplatformgroup/ModelLang/issues"},"author":{"name":"Nick Scipione"},"license":"Apache-2.0","homepage":"https://github.com/atlanticplatformgroup/ModelLang#readme","keywords":["semantic-model","compiler","postgresql","mcp","agent-tools"],"repository":{"type":"git","url":"git+https://github.com/atlanticplatformgroup/ModelLang.git"},"description":"ModelLang reference compiler and modelc CLI for semantic application models","maintainers":[{"name":"nscipione","email":"nick@atlanticplatformgroup.com"}],"readme":"# ModelLang\n\nModelLang is a compiler for semantic application models. Describe your data, permissions, workflows, invariants, and transactions in one model; ModelLang generates a PostgreSQL enforcement layer, typed TypeScript interfaces, OpenAPI, and MCP tools from the same source.\n\nThe goal is simple: keep the rules enforced by your database, used by your application, and exposed to agents from drifting apart.\n\n```mermaid\nflowchart LR\n    M[\"ModelLang source\"] --> C[\"modelc\"]\n    C --> I[\"Canonical IR\"]\n    I --> P[\"PostgreSQL enforcement\"]\n    I --> A[\"TypeScript + OpenAPI\"]\n    I --> G[\"MCP + agent contracts\"]\n    I --> E[\"Evidence + evolution\"]\n```\n\n## What makes it different\n\n- **Rules become enforcement.** Authorization, preconditions, invariants, workflows, and multi-entity effects compile into a PostgreSQL boundary rather than remaining advisory metadata.\n- **One model serves every interface.** Database functions, TypeScript clients, HTTP handlers, OpenAPI, UI metadata, and MCP tools share the same typed operation contracts.\n- **Agent access uses the application boundary.** Generated agent tools authenticate callers and re-run the same authorization and policy checks as other clients. Discovery metadata never grants authority.\n- **Changes retain semantic identity.** Stable declaration IDs support deterministic generation, semantic diffs, guarded migrations, and auditable renames.\n\n## How it differs from an ontology\n\nAn ontology defines shared business concepts and relationships, often across several systems and data sources. For example, an enterprise ontology answers:\n\n> What is an Inventory Item across the organization, where is information about it, and how does it relate to customers, suppliers, orders, and channels?\n\nModelLang works within one bounded operational context and answers a different question:\n\n> What operations exist for this inventory system, who can perform them, what state transitions are legal, and what must remain transactionally true?\n\nA ModelLang semantic application model contains concepts and relationships, but also defines authenticated operations, authorization, preconditions, workflows, invariants, and atomic effects. The generated PostgreSQL boundary enforces those rules when state changes; the generated HTTP, UI, and agent contracts expose the same operation semantics.\n\nModelLang is not an enterprise knowledge graph, federated data catalog, or analytics semantic layer. Those systems can provide organization-wide meaning above several bounded applications, while ModelLang governs transactional authority inside an application that owns its state.\n\n## Quickstart\n\nModelLang requires Node.js 20 or newer.\n\nInstall the compiler and initialize an agent-ready project:\n\n```bash\nnpm install --save-dev @atlanticplatformgroup/modellang@0.51.0\nnpx modellang init\nnpm install\nnpm run modellang:smoke\n```\n\nInitialization is additive: it will not replace an existing model, skill, or ModelLang section in `AGENTS.md`. It creates a starter `app.model`, `modellang.json`, and a project-local skill with the complete version-matched specification.\n\nEdit `app.model`:\n\n```modellang\nmodel ApprovalApp version \"0.50.0\";\n\nentity User {\n  id: UUID @id @generated(uuid);\n  canApprove: Boolean;\n}\n\nentity Request {\n  id: UUID @id @generated(uuid);\n  approved: Boolean;\n}\n\nentity Approval {\n  id: UUID @id @generated(uuid);\n  request: Request @unique;\n  actor: User;\n}\n\naction approve(caller actor: User, request: Request) -> Approval {\n  authorize actor.canApprove;\n  require pending: request.approved == false;\n  update request { approved = true; }\n  create Approval { request = request; actor = actor; }\n}\n```\n\nCheck the model and build it:\n\n```bash\nnpx modelc check app.model\nnpx modelc build app.model --out generated/app\n```\n\nUse `npx modellang doctor` to validate the project and generated provenance, `npx modellang docs` to locate installed documentation, and `npx modellang capabilities --json` for machine-readable authoring and generation capabilities. The smoke gate compiles the host and every generated TypeScript file, then imports the MCP runtime against declared dependencies.\n\nThe action above updates the request and creates its approval in one database transaction. The build produces a complete generated boundary:\n\n```text\ngenerated/app/\n├── model.ir.json\n├── postgres/\n├── typescript/\n├── openapi.json\n├── operations.json\n├── mcp.json\n├── agent-tools.json\n├── enforcement.md\n└── provenance.json\n```\n\nGenerated files are replaced atomically. Regenerate them from the model instead of editing them by hand.\n\n## What you can model\n\nModelLang currently supports:\n\n- entities, enums, exact money, generated values, and immutable fields;\n- authenticated callers and reusable authorization policies;\n- action preconditions, invariants, workflows, and ordered atomic effects;\n- bounded queries with explicit projections, filters, sorting, pagination, and conditional field disclosure;\n- reliable commands with caller-scoped replay protection;\n- typed domain events, transactional outbox delivery, consumers, and bounded recovery;\n- stable semantic identity, semantic diffs, and guarded schema evolution;\n- generated HTTP, TypeScript, OpenAPI, UI, MCP, and Agent Plugin contracts; and\n- private execution evidence and deterministic artifact provenance.\n\nTwo reference applications exercise the language end to end:\n\n- [Procurement](https://github.com/atlanticplatformgroup/ModelLang/blob/v0.50.0/examples/procurement.model) covers request workflows, approval authority, reliable commands, events, recovery, caller-scoped queries, and atomic approval effects.\n- [Reservations](https://github.com/atlanticplatformgroup/ModelLang/blob/v0.50.0/examples/reservations.model) covers temporal constraints, concurrent conflict prevention, event delivery, and consumer replay.\n\n## Runtime boundary\n\nModelLang generates application code and database enforcement, not hosting infrastructure. A deployed application still supplies:\n\n- PostgreSQL connectivity and migrations;\n- credential verification and audience policy;\n- secret management and operational monitoring;\n- implementations for declared external extensions; and\n- an HTTP server or framework that hosts the generated handler.\n\nCaller identity is bound by the host and database session. It is never accepted as an action input. Application roles can execute generated operations but cannot mutate model tables directly.\n\nThe [host bootstrap guide](./docs/HOST_BOOTSTRAP.md) walks through PostgreSQL installation, least-privilege roles, JWT verification, HTTP hosting, and the MCP boundary using an installed package.\n\n## CLI\n\n```text\nmodelc check <file>\nmodelc build <file> --out <directory>\nmodelc print-ir <file>\nmodelc explain <file>\nmodelc assign-ids <file>\nmodelc semantic-diff <previous-ir.json> <current.model> --out <file>\nmodelc migration <previous-ir.json> <current.model> --out <file>\nmodelc reviewed-migration <previous-ir.json> <current.model> --plan <plan.json> --out <file>\n```\n\nTo generate a portable Agent Plugin package for a deployed MCP endpoint:\n\n```bash\nnpx modelc build app.model \\\n  --out generated/app \\\n  --agent-plugin-url https://app.example.com/mcp\n```\n\nThe generated package contains connection metadata, never credentials. Authentication remains client-managed and every request still crosses the generated runtime authorization boundary.\n\n## Public preview status\n\nModelLang is a pre-1.0 public preview. The current compiler release is `0.51.0`, uses the 0.51 language and canonical IR2, and targets PostgreSQL as its enforcement backend.\n\nIt is ready for language evaluation, reference applications, and integration experiments. It is not yet a production-support commitment, a general-purpose ORM, a hosted platform, or a complete implementation of the SML-Agent or SML-Federation proposals.\n\nBefore adopting it, review the [unstable boundaries](https://github.com/atlanticplatformgroup/ModelLang/blob/v0.50.0/spec/0.50/UNSTABLE.md) and [public preview compatibility contract](https://github.com/atlanticplatformgroup/ModelLang/blob/v0.50.0/spec/0.50/PUBLIC_PREVIEW_DISTRIBUTION.md).\n\n## Documentation\n\n- [Public preview guide](./docs/PUBLIC_PREVIEW.md)\n- [Language specification](https://github.com/atlanticplatformgroup/ModelLang/blob/v0.50.0/spec/0.50/LANGUAGE.md)\n- [Atomic effects](https://github.com/atlanticplatformgroup/ModelLang/blob/v0.50.0/spec/0.50/ATOMIC_EFFECTS.md)\n- [Conformance requirements](https://github.com/atlanticplatformgroup/ModelLang/blob/v0.50.0/spec/0.50/CONFORMANCE.md)\n- [The Semantic Application Model Layer whitepaper](https://github.com/atlanticplatformgroup/ModelLang/blob/v0.50.0/docs/whitepaper/THE_SEMANTIC_MODEL_LAYER.md)\n- [Security policy](https://github.com/atlanticplatformgroup/ModelLang/blob/v0.50.0/SECURITY.md)\n- [Changelog](./CHANGELOG.md)\n\n## Development\n\nFrom a source checkout:\n\n```bash\nnpm ci\nnpm run model:check\nnpm run model:generate\nnpm run db:up\nnpm run health\n```\n\n`npm run health` builds and lints the compiler, checks unused code and dependencies, validates evaluation fixtures, clean-installs the packed npm artifact, and runs the unit and live PostgreSQL integration suites.\n\nStop the disposable local database with:\n\n```bash\nnpm run db:down\n```\n\nSee [CONTRIBUTING.md](https://github.com/atlanticplatformgroup/ModelLang/blob/v0.50.0/CONTRIBUTING.md) for change requirements and [RELEASING.md](https://github.com/atlanticplatformgroup/ModelLang/blob/v0.50.0/RELEASING.md) for the release process.\n\n## License\n\nApache-2.0. See [LICENSE](./LICENSE).\n","readmeFilename":"README.md"}