Context
GenerateContextType
The type of the context that transform, projections and snippets receive. Use it as the type of a context argument in a generator.
GenerateContext implements it. See that class for what a generator does with the context.
Signature
import type { GenerateContextType } from '@skmtc/core'Properties
The run's logger. A line logged inside a transform carries the subject's stack trail, and a warn or error line sets the subject's result to 'warning' or 'error'.
The pending models, outermost first: the last is the model whose projection constructor is running, the source of any reference made now. Kept by the ModelDriver.
Attribution (gen-maps) state. It does not decide whether a SnippetBase wraps its toString: capturesRender does.
The active attribution capture sink, or undefined outside the capture interval. Read by every SnippetBase instance's toString wrapper; RenderContext opens/closes the interval through the shared CaptureChannel that CoreContext wires into both contexts. In a run with no capturing render (capturesRender false, as in a bare test mock) no snippet has a wrapper, so nothing reads it.
Whether the run has a capturing render (attribution emission is configured). Read once by every SnippetBase instance, at construction: it installs its toString wrapper only when this is true.
Look up an existing file by path (no creation); the neutral read primitive. Throws for a file given to the host by onArtifact.
Look up an existing file by its normalized path, which is its key: a miss is not normalized again. Throws for a file given to the host by onArtifact.
Read-only view of every file generated so far, without those given to the host by onArtifact - an inspection/tooling seam (not coordination).
Store a language-constructed file; the neutral write primitive. Returns the stored file.
The Definition named name in exportPath (or inside the declaration into), or undefined.
The recording enrichment accessor - the single choke point every enrichment lookup routes through. Reads the node at settings.enrichments[...segments] (segments are literal keys, never dotted paths) and records the read for the post-walk consumption audit, so configured-but-never-read entries surface as UNCONSUMED_ENRICHMENT warnings.
Read the { subject, generator, stack } enrichments of a generator and parse them with schema. An entry's toEnrichments calls it with the place of its kind of subject. Each read is recorded for the audit (GenerateContextType.readEnrichment), and each key that the schema drops is reported.
Add an enrichment warning to this run's audit, deduplicated on (type, path). Used by parseEnrichments for UNKNOWN_ENRICHMENT_KEY reports; the warnings surface on GenerateResult.enrichmentWarnings and ride the manifest.