Skip to content

Generator and tool API ​

Register a golem.yaml block from your own package, call a generator from your own tool, and apply the files it returns, with the tool subpaths of @exprtlabs/golem.

Application projects use the CLI, which writes files, tracks the files each job wrote and runs watch mode.

  • Providers return file contents. They do not write files.
  • Every generator context takes absolute paths and a profile.
  • watchInputs lists the paths a build tool watches after generation.
  • A provider reports apiVersion 1. The CLI rejects another version.
  • A package that registers a block (below) implements a plan entry and a generator entry with generator-api alone. It can write source models, and the models job makes their codecs.

Usage: Run the generators from code and Write a generator.

Register a block ​

A golem package is an npm package whose package.json has a golem field. The field registers one top-level block of golem.yaml. The package owns the block: it validates every key and declares the jobs. Golem knows no package by name.

json
{
  "name": "@acme/golem-events",
  "exports": { "./plan": "./dist/plan.js", "./generator": "./dist/generator.js", "./tag": "./dist/tag.js" },
  "golem": {
    "apiVersion": 2,
    "block": "events",
    "plan": "./plan",
    "generator": "./generator",
    "extensions": { "tag": "./tag" },
    "schema": "./golem-schema.json"
  }
}
FieldRequiredMeaning
apiVersionYes2. Golem stops on a package with another registration version.
blockYesThe golem.yaml key that the package owns. It is not a root key, and no other installed package registers it.
planYesA subpath of exports. The light entry: it reads the block and declares the jobs. A package without it stops loading.
generatorFor a jobA subpath of exports. The heavy entry: it runs a job and returns files.
extensionsNoThe extensions that the block can turn on: a name for each, with a subpath, or { "entry": "./sub", "profile": true }.
schemaNoA JSON Schema file of the block, a path in the package. Golem merges it into .golem/schema.json.

A subpath must be a key of exports that Node resolves from the folder of golem.yaml. Golem finds the package when a package.json of the project lists it, or when it is the nearest package.json to golem.yaml (blocks).

Golem also checks the version of a package that pins @exprtlabs/golem to its own exact version, as it does for its own packages. A package with run-time code lists @exprtlabs/golem as a peer dependency, so the app holds one copy.

The plan entry ​

The plan module exports plan. It imports no TypeScript, no generator code and no yaml, so it takes only types from @exprtlabs/golem/generator-api. Name a contract by its text: ModelBoundary or CodecsHost.

ts
import path from 'node:path';
import type { GolemPlanEntry } from '@exprtlabs/golem/generator-api';

export const plan: GolemPlanEntry = {
  declare({ directory, block, profile }) {
    const { output } = (block ?? {}) as { output?: unknown };
    if (typeof output !== 'string') throw new TypeError('events.output must be a string.');
    const folder = path.resolve(directory, output);
    return [{
      facts: { id: 'events', outputs: [{ path: folder, kind: 'folder' }], ownedRoots: [], inputFiles: [], inputFolders: [], readsProgram: false, provides: [], needs: [], hooks: [], watch: [] },
      options: { output: folder, profile },
    }];
  },
};

Golem calls the entry in two passes:

  1. declare(context) validates the whole block and returns its jobs. Each job has facts and options, and, when it provides a contract, a provided value for each.
  2. link(job, { needed, consumers }) is optional. It gets the value of each contract the job needs, and the facts of the jobs that need a contract the job provides. It returns facts and options, and cannot change the id.
PlanContext fieldMeaning
configFile, directoryThe golem.yaml file and its folder, absolute. Resolve the paths of the block from directory.
tsconfigThe project's tsconfig, absolute.
profileThe root keys validation, allowAny and unknownFormats, resolved, with the options of the extensions that you flag profile: true.
exactThe root key exact. Omitted when it is not set.
blockThe value under your block name, as parsed, extensions included. Accept the extensions key when you validate it: golem reads that key itself.
onInputCall it with each local path you read or resolve, before you touch it.

Golem passes the options of a job to its generator as they are. They must be an object. Golem compares them as stable JSON, so a changed option runs the job again.

What a job declares ​

The facts of a job drive the job order and the checks that golem makes. A fact names no package. Every path is absolute and canonical.

FactMeaning
idA name unique in one golem.yaml. Golem prints it in every message.
outputsDestinations that only this job writes, each a file or a folder. They never overlap another job, and none holds golem.yaml or .golem/. Add importedByApp: true when the app imports the files: the output then lies in the tsconfig folder.
ownedRootsFolders the job owns but does not claim alone. They lie in the tsconfig folder.
scanRootsFolders the job only reads and scans. They lie in the tsconfig folder and exist, unless an earlier job writes into them.
inputFiles, inputFoldersWhat the job reads. A job that reads the output of another job runs after it.
readsProgramtrue when the job opens the app's TypeScript program. This decides its place in the order and which later outputs it sees.
provides, needs, wantsContracts, below.
hooksNames of the hooks the job offers to extensions.
watchWhere a new file runs the job: a folder, or the folders the job owns, scans or reads, and the file-name suffixes. An empty list means none.

A job that breaks a rule stops loading and the message names the jobs: a cycle of reads, overlapping outputs, an output in golem.yaml or .golem/, a root or an app-imported output outside the tsconfig folder, or a contract problem.

Contracts ​

A contract is a typed value that one job provides and others use. Golem knows two by name. Any package can provide them.

ContractValueUsed for
ModelBoundaryModelBoundaryValue: the models root, directory, output and suffixesGolem's rewrite and the docs jobs find the models of the app. It is optional: without a provider, the rewrite serves SDK models only.
CodecsHostCodecsHostValue: modelsOutput and configDirectoryAn SDK in mode: golem imports the codecs file that its provider writes.
  • A job lists a contract in provides and returns its value in provided, in the first pass.
  • A job lists a contract in needs to get its value in link. A needed contract with no provider stops loading and names the contract.
  • A job lists a contract in wants to get the value when exactly one job provides it. No provider is no error.
  • At most one job provides a contract. Two providers stop loading.

The generator entry ​

The generator module exports apiVersion (1) and generate(context), as in Generator modules. The context is the options of the job from the plan entry, plus the host context:

FieldMeaning
onInputCall it with each local file path before you read it. Golem skips a job whose inputs did not change.
sessionretain and share keep a resource, such as a compiler, across runs.
programViewFor a job with readsProgram: true. laterOutputs lists the outputs of the jobs that run later, which the program leaves out.
hooksFor a job that offers hooks: the participants of the extensions that fill each, in the order of golem.yaml.

Each artifact carries the name of your package as its ownership marker. A text file starts with /* Generated by <package>. Do not edit. */, or with //, # or <!-- in place of /*. A space, a line end or a full stop must follow the name. A JSON file holds the name in a top-level x-generator property or in generator.name.

Offer a hook ​

A hook is a named place where extensions add code to a job. The job that offers the hook defines its contract, exports its name as a constant, and owns the type of its participant. Golem only routes the participants.

  • List the hook name in facts.hooks.
  • Call each participant through fill.use: context.hooks?.['acme.note']?.map(fill => fill.use(note => (note as NoteParticipant)({ options: fill.options }))), where NoteParticipant is the participant type that your package exports.
  • A participant that throws stops the run, and the message names the package of the extension. This is a fault in that package.
  • A hook that no job of the golem.yaml offers stays unfilled. An extension with no rewrite whose hooks no job offers stops loading, and the message lists the hooks offered.
  • Golem runs the job again when the code or options of an extension on its hooks change.

Write an extension ​

An extension has no output. It plugs into the rewrite or into a hook of a job. The user turns it on under extensions: in your block, by name, with its options ({} for none):

yaml
events:
  output: src/events
  extensions:
    tag: {}

The entry is a module that exports extension. Golem loads it when a build tool or the CLI starts, after the host picks the project's TypeScript, and it never loads an extension that the block does not name.

ts
import type { GolemExtension } from '@exprtlabs/golem/generator-api';

export const extension: GolemExtension = {
  rewrite({ ts, checker, file, options, core }) {
    return { edits: [], reads: [], diagnostics: [] };
  },
  hooks: { 'acme.note': (input: { readonly options: Readonly<Record<string, unknown>> }) => 'a line of text' },
};

rewrite runs for each source file in golem check, golem build, the Vite plugin, the esbuild plugin and the Node loader alike. It gets the TypeScript seam ts, so it never picks TypeScript itself.

InputMeaning
ts, checker, fileThe TypeScript API of the project, its type checker and the source file.
rootThe project root, the folder of the tsconfig.
optionsThe value under the extension's name in golem.yaml.
codecKeysidFor(filename, name) and moduleOf(id), from .golem/codec-keys.json.
boundaryThe ModelBoundary value. undefined without a provider.
modelClasses()How many classes register for each model, by model key.
coreHelpers: importName(node, name, from), loadCodecModule(id), codecIdOf(symbol), isGolemModel(symbol), readAliasChain(name), readWrittenIn(node) and locate(node, code, message).
ResultMeaning
editsText edits { start, end, expect, text }. Golem checks each against the file. No edit may overlap an edit of core or of another extension: the build stops with RUNM1091.
readsAbsolute files the extension read besides the source. A change to one scans the file again.
diagnosticsDiagnostics for the user, with your own codes.

Set "profile": true on an extension in golem.extensions when its options change generated code. Golem then records the options of that extension in profile.extensions of each manifest, by package name, as golem.yaml writes them. Every option of such an extension must change generated code and must have no silent default.

What stops loading ​

CaseResult
A block that no installed package registersLoading stops and lists the installed golem packages and their blocks.
Two packages register one blockLoading stops and names both.
A package with another apiVersionLoading stops and names the package.
A block turns on an extension that the package does not registerLoading stops and lists the extensions that it registers.
Two jobs with one idLoading stops and names both packages.
An extension or a plan entry that does not loadLoading stops and names the package and the file.
An extension that throwsThe run stops and names the package.

Shared contracts ​

ts
import type {
  GolemDiagnostic,
  GolemProfile,
  GolemProvider,
  GolemResult,
} from '@exprtlabs/golem/generator-api';

interface GolemProfile {
  /** `true` checks every rule, `'sanity'` the JSON shape only, `false` nothing. */
  readonly validation: boolean | 'sanity';
  readonly allowAny?: boolean;
  /** `error` (the default) fails generation on a schema format that golem does not implement; `warn` skips its check. */
  readonly unknownFormats?: 'warn' | 'error';
  /** The options of the extensions flagged `profile: true`, by package name and extension name. Omitted when none is turned on. */
  readonly extensions?: Readonly<Record<string, Readonly<Record<string, unknown>>>>;
}

interface GolemArtifact {
  readonly path: string;
  readonly content: string;
}

interface GolemResult {
  readonly artifacts: readonly GolemArtifact[];
  readonly manifestPaths: readonly string[];
  readonly watchInputs: readonly string[];
  readonly diagnostics?: readonly GolemDiagnostic[];
}

enum GolemDiagnosticSeverity {
  Error = 'error',
  Warning = 'warning',
}

interface GolemDiagnostic {
  readonly code: string;
  readonly severity: GolemDiagnosticSeverity;
  readonly message: string;
  readonly file?: string;
  readonly line?: number;
  readonly column?: number;
  readonly path?: string;
}

type InputObserver = (absolutePath: string) => void;

/** The name of a session resource; its type is the resource that a request under it returns. Make one with `sessionKey<Resource>(name)`. */
type SessionKey<Resource extends Disposable> = string & { readonly [brand]: Resource };

interface GeneratorSession {
  retain<Resource extends Disposable>(key: SessionKey<Resource>, create: () => Resource): Resource;
  /** A resource that every job and the rewrite share for the run, such as one compiler session. The first request under `key` creates it. */
  share<Resource extends Disposable>(key: SessionKey<Resource>, create: () => Resource): Resource;
}

interface GolemProvider<Context> {
  readonly apiVersion: 1;
  generate(context: Context): GolemResult | Promise<GolemResult>;
}
ExportSignatureBehavior
resolveProfile(profile: GolemProfile): ResolvedGolemProfileApplies the defaults allowAny: false and unknownFormats: 'error' and returns a frozen profile. Throws TypeError for an unknown key, an allowAny that is not a boolean, a validation that is not true, false or 'sanity', or an unknownFormats other than 'warn' or 'error'.
GolemProvider{ apiVersion: 1; generate(context) }The shape each generator module exports.
GolemDiagnosticSeverityError, WarningSeverity of a returned diagnostic.
GolemPlanEntry{ declare(context); link?(job, contracts) }The shape each plan module exports as plan (the plan entry).
GolemGeneratorEntryGolemProvider<Options & GeneratorHostContext>The shape of the generator module of a job. Each artifact it returns must carry the ownership marker of its package (the generator entry).

Build tool rules ​

  • Every generator applies resolveProfile to the profile you pass.
  • profile.validation is a level, not a flag. 'sanity' still writes validators, so test profile.validation === false for off. A model may set a lower level than the profile (Validation profiles).
  • Show returned diagnostics to the user. Their codes are in Diagnostics.
  • A generator reports a failure as an exception or as a result that carries an Error diagnostic. Treat both as a failed run. The CLI stops the job.
  • onInput runs before each local read or existence check, including for a missing path.
  • The CLI skips a job whose recorded inputs did not change since its last run. It learns an input when the generator calls onInput. A file that the generator returns in watchInputs without calling onInput is recorded when the generator returns. If the file changed during the run, the next run runs the generator again. A directory that the generator returns without announcing it makes the generator run every time. Call onInput for each file you read, so golem records it at the read.
  • Pass the same session to repeated generate() calls of the model or controller generator to keep its TypeScript compiler running between calls. The session owner disposes the retained resources.
  • Without a session, each call starts and closes its own compiler.

Usage: Run the generators from code.

@exprtlabs/golem/generator-api ​

ts
import type { GolemProvider } from '@exprtlabs/golem/generator-api';

The subpath is the extension API. It exports the contracts above and the types GolemExtension, RewriteParticipant, RewriteParticipantInput, RewriteParticipantResult, RewriteCore, GolemDiagnosticCode, ResolvedGolemProfile and SourceDiscoveryOptions. It follows semver, and an extension package keeps its own version.

ExportSignatureBehavior
stableJson(value): stringIndented JSON text with the keys sorted at every depth.
sessionKey<Resource extends Disposable>(name: string): SessionKey<Resource>The key that names a session resource of type Resource. Make it once, in a constant, and pass it to retain and share.
stableValue(value): unknownA copy of the value with sorted keys.
compareText(left, right): numberOrders text by UTF-16 code unit, so output does not depend on the locale.
isInsideDirectory(directory, filename): booleantrue when filename is directory or lies inside it.
discoverSources(root, options: SourceDiscoveryOptions): string[]Sorted, unique sources below root. Skips dot entries and node_modules. A missing root yields none.
parseYamlFile(text, filename, options?): unknownParses YAML text that came from filename. Throws a YamlFileError for invalid YAML.
YamlFileErrorclass extends ErrorIts message starts with <file>:<line>:<column>, the file relative to the working directory. Its cause is the parser's error.

@exprtlabs/golem/manifest ​

ts
import { discoverModelManifests, readModelManifest } from '@exprtlabs/golem/manifest';

An OpenAPI job writes model-manifest.json beside its SDK. A model job reads it to use the SDK types in your declarations.

MemberSignatureBehavior
discoverModelManifests(root = process.cwd(), onInput?): string[]Sorted absolute paths of model-manifest.json files below <root>/src, skipping dist and build.
readModelManifest(filename: string, onInput?): ModelManifestReads and checks one manifest. Throws with the file name when it is unreadable or invalid.
validateModelManifest(manifest: unknown, filename?): ModelManifestChecks a parsed manifest.
ModelManifest{ profile, models, mode?, … }The generation profile, one entry in models for each schema, and, in a golem SDK, the schema graph that the model job compiles.
MODEL_MANIFEST_FILENAME'model-manifest.json'The file name.

@exprtlabs/golem/rewrite ​

ts
import { applyRewrites } from '@exprtlabs/golem/rewrite';

Every build tool scans each TypeScript file it compiles or loads with your project's own TypeScript. Then it edits the file's text before the types are stripped. The edits are:

CallBecomes
model<T>()modelBase(...) plus a side-effect import of the generated codec file for T
stringify<T>(value)the generated stringify for T
parse<T>(text)the generated parse for T, constructing your class when T is a class
validate<T>(value)the generated validate for T
assertValue<T>(value)the generated assert for T
toWireFormat<T>(value)the generated toWireFormat for T
fromWireFormat<T>(wire)the generated fromWireFormat for T, constructing your class when T is a class

When the ts-openapi block of golem.yaml holds the nest extension, the rewrite also marks @Body() and @Query() parameters that take a model, and handlers that return a model, so that NestModelInterceptor can convert them. golem build, loader, vite and esbuild use this subpath to apply their edits.

MemberSignatureBehavior
applyRewrites(text: string, rewrite: FileRewrite, file?: string): { code: string; map: SourceMapV3 }Applies the edits and the imports they need to the file's text, and returns the new code with its source map. Offsets are UTF-16 units of the text without a leading byte order mark, which the output keeps. The map has one source, named ''. Set sources on it when you know the file name. Throws an error that names file and the line when an edit is out of range, overlaps another edit, or no longer matches the text it expects.
REWRITE_IMPORT_PREFIX'__golem_'The prefix of the names that the rewrite imports. Each name is imported as __golem_<name>, so edit text cannot clash with an import of your file.

Types: FileRewrite ({ edits, imports, importsAt }, where importsAt is the offset in the text where the imports go: after a shebang and the directive prologue, such as 'use client'), RewriteEdit ({ start, end, expect, text }) and RewriteImport ({ from, names }).

Generator modules ​

Each module exports apiVersion (1) and generate. Usage: Run the generators from code.

ModuleSignatureResult
@exprtlabs/golem-ts-openapi/generatorgenerate(context: ControllerContext): Promise<TsToOpenApiResult>The first artifact is the OpenAPI document. A second artifact is a generated file that the rewrite reads. manifestPaths is empty.
@exprtlabs/golem-openapi-ts/generatorgenerate(context: OpenApiContext): Promise<OpenApiGenerationResult>The SDK files. manifestPaths holds the SDK's model-manifest.json.
@exprtlabs/golem-model/generatorgenerate(context: ModelContext): GolemModelResultThe generated model files.

ControllerContext ​

The context of the generator that writes an OpenAPI document from controllers. @exprtlabs/golem-ts-openapi/generator exports it with ControllerModels, ControllerTag, ControllerUriVersioning and ControllerUriVersioningType. Usage: Generate OpenAPI from controllers.

FieldRequiredDefaultEffect
rootYes—Existing project directory.
outputYes—The .json, .yaml or .yml file to generate.
infoYes—OpenAPI info object.
profileYes—GolemProfile.
exactNotrueDefault for the exact option of a model that sets none. golem.yaml passes its root exact.
modelsNoomittedThe model block of the same golem.yaml: root, directory and output as absolute paths, and suffixes. With it, a shared model of the app, or a class that extends model<T>() of one, matches its model. golem.yaml passes it.
sourcesNofiles that end in suffixes below <root>/srcNon-empty list of controller files.
suffixesNo['.controller.ts']File-name endings that make a file below <root>/src a controller source.
openapiVersionNo'3.2.0''3.2.0' or '3.1.2'.
servers, securitySchemes, tags, globalPrefix, uriVersioning, maxResultBytesNoomittedSame as the docs keys.
onInputNoomittedCalled with each path before it is read.
sessionNoomittedKeeps the compiler running across calls.

Diagnostic source locations are not copied into the OpenAPI document.

Example:

ts
import { generate } from '@exprtlabs/golem-ts-openapi/generator';

const result = await generate({
  root: '/absolute/app/backend',
  output: '/absolute/app/api/payments.yaml',
  info: { title: 'Payments API', version: '1' },
  profile: { validation: true },
});

console.log(result.artifacts[0]?.path); // /absolute/app/api/payments.yaml

OpenApiContext ​

Import the type from @exprtlabs/golem-openapi-ts/generator. The context of the SDK generator. Usage: Generate an OpenAPI SDK.

FieldRequiredDefaultEffect
inputYes—OpenAPI document, JSON or YAML.
outputYes—SDK directory.
profileYes—GolemProfile.
nameNothe document's info.title, else ApiPrefix of the client name, such as PaymentsClient.
datesNo'date''temporal' maps date and date-time strings to Temporal types (dates).
modeNo'standalone''standalone' writes an SDK that carries its own checks, conversions and runtime. 'golem' writes types and the client only, and leaves checks and conversions to the model job (mode).
codecsFileWith mode: 'golem'omittedThe absolute path of the file that the model job writes for this SDK. The operation modules import the operation codecs from it. golem.yaml sets it for you.
remoteHostsNo[]Hosts that remote references may use, such as schemas.example for the default HTTPS port or schemas.example:8443 for that port only. With an empty list, the generator loads no remote reference.
maxRefBytesNo5242880Maximum bytes read from one referenced document.
maxRefDocumentsNo256Maximum referenced documents, local ones included.
refTimeoutMsNo10000Timeout of each remote read, in milliseconds.
onInputNoomittedCalled with each local path before it is read.
  • manifestPaths holds the SDK's model-manifest.json. A model job reads it to know the SDK types.
  • A standalone SDK carries its checks and conversions. Its manifest lists the schemas of the SDK.
  • A golem SDK carries none. Its manifest holds the schema graph as data, and the model job compiles the checks and conversions of the SDK with your models.
  • A model job that reads a manifest from an older release fails and asks you to generate the SDK again.

Example:

ts
import { apiVersion, generate } from '@exprtlabs/golem-openapi-ts/generator';

const result = await generate({
  input: '/absolute/app/api.yaml',
  output: '/absolute/app/sdk',
  name: 'Payments',
  profile: { validation: true },
});

console.log(apiVersion, result.artifacts.map(artifact => artifact.path));

writeSdk and loadValidatedDocument ​

Both are exports of @exprtlabs/golem-openapi-ts/generator. Usage: Start from a loaded document.

ts
function writeSdk(
  document: unknown,
  options: { readonly output: string; readonly name?: string; readonly profile: GolemProfile; readonly dates?: 'date' | 'temporal'; readonly mode?: 'standalone' | 'golem'; readonly codecsFile?: string },
): GolemResult;

function loadValidatedDocument(filename: string, options?: ReferenceResolutionOptions): Promise<unknown>;
  • loadValidatedDocument reads and checks the document and bundles its references. options takes the reference fields of OpenApiContext and onInput.
  • writeSdk reads no files and returns empty watchInputs.
  • mode: 'golem' needs codecsFile as an absolute path; writeSdk throws a TypeError without it.

Example:

ts
import { loadValidatedDocument, writeSdk } from '@exprtlabs/golem-openapi-ts/generator';

const document = await loadValidatedDocument('/absolute/app/api.yaml');
const result = writeSdk(document, {
  output: '/absolute/app/sdk',
  profile: { validation: true },
});

ModelContext ​

The context of the model generator. Import the type from @exprtlabs/golem-model/generator. Usage: Generate TypeScript models.

FieldRequiredDefaultEffect
rootYes—Existing TypeScript project directory.
profileYes—GolemProfile.
directoryNorootThe directory of the golem.yaml. Its .golem/ receives the codec keys.
exactNotrueDefault for the exact option of a model that sets none. golem.yaml passes its root exact.
outputNo<root>/.golem/modelsDirectory for all generated model files: local models, controller DTOs, shared models, golem-mode SDK codecs and models.validators.generated.ts.
sourcesNofiles that end in suffixes below <root>/srcModel files.
suffixesNo['.model.ts', '.models.ts']File-name endings that make a file below <root>/src a model source.
manifestInputsNo[]SDK model-manifest.json files whose types your declarations use.
sdkOutputsNo[]The absolute output folders of the SDK jobs of mode golem in the same golem.yaml. The model job writes the checks and conversions of each SDK.
onInputNoomittedCalled with each path before it is read or checked.
sessionNoomittedKeeps the compiler running across calls.
HelperSignatureReturns
discoverModelSources(root?, onInput?, suffixes?): string[]Model files below <root>/src, sorted.
generatedFilename(source: string): stringThe generated file name with .generated inserted before the extension (emitted inside model.output).
isModelSource(filename: string): booleanWhether the name ends in .ts, .mts or .cts, a declaration file such as customer.model.d.ts included, and is not a generated file.
discoverModelManifests(root?, onInput?): string[]@exprtlabs/golem/manifest re-export.

Example:

ts
import { apiVersion, generate } from '@exprtlabs/golem-model/generator';

const result = generate({
  root: '/absolute/app',
  profile: { validation: true },
});

console.log(apiVersion, result.artifacts.length);

Apply results ​

A result is an in-memory plan. A build tool that applies it:

  • keeps the artifact paths and contents,
  • tracks manifestPaths and watchInputs,
  • chooses its own write policy, stale-file policy and record of written files.

The golem CLI applies results in the job order of the configuration. Usage: Apply the results.

Generated code ​

Generated files and rewritten sources import runtime helpers from internal entries of @exprtlabs/golem. These entries change with the golem version and are not application API. The CLI requires each built-in generator package to have the exact version of @exprtlabs/golem (Runtime version).