You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: deepen AI chat editor integration with context chips and live preview tools
- Add context bar above chat input showing selection/cursor position and
live preview status as dismissable chips
- Send selected text as context with chat prompts so Claude sees what the
user is looking at
- Add execJsInLivePreview MCP tool to execute JS in the live preview iframe
- Enrich getEditorState with cursor/selection info and surrounding lines
- Add human-readable labels for MCP tools (Editor state, Screenshot,
Live Preview JS) instead of raw mcp__ identifiers
- Show captured screenshots inline as collapsible thumbnails
- Guide Claude to prefer specific selectors for screenshots
- Remove maxTurns cap so agent runs to completion
- Namespace all event listeners with .off before .on to prevent leaks
"Get the current Phoenix editor state: active file, working set (open files), and live preview file.",
44
+
"Get the current Phoenix editor state: active file, working set (open files), live preview file, "+
45
+
"and cursor/selection info (current line text with surrounding context, or selected text). "+
46
+
"Long lines are trimmed to 200 chars and selections to 10K chars — use the Read tool for full content.",
44
47
{},
45
48
asyncfunction(){
46
49
try{
@@ -59,8 +62,12 @@ function createEditorMcpServer(sdkModule, nodeConnector) {
59
62
60
63
consttakeScreenshotTool=sdkModule.tool(
61
64
"takeScreenshot",
62
-
"Take a screenshot of the Phoenix Code editor window. Returns a PNG image.",
63
-
{selector: z.string().optional().describe("Optional CSS selector to capture a specific element")},
65
+
"Take a screenshot of the Phoenix Code editor window. Returns a PNG image. "+
66
+
"Prefer capturing specific regions instead of the full page: "+
67
+
"use selector '#panel-live-preview-frame' for the live preview content, "+
68
+
"or '.editor-holder' for the code editor area. "+
69
+
"Only omit the selector when you need to see the full application layout.",
70
+
{selector: z.string().optional().describe("CSS selector to capture a specific element. Use '#panel-live-preview-frame' for the live preview, '.editor-holder' for the code editor.")},
0 commit comments