@kanzo-tech/kernel
v0.49.0
Published
Layer 0 of Kanzo's packages — what four of them each wrote: the one failure (`Problem`, RFC 9457), the one bounded wait (`within`), the read side of an engine (`Queryable`), the dispose symbols and a Performance span (`mark`). Depends on nobody.
Readme
@kanzo-tech/kernel
Layer 0: what the other packages each wrote and now share. It imports nothing, declares no dependency
and no peer, touches no DOM, and does nothing at import. The argument is /docs/design/kernel.
import { Problem, isProblem, within, until, mark, dispose, asyncDispose } from "@kanzo-tech/kernel";
import type { Queryable, Table, Vector } from "@kanzo-tech/kernel";Problem— the one failure, in RFC 9457's shape:type(a tag URI derived fromcode),title(the registry's, one per type),status,detail(message), and the extension memberscode(area/kind),data(typed per code),help,related, andcause, kept whole in process.toJSON()isapplication/problem+jsonand carries acauseonly when it is itself a Problem (at most 8 deep, a cycle cut), never a stack.Problem.from(body)rebuilds one.isProblem(error, code?)is structural, neverinstanceof;isCodeis the grammar.within(ms, wait, { signal, silent })— the one bounded wait.silent(after)is mandatory and returns theProblemthat names who did not answer.until(promise, signal)abandons a wait that takes no signal.Queryable,Table,Vector— the read side of an engine, as types; an Arrow table is one.dispose,asyncDispose— the runtime'sSymbol.disposeandSymbol.asyncDispose, elseSymbol.for("Symbol.dispose"). Nothing is installed on a global. Their types need TypeScript 5.2 and"lib": ["esnext.disposable"]; a host that polyfillsusingusesSymbol.dispose ??= Symbol.for("Symbol.dispose")(TypeScript's own recipe is a private symbol and would not agree). Native: Chrome 125/127, Firefox 141, Node 24, Deno 1.37; Safari not shipped (MDN browser-compat-data).mark("area:name", start, detail?)— akanzo:area:nameUser Timing measure fromstart(aperformance.now()reading) to now; never throws.
The codes are written once in problems.bnf, published beside the code, and src/problems.gen.ts is
generated from it (pnpm --filter @kanzo-tech/kernel gen; pnpm check:generated fails on a diff).
