> ## Documentation Index
> Fetch the complete documentation index at: https://executioncontrolprotocol.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Schema reference

> JSON Schema and TypeScript types for ECP Context

The ECP Context manifest is defined by a **JSON Schema** and **TypeScript types**. Use them to validate manifests, generate UIs, or build runtimes.

## JSON Schema

The canonical schema for an ECP Context is generated from the TypeScript types and emitted as:

**`packages/spec/dist/ecp-context.schema.json`**

Generate it from the repo root (after a build):

```bash theme={null}
npm run build
npm run generate:schema
```

Then validate a manifest (e.g. `spec.yaml`) with the spec package validator:

```bash theme={null}
npm run validate
```

The schema covers the root `ECPContext` and all nested types: `metadata`, `inputs`, `outputs`, `schemas`, `triggers`, `orchestration`, `orchestrator`, `executors`, `plugins`, and policy/mount/schema definition shapes.

## System configuration

The **host system config** file is usually named **`ecp.config.yaml`** (YAML or JSON). It is **not** part of the Context JSON Schema above. It is documented in the protocol spec and enforced by the reference runtime’s loader and structural validation.

**Authoritative references**

* **[SPEC.md — Host system configuration (`ecp.config.yaml`)](https://github.com/executioncontrolprotocol/executioncontrolprotocol/blob/main/SPEC.md#L623)** — Full normative description: `version`, configure vs `security` mirror, MCP `tool` kind, A2A endpoints.
* **[config/ecp.config.example.yaml](https://github.com/executioncontrolprotocol/executioncontrolprotocol/blob/main/config/ecp.config.example.yaml)** — Annotated example file (validated in CI against the enforced shape).
* **TypeScript:** [`ECPSystemConfig`](https://github.com/executioncontrolprotocol/executioncontrolprotocol/blob/main/packages/runtime/src/engine/types.ts#L484) and [`SecurityConfig`](https://github.com/executioncontrolprotocol/executioncontrolprotocol/blob/main/packages/runtime/src/engine/types.ts#L432) in `packages/runtime/src/engine/types.ts`.

There is no separate checked-in JSON Schema for system config today; implementers should treat SPEC.md plus the example file and `ECPSystemConfig` as the source of truth.

## TypeScript types

The single source of truth for the schema is:

**`packages/spec/src/types/ecp.ts`**

All types are exported from `@executioncontrolprotocol/spec` (or `packages/spec/src/types/index.ts`). Key exports include:

* **ECPContext** — Root manifest interface
* **Metadata**, **InputDefinition**, **OutputDefinition** — Context-level fields
* **SchemaDefinition**, **SchemaProperty** — JSON Schema-aligned definitions
* **Trigger**, **Orchestration**, **Orchestrator**, **Executor** — Execution model
* **Mount**, **ToolAccessPolicy**, **BudgetsPolicy**, **WriteControlsPolicy** — Per-executor configuration
* **Plugins**, **PluginReference** — Declared plugins (`provider`, `executor`, `logger`, `memory`, …)

Naming follows OpenAPI conventions: **camelCase** for field names, **kebab-case** for enum/union literals (e.g. `"controller-specialist"`, `"propose-only"`), **PascalCase** for types and schema names.

## TypeDoc (API docs)

For full JSDoc and category-based API documentation of every type and property, the repo can generate **TypeDoc** output. From the repo root:

```bash theme={null}
npm run build
npm run docs
```

This builds the TypeDoc site into `packages/docs/dist` (when using the existing TypeDoc config). TypeDoc is useful for a browsable **programmatic API reference** of the TypeScript types. If you publish TypeDoc elsewhere (e.g. GitHub Pages), link to it from this page or the footer.

## Example: minimal Context

A minimal valid Context in YAML:

```yaml theme={null}
specVersion: ecp/v0.5-draft
kind: Context
metadata:
  name: hello-agent
  version: 1.0.0
inputs:
  topic:
    type: string
    required: true
outputs:
  - name: summary
    fromSchema: Summary
schemas:
  Summary:
    type: object
    required: [headline, body]
    properties:
      headline: { type: string }
      body: { type: string }
plugins:
  version: 1.0.0
  providers:
    - name: openai
      kind: provider
      type: builtin
      version: 0.3.0
  security: {}
orchestration:
  entrypoint: summarizer
  strategy: single
  produces: Summary
executors:
  - name: summarizer
    type: agent
    model:
      provider: { name: openai, type: builtin, version: 0.3.0 }
      name: gpt-4o-mini
    instructions: Given a topic, produce a JSON object with headline and body.
    outputSchemaRef: "#/schemas/Summary"
```

## See also

* [spec.yaml](https://github.com/executioncontrolprotocol/executioncontrolprotocol/blob/main/spec.yaml) — Canonical example Context
* [SPEC.md](https://github.com/executioncontrolprotocol/executioncontrolprotocol/blob/main/SPEC.md) — Full protocol specification (includes [host system configuration](https://github.com/executioncontrolprotocol/executioncontrolprotocol/blob/main/SPEC.md#L623))
* [CLI reference](/reference/cli) — `ecp run`, `ecp validate`, and `ecp trace`
* [Security](/learn/security) — Context policies, `security` mirror, secret namespaces
