Add a capability
When a new *.cap.ts is justified, codegen, method auth tiers, and what must ship in @dominevo/server.
Authoritative checklist: server skill add-capability.
Do you need a new cap?
Prefer existing surfaces:
- List providers →
addons.listCapabilityProviders - Integration or connection configuration → an
integration-instancesrecord. See Build an integration - Enable/disable a provider →
addons.setCapabilityProviderEnabled - Additive field on an existing method → redeploy the providing addon only
A new capability is a framework change: codegen + a published
@dominevo/server before production nodes see the router.
Define it
packages/types/src/capabilities/<name>.cap.ts — name, scope
(system | device), mode (singleton | collection), methods with Zod
I/O and auth / kind.
The existing device capabilities, with their methods, state and events, are listed in Device capabilities.
Then:
npm run codegenWire the provider with registerNativeCap / the addon registration path your
kind uses. Export from the types barrel if codegen does not already.
A device cap with a derived UI
A device capability of the camera-settings kind declares a deviceConfig block
and implements only getOptions, getStatus and the set* methods. The
framework derives the device-page section and the save routing, so you never
write getDeviceSettingsContribution, getDeviceLiveContribution or
applyDeviceSettingsPatch.
export const dayNightCapability = {
name: 'day-night',
scope: 'device',
mode: 'singleton',
deviceTypes: [DeviceType.Camera],
deviceConfig: {
ui: { kind: 'derived-form', builderId: 'day-night', tab: 'image' },
},
// getOptions (what THIS camera supports), setSettings (a partial patch) …
}ui is either a derived-form (a generated form from a registered pure
builder) or a widget (one embedded component that saves through the cap's own
mutations). getOptions must be honest, probed from the device: the UI shows
only what you declare. deviceConfig and exposesDeviceSettings are mutually
exclusive.
Auth and tiers
Method auth is pinned in CI (check-method-tiers). Device actuation is usually
protected (device grant), not admin-only. Do not invent a parallel permission
model in the addon.
Then
- Add an addon
- AI-assisted development — agents must run codegen
Build an integration
Device integrations, service connections, and exporters — each one a typed instance record, with secrets, test, and a migration when the stored shape changes.
Device identity
Declare what a device is (MAC, serial, vendor id, machine uuid) so Dominevo can recognise the same object across integrations, and decide when a machine is a Host and when a Gateway.