@happyvertical/smrt-fields
Layered field policy: per-field defaults, visibility tiers, labels, help, ordering, and organization locks resolved over the code seed at app, tenant, and user scope.
What it gives you
Layered field policy: per-field defaults, visibility tiers, labels, help, ordering, and organization locks resolved over the code seed at app, tenant, and user scope.
- 01Code seed, app, tenant, and user layers resolved into one policy per object
- 02Generated forms that render only the fields present in both the manifest definition and the resolved policy
- 03A form gear and an organization control panel behind two dedicated permissions
How resolution works
Four layers merge low to high: the code seed from @field({ ui }), app rows, the tenant chain, then the signed-in user. A column left empty inherits from the layer below and resetting a customization deletes the row.
Read the field policy guide →Building forms
PolicyField adopts an existing form incrementally; ObjectForm renders the fields present in both the generated definitions and the resolved policy.
Build a policy-aware form →Running it in production
The form gear, the organization control panel, the two permissions, and the difference between a personal preference and an organization rule.
Operate field policies →API and semantics
Exported functions and types, the canonical object reference format, the default-value wire contract, write validation, and caching.
Field policy API →A recipe for form customization
The package declares the fields.form-customization recipe, emitted into the manifest and knowledge recipes with its own user-facing help. It declares a server runtime.
Package UI
Component catalog and public contracts
Browse by the job you are doing. Each group shows its focused import path; the Playground tab renders the working controls and composed patterns.
Policy-aware form primitives
Wrap the inputs a hand-written form already has. Outside a provider PolicyField renders its children verbatim, so a form can adopt policy one field at a time.
@happyvertical/smrt-fields/svelteGenerated object forms
Build a create or edit form from generated browser field definitions and a resolved policy. Alternatively, register every generated collection once. Let each form request its object reference.
@happyvertical/smrt-fields/sveltePolicy administration
The per-form gear for organization and personal overrides, and the tenant-wide control panel that replays the resolved layers.
@happyvertical/smrt-fields/sveltePackage previews
Try the working views
These previews are owned by the package and use its public components. Mock mode is intended for safe browsing; live mode appears only where the package supports it.
Generated interface
REST
The exact route set comes from each model's @smrt({ api }) policy
and the application manifest—not from a second controller definition.
Policy rows are not a browsable resource, and FieldPolicy generates create, update, and delete routes. It also generates the resolve, editor-state, and policy-audit collection actions. Generated list and get remain closed because the model is not tenant-scoped. Unrestricted reads would enumerate every tenant and user row. The generated CLI mirrors that shape and is writes-only. MCP is closed entirely.
Generated interface
MCP
AI tools are generated from the methods you explicitly include. Their inputs are validated against the same model metadata used by REST and CLI.
Policy rows are not a browsable resource, and FieldPolicy generates create, update, and delete routes. It also generates the resolve, editor-state, and policy-audit collection actions. Generated list and get remain closed because the model is not tenant-scoped. Unrestricted reads would enumerate every tenant and user row. The generated CLI mirrors that shape and is writes-only. MCP is closed entirely.
Browser-native agent interface
WebMCP
The generated web definitions carry the same tool names, descriptions, and JSON Schema
inputs as MCP. smrt-web registers them with document.modelContext.
Policy rows are not a browsable resource, and FieldPolicy generates create, update, and delete routes. It also generates the resolve, editor-state, and policy-audit collection actions. Generated list and get remain closed because the model is not tenant-scoped. Unrestricted reads would enumerate every tenant and user row. The generated CLI mirrors that shape and is writes-only. MCP is closed entirely.
Generated interface
CLI
The app CLI turns manifest resources into predictable operator commands while keeping package-specific actions close to their models.
Policy rows are not a browsable resource, and FieldPolicy generates create, update, and delete routes. It also generates the resolve, editor-state, and policy-audit collection actions. Generated list and get remain closed because the model is not tenant-scoped. Unrestricted reads would enumerate every tenant and user row. The generated CLI mirrors that shape and is writes-only. MCP is closed entirely.