Skip to content

Conversation

@yran-godaddy
Copy link

No description provided.

vyung-godaddy and others added 30 commits November 12, 2025 11:45
- Rebrand from Atlas to GoDaddy ANS Chat Sidebar
- Add support for Anthropic Claude and OpenAI providers
- Implement browser automation tools for Anthropic (navigate, click, type, screenshot)
- Add custom base URL and model name configuration
- Implement per-tab isolated chat history
- Add automatic page context extraction
- Fix auto-scroll during streaming responses
- Update header to show correct provider/model

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Fixed MCP tool execution by bypassing broken client.callTool() method in AI SDK.
The AI SDK's experimental_createMCPClient has a bug where client.callTool() hangs
forever with StreamableHTTPClientTransport. Implemented workaround using direct
transport.send() with onmessage handler.

Changes:
- mcp-service.ts: Rewrote executeToolCall() to use transport layer directly
- mcp-tool-router.ts: Added formatToolsForAnthropic() to unwrap jsonSchema
- trusted-business-service.ts: Fixed URL extraction from protocolExtensions.mcp.remotes[0].url
- anthropic-browser-tools.ts: Added AbortSignal validation
- anthropic-service.ts: Added AbortSignal validation
- sidepanel.tsx: Added MCP initialization for browser tools, fixed missing onComplete parameter
- types.ts: Added serverUrl to MCPConnection interface
- test-mcp-client.mjs: Test script proving transport.send() works in 33ms

Result: MCP tools now execute successfully, returning "Quack Time - A Duck Blog" in 33ms.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Settings Page Updates:
- Renamed "Custom Base URL" to "GoCode URL" with consistent width
- Renamed "Anthropic API Key" to "GoCode Key" (static label for all providers)
- Made GoCode URL and GoCode Key labels static regardless of provider selection
- Hidden Composio API Key field from UI
- Removed provider-specific help text from GoCode Key field
- Updated service count from "400+" to "115 Million" in Business Services
- Added Claude Sonnet 4.5 (claude-sonnet-4-5-20250929) to model selection
- Fixed field widths: GoCode URL, GoCode Key, and ANS API Token now use same width

Sidepanel Updates:
- Added MODEL_DISPLAY_NAMES mapping for friendly model names
- Added getModelDisplayName() helper function
- Updated chat header to show friendly model names (e.g., "Claude Sonnet 4.5")
- Applied display names to browser tools mode and warning banners

Result: Cleaner UI with consistent naming and proper model display names

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
## A2A Protocol Support
- Add A2A service with direct HTTP POST to /invoke endpoint
- Implement site detection and automatic agent matching
- Add trusted agent badge UI with opt-in/out control
- Filter A2A servers from MCP connection process
- Support domain matching with/without www prefix
- Convert agent names for display (www-godaddy-com -> www.godaddy.com)
- Initialize A2A service on extension load
- Route all messages to site's A2A agent when opted in
- Update trusted badge on URL changes via chrome.tabs.onUpdated

## Browser Tools Fixes
- Fix tool call format: keep content as arrays instead of stringified JSON
- Add smart input detection: automatically find and click search boxes when nothing is focused
- Limit conversation history to 6 recent messages to prevent context overflow
- Reduce page context from 3000 to 800 chars in browser tools mode

## UX Improvements
- Add loading state for input field: show "Loading settings..." until ready
- Disable input/submit until settings are loaded to prevent lost messages
- Fix infinite loop in useEffect by using empty dependency array and refs
- Remove unnecessary settings check from trusted agent detection

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
## Context Management Improvements
- Reduce initial history to 2 messages (only keep last user message)
- Reduce loop limit to 6 messages during tool execution
- Reduce page context from 500 to 300 chars in browser tools mode
- Add in-loop trimming to prevent context accumulation

## Remove Screenshot Tool
- Remove screenshot tool from Anthropic browser tools
- Screenshots consume 50K-150K tokens each (25-75% of 200K context!)
- Anthropic uses text-based navigation, not vision
- Only Gemini Computer Use needs screenshots for visual element location

## Better Error Messages
- Show clear "Context limit exceeded. Please start a new chat" message
- Replace cryptic API error with user-friendly guidance

This change provides massive context savings and eliminates the "Input is too long"
errors that were blocking multi-step browser automation tasks.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Added persistent blue border overlay and "Take Over Control" button to give
users clear visual indication when AI is controlling the browser.

Key Features:
- Blue border (#007AFF) with subtle glow effect around browser window
- "Take Over Control" button centered at bottom of page
- Overlay appears immediately when ANY browser tool executes
- Overlay persists throughout entire automation session
- Overlay survives page navigations by re-showing after each action
- Overlay disappears only when automation completes or user clicks button

Implementation:
- content.ts: Overlay creation/destruction functions with DOM ready checks
- sidepanel.tsx: Show overlay before every browser tool execution
- sidepanel.tsx: Re-show overlay after every tool (handles navigation)
- sidepanel.tsx: Hide overlay on completion, error, or user abort
- Works with both Anthropic and Gemini browser tools

User Experience:
- Clear visual feedback during automation (blue border)
- Non-intrusive design (pointer-events: none on border)
- Single-click abort button for immediate control takeover
- Overlay maintains visibility across page navigations and all actions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Auto-scroll improvements:
- Fixed messagesEndRef placement - moved inside scrollable container
- Increased scroll threshold from 100px to 200px for more aggressive auto-scroll
- Added block: 'end' parameter for more reliable bottom scrolling
- Added incremental message updates in Gemini Computer Use
- Messages now update after each text chunk and tool execution
- Auto-scroll triggers more frequently during browser automation

Click accuracy improvements:
- Added smart input detection when clicking near search boxes
- Searches for input fields inside clicked containers
- Finds nearby inputs within 100px radius when coordinates are inaccurate
- Auto-adjusts coordinates to center of found input field
- Explicitly focuses input fields after clicking
- Uses distance calculation for fuzzy targeting

User Experience:
- Chat automatically stays scrolled to bottom during automation
- Users no longer need to manually scroll to see latest messages
- Search box clicks are much more accurate (e.g., Amazon search)
- Works even when coordinates are slightly off target

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Added manual-trigger workflow for building Dev, Test, and Prod environments:

Workflow features:
- Manual trigger from GitHub Actions tab
- Environment selection dropdown (dev, test, prod)
- Passes BUILD_ENV variable to npm run build
- Uploads artifacts to GitHub for download
- 30-day artifact retention
- Build summary with environment info

Build output structure:
- Dev builds → artifacts/Dev/
- Test builds → artifacts/Test/
- Prod builds → artifacts/Prod/

Vite config updates:
- Reads BUILD_ENV from environment variable (defaults to 'dev')
- Outputs to artifacts/{env}/ based on BUILD_ENV
- Makes BUILD_ENV available in extension via import.meta.env.BUILD_ENV
- Logs build environment and output directory

Local usage:
BUILD_ENV=dev npm run build   → artifacts/Dev/
BUILD_ENV=test npm run build  → artifacts/Test/
BUILD_ENV=prod npm run build  → artifacts/Prod/

GitHub Actions usage:
1. Go to Actions tab on GitHub
2. Select "Build Extension" workflow
3. Click "Run workflow"
4. Select environment (dev/test/prod)
5. Download artifact: extension-{env}-{run_number}.zip

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Restructured README to prioritize GoDaddy ANS use case:

Features section:
- Highlighted browser automation and ANS integration
- Moved Composio to last as optional feature

Getting Started section:
- Split into two clear paths:
  1. For GoDaddy Employees (ANS Extension)
     - VPN connection steps
     - ANS authentication via www.dev-godaddy.com
     - GoCode and ANS credential setup
  2. For Developers (Building from Source)
     - BUILD_ENV environment variable usage
     - Multi-environment build instructions

Composio content:
- Moved to separate section at end
- "For Composio Users (Tool Router Mode)"
- Includes prerequisites, setup, and usage examples
- Composio-specific resources grouped together

References:
- Removed Composio links (now in Composio section)
- Added GoDaddy ANS documentation link

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…ron browser

- Add support for Google Gemini, Anthropic Claude, and OpenAI in chat mode
- Implement Anthropic computer use capabilities for browse mode
- Fix GoCode API endpoint compatibility with custom base URLs
- Update IPC handlers to pass provider, model, and baseURL parameters
- Refactor ComputerUseService to route between Gemini and Anthropic implementations
- Add Anthropic Messages API integration with computer_20241022 tool
- Map Anthropic computer actions (left_click, type, key) to browser automation
- Update preload bridge and renderer services for multi-provider support
- Install @ai-sdk/anthropic and @ai-sdk/openai packages

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Use app.getAppPath() instead of __dirname for production builds
- Fixes blank screen issue when loading from asar archive
- Properly load renderer HTML and preload script in packaged app
- Add dev tools in production mode for debugging

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add isDestroyed() check before cleaning up BrowserView
- Wrap cleanup in try-catch to handle already-destroyed objects
- Fixes "Object has been destroyed" error on app close

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add magical blue overlay (50% opacity) with sparkle effects when browser actions occur
- Compact tool execution messages with smaller font and reduced spacing
- Add color differentiation for page context in user messages (blue scrollable box)
- Fix message fragmentation - AI responses now flow as unified text
- Compact JSON formatting for tool parameters (single line instead of multi-line)
- Version bumped to 1.1.9

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add ZIP packaging for easy distribution
- Create both ZIP and unzipped artifact uploads
- Organize artifacts by environment (dev/test/prod)
- Add comprehensive build summary with:
  - Version and build number info
  - Download instructions
  - Installation steps for Chrome
- Extend artifact retention to 90 days

This makes it easier for users to find and download the correct
build artifacts from the GitHub Actions UI.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Fix ZIP path from artifacts directory (use ../../ instead of ../../../)
- Add validation to check artifacts directory exists
- Add helpful error messages if build artifacts are missing

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add Home page with overview and quick links
- Add Installation guide for end users
- Add Building guide for different environments
- Add Architecture documentation with system diagrams
- Add Artifacts guide for GitHub Actions downloads
- Add Development guide for contributors
- Add README with upload instructions

Wiki content covers:
- Installation from artifacts and source
- Build process for dev/test/prod
- Technical architecture and data flow
- Artifact download and usage
- Development workflow and code style
- Common issues and troubleshooting

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Change browserToolsEnabled initial state from false to true
- Browser automation tools (navigate, click, type, scroll) now active on startup
- Users can still disable via the ○/◉ button in sidebar if needed
- Update version to 1.2.0

This improves the default user experience by enabling computer use
capabilities without requiring manual activation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add dynamic job name showing environment (e.g., "Build Extension - prod")
- Update version in build summary from 1.1.9 to 1.2.0
- Makes it easier to identify build jobs in GitHub Actions UI

Before: All jobs showed "Build Extension"
After: Jobs show "Build Extension - dev", "Build Extension - test", "Build Extension - prod"

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add run-name field to display environment in workflow run list
- This makes "Build Extension - dev/test/prod" visible in the Actions UI
- Previous change only affected job name within the run details

The run-name field controls what appears in the GitHub Actions
workflow runs list, making it easy to identify which environment
was built at a glance.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Change browserToolsEnabled initial state from true back to false
- Users must explicitly enable browser tools by clicking the ○ button
- Update version to 1.2.1
- Update workflow build summary to show 1.2.1

This provides a safer default experience, requiring users to opt-in
to browser automation capabilities rather than having them active
immediately on startup.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add ABORT_ALL_BROWSER_OPERATIONS message type
- Background script sets abort flag when user clicks "Take Over"
- All browser operations (navigate, click, type, scroll) check abort flag
- Operations return "Operation aborted by user" error if flag is set
- Abort flag clears automatically after 1 second
- Update version to 1.2.2

When users click "Take Over Control", the extension now:
1. Aborts the AI API call (existing)
2. Sets abort flag in background script (new)
3. Prevents any queued browser operations from executing (new)
4. Hides the browser overlay (existing)

This gives users immediate control and stops all pending automation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add isUserAborted flag in content script
- Block overlay from showing for 5 seconds after "Take Over" is clicked
- Immediately hide overlay before sending abort message
- Add parentNode check before removing elements
- Enhanced logging for debugging overlay behavior
- Update version to 1.2.3

This fixes the issue where the overlay would remain visible or
reappear after clicking "Take Over Control". The abort flag
prevents any new overlay requests from showing for 5 seconds,
giving the user full control.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Log received click coordinates (x, y)
- Log viewport dimensions
- Log document scroll position
- Log element found at coordinates
- Version 1.2.4

This will help diagnose why clicks are happening at incorrect
positions. Check browser console (F12) when AI attempts to click
to see the coordinate information.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- When AI clicks near an input, find the largest visible input field
- Search all visible inputs/textareas/contenteditable elements
- Select the largest one by area (likely the main chat input)
- Update coordinates to center of found input
- Add enhanced logging for debugging
- Version 1.2.5

This helps when AI is clicking blindly without screenshots by
automatically finding and targeting the most prominent input field
on the page when coordinates miss the actual input.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add screenshot tool to Anthropic browser tools
- Format screenshot results as base64 images for Claude vision API
- Enable Claude to see the page before clicking/interacting
- This fixes blind clicking issues where AI guesses coordinates
- Version 1.3.0

With screenshots, Claude can:
- See where UI elements are located
- Click accurately on buttons, inputs, etc.
- Navigate complex interfaces visually
- Provide better context-aware interactions

The AI will now automatically take screenshots when needed
to understand page layout before performing actions.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add detailed system prompt instructing Claude to take screenshots
- Enforce workflow: screenshot → analyze → click → type
- Tell Claude to ALWAYS screenshot before clicking or typing
- Provide step-by-step interaction instructions
- Version 1.3.1

New workflow Claude will follow:
1. Navigate to URL (if needed)
2. Take screenshot to see the page
3. Identify target element coordinates from screenshot
4. Click at those coordinates
5. Type text (if needed)

This ensures Claude uses its vision capabilities proactively
instead of guessing coordinates blindly.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add GET_VIEWPORT_SIZE handler in content script
- Pass viewport dimensions (width, height, devicePixelRatio) with screenshot
- Include viewport info in text description to Claude
- Tell Claude exact coordinate bounds: (0,0) to (width,height)
- Version 1.3.2

This fixes coordinate mismatch issues where Claude sees a screenshot
but doesn't know the actual viewport size, causing clicks to be
off-target. Now Claude knows the exact bounds for coordinates.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add red/yellow circle marker at exact click coordinates
- Shows for 3 seconds where Claude is trying to click
- Log devicePixelRatio to diagnose scaling issues
- Version 1.3.3

This helps diagnose coordinate mismatch issues by showing
exactly where the extension thinks Claude is clicking.
If the marker appears in the wrong place, it indicates a
coordinate scaling or interpretation problem.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add detailed CRITICAL COORDINATE INSTRUCTIONS in system prompt
- Explain coordinate system with multiple examples
- Tell Claude to measure from top-left and estimate center points
- Add comprehensive coordinate guide with each screenshot
- Include corner coordinates and center point calculations
- Emphasize clicking CENTER of elements, not edges
- Version 1.4.0

System prompt now includes:
- Visual coordinate examples (top-right, center, etc.)
- Step-by-step workflow for measuring in screenshots
- Explicit instruction to retry with adjusted coordinates if needed

Screenshot results now include:
- All corner coordinates labeled
- Center point calculated
- Clear X/Y axis explanations
- Step-by-step clicking instructions

This should dramatically improve Claude's ability to click accurately
by teaching it how to measure and estimate coordinates from screenshots.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
BREAKING CHANGE: Changed browser automation workflow to prefer HTML DOM methods

Changes:
- Added new `clickElement` tool that uses CSS selectors or text content to find elements
- Enhanced `click` action in content script to support text-based element searching
- Searches through buttons, links, inputs, and elements with onclick/aria-label
- Updated system prompt to instruct Claude to try DOM methods FIRST before screenshots
- Enhanced `getPageContext` to include interactive elements with their selectors
- Screenshots are now only used as fallback when DOM methods fail

Benefits:
- More reliable clicking (CSS selectors don't depend on viewport coordinates)
- More efficient (no need to process/send large screenshots for every action)
- Lower token costs (screenshots consume ~1,500-2,000 tokens each)
- Works better with dynamic content and responsive layouts

Version: 1.4.0 → 1.5.0
vyung-godaddy and others added 30 commits November 24, 2025 13:07
Fixed scrolling failure on pages with custom scroll containers:

**Problem:**
Scroll commands would fail silently on many modern web apps (JIRA,
Slack, Notion, etc.) that use custom scrollable divs instead of
window scroll.

**Root Cause:**
The code used `element.scrollBy()` method which is NOT supported
on all DOM elements:

```typescript
// Before (content.ts:1054, 1062)
scrollableElement.scrollBy({ top: -scrollAmount, behavior: 'smooth' });
scrollableElement.scrollBy({ top: scrollAmount, behavior: 'smooth' });
```

**Browser Compatibility:**
- `scrollBy()` works on: Window object
- `scrollBy()` FAILS on: Most custom DIV scrollable containers
- `scrollTop` property works on: ALL scrollable elements

**Solution:**
Use different scroll methods based on element type:

```typescript
// After (content.ts:1055-1062, 1072-1080)
if (isWindow) {
  window.scrollBy({ top: scrollAmount, behavior: 'smooth' });
} else {
  // Use scrollTop for universal compatibility
  const maxScroll = scrollableElement.scrollHeight - scrollableElement.clientHeight;
  const targetScroll = Math.min(maxScroll, scrollableElement.scrollTop + scrollAmount);
  scrollableElement.scrollTop = targetScroll;
}
```

**Benefits:**
- ✅ Works on window scroll
- ✅ Works on custom div containers
- ✅ Works on overflow:auto/scroll elements
- ✅ Works on Jira, Slack, Notion, etc.
- ✅ Proper boundary checking (doesn't scroll past end)

**Testing:**
Scroll commands should now work on all pages, including SPAs with
custom scrollable containers.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…gging

Fixed scrolling not working on SharePoint and Office Online documents.

**Problem:**
Scrolling failed on SharePoint/Office Online documents because the
scroll detection couldn't find Office's custom document canvases.

From user screenshot: AI was falling back to keyboard arrow keys
instead of scroll commands, indicating scroll detection failure.

**Root Cause:**
Office Online documents use special containers that weren't detected:
- Word Online: #WACViewPanel_EditingElement
- Excel Online: #m_excelWebRenderer_ewaCtl_scrollableContainer
- Generic: [role="document"], .CanvasElement

**Solution:**

1. **Added Office Online Detection** (lines 968-989):
   ```typescript
   const officeCanvases = [
     document.querySelector('#WACViewPanel_EditingElement'),  // Word Online
     document.querySelector('.CanvasElement'),                // Office canvas
     document.querySelector('[role="document"]'),             // Generic document
     document.querySelector('#m_excelWebRenderer_ewaCtl_scrollableContainer'), // Excel
     document.querySelector('.ewaCtl_table')                  // Excel table
   ].filter(el => el !== null);
   ```

2. **Comprehensive Logging** (lines 1050-1074):
   - Log scroll target selection
   - Log current position and dimensions
   - Log actual scroll delta after scrolling
   - Warning if scroll doesn't move (detection issue)

3. **Better Error Detection**:
   ```typescript
   if (actualDelta === 0 && beforeScroll < maxScroll) {
     console.warn('⚠️ Scroll didn't move! This might indicate a scrolling issue');
   }
   ```

**Debugging Info Now Available:**
- 📍 Final scroll target details
- 🔽/🔼 Scroll attempt with before/after positions
- ⚠️ Warnings when scroll fails
- Element type, class, dimensions logged

**Testing:**
1. Reload extension
2. Open SharePoint document
3. Open DevTools Console
4. Ask to scroll down
5. Check console logs for detailed scroll info

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Added comprehensive SharePoint instructions to fix AI using wrong
scroll methods.

**Problem:**
AI was avoiding the scroll command on SharePoint and instead:
- Clicking on document
- Using arrow keys repeatedly
- None of these worked

**Root Cause:**
No site-specific instructions for SharePoint, so AI had no guidance
on how to handle Office Online documents. AI likely learned from
past failures to avoid scroll and use keyboard shortcuts instead.

**Solution:**
Added SharePoint-specific instructions (*.sharepoint.com):

1. **Explicit Scroll Guidance:**
   - ✅ CORRECT: scroll({direction: "down", amount: 500})
   - ❌ WRONG: Click document, then pressKey({key: "ArrowDown"})
   - "ALWAYS use the scroll tool, not arrow keys"
   - "DO NOT click first - just use scroll directly"

2. **Error Handling:**
   - Try scroll max 2 times
   - If fails, report to user clearly
   - Don't repeatedly try arrow keys as fallback

3. **Common SharePoint Workflows:**
   - Reading documents (scroll-based navigation)
   - Navigating SharePoint sites
   - Searching documents (Ctrl+F)

**Why Arrow Keys Don't Work:**
SharePoint/Office Online documents use:
- Custom event handlers
- Virtual scroll containers
- Canvas rendering
- Arrow keys often captured by UI, not document

**Testing:**
1. Reload extension
2. Open SharePoint document
3. Ask "scroll down"
4. AI should now use scroll() directly without clicking
5. Check console for scroll detection logs

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Fixed critical bug where PageDown, ArrowDown, and other navigation
keys were completely ignored by browsers.

**Problem:**
User reported: "why is PageDown keypress event not working"
All navigation keys (PageDown, ArrowDown, ArrowUp, etc.) were failing
silently with no effect.

**Root Cause:**
Line 1312 was generating WRONG key codes for special keys:

```typescript
// BEFORE (BROKEN)
code: keyToPress === 'Tab' ? 'Tab' : keyToPress === 'Escape' ? 'Escape' : `Key${keyToPress}`,
```

This generated:
- PageDown → code: 'KeyPageDown' ❌ (should be 'PageDown')
- ArrowDown → code: 'KeyArrowDown' ❌ (should be 'ArrowDown')
- Home → code: 'KeyHome' ❌ (should be 'Home')

The `Key` prefix is ONLY for letter keys (KeyA, KeyB, etc.), not
navigation keys. Browsers ignore events with malformed codes.

**Solution:**

1. **Added getKeyCode() function** (lines 1311-1345):
   - Navigation keys: ArrowUp, ArrowDown, PageUp, PageDown, Home, End
   - Special keys: Tab, Escape, Enter, Backspace, Delete, Space
   - Function keys: F1-F12
   - Letter keys: KeyA-KeyZ (with Key prefix)
   - Digit keys: Digit0-Digit9

2. **Added getKeyCodeValue() function** (lines 1348-1375):
   - Proper keyCode values for compatibility with older apps
   - PageDown: 34, ArrowDown: 40, etc.

3. **Added logging** (line 1380):
   ```
   ⌨️  Pressing key: "PageDown" (code: PageDown, keyCode: 34)
   ```

**Before/After:**

| Key | Before | After |
|-----|--------|-------|
| PageDown | code: 'KeyPageDown' ❌ | code: 'PageDown', keyCode: 34 ✅ |
| ArrowDown | code: 'KeyArrowDown' ❌ | code: 'ArrowDown', keyCode: 40 ✅ |
| Home | code: 'KeyHome' ❌ | code: 'Home', keyCode: 36 ✅ |
| A | code: 'KeyA' ✅ | code: 'KeyA', keyCode: 65 ✅ |

**Testing:**
1. Reload extension
2. Press PageDown, ArrowDown, etc.
3. Check console: "⌨️  Pressing key: ..."
4. Keys should now work properly

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Filter out messages with empty content in both anthropic-service.ts and
anthropic-browser-tools.ts to prevent API errors. Anthropic API requires
all messages to have non-empty content except for the optional final
assistant message.

Handles both string and array content types, logging filtered messages
for debugging.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Added validation to check for empty/missing API keys before making
API requests in both anthropic-service.ts and anthropic-browser-tools.ts.

Also improved error handling in anthropic-service.ts to handle non-JSON
error responses (HTML error pages) with better error messages.

Changes:
- Validate API key is not empty before making requests
- Improved error message: "Anthropic API key is not configured. Please add it in Settings"
- Added try-catch for JSON parsing of error responses
- Show helpful message when API returns HTML instead of JSON

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Updated API key validation error messages to mention both GoCode Key
and Anthropic API key, since the extension supports both direct Anthropic
API usage and GoDaddy's internal GoCode API.

Error message changed from:
"Anthropic API key is not configured..."

To:
"API key is not configured. Please add your GoCode Key or Anthropic API key..."

This makes it clearer for internal GoDaddy users who use GoCode.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
All API requests now route through GoCode endpoint only. No direct
Anthropic API access is allowed.

Changes:
- Default baseUrl to GoCode production endpoint in both anthropic-service.ts
  and anthropic-browser-tools.ts
- Updated error messages to say "GoCode Key" instead of "API key" or
  "Anthropic API key"
- Updated settings UI:
  - Placeholder: "Enter your GoCode key"
  - Added help text with link to get GoCode API key
- Updated code comments to reference GoCode instead of Anthropic

Default endpoint: https://caas-gocode-prod.caas-prod.prod.onkatana.net

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Synthetic keyboard events have isTrusted=false and browsers block them
from triggering default actions (scrolling, navigation) for security.

Added manual scroll implementation for navigation keys:
- PageDown: Scroll one viewport height down
- PageUp: Scroll one viewport height up
- ArrowDown: Scroll 40px down
- ArrowUp: Scroll 40px up
- Home: Scroll to top
- End: Scroll to bottom

This ensures keyboard navigation works even though synthetic events
cannot trigger browser default scroll behavior.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
When GoCode API endpoint is unreachable (network error), show a
user-friendly message instead of generic "Failed to fetch" error.

New error message explains:
🔌 Cannot reach GoCode API endpoint.

This usually means:
• You are not connected to GoDaddy VPN
• The GoCode service is temporarily unavailable

Please connect to VPN and try again.

Changes:
- Wrapped fetch calls in try-catch for network errors
- anthropic-service.ts: Main API calls
- anthropic-browser-tools.ts: Both main API and summarization calls
- Summarization silently falls back to original messages on network error

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Changed ANS discovery service URL from internal dev endpoint to
OTE (Operational Test Environment) endpoint for production readiness.

Changes:
- trusted-business-service.ts: API_URL constant updated
- settings.tsx: Updated endpoint display and sign-in URL
- README.md: Updated documentation links (2 locations)
- test-url-extraction.mjs: Updated mock data URLs (3 locations)

Old endpoint: https://ra.int.dev-godaddy.com
New endpoint: https://api.ote-godaddy.com

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Changed MCP protocol discovery from protocolExtensions.mcp to
protocolExtensions.mcp1 to match updated API format.

Changes:
- trusted-business-service.ts: Look for mcp1 instead of mcp
- test-url-extraction.mjs: Updated test to match new format
- Updated diagnostic logging to show mcp1RemotesUrl

Old path: protocolExtensions.mcp.remotes[0].url
New path: protocolExtensions.mcp1.remotes[0].url

Example format:
{
  "mcp1": {
    "url": "",
    "remotes": [
      {
        "url": "https://lyrics.agenth.godaddy.com/mcp"
      }
    ]
  }
}

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Added serverUrl to MCP tool metadata and updated UI to show the
actual MCP server URL instead of empty parentheses.

Changes:
- types.ts: Added serverUrl field to MCPToolWithOrigin interface
- mcp-service.ts: Include serverUrl when collecting tools with origin
- sidepanel.tsx: Display tool.serverUrl instead of non-existent tool.origin

UI now shows:
🔌 MCP Tools (1)
tool_name (https://lyrics.agenth.godaddy.com/mcp)

Instead of:
tool_name ()

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add audioLink field to Message interface
- Capture audio links from MCP tool results (both browser tools enabled/disabled paths)
- Display inline audio player with lyrics header and site footer
- Increase MCP tool timeout from 30s to 5 minutes for music generation
- Extract audioLink from JSON-stringified MCP responses
- Improve service mapping with auto-add and persistent storage
- Use proper React immutability for message updates

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
- Add immediate audioLink attachment when MCP tool returns audio
- Implement retry logic (5 attempts, 100ms delay) to handle timing issues
- Add fallback retry in onComplete callback (3 attempts, 200ms delay)
- Improve React key to include audioLink for forced re-render
- Add comprehensive logging for debugging audio attachment flow
- Fix intermittent audio player not displaying issue
- Add onToolStart callback to streamAnthropicWithBrowserTools to notify when tool execution starts
- Show typing indicator ("...") immediately after [Executing: toolName] message appears
- Clear typing indicator when tool completes, errors, or when audio player is shown
- Ensure typing indicator only shows on last assistant message and not when audio player is present
- Clear isToolExecuting state at start of each new message to prevent stuck state
- Add check to ensure A2A server is enabled before routing
- Prioritize MCP over A2A when MCP is enabled with mappings
- Prevent A2A routing when A2A is disabled or not configured
- Remove auto-creation of enabled A2A configs
- Only show MCP/A2A tools when trusted mappings exist
- Fix response object handling in A2A sendMessage
…sabled

- Set MCP client.tools() timeout to 3 seconds with proper cleanup
- Add explicit system prompt warnings to prevent AI from writing [Executing: ...] text when browser tools are disabled
- Add text filtering to remove [Executing: ...] patterns and navigation claims from AI responses when browser tools are disabled
- Update system prompts to conditionally hide browser tool instructions when disabled
- Ensure AI tells users to navigate manually when browser tools are not available
- Group ANS Authentication, Site-Specific Service Mappings, and Active Mappings into unified workflow
- Move tabs (Discover Services, Custom, Site Mappings) to top of Step 2
- Set 'Discover Services' as default tab
- Make Step 3 (Show Active Mappings) always visible regardless of active tab
- Add visual connectors between steps for better workflow clarity
- Add comprehensive guide for mapping *.godaddy.com to agent service
- Include screenshots for each step (Step 1, Step 2a, Step 2b, Step 3)
- Add Quick Reference section with exact values needed
- Include troubleshooting section and summary checklist
- Add screenshots directory with README describing each screenshot
- Add Chrome Extension Setup section with VPN requirement
- Add instructions for downloading builds from GitHub Actions
- Add extension refresh/update instructions
- Add Step 4: Final Verification with badge check and service test
- Update Summary section to include all steps
Move early return statement after all React hooks to comply with hooks rules.
Previously, the welcome screen returned before useMemo and useEffect hooks
were called, causing inconsistent hook counts between renders when users
first installed the extension and configured settings.

Also add guard to prevent trustedAgentOptIn race condition where save
useEffect would fire before initial load completed.

Resolves React error: "Rendered fewer hooks than expected"

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Previously, checkForTrustedAgent() would return early if mcpServers array
was empty, even if serviceMappings existed. This prevented the auto-add
logic from running, which creates mcpServers entries from serviceMappings.

Changes:
- Check for either mcpServers OR serviceMappings before early return
- Initialize empty mcpServers array if missing (needed for auto-add logic)
- Update warning message to clarify what's missing

This allows MCP services to be auto-populated from serviceMappings and
properly connect even when mcpServers is initially empty.

Fixes issue where "⚠️ No services configured" appeared despite having
valid serviceMappings, preventing MCP tool invocation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Prevent duplicate typing indicators from appearing when both isLoading and isToolExecuting are true. The separate loading indicator now only shows when no message already displays a typing indicator.
- Track viewport info from screenshots for coordinate scaling
- Apply DPR and perception adjustment (~5%) to coordinates
- Add detailed debug logging for coordinate scaling
- Improves coordinate accuracy when screenshot-based clicking is used
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.

3 participants