Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,30 @@ hidden inside library objects that accumulate. One exception: metadata an
author declares at module evaluation, about a value the author owns, may live
on that value.

Ordinary TypeScript components use `ComponentModuleLoader`, the same-name
interface and scoped Context in `@executablemd/core/api`, with stable name
`@executablemd/core/ComponentModuleLoader` and default `undefined`. Canonical
setup captures its bound `load(source, origin)` before profile resolution.
Profile and durable imports pass exact selected direct bytes and the logical
file URL; core still validates the complete namespace and owns durable identity
and admission. Runtime-named CLI entrypoints install their matching core
`host/deno`, `/node` or `/bun` provider; compiled installs Deno's.
Embeddings explicitly use the matching exported installer. Eval compilation is
a separate service. Absent installation refuses TypeScript loading before native
work; Markdown and registered functions are unaffected.

These adapters transform direct TypeScript in memory, preserving module exports,
logical origin, source maps and ordinary live dependencies without staging files
or permission grants. Deno and Node retain owned native hooks; Bun retains an
owned JavaScript object URL. Each load has a separate canonical-owned scope-eval
worker, retaining resources beyond materialization and namespace return without
serializing independent loads. Before namespace transfer, cancellation halts and
joins that worker’s hosting task; canonical completion owns transferred hosts.
Adapter teardown joins native import work before deregistration or revocation.
The transformer is imported lazily by the actual load operation; neutral imports
and adapter installation evaluate no Babel code. Retained imports execute retained direct text after file removal;
they do not snapshot dependencies or repeat completed effects.

A callback registered with something outside the process — a listener on a
socket, a child process, a stream or a DOM target — is state of exactly this
kind, and the source it is attached to knows nothing about the operation that
Expand Down
3 changes: 2 additions & 1 deletion deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@
"unist-util-select": "npm:unist-util-select@^5",
"zod": "npm:zod@^4.3.6",
"mdast-util-to-string": "npm:mdast-util-to-string@^4",
"yq.rs": "npm:yq.rs@0.1.4"
"yq.rs": "npm:yq.rs@0.1.4",
"@executablemd/test-support/host": "./packages/test-support/host.ts"
},
"tasks": {
"xmd": "deno run --allow-all packages/cli/src/deno.ts",
Expand Down
Loading
Loading