schema_registry.ts view source
SchemaRegistry Global instance of the schema registry for convenience.
3 declarations
schema_registry.ts view source
SchemaRegistry Global instance of the schema registry for convenience.
schema_registry.ts view source
A central registry for schemas and actions. Provides a single source of truth for schema definitions.
schemasAll schemas, including model schemas, action params, and responses.
type Array<z.ZodType>
model_schemasModel schemas are distinct from the action schemas. Models are the nouns compared to the Action verbs, and compared to Views they are data not Svelte components.
type Array<z.ZodType>
action_params_schemasAction parameter schemas.
type Array<z.ZodType>
action_response_schemasAction response schemas.
type Array<z.ZodType>
schema_by_nameMap of schema names to schemas.
type Map<VocabName, z.ZodType>
name_by_schemaMap of schemas to their names, for reverse lookup.
Zod schemas don't have a name property and we don't want to abuse description.
type Map<z.ZodType, VocabName>
action_specsCollection of all action specs.
type Array<ActionSpecUnion>
request_response_action_specsCollection of 'request_response' action specs.
type Array<RequestResponseActionSpec>
remote_notification_action_specsCollection of 'remote_notification' action specs.
type Array<RemoteNotificationActionSpec>
local_call_action_specsCollection of 'local_call' action specs.
type Array<LocalCallActionSpec>
action_spec_by_name_mapMap of action spec names to action specs.
type Map<ActionMethod, ActionSpecUnion>
add_schemaAdd a schema to the appropriate registries.
type (name: VocabName, schema: { method: "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | ... 12 more ... | "toggle_main_menu"; ... 6 more ...; async: true; } | { ...; } | { ...; } | ZodType<...>): void
nameschema{ method: "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | "ollama_delete" | ... 10 more ... | "toggle_main_menu"; ... 6 more ...; async: true; } | { ...; } | { ...; } | ZodType<...>voidregister_manyRegister multiple schemas at once.
type (schemas: Record<string, any>): void
schemasRecord<string, any>voidlookup_schema_nameLookup a schema name, guaranteed to return a string, or throws.
type (schema: ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>): VocabName
schemaZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>get_action_specGet an action specification by method name.
type (method: "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | "ollama_delete" | ... 10 more ... | "toggle_main_menu"): { ...; } | ... 2 more ... | undefined
method"completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | "ollama_delete" | ... 10 more ... | "toggle_main_menu"{ method: "completion_create" | "completion_progress" | "directory_create" | "diskfile_delete" | "diskfile_update" | "filer_change" | "ollama_copy" | "ollama_create" | "ollama_delete" | ... 10 more ... | "toggle_main_menu"; ... 6 more ...; async: true; } | { ...; } | { ...; } | undefinedget_schemaGet a schema by name.
type (name: VocabName): ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>> | undefined
nameZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>> | undefinedschema_registry.ts view source
VocabName