Create a package
Shipping one PackageDefinition as an installed node package, a project WASM package or source markdown, side by side.
In Neuralis every capability is a package, and the PackageDefinition is
identical whichever way it ships; you only pick where it lives. An
installed node package runs in-process; a project package (a drop in
_packages/, or a package folder listed on a source, which loads the same way)
runs WASM-sandboxed; a source package is markdown discovered in a synced source
with no install step. Author the same manifest, tools/*.json and
skills/<name>/SKILL.md; the platform treats it by the path it arrived through
(four ways).
The parity matrix
installed node @scope/* | project _packages/ (WASM) | source markdown | |
|---|---|---|---|
| Install | while the host runs: neuralis package install + an approval + a restart; or into the image: neuralis pkg add + rebuild → node_modules/<name> (any scope) | drop a folder in _packages/ (or list a source folder in packageFolders) | none — discovered in a synced source |
| Discovery | deps-scan (the neuralis block) | ProjectPackageScanner | source vector-index |
| Trust | native (host-assigned) | untrusted → trusted | inherits the source trust |
| Runtime code | in-process node | WASM sandbox (neuralis-build generates dispatch) | none — context-only |
| Tools + handlers | ✅ | ✅ generated dispatch | ❌ |
| Routes | ✅ direct | ✅ host-gated (dist/routes.json) | ❌ |
| UI | direct React (a prebuilt module built with neuralis-build ui) | iframe only | ❌ |
| State | live | stateless (lazy-init, ctx.data) | ❌ |
| Hooks | callback executes; script / http are declared but have no executor | declared only — nothing fires today | ❌ |
| skills / rules / instructions / agents / docs | ✅ | ✅ | ✅ (whole surface) |
The 3 irreducible differences
Between an installed node package and a project WASM package, only three things genuinely differ — everything else is the same contract:
- UI: direct React vs iframe. A native package's widgets and cards are
React components in the workspace, shipped as a prebuilt UI module
(
app.module); a project package's UI loads in a sandboxed iframe. - State: live vs stateless. A node package holds live in-process state; a
WASM package is stateless across calls (
init(ctx)runs lazily once) and persists throughctx.data. - Hooks: in-process callbacks vs nothing that fires.
callback,scriptandhttphandlers are all validated at load, but only a node package'scallbackexecutes; ascriptorhttphook fails at dispatch with no executor configured. Do not build a capability whose only trigger is a hook (Hooks).
A source package carries no code at all: the markdown surface only, no tools, routes, UI, state or hooks.
Which layer does this value belong in?
Three stores, not interchangeable; pick by what the value is:
| The value is… | Goes in | Read with |
|---|---|---|
| a secret — an API key, token, or client secret | manifest credentials[] | ctx.credentials.resolveCredential(id, scope) |
| a tunable — a cap, timeout, TTL, interval, threshold, model or URL default | manifest configSettings[] | the injected config provider, read per call |
| boot-critical infrastructure — a database URL, an auth secret, a topology address needed before anything is decryptable | .env | the host, at boot |
Two rules follow from the table and are enforced:
- A secret is never a config key: config values are admin-visible plaintext in the Config tab.
- Declare only what something resolves: a credential or config row no code reads makes the operator believe a feature is configured while it stays dark.
- A connector has no
credentialFieldsand its factory context no credentials map: its secrets are ordinarycredentials[]declarations (Credentials, Config settings).
Start from an example
One official example per way a package reaches the platform, each readable element by element from the package registry:
| Your package will… | Example | Read it |
|---|---|---|
| be admin-installed as an npm dependency | @neuralis/example-builtin | neuralweb read '@neuralis/example-builtin#docs/docs.create-package' |
be dropped into a project's _packages/ | @example/project-package | neuralweb read '@example/project-package#docs/<id>' |
| be markdown in a synced source | @neuralis-examples/example-source | neuralweb read '@neuralis-examples/example-source#skill/<id>' |
Markdown elements read as plain text (--path for a multi-file element,
--line-start/--line-end for a window); tool, connector, credential and
config-setting contracts read as JSON (neuralweb info '<identity>#tool/<id>').
What the examples promise: Contract examples;
the registry: Marketplace.
Where to go for depth
Manifest · Tools · Lifecycle · Routes · WASM build · Source packages.