PR Summary

What problems was I solving

Builds the custom component authoring service layer on top of the ARC-2161 security substrate, enabling customers to describe custom components in plain language and receive AI-generated, brand-aware proposals complete with props schemas and function bodies.

What user-facing changes did I ship

Customers can now use the Studio's chat interface to describe custom components, receive interactive authoring guidance, semantic validation feedback, and get proposals that automatically ground against their brand standards and published component library.

How I implemented it

The authoring service uses Anthropic's structured output mode with a custom toolset (loadSkill, answer, askClarification, submitProposal) orchestrated by CustomComponentAuthoringAgent. Proposals flow through a two-stage validation: first via Anthropic's fixed-shape grammar, then via Zod schema validation. Asset URLs are resolved server-side for preview but raw IDs persist in published source. Three systematic skills (frontend-design, globe-visualization, responsive-layout) provide authoritative guidance on aesthetics, SVG globes, and fluid layout.

Description for the changelog

Adds to custom-component-service: authoring feature API surface, props descriptor-to-converter conversion, tenant context catalog, AI agent orchestration with reasoning streaming, and three authoring skills. All validation flows through the substrate service API schemas, no runtime packs added. Tests at ~900 lines validate schemas, workflow logic, tool schemas, and prompt quality with specific validation for scope control guardrails to prevent over-scoped component outputs.

Custom Component Authoring API Contracts

medium5 files
Adds authoring contracts: prop descriptors, proposal schemas, conversation turn types, attached images, and stream event schemas. Extracts asset reference fields from props contracts and resolves asset URLs in sample props.

Custom Component Authoring Workflow Components

medium6 files
Implements the AI-powered authoring agent that orchestrates proposal generation, catalog/knowledge grounding, system prompt assembly, and proposal-to-descriptor conversion.

Custom Component Authoring Conversation Logic

medium3 files
Implements the unified tool-calling loop, idle monitoring for streaming, and terminal tools (answer, askClarification, submitProposal) that drive the agent conversation flow.

Custom Component Authoring API Base Exports

low2 files
Extends CustomComponentService with CustomComponentAuthoringFeature and re-exports all authoring contracts and utilities at the root API entry point.

Custom Component Authoring Service Implementation

low2 files
Wires authoring into CustomComponentService via CustomComponentAuthoringAgent and AgentStreamManager in the service factory.

Custom Component Authoring Skills

low6 files
Defines three authoring skills (frontend-design, globe-visualization, responsive-layout) that provide guidance on aesthetics, SVG globes, and fluid layout recipes. Skills are lazily loaded via dynamic import to keep the static prompt cacheable.

Custom Component Authoring Implementation Tests

low9 files
Comprehensive test suite covering the entire authoring workflow: reasoning streaming, context loading failures, proposal conversion, skill loading, prompt construction including scope guardrails, and tool schemas.

Custom Component Authoring API Tests

low3 files
Validates authoring schemas across contract boundaries: proposal/response schemas, props descriptor kind validation (7 prop kinds), and asset resolution behavior.

Custom Component Authoring Dependencies

low2 files
Adds authoring runtime dependencies: AI SDK, logger, brand/company-knowledge/page-orchestrator services, and agent stream infrastructure.

Custom Component Service Publish Tests (Modified)

low1 file
Adds streamManager stub to service factory construction for test compatibility with authoring feature interface.