AI integration
contract.
Scaffold only: no provider or model is connected. The AI Lab currently prepares and exports request JSON locally. It does not send data to an AI service or automatically modify sites.
Extension points
public/studio.js prepares the versioned request envelope. lib/ai/contract.js defines the validation boundary. GET /api/studio/ai/status describes capabilities and POST /api/studio/ai/plan intentionally returns 503 AI_PROVIDER_NOT_CONFIGURED for now.
Safe integration principles
- Keep API keys and provider calls server-side.
- Return structured operations, not executable HTML or JavaScript.
- Validate all operations against the current document and stable section/page IDs.
- Show a diff and require explicit user approval before applying changes.
- Keep publish separate from AI planning and apply.
- Snapshot before applying changes, and test undo/restore and malformed provider outputs.
Allowed operations (initial contract)
site.updateSettings page.add · page.update · page.delete section.add · section.update · section.remove section.move · section.duplicate
Read docs/AI_INTEGRATION.md for the full request shape, future adapter responsibilities, limits and tests to add before enabling a provider.