packages/core/src/kernel/index.ts · 27 core · 64 low-level · commit c02bc5261

@prismshadow/penguin-core/kernel

IMPORT import { ... } from "@prismshadow/penguin-core/kernel";

Filter by Identifier type

  • All
  • Decorator (6)
  • Function (29)
  • Class (2)
  • Interface (32)
  • Type Alias (22)

Authoring (11)

@Module
Registers a class as a module. create(ctx, context) runs once per App; the class's @Use fields are injected before it, its @Provide fields a…
decorators.ts:107
@Component
Registers a class as a COMPONENT: a module that exports itself. The instance is the provision, named in a consumer by its own class (@Use() …
decorators.ts:121
@Interface
An interface as a CLASS. It is also a runtime value, so a manifest names it by reference (requires: { db: [Db, RuntimeModule] }) instead of …
markers.ts:50
@Use
A requirement: @Use(SessionsModule) readonly runner!: ScheduleTaskRunner; — the field's type is the interface, the decorator's argument the …
decorators.ts:133
@Provide
A provision: @Provide() settings!: Settings; — assigned in create, read after it; unassigned = boot error.
decorators.ts:143
@Bind
The code half of one contribution: @Bind("agents.routes") routes!: Hono; — assigned in create.
decorators.ts:153
Slot type
A contribution slot with a CODE half: the data one contribution carries in the manifest, and the implementation the contributor binds by id.…
markers.ts:64
Opaque type
Type-level markers the interface generator (bin/gen-ifaces.mjs) recognizes in a package. They exist only to be projected; at runtime they ar…
markers.ts:14
ClassCtx type
What a module class's create receives: everything in ModuleCtx except use — requirements are fields.
module.ts:133
Contributed type
One contribution as the consuming module receives it.
module.ts:33
Resources type
Runtime-owned live resources (pty, child processes, connections).
boot.ts:20

Assembly & Boot (16)

moduleDefOf
Turns a module class (and, recursively, its children) into the ModuleDef the booter runs. The string manifest is the generator's (table.modu…
module.ts:154
bootModules
async function bootModules(root: ModuleDef, opts: BootModulesOptions): Promise<ModuleTree>
module.ts:421
wire
Constructs a component OUTSIDE a tree — a script or a test that wants the class with its fields supplied by hand. The fields are assigned as…
decorators.ts:167
moduleMetaOf
The meta a class was decorated with; throws for an undecorated class.
module.ts:136
ModuleDef type
interface ModuleDef<M extends Manifest = Manifest, Use = Record<string, unknown>, Api = Record<string, unknown…
module.ts:60
ModuleTree type
A booted tree.
module.ts:304
ModuleInstance type
interface ModuleInstance<Api = Record<string, unknown>> { api: Api; bind?: Record<string, unknown>; park?(): J…
module.ts:52
ModuleCtx type
interface ModuleCtx<Use = Record<string, unknown>> { use: Use; contributions: Record<string, Contributed[]>; r…
module.ts:42
BootModulesOptions type
interface BootModulesOptions { ifaces: TableLike; published?: { ifaces: Published; values: Record<string, Reco…
module.ts:314
ModuleBootError
class ModuleBootError extends Error { constructor(message: string, readonly problems: Problem[] = []); }
module.ts:293
ModuleClass type
A module class: decorated with @Module; instantiated once per App; create is the module's create.
decorators.ts:21
IfaceClass type
An interface handle: an abstract class whose instance type is the interface (see markers.ts Interface).
decorators.ts:18
ModuleMeta type
The static half a module class declares in its decorator. Requirements and provisions are FIELDS (@Use, @Provide), where their types already…
decorators.ts:28
ComponentMeta type
What a @Component declares: a module's meta minus children — a component exports itself. name (an explicit node name) and key (an explicit m…
decorators.ts:51
ManifestTable type
The manifests the generator extracted, by module name — the modules section of the table.
module.ts:144
IfaceTable type
Every interface a bundle knows, keyed <module>#<Export>, plus the named data types its signatures reference by $ref (keyed the same way). Se…
sig.ts:83
Low-level Kernel & Upgrade low-level 36 exports
AnyIface type
type AnyIface = Iface<any, any>;
iface.ts:43
AnyImpl type
type AnyImpl = Impl<any, any>;
boot.ts:77
ApiOf type
The api a manifest's provides demands, by alias.
module.ts:91
boot
async function boot<A extends Park, C extends Json>(impl: Impl<A, C>, iface: Iface<A, C>, context: Json, resou…
boot.ts:315
BootError
class BootError extends Error { constructor(message: string); }
boot.ts:79
ChildDecl type
type ChildDecl = AnyIface | KeyedDecl;
iface.ts:22
defineIface
function defineIface<A extends Park, C extends Json>(def: { name: string; version: number; context: Schema<C>;…
iface.ts:45
defineModule
defineModule with no registry: every requirement is unknown at compile time.
module.ts:123
Iface type
interface Iface<A extends Park = Park, C extends Json = Json> { kind: "iface"; name: string; version: number; …
iface.ts:24
ifaceData
The serializable interface descriptor — the "platform interface" term of the snapshot equation (snapshot = platform interface + code + state…
iface.ts:78
IfaceRegistry type
Interface key (<module>#<Export>) → TypeScript type: a registry a package may declare over its interface classes, and moduleDefiner<ThatRegi…
module.ts:84
Impl type
An impl provides the factory for its node plus impls for declared children. children values handed to create(): singleton child → its api, k…
boot.ts:70
initialDoc
Shapes a fresh (no prior state) parked document for an iface tree.
boot.ts:121
Instance type
interface Instance<A extends Park = Park> { api: A; iface: Iface<A, Json>; park(): ParkedNode; dispose(): void…
boot.ts:111
isJsonObject
function isJsonObject(value: Json | undefined): value is JsonObject
json.ts:12
isKeyed
function isKeyed(decl: ChildDecl): decl is KeyedDecl
iface.ts:69
Json type
Kernel currency: everything that crosses a park/boot boundary is plain JSON.
json.ts:8
JsonObject type
type JsonObject = { [key: string]: Json };
json.ts:10
keyed
Keyed collection: static shape, dynamic cardinality.
iface.ts:65
KeyedDecl type
interface KeyedDecl { kind: "keyed"; iface: AnyIface; }
iface.ts:17
KeyedHandle type
Handle a parent receives for a keyed() child collection.
boot.ts:57
moduleDefiner
A defineModule bound to an interface registry. A module is its manifest as a literal (the static half — the generator extracts it without ex…
module.ts:113
ModuleImplOf type
interface ModuleImplOf<M extends Manifest, Reg extends IfaceRegistry> { migrations?: Record<number, (old: Json…
module.ts:95
NodeCtx type
interface NodeCtx { resources: Resources; effect(dispose: () => void): void; }
boot.ts:50
Park type
The minimal interface every node implements: a pure snapshot. Dispose is separate.
iface.ts:13
ParkedNode type
Parked tree node: v is the iface version the document was parked under.
boot.ts:87
ParseFail type
interface ParseFail { ok: false; dropped: string[]; missing: string[]; invalid: string[]; }
schema.ts:18
ParseResult type
type ParseResult<C extends Json = Json> = { ok: true; value: C } | ParseFail;
schema.ts:28
schema
Wraps an arktype type as a kernel Schema (undeclared object keys rejected).
schema.ts:41
Schema type
interface Schema<C extends Json = Json> { strictParse(doc: Json | undefined, path?: string): ParseResult<C>; d…
schema.ts:30
type
Re-exported from `arktype` for defining versioned context schemas passed to `schema()`.
schema.ts:37
upgrade
async function upgrade<A extends Park, C extends Json>(opts: { current: Instance<Park>; impl: Impl<A, C>; ifac…
upgrade.ts:135
UpgradeBlocked type
interface UpgradeBlocked { status: "blocked"; dropped: string[]; missing: string[]; invalid: string[]; doc: Js…
upgrade.ts:26
UpgradeFailed type
interface UpgradeFailed { status: "failed"; error: unknown; doc: Json; }
upgrade.ts:35
UpgradeResult type
type UpgradeResult<A extends Park> = | { status: "ok"; mode: "silent" | "migrated"; instance: Instance<A>; doc…
upgrade.ts:47
UseOf type
The use a manifest's requires resolves to, by alias.
module.ts:87
Manifest & Static Verification low-level 28 exports
assignable
Function subtyping: have can stand in for want when it takes no more parameters than a caller of want passes, each of its parameters accepts…
sig.ts:151
CheckResult type
interface CheckResult { problems: Problem[]; provides: Record<string, Record<string, IfaceDecl>>; }
check.ts:93
checkTree
function checkTree(root: ManifestNode, table: TableLike, published: Published = {},): CheckResult
check.ts:99
ChildRef type
type ChildRef = string | { readonly keyed: string };
manifest.ts:39
closedShape
An interface's CLOSED shape, as one canonical string: its declaration plus every interface and named data type it reaches through the table,…
sig.ts:247
ContextDecl type
interface ContextDecl { readonly version: number; readonly schema?: Json; }
manifest.ts:33
dataExtends
a ⊆ b. types resolves $refs; a pair of references met again while it is being decided is assumed to hold (coinduction — the rule that makes …
data.ts:78
describeProblem
function describeProblem(p: Problem): string
check.ts:284
extendsExpr
a ⊆ b over the shapes of TypeExpr; data goes to arktype, interfaces recurse through the table.
sig.ts:182
IfaceDecl type
One interface. name is for messages and lookup; identity is the member set. fields are the non-method members (Go has none; TS interfaces do…
sig.ts:71
ifaceKey
The iface-table key a manifest reference resolves to.
manifest.ts:90
inlineRefs
A definition with its $refs substituted, for arktype (which knows no references); a cycle stays a reference and parses as unknown.
check.ts:267
Manifest type
interface Manifest { readonly name: string; readonly requires: Readonly<Record<string, Requirement>>; readonly…
manifest.ts:41
ManifestNode type
A manifest and its children, as the tree is declared.
check.ts:30
Mismatch type
interface Mismatch { method: string; kind: "missing" | "signature" | "field"; why: string; }
sig.ts:99
parseManifest
Strict parse of a manifest document; throws with the arktype summary on failure. An empty requires, provides, contributes or children may be…
manifest.ts:77
Problem type
type Problem = | { path: string; kind: "unresolved"; alias: string; from: string; why: string } | { path: stri…
check.ts:38
Published type
What the host publishes: modules with provided interfaces, no manifests of their own.
check.ts:36
Requirement type
interface Requirement { readonly iface: string; readonly from?: string; }
manifest.ts:28
satisfies
offered satisfies required ⇔ every required method exists on offered with an assignable signature.
sig.ts:107
show
A short rendering for messages.
sig.ts:281
Sig type
A method signature: positional parameters and a return type.
sig.ts:51
SlotDecl type
A contribution slot: the data shape one contribution carries (an arktype expression, id excluded — the framework adds it) and, when the slot…
sig.ts:61
splitSlotKey
<module>.<slot> → its two halves.
manifest.ts:95
TableLike type
The table as functions take it: the full form, or just the interface map.
sig.ts:89
tableOf
function tableOf(t: TableLike | undefined): IfaceTable
sig.ts:91
TypeExpr type
A type, as data.
sig.ts:21
TypeTable type
Named data definitions a definition may reference as { "$ref": "<name>" }.
data.ts:23