Skip to content

Tell the editor which fields take AI actions - #3129

Merged
pournasserian merged 2 commits into
mainfrom
3101-ai-assist-fields
Nov 15, 2026
Merged

pournasserian merged 2 commits into
mainfrom
3101-ai-assist-fields

Conversation

@pournasserian

Copy link
Copy Markdown
Member

Closes #3101

An editor with ai.use can now learn where to offer AI actions without the ai settings area. GET /api/management/v1/ai/fields needs ai.use in the site and answers { "enabled", "locale", "fields" }: whether the site names a provider, the locale of the request, and per content type the opted-in fields the caller may act on there. It runs the same opt-in and update checks as POST /ai/actions/{action}, which now share two small helpers so the two cannot drift. The body is declared as AiFields in the OpenAPI document. Spec 5.5 and the plugin's README describe the route.

Dependencies

None.

Decisions

  • Route. GET /ai/fields, beside /ai/actions/{action} and /ai/usage.
  • Enabled. True when provider is a provider the plugin has: not none, and not a removed one (anthropic, ollama). The factory is not asked, so whether the provider is configured well enough to answer (FCMS1684, FCMS1685), or whether a host's factory gives no client (FCMS1682), shows only at the call. A site that is off lists no field.
  • Which fields. Opted in, a field that takes actions, and one the caller may update (Update and UpdatableFields of IEffectiveAccess) in the locale of the request. A type the caller cannot read is left out even if it may update it. A type with no such field is left out. Fields the caller may only set on create are left out, because the actions refuse them too (FCMS3103).
  • Locale. The locale of the request (?locale= or X-Cms-Locale), echoed back in locale. A grant limited to other locales lists nothing.
  • Shape. fields is a map of type to field names in schema order, like the fields setting. No provider, model, endpoint or key, and nothing about whether a key is set.
  • No new error codes or log ids. The AI assist permission provider file is unchanged.

Tests

AiFieldsTests in tests/FluentCMS.Plugins.AiAssist.Tests covers each acceptance item:

  • an editor with ai.use gets the opted-in fields it may update and not those it may only read, and the actions agree;
  • types it cannot read and create-only fields are left out;
  • the locale of a grant is followed;
  • none, a bare site and a removed provider are off;
  • a caller without ai.use gets 403;
  • the raw JSON holds no provider, model, endpoint or key;
  • the OpenAPI document lists the route with the AiFields body.

AiSiteTests checks that the route answers 404 where the plugin is disabled. The full AI assist suite passes (133). dotnet build -c Release -warnaserror, the SDK, Core and Architecture tests and markdownlint pass.

@pournasserian pournasserian added type:feature New capability area:api Delivery and Management APIs, OpenAPI, errors and caching labels Nov 15, 2026
@pournasserian
pournasserian enabled auto-merge (squash) November 15, 2026 16:36
@pournasserian
pournasserian merged commit aba8fab into main Nov 15, 2026
14 checks passed
@pournasserian
pournasserian deleted the 3101-ai-assist-fields branch November 15, 2026 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:api Delivery and Management APIs, OpenAPI, errors and caching type:feature New capability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tell the editor which fields take AI actions

1 participant