Skip to main content
A mountable app is a function from its capabilities to app(...). Mount it by calling it at a path of your tree:
bijection/app.ts
The mounted app’s declarations take their paths under the mount: its functions are blog.add and blog.list, and its tables blog.comments and blog.formatJobs. Mount it twice at two paths and each mount has its own tables.

Pass it what it needs

What a mountable app takes is its own contract, stated by its function’s parameters: the roles that may call its functions, labels to run under, functions of yours to call, plain options. Pass your own declarations by value:
The app exposes only the functions it gives allow; with the roles you passed, your callers reach them at their paths (api<typeof App>().blog.add).

Reach its declarations

app(tree) returns the tree, so the mounted app’s declarations are values of yours:
bijection/app.ts
Your functions read its tables and call its functions like your own, under the same label rules. A route a mounted app declares is served under the mount: a route.post("/hook", verifier.session()) in an app mounted at blog serves /blog/hook.

Guard its acts

An installer may add guards over a mounted app’s acts. Name the declaration by value, through the mount:
bijection/app.ts
act.enter(blog) covers every function of the mounted app, and act.write(blog.comments) every write to its table. A guard’s path is its identity: this one is guards.quietHours. See Guards.

Review it

bijection check lists the mounted app’s paths in bijection.lock with the rest of yours: their allow, under, grave acts and guards. Adopting or upgrading a package is a reviewed lock diff.