IR schema
Axint’s Intermediate Representation (IR) is the cross-language contract that makes it possible for both the TypeScript and Python SDKs to produce byte-identical Swift output. Every authoring surface eventually serializes to this schema; the validator and generator operate purely on the IR.
JSON schema
{ "name": "CreateCalendarEventIntent", "title": "Create Calendar Event", "description": "Creates a new event on the user's calendar.", "domain": "productivity", "isDiscoverable": true, "parameters": [ { "name": "eventTitle", "type": "string", "description": "Title of the event", "optional": false, "default": null }, { "name": "durationMinutes", "type": "int", "description": "Length of the event in minutes", "optional": false, "default": null } ], "entitlements": ["com.apple.developer.calendars"], "infoPlistKeys": ["NSCalendarsUsageDescription"], "returnType": null, "sourceFile": "intents/create_event.ts", "sourceLine": 3}Field reference
| Field | Type | Notes |
|---|---|---|
name | string | Swift struct name |
title | string | Human-facing title |
description | string | Human-facing description |
domain | string | App Intent domain |
isDiscoverable | boolean | Defaults to true |
parameters | IRParameter[] | Ordered list (insertion order preserved) |
entitlements | string[] | Reverse-DNS identifiers |
infoPlistKeys | string[] | Info.plist usage description keys |
returnType | IRType | null | Inferred from perform(); null if none |
sourceFile | string | Source file for diagnostics |
sourceLine | number | Line where defineIntent(...) starts |
IRParameter
| Field | Type | Notes |
|---|---|---|
name | string | Parameter name in source |
type | IRType | See below |
description | string | Used as @Parameter(title:) |
optional | boolean | Defaults to false |
default | unknown | null | Only valid if optional: true |
IRType
One of: "string", "int", "double", "float", "boolean", "date",
"duration", "url", or the legacy alias "number" (which normalizes to
"int" during validation).
Why camelCase?
The IR uses camelCase keys (isDiscoverable, infoPlistKeys) even when
authored from Python, because the JSON schema is the cross-language contract
and needs to be stable across both sides. The Python IntentIR.to_dict()
method emits camelCase specifically for this reason.
Using the IR directly
You can consume IR JSON directly without using either SDK — useful for building your own authoring layer on top:
import { generateSwift, validateIntent } from "@axint/compiler";
const ir = JSON.parse(irJson);const diagnostics = validateIntent(ir);if (diagnostics.some(d => d.severity === "error")) { console.error(diagnostics); process.exit(1);}const swift = generateSwift(ir);