{
  "schema": "leumas.docs.page/1",
  "id": "skill:leumas-lmx#lmi",
  "slug": "skills/leumas-lmx/lmi",
  "kind": "tools",
  "bucket": "skill",
  "title": "lmi — the install-introspection language",
  "name": "lmi",
  "eyebrow": "the install-introspection language",
  "chip": null,
  "summary": "Ask the running deployment what it is and what it can actually do. Safe mode, needs the host's install bridge — so POST /api/lmx/run or Studio's LMX Playground, not the CLI.",
  "keywords": [
    "leumas-lmx",
    "entitled fulfillable",
    "playground",
    "deployment",
    "bridge",
    "safe",
    "mode",
    "running"
  ],
  "audience": "both",
  "funnel": {
    "product": null,
    "cta": null
  },
  "body": "# `lmi` — the install-introspection language\n\nAsk the **running deployment** what it is and what it can actually do. **Safe** mode, needs the host's\n`install` bridge — so `POST /api/lmx/run` or Studio's LMX Playground, not the CLI.\n\n```lmi\nINSTALL\nKINDS\n\nLIST apps LIMIT 5\nFIND \"invoice\"\n\nCAN ai.text.generate\nPROVIDERS FOR email.send\n```\n\n---\n\n## Why this exists\n\nLeumas is a product other people run. **\"Leumas can do X\" and \"you can do X\" are different claims**,\nand the second is the one that matters when answering someone about their own deployment.\n\nA given install has a role, an edition, a set of published apps and tools, its own index sources, a\nset of connected providers, and a per-user entitlement map. None of that is knowable from the source\ntree — the repo says what Leumas *can* ship, not what this box *has*. `lmi` asks the instance.\n\nLike `lma`, it holds no vocabulary. `LIST <kind>` accepts whatever kinds the install indexes, because\nthe bridge takes the **same `{ <kind>: async () => Array }` source map** `createIndexRouter` takes —\nin `leumas-api` literally the same hoisted object. Add a source there and the language gains a kind.\n\n---\n\n## [critical] The rule: never answer \"yes\" by default\n\nEvery answer here is three-state:\n\n| | Means |\n|---|---|\n| `yes` | this install said so |\n| `no` | this install said so |\n| `unknown` | nothing was wired to answer, so nothing was said |\n\nAn `unknown` reported as `yes` produces a confident, wrong claim about somebody else's deployment —\nexactly the failure this language exists to stop. So:\n\n- `CAN` with no entitlement engine wired prints **`unknown — no entitlement engine is wired here`**,\n  and its `allowed` field is `null`, never `true`.\n- `LIST` on a kind this install does not index **throws**, naming the kinds that do exist. Returning\n  `[]` would read as \"you have none of those\", which is a different and misleading answer.\n- A source that fails is reported as **broken** (`count: null` plus the error), not as empty.\n\n## And: entitled ≠ fulfillable\n\n`CAN` and `PROVIDERS FOR` answer different questions, and a thing only works here when both are\nsatisfied. A user can be perfectly entitled to `email.send` on an install where nothing is connected\nto send it. `PROVIDERS FOR` says so in as many words:\n\n```\n--- providers for sms.send (0) ---\n  nothing here fulfils it — CAN may still say yes, and it would still fail\n```\n\n---\n\n## Statements\n\n`#` starts a comment.\n\n| Statement | Answers |\n|---|---|\n| `INSTALL` | role, edition, plane flags, which kinds are indexed, who you are |\n| `KINDS` | every indexed kind with a live count |\n| `LIST <kind> [WHERE …] [LIMIT n] [-> var]` | that kind's rows |\n| `FIND \"query\"` | search every kind at once |\n| `CAN <capability> [-> var]` | is THIS user entitled, and up to what limit |\n| `PROVIDERS FOR <capability> [-> var]` | which connected provider would actually serve it |\n| `ORPHANS` | capabilities nothing here fulfils — a worklist |\n| `SET` · `PRINT` · `WHEN … THEN` · `RETURN` | the usual |\n\n`WHERE` takes one comparison against a row field: `LIST tools WHERE category = \"media\" LIMIT 20`.\n\nEvery question and its answer is kept in `answers` on the result — a report about an install should be\nquotable, and that is the quotable part.\n\n---\n\n## What it deliberately cannot do\n\n- **Change anything.** No method on the bridge installs, enables, entitles or connects. It is a\n  read-only surface by construction, not by check.\n- **Default a missing fact.** A `describeInstall` that omits `edition` yields no `edition` field —\n  \"this install did not say\" is not \"community\".\n- **Run from the CLI.** No `install` bridge there, and answering from nothing is the one thing this\n  language must never do.\n\n---\n\n## Running it\n\n```bash\ncurl -s -X POST localhost:3000/api/lmx/run \\\n  -H 'content-type: application/json' \\\n  -d '{\"mode\":\"lmi\",\"source\":\"INSTALL\\nKINDS\"}'\n```\n\nBundled examples: `shared/engines/lmx/src/scripts/demo.lmi`, `shared/engines/lmx/src/scripts/audit-install.lmi` — the latter is the report\nto run **before** telling a user what they can do on their install.\n\nTests: `shared/engines/lmx/src/test/lmi.test.js`. Guard: `pnpm smoke:lmx`.\n",
  "source": {
    "path": ".claude/skills/leumas-lmx/reference/lmi.md",
    "blobSha": "",
    "commit": "",
    "committedAt": "",
    "provenance": "no-git",
    "bytes": 4310,
    "hash": "5765af72c73fbde253f22d97635f1f7bf8435ee8"
  },
  "urls": {
    "html": "/p/skills/leumas-lmx/lmi",
    "json": "/docs/skills/leumas-lmx/lmi.json",
    "md": "/docs/skills/leumas-lmx/lmi.md"
  },
  "links": {
    "composes": [],
    "usedBy": [],
    "product": [],
    "howTo": [],
    "skills": []
  }
}
