TypeScript SDK for the Omnigraph graph database.
@modernrelay/omnigraph provides typed clients and
errors, camelCase types and streaming export for applications using
omnigraph-server.
The TypeScript MCP wrapper is retired. @modernrelay/omnigraph-mcp@0.17.1
is its final release and remains installable. Connect MCP hosts to the native
server's /mcp endpoint or the omnigraph mcp stdio bridge. See the
migration guide for authentication,
tool and result changes, and programmatic callers.
.
├── spec/openapi.json # committed copy of upstream OpenAPI at the pinned source
├── scripts/ # spec sync, drift check, version-stamp generator
├── packages/sdk/ # @modernrelay/omnigraph
├── docs/ # migration guidance
└── .github/workflows/ # ci (build/typecheck/test/coverage), e2e (live server), release
The SDK targets the omnigraph-server version in package.json#omnigraph.serverVersion. By default, the source is the matching vX.Y.Z tag. Before a server release exists, omnigraph.serverRef may temporarily pin a full immutable commit SHA. The OpenAPI spec and live CI server use that source. Branch names and abbreviated SHAs are rejected.
The v0.17 line is generated from and tested against omnigraph-server v0.17.1 and enforces its exact HTTP contract (0.14). Upgrade the CLI, server, and client integrations together; see the SDK guide. Development source pins remain supported, but block publishing through both the release workflow and the SDK's prepublishOnly hook.
scripts/gen-version.ts stamps the target version as SERVER_VERSION. CI checks that the bundled spec matches the pinned source byte for byte and runs live e2e tests against it: a checksum-verified release binary for tags, or a source build for commit pins.
@modernrelay/omnigraph matches omnigraph-server on major.minor; the patch is independent. A published @modernrelay/omnigraph@X.Y.* is built against omnigraph-server@X.Y.* and is expected to work against any >=X.Y.0, <X.(Y+1).0. The exact server version the SDK was generated from is always available at runtime as import { SERVER_VERSION } from '@modernrelay/omnigraph'.
The server release and the HTTP contract are separate numbers. Every request sends, and every response must carry, the Omnigraph-Http-Api value that the pinned spec/openapi.json requires; scripts/gen-version.ts reads it from the spec as HTTP_API_CONTRACT. Server releases 0.15, 0.16 and 0.17 retain contract 0.14. A matching contract is required but does not guarantee identical features or authorization behavior: later routes and fields require the release that introduced them, and graph discovery changed between 0.17.0 and 0.17.1. The live compatibility gate exercises the exact pinned release.
- Bump
package.json#omnigraph.serverVersionandpackages/sdk/package.json#version. Remove a temporaryomnigraph.serverRefonce the release tag exists. pnpm run sync-spec— fetch the releasedopenapi.jsonintospec/.pnpm run generate— regenerate SDK types and its version stamp.- Commit the pin, SDK version, spec, generated types, and
packages/sdk/src/version.gen.tstogether. - Run the full checks, including
pnpm run check-releaseandpnpm run test:e2e, against the released binaries. - Tag
vX.Y.Zafter review.release.ymlpublishes the SDK to npm after approval.
Pushing a v* tag triggers .github/workflows/release.yml, which runs the full gate (release pin, drift, coverage, build, typecheck, test) on the tag SHA and then publishes @modernrelay/omnigraph with npm provenance. check-release rejects a source pin and verifies the spec against the released server tag. The dist-tag is derived from the tag name: v1.2.3-alpha.1, -beta.x, -rc.x ship under next; everything else under latest.
One-time setup: add a publish-capable npm NPM_TOKEN repo secret suitable for CI and create a release GitHub Environment with required reviewers so a stray tag push cannot ship.
pnpm install
pnpm run check-drift # asserts spec matches the pinned tag or immutable commit
pnpm run generate # regenerates types + version stamp
pnpm run check-coverage # asserts every spec op has an SDK binding
pnpm run build # builds the SDK
pnpm run typecheck # runs after build so workspace types resolve
pnpm run test # pin-tooling tests + mocked SDK unit tests
pnpm run check-release # release-only gate; intentionally fails with serverRef set
# Isolated live cluster using released binaries on PATH:
pnpm run test:e2eCI runs the same sequence (see .github/workflows/ci.yml and e2e.yml). Its e2e job downloads the pinned release binary or builds the immutable source candidate, then runs test:e2e. This creates a fresh local cluster, waits for readiness, runs SDK live tests, and stops the server. Set OMNIGRAPH_BIN and OMNIGRAPH_SERVER_BIN to select explicit binaries; failed runs retain their fixture/log directory for diagnosis.
MIT