Skip to content
Browse documentation

SDK

@langdrift/sdk 0.1.0 · unpublished

@langdrift/sdk implements protocol/schema version 1 for the canonical model:

Vision → Loop → Evidence

Drift is an Evidence document type, not a fourth pillar. A Record captures a fact. A Drift Event is an interpretation of facts against a Vision Target, supported by Evidence.

Runtime

  • Node.js 24 or newer
  • ECMAScript modules with TypeScript declarations
  • AJV’s JSON Schema Draft 2020-12 validator and the yaml parser
  • no React, backend, database, transport, or LLM dependency

The SDK validates and normalizes caller-supplied data. It does not define the Product Vision formula, calculate Product Vision, persist entities, or make identity and authorization decisions.

Entry points

The package manifest exposes:

  • @langdrift/sdk — the complete public API, re-exported by module
  • @langdrift/sdk/schema — schemas and schema constants
  • @langdrift/sdk/mcp — payload construction and injected transport contracts
  • @langdrift/sdk/integrations — the GitHub mapper and integration interfaces

The root API groups types, errors, diagnostics, schemas, validation, safe paths, projects, artifacts, references, Records and Drift Events, payload transport, and integrations.

Execution model

Filesystem operations are asynchronous:

  • findRepositoryRoot
  • resolveSafePath and readProjectFile
  • loadProject
  • discoverArtifacts
  • resolveReferences

Parsing, validation, event creation, payload construction, credential resolution, diagnostics, and the GitHub mapper are synchronous. sendPayload is asynchronous because it calls an injected transport.

Validation is strict. The SDK does not coerce values, add defaults, remove unknown fields, or migrate unsupported schema versions. Validation and safe path failures use LangDriftError, with a stable code and field-specific issues.

Edit this page on GitHub