@inhuman.tools/arrival-internals-types-prelude
v0.9.9
Published
The TypeScript type vocabulary for arrival builtins — the PRE prelude plus per-builtin ambient `declare function` leaves (encodeSchemeIdent names: `car`, `string$dash$append`, `null$qmark$`, …) over `sexpr`, `List`/`Tuple`, and list/string/math ops. The s
Readme
@inhuman.tools/arrival-internals-types-prelude
PRE (prelude/types.d.ts) plus per-builtin ambient declare function leaves so arrival-lsp and arrival-mercury/typefacts share one type vocabulary without cycling.
This is the TypeScript type surface for arrival builtins: sexpr, List / Tuple, and every list / string / math op as ambient declares. The interactive LSP and the batch fact extractor both depend down on this leaf; it imports neither.
Exports
| Subpath | Surface |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| . | Node getPreludeFiles — reads the shipped src/ .d.ts files via node:fs. Also re-exports PRELUDE_FILE / PROGRAM_FILE. |
| ./browser | getBundledPreludeFiles — the same map from a vite-inlined ?raw glob. No node:fs. |
| ./virtual-files | Path constants (PRELUDE_FILE, PROGRAM_FILE) for hosts that must not pull node:fs. |
Authoring a builtin leaf
- Copy
src/prelude/builtins/_TEMPLATE.d.tsto<slug>.d.ts(the slug is the scheme name; operators get a readable slug such asplus). declare functionunder theencodeSchemeIdentname (car,string$dash$append,null$qmark$, …) into the same ambient global as PRE.- Pair it with
<slug>.cases.ts(expectTypeOfpositives and// @ts-expect-errornegatives). The merged cases program insrc/__tests__/builtins.test.tsis the proof.
Invariants
- Leaves are pure ambient
.d.ts— noimport/export. - PRE alone does not define
car. That declare lives on thecarleaf; PRE without it yields “Cannot find namecar”.
Out of scope
Language-service, type-emit, and runtime implementations do not belong here.
License
MIT.
