You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(protocol): document requiresFeature capability gates on actions/params (#2874)
Also lists the param-level visible predicate (added in #2871) in the
ActionParam field summary, which had drifted.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HGofzwNXvtahMGk8TQqXdx
requiresFeature?: string; // Public auth feature flag gate — lowered into `visible` at parse time
192
193
disabled?: boolean | ExpressionInput; // Disabled when TRUE (CEL)
193
194
194
195
// Bulk
@@ -291,6 +292,27 @@ Prefer the `record.<field>` form: it reads unambiguously and resolves identicall
291
292
292
293
This is a narrower scope than [record-alert](/docs/protocol/objectui/record-alert) conditions (which also expose `os.user` / `os.org` / `os.env`) — action predicates see the record only.
293
294
295
+
#### Capability gates: `requiresFeature`
296
+
297
+
When an action (or param) only works with an opt-in auth capability behind it — the better-auth `admin` plugin, `phoneNumber`, `twoFactor`, … — gate it with **`requiresFeature: '<flag>'`** instead of a hand-written `features.*` predicate. The flag names the public feature flag served at `/api/v1/auth/config` (see `PUBLIC_AUTH_FEATURES` in `@objectstack/spec/kernel`); at parse time the schema lowers it into the canonical `visible` predicate — `features.X == true` for opt-in flags, `features.X != false` for default-on flags — AND-composing with any explicit `visible` you also declare, then strips itself from the output. An unknown flag name fails the parse.
298
+
299
+
```yaml
300
+
# Hidden entirely when the admin plugin is off (instead of a button that 404s)
This is how the platform keeps "form follows plugin" (#2874): the UI never advertises an input the default backend would reject.
315
+
294
316
## Confirmation & Feedback
295
317
296
318
Actions express confirmation and feedback through dedicated string fields — there is no nested confirm-dialog object with `requireTyping`/`confirmLabel`.
0 commit comments