As a library to build on
A third shape, for a package whose job is to be built on. Export a piece of an app and let the application compose it:
ts
// in your library
export const observability = {
agents: { auditor: agent({ role: "Audit.", description: "Audits things." }) },
functions: { measure: fn({ /* ... */ }) },
};
// in the application
import { mergeApps, createApp } from "@praecise/harness";
import { observability } from "@acme/observability";
const app = await createApp(mergeApps(observability, myOwnApp));Later definitions win, because the merge order is the caller's statement of precedence —
an application overriding a library's agent is the point. Collisions are reported in
collisions rather than applied silently: two packages that both export support produce
an app where one of them is simply gone, and nobody notices until the wrong one answers.
Two guards is not a guard, so that is reported too.