@hanzo/browser-extension 1.7.6 → 1.9.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. package/LICENSE +9 -18
  2. package/dist/browser-extension/content-script.js +1642 -123
  3. package/images/icon128.png +0 -0
  4. package/images/icon16.png +0 -0
  5. package/images/icon48.png +0 -0
  6. package/manifest.json +7 -2
  7. package/package.json +28 -10
  8. package/src/answer/AnswerEngine.tsx +553 -0
  9. package/src/chat-widget.tsx +96 -0
  10. package/src/gui-primitives.tsx +116 -0
  11. package/src/icon128.png +0 -0
  12. package/src/icon16.png +0 -0
  13. package/src/icon32.png +0 -0
  14. package/src/icon48.png +0 -0
  15. package/src/manifest-firefox.json +32 -13
  16. package/src/manifest.json +35 -11
  17. package/src/newtab.css +277 -0
  18. package/src/newtab.html +13 -0
  19. package/src/package.json +1 -1
  20. package/src/popup.css +352 -110
  21. package/src/popup.html +186 -47
  22. package/src/popup.js +196 -0
  23. package/src/sidebar.css +772 -156
  24. package/src/sidebar.html +268 -85
  25. package/src/sidebar.js +885 -0
  26. package/.github/workflows/docs.yml +0 -44
  27. package/.github/workflows/release.yml +0 -55
  28. package/README.md +0 -126
  29. package/dist/browser-extension/README.md +0 -43
  30. package/dist/browser-extension/ai-worker.js +0 -30
  31. package/dist/browser-extension/background-firefox.js +0 -875
  32. package/dist/browser-extension/background.js +0 -2732
  33. package/dist/browser-extension/browser-control.js +0 -683
  34. package/dist/browser-extension/cdp-bridge-server.js +0 -444
  35. package/dist/browser-extension/chrome/ai-worker.js +0 -571
  36. package/dist/browser-extension/chrome/background.js +0 -2732
  37. package/dist/browser-extension/chrome/callback.html +0 -17
  38. package/dist/browser-extension/chrome/content-script.js +0 -1270
  39. package/dist/browser-extension/chrome/icon128.png +0 -0
  40. package/dist/browser-extension/chrome/icon16.png +0 -0
  41. package/dist/browser-extension/chrome/icon32.png +0 -0
  42. package/dist/browser-extension/chrome/icon48.png +0 -0
  43. package/dist/browser-extension/chrome/manifest.json +0 -57
  44. package/dist/browser-extension/chrome/popup.css +0 -519
  45. package/dist/browser-extension/chrome/popup.html +0 -242
  46. package/dist/browser-extension/chrome/popup.js +0 -278
  47. package/dist/browser-extension/chrome/sidebar.css +0 -1176
  48. package/dist/browser-extension/chrome/sidebar.html +0 -280
  49. package/dist/browser-extension/chrome/sidebar.js +0 -779
  50. package/dist/browser-extension/cli.js +0 -233
  51. package/dist/browser-extension/firefox/ai-worker.js +0 -571
  52. package/dist/browser-extension/firefox/background.js +0 -875
  53. package/dist/browser-extension/firefox/callback.html +0 -17
  54. package/dist/browser-extension/firefox/content-script.js +0 -1270
  55. package/dist/browser-extension/firefox/icon128.png +0 -0
  56. package/dist/browser-extension/firefox/icon16.png +0 -0
  57. package/dist/browser-extension/firefox/icon32.png +0 -0
  58. package/dist/browser-extension/firefox/icon48.png +0 -0
  59. package/dist/browser-extension/firefox/manifest.json +0 -66
  60. package/dist/browser-extension/firefox/popup.css +0 -519
  61. package/dist/browser-extension/firefox/popup.html +0 -242
  62. package/dist/browser-extension/firefox/popup.js +0 -278
  63. package/dist/browser-extension/firefox/sidebar.css +0 -1176
  64. package/dist/browser-extension/firefox/sidebar.html +0 -280
  65. package/dist/browser-extension/firefox/sidebar.js +0 -779
  66. package/dist/browser-extension/hanzo-browser-extension-firefox-1.1.0.zip +0 -0
  67. package/dist/browser-extension/icon128.png +0 -0
  68. package/dist/browser-extension/icon16.png +0 -0
  69. package/dist/browser-extension/icon32.png +0 -0
  70. package/dist/browser-extension/icon48.png +0 -0
  71. package/dist/browser-extension/manifest.json +0 -57
  72. package/dist/browser-extension/package.json +0 -41
  73. package/dist/browser-extension/popup.css +0 -468
  74. package/dist/browser-extension/popup.html +0 -191
  75. package/dist/browser-extension/popup.js +0 -278
  76. package/dist/browser-extension/safari/Info.plist +0 -21
  77. package/dist/browser-extension/safari/ai-worker.js +0 -571
  78. package/dist/browser-extension/safari/background.js +0 -2732
  79. package/dist/browser-extension/safari/callback.html +0 -17
  80. package/dist/browser-extension/safari/content-script.js +0 -1270
  81. package/dist/browser-extension/safari/icon128.png +0 -0
  82. package/dist/browser-extension/safari/icon16.png +0 -0
  83. package/dist/browser-extension/safari/icon32.png +0 -0
  84. package/dist/browser-extension/safari/icon48.png +0 -0
  85. package/dist/browser-extension/safari/popup.css +0 -519
  86. package/dist/browser-extension/safari/popup.html +0 -242
  87. package/dist/browser-extension/safari/popup.js +0 -278
  88. package/dist/browser-extension/safari/sidebar.css +0 -1176
  89. package/dist/browser-extension/safari/sidebar.html +0 -280
  90. package/dist/browser-extension/safari/sidebar.js +0 -779
  91. package/dist/browser-extension/sidebar.css +0 -718
  92. package/dist/browser-extension/sidebar.html +0 -184
  93. package/dist/browser-extension/sidebar.js +0 -779
  94. package/dist/browser-extension/webgpu-ai.js +0 -495
  95. package/dist/cdp-bridge-server.js +0 -411
  96. package/dist/hanzo-ai-chrome-1.7.2.zip +0 -0
  97. package/dist/hanzo-ai-chrome-1.7.3.zip +0 -0
  98. package/dist/hanzo-ai-firefox-1.7.2.zip +0 -0
  99. package/dist/hanzo-ai-firefox-1.7.3.zip +0 -0
  100. package/dist/safari/Hanzo AI/Hanzo AI.xcodeproj/project.pbxproj +0 -1047
  101. package/dist/safari/Hanzo AI/Hanzo AI.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
  102. package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AccentColor.colorset/Contents.json +0 -11
  103. package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/Contents.json +0 -98
  104. package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/mac-icon-128@1x.png +0 -0
  105. package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/mac-icon-128@2x.png +0 -0
  106. package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/mac-icon-16@1x.png +0 -0
  107. package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/mac-icon-16@2x.png +0 -0
  108. package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/mac-icon-256@1x.png +0 -0
  109. package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/mac-icon-256@2x.png +0 -0
  110. package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/mac-icon-32@1x.png +0 -0
  111. package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/mac-icon-32@2x.png +0 -0
  112. package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/mac-icon-512@1x.png +0 -0
  113. package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/mac-icon-512@2x.png +0 -0
  114. package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/AppIcon.appiconset/universal-icon-1024@1x.png +0 -0
  115. package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/Contents.json +0 -6
  116. package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/LargeIcon.imageset/Contents.json +0 -21
  117. package/dist/safari/Hanzo AI/Shared (App)/Assets.xcassets/LargeIcon.imageset/icon128.png +0 -0
  118. package/dist/safari/Hanzo AI/Shared (App)/Resources/Base.lproj/Main.html +0 -20
  119. package/dist/safari/Hanzo AI/Shared (App)/Resources/Icon.png +0 -0
  120. package/dist/safari/Hanzo AI/Shared (App)/Resources/Script.js +0 -24
  121. package/dist/safari/Hanzo AI/Shared (App)/Resources/Style.css +0 -61
  122. package/dist/safari/Hanzo AI/Shared (App)/ViewController.swift +0 -81
  123. package/dist/safari/Hanzo AI/Shared (Extension)/SafariWebExtensionHandler.swift +0 -42
  124. package/dist/safari/Hanzo AI/iOS (App)/AppDelegate.swift +0 -24
  125. package/dist/safari/Hanzo AI/iOS (App)/Base.lproj/LaunchScreen.storyboard +0 -36
  126. package/dist/safari/Hanzo AI/iOS (App)/Base.lproj/Main.storyboard +0 -38
  127. package/dist/safari/Hanzo AI/iOS (App)/Info.plist +0 -27
  128. package/dist/safari/Hanzo AI/iOS (App)/SceneDelegate.swift +0 -18
  129. package/dist/safari/Hanzo AI/iOS (Extension)/Info.plist +0 -13
  130. package/dist/safari/Hanzo AI/macOS (App)/AppDelegate.swift +0 -21
  131. package/dist/safari/Hanzo AI/macOS (App)/Base.lproj/Main.storyboard +0 -124
  132. package/dist/safari/Hanzo AI/macOS (App)/Info.plist +0 -8
  133. package/dist/safari/Hanzo AI/macOS (Extension)/Info.plist +0 -13
  134. package/docs/_config.yml +0 -13
  135. package/docs/_layouts/default.html +0 -435
  136. package/docs/index.md +0 -54
  137. package/hanzo-ai-chrome-v1.7.6.zip +0 -0
  138. package/hanzo-ai-firefox-v1.7.6.zip +0 -0
  139. package/install-extension.sh +0 -75
  140. package/test/claude-integration.test.ts +0 -251
  141. package/test/server-frameworks-edge-cases.test.ts +0 -145
  142. package/test/server-frameworks.test.ts +0 -395
  143. package/test-cdp-connection.js +0 -140
  144. package/tsconfig.json +0 -19
@@ -1,44 +0,0 @@
1
- name: Deploy Docs
2
-
3
- on:
4
- push:
5
- branches: [main]
6
- workflow_dispatch:
7
-
8
- permissions:
9
- contents: read
10
- pages: write
11
- id-token: write
12
-
13
- concurrency:
14
- group: pages
15
- cancel-in-progress: false
16
-
17
- jobs:
18
- build:
19
- runs-on: ubuntu-latest
20
- steps:
21
- - uses: actions/checkout@v4
22
-
23
- - name: Setup Pages
24
- uses: actions/configure-pages@v4
25
-
26
- - name: Build with Jekyll
27
- uses: actions/jekyll-build-pages@v1
28
- with:
29
- source: ./docs
30
- destination: ./_site
31
-
32
- - name: Upload artifact
33
- uses: actions/upload-pages-artifact@v3
34
-
35
- deploy:
36
- environment:
37
- name: github-pages
38
- url: ${{ steps.deployment.outputs.page_url }}
39
- runs-on: ubuntu-latest
40
- needs: build
41
- steps:
42
- - name: Deploy to GitHub Pages
43
- id: deployment
44
- uses: actions/deploy-pages@v4
@@ -1,55 +0,0 @@
1
- name: Release
2
-
3
- on:
4
- push:
5
- tags:
6
- - 'v*'
7
-
8
- permissions:
9
- contents: write
10
-
11
- jobs:
12
- build:
13
- runs-on: ubuntu-latest
14
- steps:
15
- - uses: actions/checkout@v4
16
-
17
- - name: Setup Node.js
18
- uses: actions/setup-node@v4
19
- with:
20
- node-version: '20'
21
- cache: 'npm'
22
-
23
- - name: Install dependencies
24
- run: npm ci || npm install
25
-
26
- - name: Build extension
27
- run: npm run build
28
-
29
- - name: Get version
30
- id: version
31
- run: echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
32
-
33
- - name: Package Chrome extension
34
- run: |
35
- cd dist
36
- zip -r ../hanzo-browser-extension-chrome-${{ steps.version.outputs.version }}.zip .
37
-
38
- - name: Package Firefox extension
39
- run: |
40
- # Copy Firefox manifest if exists
41
- if [ -f src/manifest-firefox.json ]; then
42
- cp src/manifest-firefox.json dist/manifest.json
43
- fi
44
- cd dist
45
- zip -r ../hanzo-browser-extension-firefox-${{ steps.version.outputs.version }}.zip .
46
-
47
- - name: Create GitHub Release
48
- uses: softprops/action-gh-release@v2
49
- with:
50
- files: |
51
- hanzo-browser-extension-chrome-*.zip
52
- hanzo-browser-extension-firefox-*.zip
53
- generate_release_notes: true
54
- draft: false
55
- prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') || contains(github.ref, 'rc') }}
package/README.md DELETED
@@ -1,126 +0,0 @@
1
- # Hanzo AI Browser Extension
2
-
3
- AI-powered browser extension for Chrome, Firefox, Edge, and Safari.
4
-
5
- [![Chrome](https://img.shields.io/badge/Chrome-4285F4?style=for-the-badge&logo=googlechrome&logoColor=white)](https://chrome.google.com/webstore)
6
- [![Firefox](https://img.shields.io/badge/Firefox-FF7139?style=for-the-badge&logo=firefox&logoColor=white)](https://addons.mozilla.org)
7
- [![Edge](https://img.shields.io/badge/Edge-0078D7?style=for-the-badge&logo=microsoftedge&logoColor=white)](https://microsoftedge.microsoft.com/addons)
8
- [![Safari](https://img.shields.io/badge/Safari-000000?style=for-the-badge&logo=safari&logoColor=white)](https://apps.apple.com)
9
-
10
- ## Features
11
-
12
- - **AI Chat Sidebar**: Chat with Claude, GPT-4, Gemini, and more
13
- - **Page Analysis**: Summarize, explain, and query any webpage
14
- - **Selection Actions**: Right-click menu for AI operations on selected text
15
- - **MCP Integration**: Access 260+ MCP tools from your browser
16
- - **Cloud Sync**: Sync conversations and settings via cloud.hanzo.ai
17
-
18
- ## Installation
19
-
20
- ### Chrome / Edge / Brave
21
-
22
- 1. Download the latest release from [Releases](https://github.com/hanzoai/browser-extension/releases)
23
- 2. Open `chrome://extensions` (or `edge://extensions`)
24
- 3. Enable "Developer mode"
25
- 4. Click "Load unpacked" and select the `dist` folder
26
-
27
- ### Firefox
28
-
29
- 1. Download the latest release
30
- 2. Open `about:debugging`
31
- 3. Click "This Firefox" → "Load Temporary Add-on"
32
- 4. Select `manifest.json`
33
-
34
- ### Safari
35
-
36
- 1. Enable developer mode in Safari preferences
37
- 2. Download the macOS app version from [Releases](https://github.com/hanzoai/browser-extension/releases)
38
- 3. Open the app and enable the extension in Safari preferences
39
-
40
- ## Development
41
-
42
- ```bash
43
- # Install dependencies
44
- npm install
45
-
46
- # Build extension
47
- npm run build
48
-
49
- # Watch mode for development
50
- npm run watch
51
-
52
- # Run tests
53
- npm test
54
- ```
55
-
56
- ## Building for Production
57
-
58
- ```bash
59
- # Build for all browsers
60
- npm run build
61
-
62
- # The dist/ folder contains the extension ready for loading
63
- ```
64
-
65
- ## Project Structure
66
-
67
- ```
68
- browser-extension/
69
- ├── src/
70
- │ ├── background/ # Service worker / background script
71
- │ ├── content/ # Content scripts injected into pages
72
- │ ├── popup/ # Extension popup UI
73
- │ ├── sidebar/ # AI chat sidebar
74
- │ └── shared/ # Shared utilities
75
- ├── dist/ # Built extension
76
- ├── manifest.json # Extension manifest (MV3)
77
- ├── package.json
78
- └── tsconfig.json
79
- ```
80
-
81
- ## Configuration
82
-
83
- ### API Keys
84
-
85
- The extension uses your Hanzo AI account for API access. Login at:
86
- - [cloud.hanzo.ai](https://cloud.hanzo.ai) - Cloud dashboard
87
- - [iam.hanzo.ai](https://iam.hanzo.ai) - API key management
88
-
89
- Or set environment variables for direct provider access:
90
- - `ANTHROPIC_API_KEY` - Claude models
91
- - `OPENAI_API_KEY` - GPT models
92
- - `GOOGLE_API_KEY` - Gemini models
93
-
94
- ### Permissions
95
-
96
- The extension requests minimal permissions:
97
- - `activeTab` - Access to current tab when activated
98
- - `storage` - Store settings and conversations locally
99
- - `contextMenus` - Right-click menu integration
100
-
101
- ## Architecture
102
-
103
- ```
104
- ┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
105
- │ Content Script │ ◄──► │ Background │ ◄──► │ Hanzo API │
106
- │ (Page Context) │ │ (Service Worker) │ │ (api.hanzo.ai) │
107
- └─────────────────┘ └──────────────────┘ └─────────────────┘
108
- │ │
109
- │ │
110
- ▼ ▼
111
- ┌─────────────────┐ ┌──────────────────┐
112
- │ Popup / Sidebar │ │ MCP Bridge │
113
- │ (React UI) │ │ (WebSocket) │
114
- └─────────────────┘ └──────────────────┘
115
- ```
116
-
117
- ## Related Projects
118
-
119
- - [ide-extension](https://github.com/hanzoai/ide-extension) - VS Code and JetBrains plugins
120
- - [hanzo-mcp](https://github.com/hanzoai/mcp) - Model Context Protocol tools
121
- - [hanzo.vim](https://github.com/hanzoai/hanzo.vim) - Vim/Neovim plugin
122
- - [hanzo.el](https://github.com/hanzoai/hanzo.el) - Emacs package
123
-
124
- ## License
125
-
126
- MIT - See [LICENSE](LICENSE)
@@ -1,43 +0,0 @@
1
- # Hanzo Browser DevTools
2
-
3
- Click-to-code navigation for web developers with MCP integration.
4
-
5
- ## Installation
6
-
7
- ```bash
8
- npm install -g @hanzoai/browser-devtools
9
- ```
10
-
11
- ## Usage
12
-
13
- 1. Start the server:
14
- ```bash
15
- hanzo-browser-server start
16
- ```
17
-
18
- 2. Install the browser extension:
19
- ```bash
20
- hanzo-browser-server install-extension
21
- ```
22
-
23
- 3. Alt+Click any element in your browser to navigate to its source code!
24
-
25
- ## Features
26
-
27
- - 🎯 **Source-map support** for React, Vue, Svelte
28
- - 🔍 **Fallback tagging** for legacy code
29
- - 🚀 **MCP integration** for Claude Code
30
- - ⚡ **Lightning fast** WebSocket communication
31
-
32
- ## Integration with Claude Code
33
-
34
- The server exposes element selection events that can be consumed by MCP tools:
35
-
36
- ```javascript
37
- server.on('elementSelected', (data) => {
38
- // data.file - Source file path
39
- // data.line - Line number
40
- // data.column - Column number (if available)
41
- // data.framework - Detected framework
42
- });
43
- ```
@@ -1,30 +0,0 @@
1
- // AI Worker stub for browser extension
2
- // This is a Web Worker that handles AI inference tasks per-tab
3
-
4
- self.onmessage = function(event) {
5
- const { type, tabId, modelName } = event.data;
6
-
7
- switch (type) {
8
- case 'init':
9
- console.log(`[AI Worker] Initialized for tab ${tabId} with model ${modelName}`);
10
- self.postMessage({ type: 'ready', tabId });
11
- break;
12
-
13
- case 'screenshot':
14
- // Process screenshot for AI analysis (stub)
15
- self.postMessage({ type: 'analysis', result: 'Screenshot received' });
16
- break;
17
-
18
- case 'contentMessage':
19
- // Handle content script messages (stub)
20
- self.postMessage({ type: 'contentResponse', response: { received: true } });
21
- break;
22
-
23
- case 'broadcast':
24
- // Handle broadcast messages (stub)
25
- break;
26
-
27
- default:
28
- console.warn('[AI Worker] Unknown message type:', type);
29
- }
30
- };