INTENT RUNTIME · V2

Turn requests into
structured intent.

Extract goals, preserve constraints, and track changes—with your model, in Node.js or MCP.

npm install @devcodex/intent-runtime

Node.js ≥20 · JavaScript / TypeScript · MCP

From a request to understandingFixed examples · No model calls
Look up order 000123. Do not cancel the order.

Preserve what the user wants, including what must not happen.

This example configures an order Schema and selects orderId through fields.

Values & conditionsProhibitionsRequirements
Inspect input and configuration

The caller supplies this material. This fixed demo makes no model calls in the browser.

{
  "config": {
    "language": "en",
    "schema": {
      "type": "object",
      "properties": {
        "orderId": {
          "type": "string",
          "pattern": "^[0-9]+$"
        }
      }
    }
  },
  "request": {
    "input": "Look up order 000123. Do not cancel the order.",
    "fields": [
      "orderId"
    ]
  }
}
Complete understanding
  • Look up order 000123intent-2
    • ProhibitionDo not cancel the order
    orderId
    "000123"
orderIdPresent

The full goal tree lives in effective. This summary does not replace the complete response.

Inspect complete JSON
{
  "slug": "native",
  "title": "Preserve the order ID as a string",
  "config": {
    "language": "en",
    "schema": {
      "type": "object",
      "properties": {
        "orderId": {
          "type": "string",
          "pattern": "^[0-9]+$"
        }
      }
    }
  },
  "request": {
    "input": "Look up order 000123. Do not cancel the order.",
    "fields": [
      "orderId"
    ]
  },
  "result": {
    "schemaVersion": "2.0-draft.6",
    "input": "Look up order 000123. Do not cancel the order.",
    "status": "complete",
    "turn": {
      "kind": "request",
      "normalizedInput": "Look up order 000123. Do not cancel the order.",
      "intentIds": [
        "intent-2"
      ],
      "changes": [
        {
          "operation": "add",
          "target": {
            "kind": "intent",
            "id": "intent-2"
          },
          "description": "Add the explicit request from this turn",
          "sourceRefs": [
            {
              "root": "input",
              "pointer": ""
            }
          ],
          "effect": "applied"
        },
        {
          "operation": "add",
          "target": {
            "kind": "constraint",
            "id": "constraint-2"
          },
          "description": "Add the explicit request from this turn",
          "sourceRefs": [
            {
              "root": "input",
              "pointer": ""
            }
          ],
          "effect": "applied"
        }
      ],
      "facts": {}
    },
    "effective": {
      "schemaVersion": "2.0-draft.6",
      "coverage": "complete",
      "scope": "current_request",
      "intents": [
        {
          "id": "intent-2",
          "domain": null,
          "action": "Look up",
          "target": "order 000123",
          "goal": "Look up order 000123",
          "understanding": "clear",
          "constraints": [
            {
              "id": "constraint-2",
              "kind": "prohibition",
              "text": "Do not cancel the order",
              "scope": {
                "type": "intent",
                "intentId": "intent-2"
              }
            }
          ],
          "inputs": {
            "orderId": "000123"
          },
          "references": [],
          "children": [],
          "extensions": {}
        }
      ],
      "constraints": [],
      "relations": [],
      "unresolved": []
    },
    "fieldResults": [
      {
        "container": "inputs",
        "intentId": "intent-2",
        "field": "orderId",
        "path": "/orderId",
        "status": "present",
        "trigger": "selection",
        "sourceRefs": [
          {
            "root": "input",
            "pointer": ""
          }
        ]
      }
    ],
    "issues": [],
    "inferences": []
  }
}
Download JSON

START WITH ONE CALL

Your model. One call.

Connect your model, call parse, and read goals and constraints. Add a Schema when you need business parameters.

intent.js
import { Intent, IntentError } from '@devcodex/intent-runtime';
import { createApiExecutor } from '@devcodex/intent-runtime/adapters/api';
const apiKey = process.env.INTENT_API_KEY;
const model = process.env.INTENT_MODEL;
if (!apiKey || !model)
    throw new Error('Set INTENT_API_KEY and INTENT_MODEL.');
const intent = new Intent({
    language: 'en',
    executor: createApiExecutor({ provider: 'openai', apiKey, model }),
});
const request = { input: 'Look up order 000123. Do not cancel the order.' };
try {
    const result = await intent.parse(request);
    console.log(JSON.stringify(result, null, 2));
    console.log('Goals:', result.effective.intents.map(node => node.goal));
    console.log('Issues:', result.issues.map(issue => issue.message));
}
catch (error) {
    if (!(error instanceof IntentError))
        throw error;
    console.error(JSON.stringify(error.toJSON()));
    process.exitCode = 1;
}
finally {
    await intent.dispose();
}

Set your model name and API key. Use type: module for JavaScript and compile TypeScript as ESM. Your own model or gateway works too.

Full installation and run instructions →

FIT YOUR EXISTING WORKFLOW

Connect it to what you already use.

An application call, your current client model, a standalone service, or an existing MCP server: choose the path that fits your project.

  1. 01

    Node.js application

    JavaScript or TypeScript with your model or gateway.

  2. 02

    Current Codex model

    Save and register configuration. No additional model API key.

  3. 03

    Standalone MCP

    Connect over stdio or HTTP with your chosen port.

  4. 04

    Existing MCP server

    Add tools while retaining your existing connection.

Intent Runtime understands the material you supply. You provide messages and history; your application manages tools, authorization and business execution.

Consume the result →Continue to the next turn →Handle issues and failures →