Building and loading package artifacts

A package contributes to Oda through the artifacts its build generates: a record of what the package exposes, the schemas that validate its contracts at runtime, and, for packages that declare Remote methods, the client side of those calls. This page follows that pipeline for package authors: what the build generates and checks, how Oda finds and loads a contribution, and how the runtime registers it, with the messages each step can raise. For the methods themselves, see Remote methods and streams; for the service and event catalog and the manifest fields a package declares, see Plugin artifacts and the catalog.

What the build reads and writes

Generation runs at build time only. It never runs inside a live Oda: Oda loads what a build produced, and it does not generate artifact files itself.

What the build checks

The build validates the package manifest against what it generated, and fails when the two disagree:

How Oda finds and loads a contribution

Oda scans the packages in its setup and registers the contributions it finds.

How a contribution is registered

The runtime keeps what each contributing package carries: its record of what it exposes, its schemas and the declarations of its calls. Registration is one atomic batch per contribution.

Questions, answered

What does the build read from my package?

The package's host and client TypeScript projects, one for each side the package contributes. The build reads them while the package is built; a running Oda never analyses your sources.

Which files does the build add to my package?

For each side, a runtime artifact and a matching declaration file in the package's output folder. A package that declares Remote methods also gets the client projections of those calls, with their declarations; a later build removes those files once the methods are gone.

Why does a package contribute nothing, with no error?

A contribution is opt-in: a package without its host entry is skipped silently, and Oda keeps that verdict for the life of the process. Add the entry and start Oda again; Hot reload lists what applies live.

Is a schema created when my package registers?

No. Registration stores the schema's factory; the schema itself is created on its first read, once for the running Oda, and every later read reuses that instance.

Can both sides of my package contribute the same schema name?

No. A schema is identified by its package and its name, without the side, so the second contribution of the same name is a duplicate, and a duplicate rejects the whole batch it arrives in.

Why did one duplicate reject my whole registration?

Registration validates the whole contribution before committing anything, so a duplicate (the same package and side, a schema name the package already contributes, an invocation id or an endpoint) rejects the batch before any of it is committed. Nothing of the refused batch lands, and an earlier registration stays intact.

Can a wire declaration change inside one run?

No. How a value crosses the boundary is declared once and fixed for the rest of the run: registering the same name again with a changed declaration is refused, even after the contribution that carried it was withdrawn. A new run sees the new declaration.

What is validated before a contribution is accepted?

The artifact must be a complete, well-formed contribution: it must be owned by the package that declares it, it must be the host side, its schemas must carry factories, and its call records must be well formed. Anything missing is refused at registration rather than half-registered.

Which load failures are loud, and which are only logged?

A malformed artifact among packages that are already mounted fails the load loudly, with one counted report and a message per failing package. A failure later in the process is logged for that package, and unrelated packages keep registering.

Why can a registered schema not be found by name?

A read that misses says which case it is: the name is not well formed (the expected shape is <package>#<name>), the package is registered but contributes no schema by that name, or nothing is registered under that package.