* feat(cli): dump native Cordis config schemas * test(cli): include schema dump in launcher help snapshot * feat(cli): export JSON Schema for Cordis configuration * fix(cli): preserve config schema discovery and annotations * fix(cli): conservatively project effectful config validation * refactor(boot): encapsulate profile config schema generation * fix(cli): follow Loader disabling and native writeback in config schema - Dormant group/include rows (disabled without group: true) may omit config and are recorded as childless trees; the entry schema skips their child declarations, matching the Loader, which never creates them. - Lazy builders run once per document, and a wrapped null-only projection keeps a deduplicated type list so the document stays compilable. - Union widening applies only when an earlier branch can write adapted values back through a container; +Infinity max and -Infinity min without a step are treated as the native no-ops they are. - Projection limitations repeat at every entry sharing a Config, and the entry schema documents the boolean/expression domain of disabled. - Record the schema-dump validation policy as an Agent Note.
17 lines
762 B
TypeScript
17 lines
762 B
TypeScript
/** Identity checks at the plugin-export and lazy-builder boundaries. */
|
|
|
|
import type { NativeConfigSchema } from './types.ts'
|
|
|
|
/**
|
|
* Recognize the native Schemastery graph protocol without invoking a validator or serialization hook.
|
|
* @param value - plugin Config export or lazy-builder result.
|
|
* @returns whether native schema fields can be inspected.
|
|
*/
|
|
export function isNativeConfigSchema(value: unknown): value is NativeConfigSchema {
|
|
if (value === null || (typeof value !== 'object' && typeof value !== 'function')) return false
|
|
const meta: unknown = Reflect.get(value, 'meta')
|
|
return Reflect.get(value, Symbol.for('schemastery')) === true
|
|
&& typeof Reflect.get(value, 'type') === 'string'
|
|
&& meta !== null && typeof meta === 'object'
|
|
}
|