Extensions and packs
An outline; the full description is in docs/architecture.md and Packs and blocks.
An extension
Section titled “An extension”An extension is a manifest (defineExtension from @composable-os/sdk) and its code. It
declares objects and their fields, fields on other objects, views, record tabs and panels,
settings, tools, automations, dashboards and, for a shipped pack, roles, grantable permissions,
routine mail and staff screens. Extension code runs in a dynamic Worker with no network and only
the host modules it asks for (ADR 0025); it
calls operations through ctx.ops.
A pack
Section titled “A pack”A pack is a shipped extension in packs/<id>/: the extension (index.ts), its headless client
hooks (client/) and its blocks (blocks/), released with the platform and turned on per
product (ADR 0420). A pack composes behaviours and
does not hook writes; a new behaviour is platform work. Every pack has its own pages under
Packs, generated from its manifest, and an overview written beside it in
packs/<id>/docs/overview.md.
Writing one
Section titled “Writing one”The steps are skills in the repository: write-extension for a new extension or new fields, and add-automations-tools-dashboards for tools, automations and dashboards (ADR 0405). Both end in the checks the host runs:
pnpm cos ext check packs/<id>pnpm cos ext test packs/<id>When the platform or the contract lacks what a pack needs, changing the platform is part of the work; a workaround in extension code is not.
This guide is docs/guides/extensions.md, written by hand beside the code.