---
title: "Operation Manifest Reference"
canonical: "https://test.abhinandan.one/operation-manifest"
markdown_url: "https://test.abhinandan.one/operation-manifest.md"
publisher: "Primitive SDKs"
kind: "reference"
content_type: "reference"
category: "API Core / OpenAPI Generation"
description: "Reference for the operationManifest array's PrimitiveOperationManifest and PrimitiveParameterManifest fields, generated from openapi/primitive-api.yaml."
keywords: ["operationManifest", "PrimitiveOperationManifest", "PrimitiveParameterManifest", "requestSchema", "responseSchema", "operations.generated.ts"]
last_modified: "2026-08-21T18:22:43.359885+00:00"
published_at: "2026-08-11T18:55:06.273773+00:00"
source_files:
  - "packages/api-core/scripts/generate-openapi-artifacts.ts"
  - "packages/api-core/src/index.ts"
sections:
  - {anchor: "what-the-operation-manifest-is", title: "What the operation manifest is"}
  - {anchor: "where-it-comes-from", title: "Where it comes from"}
  - {anchor: "primitiveoperationmanifest-fields", title: "`PrimitiveOperationManifest` fields"}
  - {anchor: "primitiveparametermanifest-fields", title: "`PrimitiveParameterManifest` fields"}
  - {anchor: "requestschema-and-responseschema-fully-inlined", title: "`requestSchema` and `responseSchema`: fully inlined"}
  - {anchor: "binary-responses", title: "Binary responses"}
  - {anchor: "inspecting-a-live-entry", title: "Inspecting a live entry"}
  - {anchor: "related-exports-from-api-core", title: "Related exports from `api-core`"}
  - {anchor: "next-steps", title: "Next steps"}
---

> Documentation index: https://test.abhinandan.one/llms.txt

# Operation Manifest Reference

The operationManifest is a generated array with one entry per OpenAPI operation, carrying its command name, HTTP method, path, parameters, and inlined request/response JSON Schemas for tooling to consume without re-parsing the spec.

## What the operation manifest is

`operationManifest` is a generated TypeScript array with one entry per OpenAPI operation in `openapi/primitive-api.yaml`, exported from `@primitivedotdev/api-core` and re-exported by `@primitivedotdev/sdk/api`. Each entry (`PrimitiveOperationManifest`) carries what a caller needs to invoke and describe that operation: command name, HTTP method, path, path/query parameters, and inlined request/response JSON Schemas.

The CLI's generic `api-command` shortcut and its `describe`/`list-operations` helpers are built on this manifest; see [Direct API Access and Generic Commands](https://test.abhinandan.one/cli-overview/cli-generic-api-access.md). This page documents the manifest's shape.

Import it directly when you need the raw metadata:

```typescript
import { operationManifest } from "@primitivedotdev/sdk/api";

for (const operation of operationManifest) {
  console.log(operation.command, operation.method, operation.path);
}

const entry = operationManifest.find((op) => op.operationId === "getAccount");
console.log(entry?.method, entry?.path, entry?.hasJsonBody);
```

## Where it comes from

`generate-openapi-artifacts.ts` writes `operationManifest` to `packages/api-core/src/openapi/operations.generated.ts`, building it from the raw (pre-normalization) OpenAPI document rather than the codegen JSON. Entries are sorted by `tagCommand`, then by `command`. It regenerates whenever you run the codegen pipeline; see [Regenerating SDK Code from the OpenAPI Spec](https://test.abhinandan.one/codegen-workflow.md). Never edit `operations.generated.ts` by hand.

## `PrimitiveOperationManifest` fields

| Field | Type | Description |
|---|---|---|
| `operationId` | `string` | The OpenAPI `operationId` verbatim (e.g. `sendEmail`). |
| `sdkName` | `string` | Same value as `operationId`; the name generated SDK functions use. |
| `command` | `string` | Kebab-case form of `operationId` (e.g. `send-email`), used as the CLI command name. |
| `tag` | `string` | The operation's first OpenAPI tag (e.g. `Sending`), or `"default"` if untagged. |
| `tagCommand` | `string` | Kebab-case form of `tag`, used to group CLI commands. |
| `method` | `string` (`"GET"`, `"POST"`, `"PUT"`, `"PATCH"`, `"DELETE"`, `"HEAD"`, `"OPTIONS"`) | Uppercased HTTP method. |
| `path` | `string` | The OpenAPI path template, including `{param}` placeholders (e.g. `/emails/{id}/reply`). |
| `summary` | `string \| null` | The OpenAPI `summary`, or `null` if absent. |
| `description` | `string \| null` | The OpenAPI `description`, or `null` if absent. |
| `pathParams` | `PrimitiveParameterManifest[]` | Parameters with `in: path`. |
| `queryParams` | `PrimitiveParameterManifest[]` | Parameters with `in: query`. |
| `hasJsonBody` | `boolean` | `true` when the operation declares an `application/json` request body. |
| `bodyRequired` | `boolean` | `true` when that request body is marked `required` in the spec. |
| `requestSchema` | `Record<string, unknown> \| null` | Inlined JSON Schema for the request body, or `null` when `hasJsonBody` is `false`. |
| `responseSchema` | `Record<string, unknown> \| null` | Inlined JSON Schema for the 200/201 response's `data` payload, or `null` if the operation has no 200/201 JSON response. |
| `binaryResponse` | `boolean` | `true` when any response uses `application/octet-stream`, `application/gzip`, `message/rfc822`, or `format: binary`. |

## `PrimitiveParameterManifest` fields

Each entry in `pathParams` / `queryParams` describes one parameter: its name, schema type, whether it's required, and any enum, default, or numeric bounds the spec declares.

| Field | Type | Description |
|---|---|---|
| `name` | `string` | The parameter name. |
| `type` | `string` | The parameter's OpenAPI schema `type` (defaults to `"string"` if unspecified). |
| `required` | `boolean` | Whether the parameter is required. |
| `description` | `string \| null` | The parameter's OpenAPI description, or `null`. |
| `enum` | `string[] \| null` | Allowed string values, or `null` if the schema has no `enum`. |
| `default` | `boolean \| number \| string` (optional) | The schema's `default` value, present only when the spec declares one. |
| `minimum` | `number` (optional) | Present only when the schema declares a numeric `minimum`. |
| `maximum` | `number` (optional) | Present only when the schema declares a numeric `maximum`. |

Path and query parameters are merged from both the path-item level and the operation level before being split into `pathParams` / `queryParams`, so an operation inherits any parameters declared once for the whole path.

## `requestSchema` and `responseSchema`: fully inlined

Both schema fields have every `$ref` into `components/schemas` and `components/parameters` recursively resolved and inlined, so a consumer never needs to re-parse the OpenAPI document to understand a shape. Cyclic references are broken by leaving the cyclic occurrence as a bare `{ $ref: "..." }` rather than recursing forever.

```bash
primitive list-operations | jq '.[] | select(.command == "send-email") | .requestSchema'
```

`responseSchema` targets the useful part of the response: the spec writes success responses as `allOf: [SuccessEnvelope, { properties: { data: <real schema> } }]` (or the `ListEnvelope` equivalent). The generator walks that `allOf` and returns the inlined `<real schema>` directly, stripping the uniform `{ success, data, meta }` envelope. If an operation stops following that idiom, `responseSchema` falls back to the full inlined response schema rather than `null`, since a partial schema is more useful to a caller than none.

## Binary responses

`binaryResponse` is `true` for any operation whose responses declare a byte-stream media type or a `format: binary` schema:

- `application/octet-stream`
- `application/gzip`
- `message/rfc822`
- any response media type schema with `format: binary`

Use this to decide whether to parse a response as JSON or handle it as a byte stream (for example raw email downloads or payload pulls).

## Inspecting a live entry

To see the real values for any operation, dump its entry from the CLI rather than transcribing it by hand:

```bash
primitive list-operations | jq '.[] | select(.tagCommand == "sending")'
```

## Related exports from `api-core`

`@primitivedotdev/api-core` (bundled inline into `@primitivedotdev/sdk` and `primitive`; see [What is API Core?](https://test.abhinandan.one/api-core-overview.md)) also exports:

- `openapiDocument`, the full raw OpenAPI document as a `Record<string, unknown>` constant, generated alongside the manifest.
- `operations`, a namespace object of every generated SDK operation function, keyed by `operationId` (mirrors the historical shape the CLI's generic command path relies on).
- `PrimitiveApiClient`, `PrimitiveApiError`, the host-aware request client and its typed error; see [PrimitiveApiClient](https://test.abhinandan.one/primitive-api-client.md).
- `isMemoryJsonValue`, a validator for Primitive Memories values; see [Memory Value Validation Helper](https://test.abhinandan.one/memory-json-value-helper.md).
