Skip to content

feat: make ai plugin page context aware#57

Open
olliethedev wants to merge 11 commits intomainfrom
feat/ai-chat-improvements-2
Open

feat: make ai plugin page context aware#57
olliethedev wants to merge 11 commits intomainfrom
feat/ai-chat-improvements-2

Conversation

@olliethedev
Copy link
Collaborator

@olliethedev olliethedev commented Feb 25, 2026

Changes in this PR:

  • make ai plugin page context aware so that ai chat widget can summarize pages or interact with pages (pre-fill forms, interact with ui-builder state etc)
screenshot_2026-02-25_at_4 35 16___pm

Feb-28-2026 20-49-26


Note

Medium Risk
Changes the AI chat request schema and tool-selection logic, and introduces new client-side tool dispatch that can mutate page state; also adds new server-side mutation helpers that bypass hooks, which could be misused if called from user-facing paths.

Overview
Adds route-aware AI context to the ai-chat plugin: pages can register routeName, pageDescription, suggestions, and client-side tool handlers via new PageAIContextProvider + useRegisterPageAIContext, and the chat UI surfaces the active route badge.

Extends the chat request to send pageContext + availableTools, appends context to the system prompt, and (when enablePageTools is on) merges a filtered set of built-in/consumer page tool schemas into streamText; the client dispatches tool calls to registered handlers and auto-resubmits once tool outputs are provided.

Updates examples and docs to showcase the floating widget, external widget control props (defaultOpen, showTrigger, sizing), and adds E2E coverage for page context/tool calls plus a new WealthReview demo tool that writes to CMS/Kanban using newly introduced server-side mutation APIs (cms.createContentItem, kanban mutations) that explicitly bypass authorization hooks.

Written by Cursor Bugbot for commit 2d85184. This will update automatically on new commits. Configure here.

@vercel
Copy link

vercel bot commented Feb 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
better-stack-docs Ready Ready Preview, Comment Mar 1, 2026 2:40am

Request Review

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant