@kon10/core
v1.5.0
Published
Kon10 kernel — types, defineConfig, module registry, hook engine, access evaluator, Zod schema builder.
Maintainers
Readme
@kon10/core
Kon10's framework-agnostic kernel. It defines the configuration model, module and plugin contracts, entity/field types, access evaluation, hooks, the module registry, and local CRUD operations.
Install
pnpm add @kon10/core zodIn this monorepo the package is consumed through pnpm workspaces.
When to use this package
Use @kon10/core when you are authoring a Kon10 config, building a first- or third-party module, defining fields, or calling the local operations API from server-side code. The package intentionally has no database, storage, routing, or UI dependency.
Public API
defineConfig()andbootstrapKon10()for composing a Kon10 instance.- Field builders such as
text(),select(),relationship(),group(), andarray(). - Zod schema helpers such as
buildZodSchema()andInferDoc. - Module registry, hook engine, access evaluator, and operation context types.
- A shared
zexport so packages use the same Zod instance.
Example
import { buildZodSchema, text, type InferDoc } from '@kon10/core'
const fields = {
title: text({ required: true }),
summary: text(),
}
const schema = buildZodSchema(fields)
type Note = InferDoc<typeof fields>Most applications should pair defineConfig() with a database adapter from @kon10/storage and entity factories from @kon10/content; the lower-level exports here are primarily for modules and advanced integrations.
Design notes
- Keep this package pure and runtime-portable. Do not import framework, database, or React code here.
- Treat Zod field schemas as the runtime source of truth for validation and TypeScript inference.
- Register new field types through the field registry and TypeScript module augmentation.
