feat(schema-form): schema-driven React form renderer package

@deepseek-ai/dsh-client-schema-form rehydrates the wire's serialized
schemastery envelope (new Schema(json)) and edits a draft user section
against it: presence-in-draft marks a field overridden with a per-field
reset, inherited values render as placeholders, role('secret') slots are
write-only with configured-state placeholders from the wire's secrets
list, dict adds take a union-typed sKey as their vocabulary, and any
node the renderer cannot faithfully edit falls back to a read-only view
instead of silently disappearing. renderField(context) is the role hook
the Models page will use for the credential-ref control; validateDraft
runs the same rehydrated validator the host uses, so the browser and
host judge one schema.
This commit is contained in:
Yichen Jiang
2026-07-30 00:24:19 +08:00
parent 191067559e
commit 9592c8f271
14 changed files with 902 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
/**
* Schema-driven React form renderer for settings sections. `SchemaForm`
* rehydrates the wire's serialized schemastery envelope and edits a draft
* user section against it; the model helpers expose the same introspection
* and immutable path editing for page-level composition.
* @module @deepseek-ai/dsh-client-schema-form
*/
export { SchemaForm } from './SchemaForm.tsx'
export type {
SchemaFieldContext, SchemaFormLabels, SchemaFormProps, SchemaFormSecret,
} from './SchemaForm.tsx'
export {
deletePath, getPath, hasPath, nodeKind, rehydrateSchema, setPath, unionChoices, validateDraft,
} from './model.ts'
export type { NodeKind, SchemaNode } from './model.ts'