Reference / SDK
JSON Schemas
The zod schemas behind every --json result, and the functions that turn them into the published JSON Schema documents.
Every result the CLI prints under --json has a zod 4 schema in the SDK, pinned at compile time to the TypeScript type it describes: the same fields, the same optional fields and the same value types, so a change to one without the other fails the build. Its parse also accepts a value from a newer verbatra: it allows fields it does not list and strips them from the result. The same schemas are published as JSON Schema documents; their URLs and the versioning rule are on Exit codes and JSON output.
Result schemas
runSummarySchema
Describes a RunSummary, the result of translate, watch and import. Published as run-summary.json.
const runSummarySchema: z.ZodObject<{ ... }, z.core.$strip>;checkSummarySchema
Describes a CheckSummary, the result of check. Published as check-summary.json.
const checkSummarySchema: z.ZodObject<{ ... }, z.core.$strip>;checkFileSummarySchema
Describes a CheckFileSummary, the result of checkFile. Published as check-file-summary.json.
const checkFileSummarySchema: z.ZodObject<{ ... }, z.core.$strip>;diffSummarySchema
Describes a DiffSummary, the result of diff. Published as diff-summary.json.
const diffSummarySchema: z.ZodObject<{ ... }, z.core.$strip>;doctorResultSchema
Describes a DoctorResult, the result of doctor. Its dataFlow field is dataFlowManifestSchema, so doctor-result.json refers to data-flow-manifest.json instead of repeating it.
const doctorResultSchema: z.ZodObject<{ ... }, z.core.$strip>;provenanceReportResultSchema
Describes a ProvenanceReportResult, the result of provenanceReport, including the available: false variant. Published as provenance-report.json.
const provenanceReportResultSchema: z.ZodUnion<readonly [...]>;pseudolocalizeResultSchema
Describes a PseudolocalizeResult, the result of pseudolocalize. Published as pseudolocalize-result.json.
const pseudolocalizeResultSchema: z.ZodObject<{ ... }, z.core.$strip>;generateTypesResultSchema
Describes a GenerateTypesResult, the result of generateTypes. Published as generate-types-result.json.
const generateTypesResultSchema: z.ZodObject<{ ... }, z.core.$strip>;extractResultSchema
Describes an ExtractResult, the result of extract. Published as extract-result.json.
const extractResultSchema: z.ZodObject<{ ... }, z.core.$strip>;exportWorkbookResultSchema
Describes an ExportWorkbookResult, the result of exportWorkbook. Published as export-workbook-result.json.
const exportWorkbookResultSchema: z.ZodObject<{ ... }, z.core.$strip>;importTmxResultSchema
Describes an ImportTmxResult, the result of importTmx. Published as import-tmx-result.json.
const importTmxResultSchema: z.ZodObject<{ ... }, z.core.$strip>;exportTmxResultSchema
Describes an ExportTmxResult, the result of exportTmx. Published as export-tmx-result.json.
const exportTmxResultSchema: z.ZodObject<{ ... }, z.core.$strip>;Shared schemas
localeSummarySchema
Describes a LocaleSummary, one entry of a run summary's locales.
const localeSummarySchema: z.ZodObject<{ ... }, z.core.$strip>;keyProvenanceSchema
Describes a KeyProvenance, the recorded origin and review state of one key.
const keyProvenanceSchema: z.ZodObject<{ ... }, z.core.$strip>;provenanceSummarySchema
Describes a ProvenanceSummary, the key counts per origin and per review state a locale of check carries.
const provenanceSummarySchema: z.ZodObject<{ ... }, z.core.$strip>;keyOriginSchema
Describes a KeyOrigin: who or what wrote a key's current value.
const keyOriginSchema: z.ZodEnum<{ ... }>;Stream records
progressEventSchema
Describes a ProgressEvent, what onProgress receives. The CLI prints some of these events to stderr under --json. Published as progress-event.json.
const progressEventSchema: z.ZodUnion<readonly [...]>;lockWaitEventSchema
Describes a LockWaitEvent, what onLockWait receives while a run waits for a locale's write lock. The CLI prints it to stderr with type: "lock-wait" added. Published as lock-wait-event.json.
const lockWaitEventSchema: z.ZodObject<{ ... }, z.core.$strip>;Publishing
SDK_ lists every document the SDK publishes under @verbatra/sdk/schemas/, each with its name, title, io and zod schema. JSON_ is https://verbatra.kreitz-webdev.de/schema/v1/. KNOWN_ lists every SDK, provider and adapter error code; the error envelope schema offers them as a hint while accepting any code.
renderJsonSchemas
Generates verbatra's own JSON Schema documents (draft 2020-12) from a list of JsonSchemaDocuments, keyed by name. Each one gets the $id that jsonSchemaUrl gives its name, a URL on this site, so use it for verbatra's documents only and renderOutputJsonSchema for a schema of your own. An output document allows every property it does not list; an input document, such as the config, keeps its closed objects. A schema that embeds a document from either list refers to it by URL.
function renderJsonSchemas(
documents: readonly JsonSchemaDocument[],
references?: readonly JsonSchemaDocument[],
): Readonly<Record<string, JsonSchemaObject>>;Returns: one document per entry of documents, each with $schema, $id and title.
renderOutputJsonSchema
Generates the JSON Schema of one zod schema the way the output documents are generated, without an $id, such as for an MCP tool's outputSchema.
function renderOutputJsonSchema(schema: z.ZodType): JsonSchemaObject;Returns: JsonSchemaObject
jsonSchemaUrl
Returns the public URL of a published document, which is also its $id: jsonSchemaUrl("run-summary") is https://verbatra.kreitz-webdev.de/schema/v1/run-summary.json.
function jsonSchemaUrl(name: string): string;Returns: string