Skip to content

ai-integrations: dedicated package + catalog-model registration for AiResource agent type #4186

Description

@johnmcollier

Summary

Move the AiResource spec.type: agent typed schema out of ai-experience-common into a dedicated package, and wire catalog-model registration the way upstream skill/rule and MCP mcp-server validators are registered (createCatalogModelLayer / declareKindVersion with specType: 'agent' + catalogModelExtensionPoint.addModelSource).

Today PR #4164 (issue #4128 / RHIDP-15867) adds types, KindValidator, type guard, JSON schema, examples, and unit tests under ai-experience-common. That package also carries ai-experience shared artifacts that consumers do not need when they only want the agent catalog type. The validator is also exported but not registered with the catalog entity model, so catalog ingest still only applies the default AiResource schema (type / lifecycle / owner) and does not enforce agent-specific fields (e.g. non-empty spec.instructions) via the model layer.

Tasks

  • Create a dedicated package in workspaces/ai-integrations/plugins/ for the agent AiResource catalog model (types, JSON schema, KindValidator, type guard, and CatalogModelLayer / entity-model export). Prefer a name that signals catalog-model scope (e.g. catalog-model-ai-resource-agent) rather than nesting under ai-experience-*
  • Move the agent schema implementation out of @red-hat-developer-hub/backstage-plugin-ai-experience-common into the new package; remove the agent public exports from ai-experience-common (and regenerate API reports / adjust imports)
  • Export an agent CatalogModelLayer mirroring MCP/skill/rule (declareKindVersion.v1 with specType: 'agent' and the agent JSON schema)
  • Add a thin catalog backend module (new package or colocated backend entry) that registers the agent model via catalogModelExtensionPoint.addModelSource, following @backstage/plugin-catalog-backend-module-ai-model
  • Wire the backend module into the workspace packages/backend (and any required app-config / dynamic-plugin packaging for this workspace)
  • Add/adjust unit tests for the moved package; keep schema accept/reject coverage; add a registration smoke test if practical
  • Add a changeset for the new package (and a changeset for any ai-experience-common public API removal if that lands in the same PR)
  • Update package README with a short agent field table / link to examples/ai-resource-agents.yaml

Acceptance Criteria

  • Agent types/validator/schema live in a dedicated package that does not pull in unrelated ai-experience shared APIs
  • ai-experience-common no longer exports the agent AiResource surface
  • Agent specType is registered with the catalog model so ingest uses the agent schema (missing/empty/wrong-type spec.instructions rejected at the catalog-model layer)
  • Workspace backend loads the registration module in local/dev
  • Tests and changesets cover the move + registration
  • No OpenAI Agents SDK dependency

Specifications

All paths below are relative to workspaces/ai-integrations/.

  • openspec/changes/airesource-agent-typed-schema/design.md (especially D3 field mapping, D10 HOW — skill/rule + MCP registration pattern)
  • openspec/changes/airesource-agent-typed-schema/tasks.md (task 2.3 wire validator into catalog model / backend module registration)
  • openspec/changes/airesource-agent-typed-schema/specs/ai-resource-agent-schema/spec.md

Out of Scope

Context

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions